WarpX
Loading...
Searching...
No Matches
FieldIO.cpp File Reference
#include "FieldIO.H"
#include "Utils/TextMsg.H"
#include <ablastr/coarsen/sample.H>
#include <AMReX.H>
#include <AMReX_IntVect.H>
#include <AMReX_MultiFab.H>
#include <AMReX_SPACE.H>
#include <algorithm>
#include <cstdint>
#include <memory>

Functions

std::vector< std::uint64_t > getVec (const IntVect &v, bool reverse)
 Convert an IntVect to a std::vector<std::uint64_t> (used for compatibility with openPMD-api)
 
std::vector< double > getVec (const Real *v, bool reverse)
 Convert Real* pointer to a std::vector<double>, (used for compatibility with the openPMD API)
 
std::vector< std::uint64_t > getReversedVec (const IntVect &v)
 Convert an IntVect to a std::vector<std::uint64_t> and reverse the order of the elements (used for compatibility with the openPMD API)
 
std::vector< double > getReversedVec (const Real *v)
 Convert Real* pointer to a std::vector<double>, and reverse the order of the elements (used for compatibility with the openPMD API)
 
void ConstructTotalRZVectorField (const std::array< std::unique_ptr< MultiFab >, 3 > &vector_total, const std::array< std::unique_ptr< MultiFab >, 3 > &vector_field)
 
void ConstructTotalRZScalarField (MultiFab &scalar_total, const MultiFab &scalar_field)
 
void AverageAndPackVectorField (MultiFab &mf_avg, const std::array< std::unique_ptr< MultiFab >, 3 > &vector_field, const DistributionMapping &dm, const int dcomp, const IntVect ngrow)
 Takes an array of 3 MultiFab vector_field (representing the x, y, z components of a vector), averages it to the cell center, and stores the resulting MultiFab in mf_avg (in the components dcomp to dcomp+2) Should only be used for BTD now.
 
void AverageAndPackScalarField (MultiFab &mf_avg, const MultiFab &scalar_field, const DistributionMapping &dm, const int dcomp, const IntVect ngrow)
 Take a MultiFab scalar_field averages it to the cell center, and stores the resulting MultiFab in mf_avg (in the components dcomp)
 

Function Documentation

◆ AverageAndPackScalarField()

void AverageAndPackScalarField ( MultiFab & mf_avg,
const MultiFab & scalar_field,
const DistributionMapping & dm,
const int dcomp,
const IntVect ngrow )

Take a MultiFab scalar_field averages it to the cell center, and stores the resulting MultiFab in mf_avg (in the components dcomp)

◆ AverageAndPackVectorField()

void AverageAndPackVectorField ( MultiFab & mf_avg,
const std::array< std::unique_ptr< MultiFab >, 3 > & vector_field,
const DistributionMapping & dm,
const int dcomp,
const IntVect ngrow )

Takes an array of 3 MultiFab vector_field (representing the x, y, z components of a vector), averages it to the cell center, and stores the resulting MultiFab in mf_avg (in the components dcomp to dcomp+2) Should only be used for BTD now.

◆ ConstructTotalRZScalarField()

void ConstructTotalRZScalarField ( MultiFab & scalar_total,
const MultiFab & scalar_field )

◆ ConstructTotalRZVectorField()

void ConstructTotalRZVectorField ( const std::array< std::unique_ptr< MultiFab >, 3 > & vector_total,
const std::array< std::unique_ptr< MultiFab >, 3 > & vector_field )

◆ getReversedVec() [1/2]

std::vector< std::uint64_t > getReversedVec ( const IntVect & v)

Convert an IntVect to a std::vector<std::uint64_t> and reverse the order of the elements (used for compatibility with the openPMD API)

◆ getReversedVec() [2/2]

std::vector< double > getReversedVec ( const Real * v)

Convert Real* pointer to a std::vector<double>, and reverse the order of the elements (used for compatibility with the openPMD API)

◆ getVec() [1/2]

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)

Convert amrex IntVect to vector of uint64, reverse if requested

Parameters
[in]vvector to convert
[in]reverse(optional) boolean indicating whether to reverse v
Returns
converted vector of type uint64, reversed if requested

◆ getVec() [2/2]

std::vector< double > getVec ( const Real * v,
bool reverse )

Convert Real* pointer to a std::vector<double>, (used for compatibility with the openPMD API)