WarpX
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 
20 void
22  const std::array< std::unique_ptr<amrex::MultiFab>, 3 >& vector_field,
24  int dcomp, amrex::IntVect ngrow );
25 
26 void
28  const amrex::MultiFab & scalar_field,
30  int dcomp, amrex::IntVect ngrow );
31 
38 std::vector<std::uint64_t>
39 getVec( const amrex::IntVect& v, bool reverse = false);
40 
47 std::vector<double>
48 getVec( const amrex::Real* v, bool reverse = false );
49 
50 std::vector<std::uint64_t>
51 getReversedVec( const amrex::IntVect& v );
52 
53 std::vector<double>
54 getReversedVec( const amrex::Real* v );
55 
56 #endif // WARPX_FieldIO_H_
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
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
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 > 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