6 template <
typename ParticleType,
int NArrayReal,
int NArrayInt>
7 AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>*
8 AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::New()
10 auto result =
new AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>;
11 result->InitializeObjectBase();
16 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
17 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::SetDataSource(
20 const std::map<std::string, std::vector<int>> & rStructs,
21 const std::map<std::string, int> & iStructs,
22 const std::map<std::string, std::vector<int>> & rArrays,
23 const std::map<std::string, int> & iArrays)
25 int retMesh = this->m_meshAdaptor->SetDataSource(amr);
26 int retPtls = this->m_particleAdaptor->SetDataSource(particles, rStructs, iStructs, rArrays, iArrays);
27 return retMesh + retPtls;
31 #if SENSEI_VERSION_MAJOR >= 3
32 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
33 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshMetadata(
35 sensei::MeshMetadataPtr &metadata)
39 return this->m_meshAdaptor->GetMeshMetadata(0, metadata);
43 return this->m_particleAdaptor->GetMeshMetadata(1, metadata);
45 SENSEI_ERROR(
"unknown mesh ID in GetMeshMetadata");
50 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
51 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshName(
53 std::string &meshName)
57 return this->m_meshAdaptor->GetMeshName(0, meshName);
61 return this->m_particleAdaptor->GetMeshName(1, meshName);
63 SENSEI_ERROR(
"unknown mesh ID in GetMeshName");
67 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
68 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshHasGhostNodes(
69 const std::string &meshName,
int &nLayers)
73 return this->m_meshAdaptor->GetMeshHasGhostNodes(meshName, nLayers);
77 return this->m_particleAdaptor->GetMeshHasGhostNodes(meshName, nLayers);
79 SENSEI_ERROR(
"unknown mesh ID in GetMeshHasGhostNodes");
83 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
84 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMeshHasGhostCells(
85 const std::string &meshName,
int &nLayers)
89 return this->m_meshAdaptor->GetMeshHasGhostCells(meshName, nLayers);
93 return this->m_particleAdaptor->GetMeshHasGhostCells(meshName, nLayers);
95 SENSEI_ERROR(
"unknown mesh ID in GetMeshHasGhostCells");
99 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
100 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetNumberOfArrays(
101 const std::string &meshName,
103 unsigned int &numberOfArrays)
107 return this->m_meshAdaptor->GetNumberOfArrays(meshName, association, numberOfArrays);
111 return this->m_particleAdaptor->GetNumberOfArrays(meshName, association, numberOfArrays);
113 SENSEI_ERROR(
"unknown mesh ID in GetNumberOfArrays");
117 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
118 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetArrayName(
119 const std::string &meshName,
122 std::string &arrayName)
126 return this->m_meshAdaptor->GetArrayName(meshName, association, index, arrayName);
130 return this->m_particleAdaptor->GetArrayName(meshName, association, index, arrayName);
132 SENSEI_ERROR(
"unknown mesh ID in GetArrayName");
137 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
138 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetNumberOfMeshes(
139 unsigned int &numMeshes)
145 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
146 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::GetMesh(
147 const std::string &meshName,
149 svtkDataObject *&mesh)
151 if(meshName == m_meshName)
153 return this->m_meshAdaptor->GetMesh(meshName, structureOnly, mesh);
155 if(meshName == m_particlesName)
157 return this->m_particleAdaptor->GetMesh(meshName, structureOnly, mesh);
159 SENSEI_ERROR(
"unknown mesh name in GetMesh");
163 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
164 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddGhostNodesArray(
165 svtkDataObject* mesh,
166 const std::string &meshName)
168 if(meshName == m_meshName)
170 return this->m_meshAdaptor->AddGhostNodesArray(mesh, meshName);
172 if(meshName == m_particlesName)
174 return this->m_particleAdaptor->AddGhostNodesArray(mesh, meshName);
176 SENSEI_ERROR(
"unknown mesh name in AddGhostNodesArray");
180 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
181 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddGhostCellsArray(
182 svtkDataObject* mesh,
183 const std::string &meshName)
185 if(meshName == m_meshName)
187 return this->m_meshAdaptor->AddGhostCellsArray(mesh, meshName);
189 if(meshName == m_particlesName)
191 return this->m_particleAdaptor->AddGhostCellsArray(mesh, meshName);
193 SENSEI_ERROR(
"unknown mesh name in AddGhostCellsArray");
197 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
198 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::AddArray(
199 svtkDataObject* mesh,
200 const std::string &meshName,
202 const std::string &arrayName)
204 if(meshName == m_meshName)
206 return this->m_meshAdaptor->AddArray(mesh, meshName, association, arrayName);
208 if(meshName == m_particlesName)
210 return this->m_particleAdaptor->AddArray(mesh, meshName, association, arrayName);
212 SENSEI_ERROR(
"unknown mesh name in AddArray");
216 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
217 int AmrParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::ReleaseData()
219 this->m_particleAdaptor->ReleaseData();
220 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