12 #ifndef smtk_mesh_moab_Interface_h
13 #define smtk_mesh_moab_Interface_h
15 #include "smtk/CoreExports.h"
18 #include "smtk/mesh/core/CellTypes.h"
19 #include "smtk/mesh/core/DimensionTypes.h"
20 #include "smtk/mesh/core/Handle.h"
21 #include "smtk/mesh/core/Interface.h"
22 #include "smtk/mesh/core/TypeSet.h"
61 std::string name()
const override {
return std::string(
"moab"); }
67 bool isModified()
const override;
109 const smtk::mesh::HandleRange& cells)
override;
115 std::size_t numPoints,
116 const std::function<std::array<double, 3>(std::size_t)>& coordinates)
override;
118 smtk::mesh::Handle getRoot()
const override;
129 bool createMesh(
const smtk::mesh::HandleRange& cells, smtk::mesh::Handle& meshHandle)
override;
131 std::size_t numMeshes(smtk::mesh::Handle handle)
const override;
133 smtk::mesh::HandleRange getMeshsets(smtk::mesh::Handle handle)
const override;
135 smtk::mesh::HandleRange getMeshsets(smtk::mesh::Handle handle,
int dimension)
const override;
138 smtk::mesh::HandleRange getMeshsets(smtk::mesh::Handle handle,
const std::string& name)
142 smtk::mesh::HandleRange getMeshsets(smtk::mesh::Handle handle,
const smtk::mesh::Domain& domain)
146 smtk::mesh::HandleRange getMeshsets(
147 smtk::mesh::Handle handle,
151 smtk::mesh::HandleRange getMeshsets(smtk::mesh::Handle handle,
const smtk::mesh::Neumann& neumann)
155 smtk::mesh::HandleRange getCells(
const smtk::mesh::HandleRange& meshsets)
const override;
158 smtk::mesh::HandleRange getCells(
159 const smtk::mesh::HandleRange& meshsets,
163 smtk::mesh::HandleRange getCells(
164 const smtk::mesh::HandleRange& meshsets,
165 const smtk::mesh::CellTypes& cellTypes)
const override;
168 smtk::mesh::HandleRange getCells(
169 const smtk::mesh::HandleRange& meshsets,
170 smtk::mesh::DimensionType dim)
const override;
175 smtk::mesh::HandleRange getPoints(
176 const smtk::mesh::HandleRange& cells,
177 bool boundary_only =
false)
const override;
184 bool getCoordinates(
const smtk::mesh::HandleRange& points,
double* xyz)
const override;
188 bool getCoordinates(
const smtk::mesh::HandleRange& points,
float* xyz)
const override;
192 bool setCoordinates(
const smtk::mesh::HandleRange& points,
const double* xyz)
override;
196 bool setCoordinates(
const smtk::mesh::HandleRange& points,
const float* xyz)
override;
198 std::string name(
const smtk::mesh::Handle& meshset)
const override;
199 bool setName(
const smtk::mesh::Handle& meshset,
const std::string& name)
override;
201 std::vector<std::string> computeNames(
const smtk::mesh::HandleRange& meshsets)
const override;
203 std::vector<smtk::mesh::Domain> computeDomainValues(
204 const smtk::mesh::HandleRange& meshsets)
const override;
206 std::vector<smtk::mesh::Dirichlet> computeDirichletValues(
207 const smtk::mesh::HandleRange& meshsets)
const override;
209 std::vector<smtk::mesh::Neumann> computeNeumannValues(
210 const smtk::mesh::HandleRange& meshsets)
const override;
213 const smtk::mesh::HandleRange& meshsets)
const override;
218 bool computeShell(
const smtk::mesh::HandleRange& meshes, smtk::mesh::HandleRange& shell)
222 bool computeAdjacenciesOfDimension(
223 const smtk::mesh::HandleRange& meshes,
225 smtk::mesh::HandleRange& adj)
const override;
228 bool canonicalIndex(
const smtk::mesh::Handle& cell, smtk::mesh::Handle& parent,
int& index)
233 bool mergeCoincidentContactPoints(
const smtk::mesh::HandleRange& meshes,
double tolerance)
237 smtk::mesh::HandleRange neighbors(
const smtk::mesh::Handle& cell)
const override;
239 bool setDomain(
const smtk::mesh::HandleRange& meshsets,
const smtk::mesh::Domain& domain)
245 bool setNeumann(
const smtk::mesh::HandleRange& meshsets,
const smtk::mesh::Neumann& neumann)
248 bool setId(
const smtk::mesh::Handle& meshset,
const smtk::common::UUID&
id)
const override;
253 const smtk::mesh::Handle& root,
255 smtk::mesh::Handle& meshset)
const override;
257 bool setAssociation(
const smtk::common::UUID& modelUUID,
const smtk::mesh::HandleRange& range)
260 smtk::mesh::HandleRange findAssociations(
261 const smtk::mesh::Handle& root,
268 bool createCellField(
269 const smtk::mesh::HandleRange& meshsets,
270 const std::string& name,
271 std::size_t dimension,
272 const smtk::mesh::FieldType& type,
273 const void* data)
override;
278 smtk::mesh::HandleRange getMeshsets(
279 smtk::mesh::Handle handle,
286 const smtk::mesh::HandleRange& meshsets,
288 void* data)
const override;
291 const smtk::mesh::HandleRange& cells,
293 void* data)
const override;
296 const smtk::mesh::HandleRange& cells,
298 const void* data)
override;
301 const smtk::mesh::HandleRange& meshsets,
303 const void* data)
override;
305 std::set<smtk::mesh::CellFieldTag> computeCellFieldTags(
306 const smtk::mesh::Handle& handle)
const override;
308 bool deleteCellField(
310 const smtk::mesh::HandleRange& meshsets)
override;
312 bool createPointField(
313 const smtk::mesh::HandleRange& meshsets,
314 const std::string& name,
315 std::size_t dimension,
316 const smtk::mesh::FieldType& type,
317 const void* data)
override;
322 smtk::mesh::HandleRange getMeshsets(
323 smtk::mesh::Handle handle,
327 const smtk::mesh::HandleRange& meshsets,
331 const smtk::mesh::HandleRange& meshsets,
333 void* data)
const override;
336 const smtk::mesh::HandleRange& points,
338 void* data)
const override;
341 const smtk::mesh::HandleRange& points,
343 const void* data)
override;
346 const smtk::mesh::HandleRange& meshsets,
348 const void* data)
override;
350 std::set<smtk::mesh::PointFieldTag> computePointFieldTags(
351 const smtk::mesh::Handle& handle)
const override;
353 bool deletePointField(
355 const smtk::mesh::HandleRange& meshsets)
override;
357 smtk::mesh::HandleRange pointIntersect(
358 const smtk::mesh::HandleRange& a,
359 const smtk::mesh::HandleRange& b,
361 smtk::mesh::ContainmentType containmentType)
const override;
363 smtk::mesh::HandleRange pointDifference(
364 const smtk::mesh::HandleRange& a,
365 const smtk::mesh::HandleRange& b,
367 smtk::mesh::ContainmentType containmentType)
const override;
372 const HandleRange& cells,
378 bool deleteHandles(
const smtk::mesh::HandleRange& toDel)
override;
382 void setModifiedState(
bool state)
override { m_modified = state; }
385 void callPointForEach(
386 const HandleRange& points,
387 std::vector<double>& coords,
390 void pointForEachRecursive(
392 std::vector<double>& coords,
396 smtk::shared_ptr<::moab::Interface> m_iface;
400 mutable bool m_modified{
false };