SCOREC core
Parallel unstructured mesh tools
pumi.h
1 /******************************************************************************
2 
3  (c) 2004-2018 Scientific Computation Research Center,
4  Rensselaer Polytechnic Institute. All rights reserved.
5 
6  This work is open source software, licensed under the terms of the
7  BSD license as described in the LICENSE file in the top-level directory.
8 
9 *******************************************************************************/
10 #ifndef PUMI_H
11 #define PUMI_H
12 #include <gmi.h>
13 #include <apfMesh2.h>
14 #include "GenTag.h"
15 #include "GenIterator.h"
16 #include "mPartEntityContainer.h"
17 #include "apf.h"
18 #include "pcu_util.h"
19 
20 enum PUMI_EntTopology {
21  PUMI_VERTEX, // 0
22  PUMI_EDGE, // 1
23  PUMI_TRIANGLE, // 2
24  PUMI_QUAD, // 3
25  PUMI_TET, // 4
26  PUMI_HEX, // 5
27  PUMI_PRISM, // 6
28  PUMI_PYRAMID, // 7
29  ENT_TOPOLOGIES
30 };
31 
32 enum PUMI_FieldType {
33  PUMI_SCALAR, // a single scalar value
34  PUMI_VECTOR, // a 3D vector
35  PUMI_MATRIX, // a 3x3 matrix
36  PUMI_PACKED, // a user-defined set of components
37  FIELD_TYPES
38 };
39 class gEntity;
40 class mPartEntityContainer;
41 
42 class gModel : public TagHolder
43 {
44 private:
45  mPartEntityContainer allEntities;
46  gmi_model* g;
47 public:
48  gModel(gmi_model* model);
49  ~gModel();
50  gmi_model* getGmi() {return g; }
51  gEntity* getGeomEnt(int d, gmi_ent* ge);
52  void add (int d, gEntity *ge) {allEntities.add(d, ge);}
53  void del(int d, gEntity *ge) {allEntities.del(d, ge); }
54  typedef mPartEntityContainer::iter iterall;
55  iterall begin(int d) {return allEntities.begin(d);}
56  iterall end(int d) {return allEntities.end(d);}
57  int size(int d) {return allEntities.size(d); }
58 };
59 
60 typedef gModel* pGeom;
61 typedef gEntity* pGeomEnt;
62 
63 typedef gModel::iterall pGeomIter;
64 typedef GenIterator<mPartEntityContainer::iter, gEntity>* gIter;
65 
66 typedef apf::Mesh2* pMesh;
67 typedef apf::MeshEntity* pMeshEnt;
68 typedef apf::EntityVector EntityVector;
69 typedef apf::MeshIterator* pMeshIter;
70 typedef apf::Copies Copies;
71 typedef apf::Copies::iterator pCopyIter;
72 typedef apf::MeshTag* pMeshTag;
73 typedef apf::Parts Parts;
75 typedef apf::Field* pField;
76 typedef apf::FieldShape* pShape;
77 typedef apf::Numbering* pNumbering;
78 typedef apf::Vector3 Vector3; // 3d vector
79 typedef apf::Adjacent Adjacent; // adjacency container
80 typedef apf::Sharing Ownership;
81 typedef apf::Sharing* pOwnership;
82 typedef apf::CopyArray CopyArray; // array type for remote copies
83 
84 // singleton to save model/mesh
85 class pumi
86 {
87 public:
88  pumi();
89  ~pumi();
90  static pumi* instance() {
91  static pumi _instance;
92  return &_instance;
93  };
94  void initializePCU(pcu::PCU *newPCU) {
95  PCU_ALWAYS_ASSERT_VERBOSE(PCUObj==nullptr, "pumi::instance() PCUObj already initialized\n");
96  PCUObj = newPCU;
97  }
98  [[nodiscard]] pcu::PCU* getPCU() const noexcept {return PCUObj;}
99 
100  pMesh mesh;
101  pGeom model;
102  int* num_local_ent;
103  int* num_own_ent;
104  int* num_global_ent;
105  pMeshTag ghosted_tag;
106  pMeshTag ghost_tag;
107  std::vector<pMeshEnt> ghost_vec[4];
108  std::vector<pMeshEnt> ghosted_vec[4];
109 
110  private:
111  pcu::PCU *PCUObj;
112 };
113 
114 //************************************
115 //************************************
116 // 0- SYSTEM-LEVEL FUNCTIONS
117 //************************************
118 //************************************
119 
120 void pumi_load_pcu(pcu::PCU *PCUObj);
121 int pumi_size();
122 int pumi_rank();
123 
124 void pumi_sync();
125 void pumi_printSys();
126 double pumi_getTime();
127 double pumi_getMem();
128 void pumi_printTimeMem(const char* msg, double time, double memory);
129 
130 //************************************
131 //************************************
132 // 1- MODEL FUNCTIONS
133 //************************************
134 //************************************
135 
136 // Geometric Model
137 // create a model from gmi_model object
138 pGeom pumi_geom_load(gmi_model* gm,
139  const char* model_type="mesh",
140  const char* fileName=NULL,
141  void (*fp)(const char*)=NULL);
142 // create a model from a file
143 pGeom pumi_geom_load (const char* fileName, const char* model_type="mesh",
144  void (*fp)(const char*)=NULL);
145 void pumi_geom_delete(pGeom g);
146 void pumi_geom_freeze(pGeom g); // shall be called after modifying model entities
147 void pumi_geom_createID(pGeom g); // generate sequential ID starting from 1
148 int pumi_geom_getNumEnt(pGeom g, int d);
149 pGeomEnt pumi_geom_findEnt(pGeom g, int d, int id);
150 
151 void pumi_geom_print(pGeom g, bool print_ent=false);
152 
153 // Geometric Entity
154 // get geometric entity's dimension
155 int pumi_gent_getDim(pGeomEnt ge);
156 // get geometric entity's local id (note local==global for geometric model)
157 int pumi_gent_getID(pGeomEnt ge);
158 void pumi_gent_getRevClas (pGeomEnt g, std::vector<pMeshEnt>& ents);
159 int pumi_gent_getNumAdj (pGeomEnt g, int target_dim);
160 void gmi_getAdj (gmi_model*, gmi_ent* ge, int tgt_dim, std::set<gmi_ent*>& result);
161 void gmi_get2ndAdj(gmi_model*, gmi_ent* ge, int brg_dim, int tgt_dim, std::set<gmi_ent*>& result);
162 void pumi_gent_getAdj (pGeomEnt g, int target_dim, std::vector<pGeomEnt>& ents);
163 void pumi_gent_get2ndAdj (pGeomEnt e, int brgType, int tgtType, std::vector<pGeomEnt>& ents);
164 
165 // Tag management
166 pTag pumi_geom_createTag (pGeom g, const char* tagName, int tagType, int tagSize);
167 void pumi_geom_deleteTag (pGeom g, pTag tag, bool force_delete=false);
168 pTag pumi_geom_findTag (pGeom g, const char* tagName);
169 bool pumi_geom_hasTag (pGeom g, const pTag tag);
170 void pumi_geom_getTag (pGeom g, std::vector<pTag>& tags);
171 
172 int pumi_tag_getType (const pTag tag);
173 void pumi_tag_getName (const pTag tag, const char** name);
174 int pumi_tag_getSize (const pTag tag);
175 int pumi_tag_getByte (const pTag tag);
176 
177 void pumi_gent_deleteTag (pGeomEnt ent, pTag tag);
178 bool pumi_gent_hasTag (pGeomEnt ent, pTag tag);
179 void pumi_gent_getTag (pGeomEnt ent, std::vector<pTag>& tags);
180 
181 void pumi_gent_setPtrTag (pGeomEnt ent, pTag tag, void* data);
182 void pumi_gent_getPtrTag (pGeomEnt ent, pTag tag, void** data);
183 void pumi_gent_setIntTag (pGeomEnt ent, pTag tag, const int data);
184 void pumi_gent_getIntTag (pGeomEnt ent, pTag tag, int* data);
185 void pumi_gent_setLongTag (pGeomEnt ent, pTag tag, const long data);
186 void pumi_gent_getLongTag (pGeomEnt ent, pTag tag, long*);
187 void pumi_gent_setDblTag (pGeomEnt ent, pTag tag, const double data);
188 void pumi_gent_getDblTag (pGeomEnt ent, pTag tag, double*);
189 void pumi_gent_setEntTag (pGeomEnt ent, pTag tag, const pGeomEnt data);
190 void pumi_gent_getEntTag (pGeomEnt ent, pTag tag, pGeomEnt*);
191 
192 void pumi_gent_setPtrArrTag (pGeomEnt ent, pTag tag, void* const* data);
193 void pumi_gent_getPtrArrTag (pGeomEnt ent, pTag tag, void** data);
194 void pumi_gent_setIntArrTag (pGeomEnt ent, pTag tag, const int* data);
195 void pumi_gent_getIntArrTag (pGeomEnt ent, pTag tag, int** data, int* data_size);
196 void pumi_gent_setLongArrTag (pGeomEnt ent, pTag tag, const long* data);
197 void pumi_gent_getLongArrTag (pGeomEnt ent, pTag tag, long** data, int* data_size);
198 void pumi_gent_setDblArrTag (pGeomEnt ent, pTag tag, const double* data);
199 void pumi_gent_getDblArrTag (pGeomEnt ent, pTag tag, double** data, int* data_size);
200 void pumi_gent_setEntArrTag (pGeomEnt ent, pTag tag, const pGeomEnt* data);
201 void pumi_gent_getEntArrTag (pGeomEnt ent, pTag tag, pGeomEnt** data, int* data_size);
202 
203 
204 //************************************
205 // Mesh management
206 //************************************
207 
208 // create an empty mesh
209 pMesh pumi_mesh_create(pGeom g, int mesh_dim, bool periodic=false);
210 void pumi_mesh_freeze(pMesh m);
211 pMeshEnt pumi_mesh_createVtx(pMesh m, pGeomEnt ge, double* xyz);
212 //ent_topology: VERTEX (0), EDGE (1), TRIANGLE (2), QUAD (3), TET (4), HEX (5), PRISM (6), PYRAMID (7)
213 pMeshEnt pumi_mesh_createEnt(pMesh m, pGeomEnt ge, int target_topology, pMeshEnt* down);
214 pMeshEnt pumi_mesh_createElem(pMesh m, pGeomEnt ge, int target_topology, pMeshEnt* vertices);
215 
216 // load a serial mesh and no partitioning
217 pMesh pumi_mesh_loadSerial(pGeom g, const char* file_name, const char* mesh_type="mds");
218 
219 // load a mesh from a file. Do static partitioning if num_in_part==1
220 pMesh pumi_mesh_load(pGeom geom, const char* fileName, int num_in_part, const char* mesh_type="mds");
221 
222 // load a mesh from a an existing partitioned apf mesh
223 pMesh pumi_mesh_load(pMesh mesh);
224 
225 // load a serial mesh on all processes and set up comm links and ptn classification
226 // note that the default owning PID is 0
227 pMesh pumi_mesh_loadAll(pGeom g, const char* filename, bool stich_link=true);
228 
229 // delete mesh
230 void pumi_mesh_delete(pMesh m);
231 
232 // given a mesh with vertex remote link properly setup,
233 // stitch all other entities and set partition model.
234 // if dup=true, the elements are duplicated on multiple parts
235 void pumi_mesh_stitch(pMesh m, bool dup=false);
236 
237 // create/delete direct Adjacency for all entities except for one-level apart
238 bool pumi_mesh_hasAdjacency(pMesh m, int from_dim, int to_dim);
239 void pumi_mesh_createAdjacency(pMesh m, int from_dim, int to_dim);
240 void pumi_mesh_deleteAdjacency(pMesh m, int from_dim, int to_dim);
241 void pumi_mesh_createFullAdjacency(pMesh m);
242 
243 // write mesh into a file - mesh_type should be "mds" or "vtk"
244 void pumi_mesh_write (pMesh m, const char* fileName, const char* mesh_type="mds");
245 pGeom pumi_mesh_getGeom(pMesh m);
246 
247 // get mesh dimension
248 int pumi_mesh_getDim(pMesh m);
249 
250 // get # mesh entities of type d on local process
251 void pumi_mesh_setCount(pMesh m, pOwnership o=NULL);
252  int pumi_mesh_getNumEnt(pMesh m, int d);
253 int pumi_mesh_getNumGlobalEnt(pMesh m, int d);
254 int pumi_mesh_getNumOwnEnt(pMesh m, int d);
255 pMeshEnt pumi_mesh_findEnt(pMesh m, int d, int id);
256 
257 //************************************
258 // Tag management over mesh
259 //************************************
260 pMeshTag pumi_mesh_createIntTag(pMesh m, const char* name, int size);
261 pMeshTag pumi_mesh_createLongTag(pMesh m, const char* name, int size);
262 pMeshTag pumi_mesh_createDblTag(pMesh m, const char* name, int size);
263 
264 void pumi_mesh_deleteTag(pMesh m, pMeshTag tag, bool force_delete=false);
265 pMeshTag pumi_mesh_findTag(pMesh m, const char* name);
266 bool pumi_mesh_hasTag (pMesh m, const pMeshTag tag);
267 void pumi_mesh_getTag(pMesh m, std::vector<pMeshTag> tags);
268 
269 //************************************
270 // Migration
271 //************************************
272 
273 // migrate mesh per migration plan which contains a set of pairs [element and destination part]
274 void pumi_mesh_migrate(pMesh m, Migration* plan);
275 
276 //************************************
277 // Distribution
278 //************************************
279 
281 // defined in pumi_distribution.cc
283 {
284  public:
288  ~Distribution();
289 
291  bool has(pMeshEnt e);
293  void send(pMeshEnt e, int to);
295  Parts& sending(pMeshEnt e);
296  void print();
297  int count();
298  pMesh getMesh() {return m;}
299 
300  Parts* parts_vec;
301  int element_count;
302  private:
303  pMesh m;
304 };
305 
306 // load a serial mesh on master process then distribute as per the distribution object
307 void pumi_mesh_distribute(pMesh m, Distribution* plan);
308 
309 //************************************
310 // Ghosting
311 //************************************
312 
314 // defined in pumi_ghost.cc
315 class Ghosting
316 {
317  public:
320  Ghosting(pMesh, int d);
321  ~Ghosting();
322 
324  int count();
325  int count(pMeshEnt e, int d);
327  bool has(pMeshEnt e);
329  void send(pMeshEnt e, int to);
331  void send(int to);
332  void print();
334  Parts& sending(pMeshEnt e, int d);
335 
336  pMesh getMesh() {return m;}
337  int ghost_dim;
338 
339  private:
340  pMesh m;
341  pMeshTag parts_index_tag;
342  std::vector<Parts*> parts_vec[4];
343 };
344 
345 /*
346 input:
347  - brgType - desired bridge entity dimension
348  - ghostType - desired ghost entity type
349  - numLayer - the number of ghost layers
350  - includeCopy - integer flag indicating whether to include non-owned bridge entity (1: yes, 0: no)
351  If includeCopy is 0 and part boundary entity of brgType is not owned by a self part
352  (shortly, non-owned bridge type entity), ghost type dimensional entities adjacent to the non-owned
353  bridge type entity is not ghost copied. If includeCopy is 1, all ghost type dimensional entities
354  adjacent to the bridge type entities on part boundaries are ghost copied.
355 
356 The error is returned in the following cases:
357  - bridge type is greater than or equal to ghost type
358  - bridge type is greater than or equal to mesh dimension
359  - ghost type is mesh vertex
360  - ghost type is grester than mesh dimension
361 */
362 void pumi_ghost_createLayer (pMesh m, int brgType, int ghostType, int numLayer, int includeCopy);
363 
364 // Ghosting: ghosting plan object for local elements or part to destinations.
365 void pumi_ghost_create(pMesh m, Ghosting* plan);
366 
367 void pumi_ghost_delete (pMesh m);
368 
369 //************************************
370 // MISCELLANEOUS
371 //************************************
372 // create/delete global ID using tag "global_id"
373 void pumi_mesh_createGlobalID(pMesh m, pOwnership o=NULL);
374 void pumi_mesh_deleteGlobalID(pMesh m);
375 
376 // verify mesh
377 void pumi_mesh_verify(pMesh m, bool abort_on_error=true);
378 // verify user-defined ownership and mesh counter
379 void pumi_ownership_verify(pMesh m, pOwnership o);
380 // print mesh size info - global and local
381 void pumi_mesh_print(pMesh m, bool print_ent=false);
382 
383 //************************************
384 // Mesh Entity
385 //************************************
386 // get mesh entity's dimension
387 int pumi_ment_getDim(pMeshEnt e);
388 int pumi_ment_getTopo(pMeshEnt e);
389 // get mesh entity's local id
390 int pumi_ment_getID(pMeshEnt e);
391 
392 // get mesh entity's global id - vertex only
393 // global id is maintained if mesh is re-partitioned or ghosted
394 // global id is NOT maintained if mesh is adapted
395 int pumi_ment_getGlobalID(pMeshEnt e);
396 
397 // get # adjacent entities
398 int pumi_ment_getNumAdj(pMeshEnt e, int tgtType);
399 
400 // get adjacent entitities with std::vector
401 void pumi_ment_getAdj(pMeshEnt e, int tgtType, std::vector<pMeshEnt>& vecAdjEnt);
402 void pumi_ment_get2ndAdj (pMeshEnt e, int brgType, int tgtType, std::vector<pMeshEnt>& vecAdjEnt);
403 
404 // get adjacent entitities with Adjacenct and return #result entities (faster than std::vector)
405 int pumi_ment_getAdjacent(pMeshEnt e, int tgtType, Adjacent& result);
406 int pumi_ment_get2ndAdjacent(pMeshEnt e, int brgType, int tgtType, Adjacent& result);
407 
408 // return entity's geometric classification
409 pGeomEnt pumi_ment_getGeomClas(pMeshEnt e);
410 
411 // for mesh edge and vertex, return the other vertex
412 pMeshEnt pumi_medge_getOtherVtx(pMeshEnt edge, pMeshEnt vtx);
413 
414 // tag management over mesh entity
415 void pumi_ment_deleteTag (pMeshEnt e, pMeshTag tag);
416 bool pumi_ment_hasTag (pMeshEnt e, pMeshTag tag);
417 
418 void pumi_ment_setIntTag(pMeshEnt e, pMeshTag tag, int const* data);
419 void pumi_ment_getIntTag(pMeshEnt e, pMeshTag tag, int* data);
420 void pumi_ment_setLongTag(pMeshEnt e, pMeshTag tag, long const* data);
421 void pumi_ment_getLongTag(pMeshEnt e, pMeshTag tag, long* data);
422 void pumi_ment_setDblTag(pMeshEnt e, pMeshTag tag, double const* data);
423 void pumi_ment_getDblTag(pMeshEnt e, pMeshTag tag, double* data);
424 
425 // return true if the entity exists on the part
426 bool pumi_ment_isOn(pMeshEnt e, int partID);
427 
428 // return owning part id. if ghosted mesh, vertex or element only
429 int pumi_ment_getOwnPID(pMeshEnt e, pOwnership o=NULL);
430 
431 // return owner entity copy. if ghoted mesh, vertex or element only
432 pMeshEnt pumi_ment_getOwnEnt(pMeshEnt e, pOwnership o=NULL);
433 
434 // return true if the entity is an owner copy
435 bool pumi_ment_isOwned(pMeshEnt e, pOwnership o=NULL);
436 
437 // return true if entity is on part boundary, ghosted, or ghost
438 // - this will fixed to consider only part boundary entities later
439 bool pumi_ment_isOnBdry (pMeshEnt e);
440 
441 // return # remote and ghost copies
442 // - this will fixed to consider only part boundary entities later
443 int pumi_ment_getNumRmt (pMeshEnt e);
444 
445 // return remote and ghost copies
446 // - this will fixed to consider only part boundary entities later
447 void pumi_ment_getAllRmt(pMeshEnt e, Copies& remotes);
448 
449 // return remote or ghost copy on a destination part
450 // - this will fixed to consider only part boundary entities later
451 pMeshEnt pumi_ment_getRmt(pMeshEnt& meshEnt, int destPart);
452 
453 // return part ids where the entity is duplicated - part boundary or ghost
454 void pumi_ment_getResidence(pMeshEnt e, Parts& residence);
455 
456 // return part ids where the entity and its downward adjacency are duplicated - part boundary or ghost
457 void pumi_ment_getClosureResidence(pMeshEnt ent, Parts& residence);
458 
459 // return true if the entity is a ghost copy
460 bool pumi_ment_isGhost(pMeshEnt e);
461 
462 // return true if the entity is ghosted
463 bool pumi_ment_isGhosted (pMeshEnt e);
464 
465 // return #ghost copies
466 int pumi_ment_getNumGhost (pMeshEnt e);
467 
468 // return ghost copies
469 void pumi_ment_getAllGhost (pMeshEnt e, Copies&);
470 
471 // return ghost copy on a destination part
472 pMeshEnt pumi_ment_getGhost(pMeshEnt& e, int partID);
473 
474 //************************************
475 // Node numbering
476 //************************************
477 pNumbering pumi_numbering_create (pMesh m, const char* name, pShape shape=NULL, int num_component=1);
478 pNumbering pumi_numbering_createLocal (pMesh m, const char* name, pShape shape=NULL);
479 pNumbering pumi_numbering_createGlobal(pMesh m, const char* name, pShape s=NULL, pOwnership o=NULL);
480 pNumbering pumi_numbering_createOwn (pMesh m, const char* name, pShape shape=NULL, pOwnership o=NULL);
481 pNumbering pumi_numbering_createOwnDim (pMesh m, const char* name, int dim, pOwnership o=NULL);
482 pNumbering pumi_numbering_createProcGrp (pMesh m, const char* name, int num_proc_grp,
483  int dim, pOwnership o=NULL);
484 
485 void pumi_numbering_delete(pNumbering n);
486 int pumi_numbering_getNumNode(pNumbering n);
487 
488 void pumi_node_setNumber(pNumbering nb, pMeshEnt e, int n, int c, int number);
489 int pumi_node_getNumber(pNumbering nb, pMeshEnt e, int n=0, int c=0);
490 bool pumi_node_isNumbered(pNumbering nb, pMeshEnt e, int n=0, int c=0);
491 void pumi_numbering_print(pNumbering nb, int rank = -1);
492 //************************************
493 // Field shape and nodes
494 //************************************
495 pShape pumi_mesh_getShape (pMesh m);
496 void pumi_mesh_setShape (pMesh m, pShape s, bool project=true);
497 int pumi_shape_getNumNode (pShape s, int topo);
498 bool pumi_shape_hasNode (pShape s, int topo);
499 
500 void pumi_node_getCoord(pMeshEnt e, int i, double* xyz);
501 void pumi_node_setCoord(pMeshEnt e, int i, double* xyz);
502 void pumi_node_getCoordVector(pMeshEnt e, int i, Vector3& xyz);
503 void pumi_node_setCoordVector(pMeshEnt e, int i, Vector3 const& xyz);
504 
505 void pumi_node_getField (pField f, pMeshEnt e, int i, double* dof_data);
506 void pumi_node_setField (pField f, pMeshEnt e, int i, double* dof_data);
507 
509 Vector3 pumi_vector3_cross(Vector3 const& a, Vector3 const& b);
510 
511 pShape pumi_shape_getLagrange (int order);
512 pShape pumi_shape_getSerendipity ();
513 pShape pumi_shape_getConstant (int dimension);
514 pShape pumi_shape_getIP (int dimension, int order);
515 pShape pumi_shape_getVoronoi (int dimension, int order);
516 pShape pumi_shape_getIPFit(int dimension, int order);
517 pShape pumi_shape_getHierarchic (int order);
518 
519 //************************************
520 // Field Management
521 //************************************
522 
523 pField pumi_field_create(pMesh m, const char* name,
524  int num_dof_per_node, int field_type=PUMI_PACKED, pShape shape = NULL);
525 int pumi_field_getSize(pField f);
526 int pumi_field_getType(pField f);
527 std::string pumi_field_getName(pField f);
528 pShape pumi_field_getShape (pField f);
529 pNumbering pumi_field_getNumbering(pField f);
530 
531 void pumi_field_delete(pField f);
532 void pumi_field_synchronize(pField f, pOwnership o=NULL);
533 void pumi_field_accumulate(pField f, pOwnership o=NULL);
534 void pumi_field_freeze(pField f);
535 void pumi_field_unfreeze(pField f);
536 pField pumi_mesh_findField(pMesh m, const char* name);
537 int pumi_mesh_getNumField(pMesh m);
538 pField pumi_mesh_getField(pMesh m, int i);
539 
540 void pumi_field_copy(pField f, pField r);
541 void pumi_field_add(pField f1, pField f2, pField r);
542 void pumi_field_multiply(pField f, double d, pField r);
543 
544 // verify field
545 void pumi_field_verify(pMesh m, pField f=NULL, pOwnership o=NULL);
546 void pumi_field_print(pField f);
547 #endif
The APF Mesh modification interface.
The APF Field interface.
Distribution plan object: send local elements to multiple destinations.
Definition: pumi.h:283
Distribution(pMesh m)
must be constructed with a mesh
void send(pMeshEnt e, int to)
assign a destination part id to an element
bool has(pMeshEnt e)
return true if the i'th element has been assigned destination(s)
Parts & sending(pMeshEnt e)
return the destination part id of an element
Ghosting plan object: local elements or part to destinations.
Definition: pumi.h:316
void send(int to)
assign a destination part id of all ghost_dim entities
void send(pMeshEnt e, int to)
assign a destination part id to an entity
Parts & sending(pMeshEnt e, int d)
return the destination parts of an entity
bool has(pMeshEnt e)
return true if the i'th element has been assigned a destination
int count()
return the number of elements with ghost destinations
Ghosting(pMesh, int d)
must be constructed with a mesh
Describes field distribution and shape functions.
Definition: apfShape.h:92
Extended mesh interface for modification.
Definition: apfMesh2.h:30
Migration plan object: local elements to destinations.
Definition: apfMesh.h:459
convenience wrapper over apf::Vector<3>
Definition: apfVector.h:151
The Parallel Contrul Unit class encapsulates parallel communication.
Definition: PCU.h:26
abstract Geometric Model Interface
DynamicArray< Copy > CopyArray
a set of copies, possibly multiple copies per part
Definition: apfMesh.h:91
DynamicArray< MeshEntity * > Adjacent
Set of adjacent mesh entities.
Definition: apfMesh.h:47
std::set< int > Parts
Set of unique part ids.
Definition: apfMesh.h:44
void number(Numbering *n, MeshEntity *e, int node, int component, int number)
number a degree of freedom
std::map< int, MeshEntity * > Copies
Remote copy container.
Definition: apfMesh.h:37
NumberingOf< int > Numbering
Numbering is meant to be a 32-bit local numbering.
Definition: apfMesh.h:28
Vector< T, N > project(Vector< T, N > const &a, Vector< T, N > const &b)
returns vector a projected onto vector b
Definition: mth_def.h:45
abstract description of entity copy sharing
Definition: apfMesh.h:489
the basic structure for all GMI models
Definition: gmi.h:112