WarpX
Loading...
Searching...
No Matches
FieldIO.H
Go to the documentation of this file.
1/* Copyright 2019 Axel Huebl, David Grote, Igor Andriyash
2 * Remi Lehe
3 *
4 * This file is part of WarpX.
5 *
6 * License: BSD-3-Clause-LBNL
7 */
8#ifndef WARPX_FieldIO_H_
9#define WARPX_FieldIO_H_
10
11#include <AMReX_REAL.H>
12
13#include <AMReX_BaseFwd.H>
14
15#include <array>
16#include <cstdint>
17#include <memory>
18#include <vector>
19
20void
22 const std::array< std::unique_ptr<amrex::MultiFab>, 3 >& vector_field,
24 int dcomp, amrex::IntVect ngrow );
25
26void
28 const amrex::MultiFab & scalar_field,
30 int dcomp, amrex::IntVect ngrow );
31
38std::vector<std::uint64_t>
39getVec( const amrex::IntVect& v, bool reverse = false);
40
47std::vector<double>
48getVec( const amrex::Real* v, bool reverse = false );
49
50std::vector<std::uint64_t>
52
53std::vector<double>
54getReversedVec( const amrex::Real* v );
55
56#endif // WARPX_FieldIO_H_
void AverageAndPackScalarField(amrex::MultiFab &mf_avg, const amrex::MultiFab &scalar_field, const amrex::DistributionMapping &dm, int dcomp, amrex::IntVect ngrow)
Take a MultiFab scalar_field averages it to the cell center, and stores the resulting MultiFab in mf_...
Definition FieldIO.cpp:197
std::vector< std::uint64_t > getVec(const amrex::IntVect &v, bool reverse=false)
Convert an IntVect to a std::vector<std::uint64_t> (used for compatibility with openPMD-api)
Definition FieldIO.cpp:30
void AverageAndPackVectorField(amrex::MultiFab &mf_avg, const std::array< std::unique_ptr< amrex::MultiFab >, 3 > &vector_field, const amrex::DistributionMapping &dm, int dcomp, amrex::IntVect ngrow)
Takes an array of 3 MultiFab vector_field (representing the x, y, z components of a vector),...
Definition FieldIO.cpp:157
std::vector< std::uint64_t > getReversedVec(const amrex::IntVect &v)
Convert an IntVect to a std::vector<std::uint64_t> and reverse the order of the elements (used for co...
Definition FieldIO.cpp:80
@ v
Definition RigidInjectedParticleContainer.H:27
IntVectND< 3 > IntVect