1 #ifndef AMReX_ParticleDataAdaptor_h
2 #define AMReX_ParticleDataAdaptor_h
4 #include <AMReX_Config.H>
10 #include <DataAdaptor.h>
16 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
17 class ParticleDataAdaptor :
public sensei::DataAdaptor
20 static constexpr
int NStructReal = ParticleType::NReal;
21 static constexpr
int NStructInt = ParticleType::NInt;
23 static ParticleDataAdaptor* New();
24 senseiTypeMacro(ParticleDataAdaptor, sensei::DataAdaptor);
29 const std::map<std::string, std::vector<int>> & rStructs = {},
30 const std::map<std::string, int> & iStructs = {},
31 const std::map<std::string, std::vector<int>> & rArrays = {},
32 const std::map<std::string, int> & iArrays = {}
37 const std::map<std::string, std::vector<int>> & rStructs,
38 const std::map<std::string, int> & iStructs,
39 const std::map<std::string, std::vector<int>> & rArrays,
40 const std::map<std::string, int> & iArrays);
43 void SetPinMesh(
int val);
46 int AddParticlesIDArray(svtkDataObject* mesh);
49 int AddParticlesCPUArray(svtkDataObject* mesh);
52 int AddParticlesSOAIntArray(
const std::string &arrayName, svtkDataObject* mesh);
55 int AddParticlesSOARealArray(
const std::string &arrayName, svtkDataObject* mesh);
58 int AddParticlesAOSIntArray(
const std::string &arrayName, svtkDataObject* mesh);
61 int AddParticlesAOSRealArray(
const std::string &arrayName, svtkDataObject* mesh);
64 #if SENSEI_VERSION_MAJOR >= 3
65 int GetMeshMetadata(
unsigned int id, sensei::MeshMetadataPtr &metadata)
override;
67 int GetMeshName(
unsigned int id, std::string &meshName)
override;
68 int GetMeshHasGhostNodes(
const std::string &meshName,
int &nLayers)
override;
69 int GetMeshHasGhostCells(
const std::string &meshName,
int &nLayers)
override;
70 int GetNumberOfArrays(
const std::string &meshName,
int association,
unsigned int &numberOfArrays)
override;
71 int GetArrayName(
const std::string &meshName,
int association,
unsigned int index, std::string &arrayName)
override;
73 int GetNumberOfMeshes(
unsigned int &numMeshes)
override;
74 int GetMesh(
const std::string &meshName,
bool structureOnly, svtkDataObject *&mesh)
override;
75 int AddGhostNodesArray(svtkDataObject* mesh,
const std::string &meshName)
override;
76 int AddGhostCellsArray(svtkDataObject* mesh,
const std::string &meshName)
override;
77 int AddArray(svtkDataObject* mesh,
const std::string &meshName,
int association,
const std::string &arrayName)
override;
78 int ReleaseData()
override;
81 ParticleDataAdaptor() =
default;
82 ~ParticleDataAdaptor() =
default;
85 svtkPolyData* BuildParticles();
87 const std::string m_particlesName =
"particles";
91 using RealDataMapType = std::map<std::string, std::vector<int>>;
92 using IntDataMapType = std::map<std::string, int>;
94 RealDataMapType m_realStructs;
95 IntDataMapType m_intStructs;
96 RealDataMapType m_realArrays;
97 IntDataMapType m_intArrays;
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition: AMReX_ParticleContainer.H:145
Definition: AMReX_Amr.cpp:49