6template <
typename ParticleType,
int NArrayReal,
int NArrayInt>
7AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>*
8AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::New()
10 auto result =
new AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>;
11 result->InitializeObjectBase();
16template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
17int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::SetDataSource(
20 const std::vector<std::vector<std::string>> &mesh_names,
22 const std::map<std::string, std::vector<int>> & rStructs,
23 const std::map<std::string, int> & iStructs,
24 const std::map<std::string, std::vector<int>> & rArrays,
25 const std::map<std::string, int> & iArrays)
27 int retMesh = this->m_meshAdaptor->SetDataSource(mesh, mesh_states, mesh_names);
28 int retPtls = this->m_particleAdaptor->SetDataSource(particles, rStructs, iStructs, rArrays, iArrays);
29 return retMesh + retPtls;
33#if SENSEI_VERSION_MAJOR >= 3
34template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
35int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshMetadata(
37 sensei::MeshMetadataPtr &metadata)
41 return this->m_meshAdaptor->GetMeshMetadata(0, metadata);
45 return this->m_particleAdaptor->GetMeshMetadata(1, metadata);
47 SENSEI_ERROR(
"unknown mesh ID in GetMeshMetadata");
52template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
53int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshName(
55 std::string &meshName)
59 return this->m_meshAdaptor->GetMeshName(0, meshName);
63 return this->m_particleAdaptor->GetMeshName(1, meshName);
65 SENSEI_ERROR(
"unknown mesh ID in GetMeshName");
69template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
70int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshHasGhostNodes(
71 const std::string &meshName,
int &nLayers)
75 return this->m_meshAdaptor->GetMeshHasGhostNodes(meshName, nLayers);
79 return this->m_particleAdaptor->GetMeshHasGhostNodes(meshName, nLayers);
81 SENSEI_ERROR(
"unknown mesh ID in GetMeshHasGhostNodes");
85template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
86int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshHasGhostCells(
87 const std::string &meshName,
int &nLayers)
91 return this->m_meshAdaptor->GetMeshHasGhostCells(meshName, nLayers);
95 return this->m_particleAdaptor->GetMeshHasGhostCells(meshName, nLayers);
97 SENSEI_ERROR(
"unknown mesh ID in GetMeshHasGhostCells");
101template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
102int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetNumberOfArrays(
103 const std::string &meshName,
105 unsigned int &numberOfArrays)
109 return this->m_meshAdaptor->GetNumberOfArrays(meshName, association, numberOfArrays);
113 return this->m_particleAdaptor->GetNumberOfArrays(meshName, association, numberOfArrays);
115 SENSEI_ERROR(
"unknown mesh ID in GetNumberOfArrays");
119template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
120int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetArrayName(
121 const std::string &meshName,
124 std::string &arrayName)
128 return this->m_meshAdaptor->GetArrayName(meshName, association, index, arrayName);
132 return this->m_particleAdaptor->GetArrayName(meshName, association, index, arrayName);
134 SENSEI_ERROR(
"unknown mesh ID in GetArrayName");
139template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
140int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetNumberOfMeshes(
141 unsigned int &numMeshes)
147template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
148int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMesh(
149 const std::string &meshName,
151 svtkDataObject *&mesh)
153 if(meshName == m_meshName)
155 return this->m_meshAdaptor->GetMesh(meshName, structureOnly, mesh);
157 if(meshName == m_particlesName)
159 return this->m_particleAdaptor->GetMesh(meshName, structureOnly, mesh);
161 SENSEI_ERROR(
"unknown mesh name in GetMesh");
165template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
166int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddGhostNodesArray(
167 svtkDataObject* mesh,
168 const std::string &meshName)
170 if(meshName == m_meshName)
172 return this->m_meshAdaptor->AddGhostNodesArray(mesh, meshName);
174 if(meshName == m_particlesName)
176 return this->m_particleAdaptor->AddGhostNodesArray(mesh, meshName);
178 SENSEI_ERROR(
"unknown mesh name in AddGhostNodesArray");
182template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
183int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddGhostCellsArray(
184 svtkDataObject* mesh,
185 const std::string &meshName)
187 if(meshName == m_meshName)
189 return this->m_meshAdaptor->AddGhostCellsArray(mesh, meshName);
191 if(meshName == m_particlesName)
193 return this->m_particleAdaptor->AddGhostCellsArray(mesh, meshName);
195 SENSEI_ERROR(
"unknown mesh name in AddGhostCellsArray");
199template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
200int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddArray(
201 svtkDataObject* mesh,
202 const std::string &meshName,
204 const std::string &arrayName)
206 if(meshName == m_meshName)
208 return this->m_meshAdaptor->AddArray(mesh, meshName, association, arrayName);
210 if(meshName == m_particlesName)
212 return this->m_particleAdaptor->AddArray(mesh, meshName, association, arrayName);
214 SENSEI_ERROR(
"unknown mesh name in AddArray");
218template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
219int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::ReleaseData()
221 this->m_particleAdaptor->ReleaseData();
222 this->m_meshAdaptor->ReleaseData();
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition AMReX_ParticleContainer.H:146
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:27
Definition AMReX_Amr.cpp:49