6 template <
typename ParticleType,
int NArrayReal,
int NArrayInt>
7 AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>*
8 AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::New()
10 auto result =
new AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>;
11 result->InitializeObjectBase();
16 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
17 int 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
34 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
35 int 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");
52 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
53 int 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");
69 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
70 int 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");
85 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
86 int 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");
101 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
102 int 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");
119 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
120 int 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");
139 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
140 int AmrMeshParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetNumberOfMeshes(
141 unsigned int &numMeshes)
147 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
148 int 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");
165 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
166 int 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");
182 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
183 int 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");
199 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
200 int 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");
218 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
219 int 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:145
Definition: AMReX_Amr.cpp:49