Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
sub_oda.h
1 /***
2  * @file sub_oda.h
3  * @author Hari Sundar hsundar@gmail.com
4  * @author Milinda Fernando milinda@cs.utah.edu
5  * @date 13 June 2019
6  * @brief Subdomain for Octree DA (ODA).
7  ***/
8 
9 #pragma once
10 
11 #include <functional>
12 #include <iostream>
13 
14 #include "oda.h"
15 
16 namespace ot {
17 
22  class subDA {
23 
24  protected:
25 
29  std::vector<unsigned char> m_ucpSkipList;
31  std::vector<unsigned char> m_ucpSkipNodeList;
33  unsigned int m_uiLocalElementSize;
39  unsigned int m_uiLocalNodeSize;
41  unsigned int m_uiPreGhostNodeSize;
43  unsigned int m_uiPostGhostNodeSize;
45  unsigned int m_uiCommTag;
46 
47  std::vector<AsyncExchangeContex> m_uiMPIContexts;
48 
51 
53  std::vector<AsyncExchangeContex> m_mpiContexts;
55  std::vector<unsigned int> m_uip_sub2DA_ElemMap;
57  std::vector<unsigned int> m_uip_DA2sub_ElemMap;
59  std::vector<unsigned int> m_uip_sub2DA_NodeMap;
61  std::vector<unsigned int> m_uip_DA2sub_NodeMap;
62 
64  double m_dMinBB[3];
66  double m_dMaxBB[3];
67 
69  unsigned int m_uiTotalNodalSz;
71  unsigned int m_uiLocalNodalSz;
72 
74  unsigned int m_uiTotalElementSz;
75 
77  unsigned int m_uiLocalElementSz;
78 
80  unsigned int m_uiElementPreGhostBegin = 0; // Not mandatory to store this.
82  unsigned int m_uiElementPreGhostEnd;
84  unsigned int m_uiElementLocalBegin;
86  unsigned int m_uiElementLocalEnd;
91 
93  unsigned int m_uiNodePreGhostBegin=0;
95  unsigned int m_uiNodePreGhostEnd;
97  unsigned int m_uiNodeLocalBegin;
99  unsigned int m_uiNodeLocalEnd;
103  unsigned int m_uiNodePostGhostEnd;
104 
108  unsigned int m_uiNumLocalElements;
111 
113  unsigned int m_uiNumPreGhostNodes;
115  unsigned int m_uiNumLocalNodes;
117  unsigned int m_uiNumPostGhostNodes;
118 
120  std::vector<unsigned int > m_uiSendScatterMap;
122  std::vector<unsigned int > m_uiRecvScatterMap;
123 
125  std::vector<unsigned int> m_uiSendCounts;
127  std::vector<unsigned int> m_uiRecvCounts;
129  std::vector<unsigned int> m_uiSendOffsets;
131  std::vector<unsigned int> m_uiRecvOffsets;
133  std::vector<unsigned int> m_uiSendProcList;
135  std::vector<unsigned int> m_uiRecvProcList;
136 
139 
141  MPI_Comm m_uiCommGlobal;
142 
144  MPI_Comm m_uiCommActive;
145 
148 
151 
154 
157 
158 
159  public:
166  subDA(DA* da, std::function<double ( double, double, double ) > fx_retain, double* gSize);
167 
168  ~subDA();
169 
170  ot::DA* global_domain() { return m_da; }
171 
173  inline unsigned int getLocalNodalSz() const {return m_uiLocalNodalSz;}
174 
176  inline unsigned int getPreNodalSz() const { return m_uiNumPreGhostNodes; }
177 
179  inline unsigned int getPostNodalSz() const {return m_uiNumPostGhostNodes;}
180 
182  inline unsigned int getTotalNodalSz() const {return m_uiTotalNodalSz;}
183 
185  inline unsigned int getLocalElemSz() const {return m_uiLocalElementSz;}
186 
188  inline unsigned int getTotalElemSz() const {return m_uiTotalElementSz;}
189 
191  inline bool isActive() const {return m_da->isActive();}
192 
194  inline unsigned int getNumNodesPerElement() const {return m_da->getNumNodesPerElement();}
195 
197  inline unsigned int getElementOrder() const {return m_da->getElementOrder();}
198 
200  inline MPI_Comm getGlobalComm() const { return m_da->getGlobalComm();}
201 
203  //inline const std::vector<DendroIntL> getNodeLocalToGlobalMap() const {return m_uiLocalToGlobalNodalMap;}
204 
206  inline const ot::Mesh* getMesh() const {return m_da->getMesh();}
207 
209  inline MPI_Comm getCommActive() const
210  {
211  if(m_da->isActive())
212  return m_da->getCommActive();
213  else
214  return MPI_COMM_NULL;
215  }
216 
218  inline unsigned int getNpesAll() const { return m_da->getNpesAll();} ;
219 
221  inline unsigned int getNpesActive() const
222  {
223  if(m_da->isActive())
224  return m_da->getNpesActive();
225  else
226  return 0;
227  }
228 
230  inline unsigned int getRankAll() const {return m_da->getRankAll();};
231 
233  inline unsigned int getRankActive() const
234  {
235  if(m_da->isActive())
236  return m_da->getRankActive();
237  else
238  return m_da->getRankAll();
239  }
240 
245  bool isBoundaryOctant(unsigned int eleID) const;
246 
263  void getElementalCoords(unsigned int eleID, double* coords) const ;
264 
265 
267  inline const RefElement* getReferenceElement()const { return m_da->getReferenceElement();}
268 
269 
271  inline unsigned int getElementSize() const {return m_uiNumLocalElements;}
272 
274  inline unsigned int getPreGhostElementSize() const {return m_uiNumPreGhostElements;}
275 
277  inline unsigned int getPostGhostElementSize() const {return m_uiNumPostGhostElements; }
278 
280  inline unsigned int getPreAndPostGhostNodeSize() const {return (m_uiNumPreGhostNodes + m_uiNumPostGhostNodes);}
281 
283  unsigned int getGhostedElementSize() const {return (m_uiNumPreGhostElements + m_uiNumPostGhostElements);}
284 
286  inline unsigned int getMaxDepth() const {return m_uiMaxDepth;};
288  inline unsigned int getDimension() const {return m_uiDim;};
289 
297  template<typename T>
298  int createVector(T*& local, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
299 
307  template<typename T>
308  int createVector(std::vector<T>& local, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
309 
314  template <typename T>
315  void destroyVector(T*& local) const;
316 
317  template <typename T>
318  void destroyVector(std::vector<T>& local) const;
319 
320 
321 
323  template<ot::DA_FLAGS::LoopType type>
324  void init();
325 
327  unsigned int curr();
328 
329 
331  template<ot::DA_FLAGS::LoopType type>
332  unsigned int end();
333 
335  template<ot::DA_FLAGS::LoopType type>
336  void next();
337 
341  template<typename T>
342  void readFromGhostBegin(T* vec, unsigned int dof=1);
343 
347  template<typename T>
348  void readFromGhostEnd(T* vec, unsigned int dof=1);
349 
350 
352  template<typename T>
353  void writeToGhostsBegin(T* vec, unsigned int dof=1) ;
354 
356  template<typename T>
357  void writeToGhostsEnd(T* vec, unsigned int dof=1) ;
358 
359 
367  template<typename T>
368  void nodalVecToGhostedNodal(const T* in,T*& out,bool isAllocated=false, unsigned int dof=1)const;
369 
370 
379  template<typename T>
380  void ghostedNodalToNodalVec(const T* gVec,T*& local,bool isAllocated=false, unsigned int dof=1) const;
381 
382 
383 
391  template <typename T>
392  void getElementNodalValues(const T*in, T* eleVecOut,unsigned int eleID,unsigned int dof=1)const;
393 
401  template <typename T>
402  void eleVecToVecAccumilation(T*out, const T* eleVecIn,unsigned int eleID,unsigned int dof=1)const;
403 
409  void getOctreeBoundaryNodeIndices(std::vector<unsigned int >& bdyIndex,std::vector<double>& coords,bool isGhosted=false);
410 
416  int getNodeIndices(DendroIntL* nodeIdx,unsigned int ele,bool isGhosted) const;
417 
423  int getGlobalNodeIndices(DendroIntL* nodeIdx,unsigned int ele) const ;
424 
434  template <typename T>
435  void setVectorByFunction(T* local,std::function<void(T,T,T,T*)>func,bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
436 
437 
448  template <typename T>
449  void setVectorByScalar(T* local,const T* value,bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
450 
451 
459  template <typename T>
460  void vecTopvtu(T* local, const char * fPrefix,char** nodalVarNames=NULL,bool isElemental=false,bool isGhosted=false,unsigned int dof=1);
461 
462 
466  inline unsigned int getLevel(unsigned int ele) const { return m_da->getLevel(m_uip_sub2DA_ElemMap[ele]);}
467 
472  inline ot::TreeNode getOctant(unsigned int ele) const {return m_da->getOctant(m_uip_sub2DA_ElemMap[ele]);}
473 
482  template<typename T>
483  T* getVecPointerToDof(T* in ,unsigned int dofInex, bool isElemental=false,bool isGhosted=false) const;
484 
485 
494  template<typename T>
495  void copyVectors(T* dest,const T* source,bool isElemental=false,bool isGhosted=false,unsigned int dof=1) const;
496 
504  template<typename T>
505  void copyVector(T* dest,const T* source,bool isElemental=false,bool isGhosted=false) const;
506 
507 
517  ot::DA* remesh(const DA_FLAGS::Refine * flags, unsigned int sz,unsigned int grainSz=100,double ld_bal=0.3, unsigned int sfK=2) const;
518 
527  template<typename T>
528  void intergridTransfer(const T* varIn, T* & varOut, const ot::DA* newDA, bool isElemental=false, bool isGhosted=false, unsigned int dof=1);
529 
530 
531 
543  template<typename T>
544  int getFaceNeighborValues(unsigned int eleID, const T* in, T* out, T* coords, unsigned int * neighID, unsigned int face, NeighbourLevel & level) const;
545 
546 
547  // all the petsc functionalities goes below with the pre-processor gards.
548 #ifdef BUILD_WITH_PETSC
549 
558  PetscErrorCode petscCreateVector(Vec &local, bool isElemental, bool isGhosted, unsigned int dof) const;
559 
560 
567  PetscErrorCode createMatrix(Mat &M, MatType mtype, unsigned int dof=1) const;
568 
569 
570 
578  PetscErrorCode petscNodalVecToGhostedNodal(const Vec& in,Vec& out,bool isAllocated=false,unsigned int dof=1) const;
579 
580 
589  PetscErrorCode petscGhostedNodalToNodalVec(const Vec& gVec,Vec& local,bool isAllocated=false,unsigned int dof=1) const;
590 
598  void petscReadFromGhostBegin(PetscScalar * vecArry, unsigned int dof=1) ;
599 
606  void petscReadFromGhostEnd(PetscScalar * vecArry, unsigned int dof=1) ;
607 
608 
618  template<typename T>
619  void petscSetVectorByFunction(Vec& local,std::function<void(T,T,T,T*)>func,bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
620 
621 
632  template <typename T>
633  void petscSetVectorByScalar(Vec& local,const T* value,bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const;
634 
635 
643  void petscVecTopvtu(const Vec& local, const char * fPrefix,char** nodalVarNames=NULL,bool isElemental=false,bool isGhosted=false,unsigned int dof=1) ;
644 
645 
658  PetscErrorCode petscSetValuesInMatrix(Mat mat, std::vector<ot::MatRecord>& records,unsigned int dof, InsertMode mode) const;
659 
660 
661 
669  PetscErrorCode petscChangeVecToMatBased(Vec& v1,bool isElemental,bool isGhosted,unsigned int dof=1) const;
670 
671 
677  PetscErrorCode petscChangeVecToMatFree(Vec& v1,bool isElemental,bool isGhosted,unsigned int dof=1) const;
678 
687  template<typename T>
688  void petscIntergridTransfer(const Vec &varIn, Vec &varOut, const ot::DA *newDA, bool isElemental = false,bool isGhosted = false, unsigned int dof = 1);
689 
694  PetscErrorCode petscDestroyVec(Vec & vec);
695 
696 
697 #endif
698 
699 
700 
701  };
702 
703 
704 }
705 
706 #include "sub_oda.tcc"
707 
708 
709 
std::vector< unsigned int > m_uip_DA2sub_ElemMap
: DA to subDA map (elemental)
Definition: sub_oda.h:57
void ghostedNodalToNodalVec(const T *gVec, T *&local, bool isAllocated=false, unsigned int dof=1) const
convert ghosted nodal vector to local vector (without ghosting)
unsigned int getNumNodesPerElement() const
get number of nodes per element
Definition: oda.h:257
void writeToGhostsBegin(T *vec, unsigned int dof=1)
Initiate accumilation across ghost elements.
int m_uiRankGlobal
: rank global
Definition: sub_oda.h:150
void setVectorByScalar(T *local, const T *value, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const
initialize a variable vector to a function depends on spatial coords.
Simple class to manage async data transfer in the ODA class.
Definition: asyncExchangeContex.h:16
std::vector< unsigned int > m_uiRecvProcList
Definition: sub_oda.h:135
unsigned int getPreAndPostGhostNodeSize() const
: get the number of pre and post ghost elements
Definition: sub_oda.h:280
void destroyVector(T *&local) const
deallocates the memory allocated for a vector
std::vector< unsigned int > m_uiSendOffsets
: send offsets
Definition: sub_oda.h:129
unsigned int m_uiNodeLocalEnd
Definition: sub_oda.h:99
unsigned int getTotalNodalSz() const
returns the total nodal size (this includes the ghosted region as well.)
Definition: sub_oda.h:182
int getNodeIndices(DendroIntL *nodeIdx, unsigned int ele, bool isGhosted) const
Returns the local indices to the nodes of the current element.
unsigned int m_uiLocalNodeSize
: Local node size
Definition: sub_oda.h:39
MPI_Comm getCommActive() const
: returns the active MPI sub com of the global communicator
Definition: oda.h:275
unsigned int m_uiTotalElementSz
total element size
Definition: sub_oda.h:74
unsigned int getElementSize() const
: get the number of local elements.
Definition: sub_oda.h:271
unsigned int getRankActive() const
: rank w.r.t active comm.
Definition: sub_oda.h:233
void writeToGhostsEnd(T *vec, unsigned int dof=1)
Sync accumilation across ghost elements.
unsigned int m_uiNodeLocalBegin
Definition: sub_oda.h:97
std::vector< unsigned int > m_uiRecvScatterMap
: recv scatter map
Definition: sub_oda.h:122
unsigned int curr()
get the current elmenent in the iteration
unsigned int getLocalNodalSz() const
returns the local nodal size
Definition: sub_oda.h:173
unsigned int getNpesAll() const
: global mpi com. size
Definition: sub_oda.h:218
unsigned int getLevel(unsigned int ele) const
return the level of current octant
Definition: oda.h:578
std::vector< AsyncExchangeContex > m_mpiContexts
: async comm contex
Definition: sub_oda.h:53
MPI_Comm getCommActive() const
: returns the active MPI sub com of the global communicator
Definition: sub_oda.h:209
std::vector< unsigned int > m_uip_DA2sub_NodeMap
: DA to subDA map (nodal)
Definition: sub_oda.h:61
unsigned int m_uiLocalNodalSz
number of local nodes
Definition: sub_oda.h:71
MPI_Comm m_uiCommActive
: MPI_Comm for the active
Definition: sub_oda.h:144
unsigned int m_uiTotalNodalSz
total nodal size (zipped nodal size)
Definition: sub_oda.h:69
A class to manage octants.
Definition: TreeNode.h:35
unsigned int m_uiLocalElementSz
local elemental size
Definition: sub_oda.h:77
Refine
contains the refine flags. DA_NO_CHANGE : no change needed for the octant DA_REFINE : refine the octa...
Definition: oda.h:86
void readFromGhostEnd(T *vec, unsigned int dof=1)
Sync the ghost element exchange.
unsigned int getLevel(unsigned int ele) const
return the level of current octant
Definition: sub_oda.h:466
ot::TreeNode getOctant(unsigned int ele) const
return the TreeNode of the current octnat.
Definition: sub_oda.h:472
unsigned int m_uiNodePreGhostEnd
Definition: sub_oda.h:95
Definition: mesh.h:179
unsigned int getRankActive() const
: rank w.r.t active comm.
Definition: oda.h:299
unsigned int m_uiCommTag
: async comm tag
Definition: sub_oda.h:45
unsigned int m_uiNumPreGhostNodes
Definition: sub_oda.h:113
std::vector< unsigned int > m_uiRecvOffsets
: recv offsets
Definition: sub_oda.h:131
unsigned int end()
Returns if the current element has reached end or not.
unsigned int getTotalElemSz() const
returns the local elemental size (includes the ghost elements as well)
Definition: sub_oda.h:188
unsigned int m_uiElementPreGhostEnd
Definition: sub_oda.h:82
int getGlobalNodeIndices(DendroIntL *nodeIdx, unsigned int ele) const
Returns the global node indices of a given element,.
void getElementNodalValues(const T *in, T *eleVecOut, unsigned int eleID, unsigned int dof=1) const
computes the element nodal values using interpolation if needed.
int getFaceNeighborValues(unsigned int eleID, const T *in, T *out, T *coords, unsigned int *neighID, unsigned int face, NeighbourLevel &level) const
computes the face neighbor points for additional computations for a specified direction.
int createVector(T *&local, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const
Creates a ODA vector.
unsigned int getLocalElemSz() const
returns the local elemental size
Definition: sub_oda.h:185
bool m_uiIsActive
: active sub da
Definition: sub_oda.h:138
unsigned int m_uiElementLocalEnd
Definition: sub_oda.h:86
std::vector< unsigned int > m_uip_sub2DA_ElemMap
: subDA to DA map (elemental)
Definition: sub_oda.h:55
unsigned int m_uiPreGhostElementSize
: pre ghost element size
Definition: sub_oda.h:35
unsigned int m_uiPostGhostNodeSize
: post ghost node size
Definition: sub_oda.h:43
unsigned int getNpesActive() const
: number of processors active
Definition: sub_oda.h:221
unsigned int getPostGhostElementSize() const
: get the number of post-ghost element size
Definition: sub_oda.h:277
std::vector< unsigned char > m_ucpSkipList
:elemental skip list
Definition: sub_oda.h:29
bool isBoundaryOctant(unsigned int eleID) const
: returns true if specified eleID is a boundary element false if the eleID is local and not a boundar...
unsigned int m_uiNodePreGhostBegin
Definition: sub_oda.h:93
unsigned int m_uiNodePostGhostBegin
Definition: sub_oda.h:101
unsigned int m_uiNumPostGhostNodes
Definition: sub_oda.h:117
ot::DA * remesh(const DA_FLAGS::Refine *flags, unsigned int sz, unsigned int grainSz=100, double ld_bal=0.3, unsigned int sfK=2) const
: Performs remesh based on the DA_FLAGS::Refine, which specifies no change, refine or coarsen...
double m_dMinBB[3]
min bound box for fe_retain
Definition: sub_oda.h:64
unsigned int getElementOrder() const
get element order
Definition: sub_oda.h:197
void copyVectors(T *dest, const T *source, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const
copy vecotor to sorce to destination, assumes the same number of dof.
double m_dMaxBB[3]
max bound box for fe_retain
Definition: sub_oda.h:66
: Simple structure to keep the loop counters
Definition: oda.h:117
unsigned int getElementOrder() const
get element order
Definition: oda.h:260
ot::DA * m_da
: parent da
Definition: sub_oda.h:27
Definition: oda.h:125
void init()
initialize the loop counters.
subDA(DA *da, std::function< double(double, double, double) > fx_retain, double *gSize)
: defult sub da constructor.
Definition: sub_oda.cpp:11
unsigned int m_uiNumPreGhostElements
Definition: sub_oda.h:106
unsigned int getMaxDepth() const
: get the max depth of the octree
Definition: sub_oda.h:286
unsigned int m_uiLocalElementSize
: local element size
Definition: sub_oda.h:33
void eleVecToVecAccumilation(T *out, const T *eleVecIn, unsigned int eleID, unsigned int dof=1) const
computes the elemental vec to global vec accumilation
unsigned int getNumNodesPerElement() const
get number of nodes per element
Definition: sub_oda.h:194
subDA based on the DA, where to perform computations sub domain of the main domain.
Definition: sub_oda.h:22
std::vector< unsigned int > m_uiSendCounts
: send counts
Definition: sub_oda.h:125
unsigned int m_uiNumLocalNodes
Definition: sub_oda.h:115
unsigned int m_uiElementLocalBegin
Definition: sub_oda.h:84
void copyVector(T *dest, const T *source, bool isElemental=false, bool isGhosted=false) const
more premitive copy, from source pointer to the dest pointer
void getOctreeBoundaryNodeIndices(std::vector< unsigned int > &bdyIndex, std::vector< double > &coords, bool isGhosted=false)
Computes the octree writable boundary nodes.
std::vector< unsigned char > m_ucpSkipNodeList
:nodal skip list
Definition: sub_oda.h:31
void getElementalCoords(unsigned int eleID, double *coords) const
computes the elementCoordinates (based on the nodal placement)
The class that manages the octree mesh that support FEM computations. Note that this file is a refact...
unsigned int m_uiElementPostGhostBegin
Definition: sub_oda.h:88
std::vector< unsigned int > m_uiSendProcList
Definition: sub_oda.h:133
const RefElement * getReferenceElement() const
get a constant pointer for the reference element
Definition: oda.h:333
unsigned int getPreNodalSz() const
returns the pre ghost nodal size
Definition: sub_oda.h:176
unsigned int m_uiNumPostGhostElements
Definition: sub_oda.h:110
unsigned int getDimension() const
: get the dimensionality of the octree
Definition: sub_oda.h:288
const ot::Mesh * getMesh() const
: returns node local to node global map
Definition: sub_oda.h:206
unsigned int m_uiPostGhostElementSize
: post ghost element size
Definition: sub_oda.h:37
int m_uiRankActive
: rank active
Definition: sub_oda.h:147
std::vector< unsigned int > m_uip_sub2DA_NodeMap
: subDA to DA map (nodal)
Definition: sub_oda.h:59
unsigned int m_uiElementPreGhostBegin
Definition: sub_oda.h:80
LoopCounter m_uiLoopInfo
: Loop counter info
Definition: sub_oda.h:50
std::vector< unsigned int > m_uiSendScatterMap
: Send scatter map
Definition: sub_oda.h:120
unsigned int m_uiPreGhostNodeSize
: pre ghost node size
Definition: sub_oda.h:41
unsigned int getRankAll() const
: rank with respect to the global comm.
Definition: oda.h:296
bool isActive() const
see if the current DA is active
Definition: oda.h:254
unsigned int getPostNodalSz() const
returns the post nodal size
Definition: sub_oda.h:179
const RefElement * getReferenceElement() const
get a constant pointer for the reference element
Definition: sub_oda.h:267
unsigned int getGhostedElementSize() const
: get the number of pre and post ghost elements
Definition: sub_oda.h:283
int m_uiNpesActive
: npes active
Definition: sub_oda.h:153
void vecTopvtu(T *local, const char *fPrefix, char **nodalVarNames=NULL, bool isElemental=false, bool isGhosted=false, unsigned int dof=1)
write the vec to pvtu file
unsigned int m_uiNumLocalElements
Definition: sub_oda.h:108
unsigned int getNpesActive() const
: number of processors active
Definition: oda.h:287
void intergridTransfer(const T *varIn, T *&varOut, const ot::DA *newDA, bool isElemental=false, bool isGhosted=false, unsigned int dof=1)
performs grid transfer operations after the remesh.
void next()
: increment it to the next element.
MPI_Comm m_uiCommGlobal
: MPI comm global
Definition: sub_oda.h:141
unsigned int getNpesAll() const
: global mpi com. size
Definition: oda.h:284
void setVectorByFunction(T *local, std::function< void(T, T, T, T *)>func, bool isElemental=false, bool isGhosted=false, unsigned int dof=1) const
initialize a variable vector to a function depends on spatial coords.
ot::TreeNode getOctant(unsigned int ele) const
return the TreeNode of the current octnat.
Definition: oda.h:584
unsigned int getPreGhostElementSize() const
: get the number of pre-ghost element size
Definition: sub_oda.h:274
void nodalVecToGhostedNodal(const T *in, T *&out, bool isAllocated=false, unsigned int dof=1) const
convert nodal local vector with ghosted buffer regions.
MPI_Comm getGlobalComm() const
: returns the global MPI communicator
Definition: oda.h:263
unsigned int getRankAll() const
: rank with respect to the global comm.
Definition: sub_oda.h:230
unsigned int m_uiNodePostGhostEnd
Definition: sub_oda.h:103
bool isActive() const
see if the current DA is active
Definition: sub_oda.h:191
const ot::Mesh * getMesh() const
returns the mesh
Definition: oda.h:269
int m_uiNpesGlobal
: npes global
Definition: sub_oda.h:156
Definition: refel.h:69
MPI_Comm getGlobalComm() const
: returns the global MPI communicator
Definition: sub_oda.h:200
std::vector< unsigned int > m_uiRecvCounts
: recv counts
Definition: sub_oda.h:127
void readFromGhostBegin(T *vec, unsigned int dof=1)
Initiate the ghost nodal value exchange.
unsigned int m_uiElementPostGhostEnd
Definition: sub_oda.h:90
T * getVecPointerToDof(T *in, unsigned int dofInex, bool isElemental=false, bool isGhosted=false) const
returns a pointer to a dof index,