SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apfCavityOp.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Scientific Computation Research Center
3  *
4  * This work is open source software, licensed under the terms of the
5  * BSD license as described in the LICENSE file in the top-level directory.
6  */
7 
8 #ifndef APFCAVITYOP_H
9 #define APFCAVITYOP_H
10 
14 #include "apfMesh.h"
15 #include <vector>
16 #include <cstring>
17 
18 namespace apf {
19 
69 class CavityOp
70 {
71  public:
75  CavityOp(Mesh* m, bool canModify = false);
77  enum Outcome {
81  OK,
85  virtual Outcome setEntity(MeshEntity* e) = 0;
87  virtual void apply() = 0;
89  void applyToDimension(int d);
91  bool requestLocality(MeshEntity** entities, int count);
93  void preDeletion(MeshEntity* e);
96  private:
97  typedef std::vector<MeshEntity*> Requests;
98  Requests requests;
99  bool isRequesting;
100  struct PullRequest { MeshEntity* e; int to; };
101  bool sendPullRequests(std::vector<PullRequest>& received);
102  bool tryToPull();
103  void applyLocallyWithModification(int d);
104  void applyLocallyWithoutModification(int d);
105  bool canModify;
106  bool movedByDeletion;
107  MeshIterator* iterator;
108  protected:
109  Sharing* sharing;
110 };
111 
112 } //namespace apf
113 
114 #endif
virtual Outcome setEntity(MeshEntity *e)=0
evaluate whether what to do with this entity
user-defined mesh cavity operator
Definition: apfCavityOp.h:69
request more elements around the entity
Definition: apfCavityOp.h:83
CavityOp(Mesh *m, bool canModify=false)
constructor
apply to the given entity
Definition: apfCavityOp.h:81
virtual void apply()=0
apply the operator on the (now local) cavity
bool requestLocality(MeshEntity **entities, int count)
within setEntity, require that entities be made local
Interface to a mesh part.
Definition: apfMesh.h:103
Mesh * mesh
mesh pointer for convenience
Definition: apfCavityOp.h:95
skip the given entity
Definition: apfCavityOp.h:79
abstract description of entity copy sharing
Definition: apfMesh.h:483
void applyToDimension(int d)
parallel collective operation over entities of one dimension
Outcome
outcome of a setEntity call
Definition: apfCavityOp.h:77
The APF Mesh interface.
void preDeletion(MeshEntity *e)
call before deleting a mesh entity during the operation