Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef APFCAVITYOP_H
00009 #define APFCAVITYOP_H
00010
00014 #include "apfMesh.h"
00015 #include <vector>
00016 #include <cstring>
00017
00018 namespace apf {
00019
00069 class CavityOp
00070 {
00071 public:
00075 CavityOp(Mesh* m, bool canModify = false);
00077 enum Outcome {
00079 SKIP,
00081 OK,
00083 REQUEST };
00085 virtual Outcome setEntity(MeshEntity* e) = 0;
00087 virtual void apply() = 0;
00089 void applyToDimension(int d);
00091 bool requestLocality(MeshEntity** entities, int count);
00093 void preDeletion(MeshEntity* e);
00095 Mesh* mesh;
00096 private:
00097 typedef std::vector<MeshEntity*> Requests;
00098 Requests requests;
00099 bool isRequesting;
00100 struct PullRequest { MeshEntity* e; int to; };
00101 bool sendPullRequests(std::vector<PullRequest>& received);
00102 bool tryToPull();
00103 void applyLocallyWithModification(int d);
00104 void applyLocallyWithoutModification(int d);
00105 bool canModify;
00106 bool movedByDeletion;
00107 MeshIterator* iterator;
00108 protected:
00109 Sharing* sharing;
00110 };
00111
00112 }
00113
00114 #endif