20#ifndef DUMUX_FVMPFAL3DINTERACTIONVOLUME_ADAPTIVE_HH
21#define DUMUX_FVMPFAL3DINTERACTIONVOLUME_ADAPTIVE_HH
37class IndexTranslatorAdaptive:
public IndexTranslator
42 subVolumeTotalNum = 8,
43 fluxFacesTotalNum = 12,
44 fluxFacesNumOnSubVolume = 3,
45 fluxEdgesTotalNum = 6,
46 edgesNumOnFluxFace = 2
49 static int getOldElemIdxFromNewFaceIdxto0(
int zeroFaceIdx,
int elementIdx)
51 return oldElemIdxFromNewFaceIdxto0_[zeroFaceIdx][elementIdx];
54 static int getNewElemIdxFromOldFaceIdxto0(
int zeroFaceIdx,
int elementIdx)
56 return newElemIdxFromOldFaceIdxto0_[zeroFaceIdx][elementIdx];
59 static int getOldFaceIdxFromNewIdxto0(
int zeroFaceIdx,
int fIdx)
61 return oldFaceIdxFromNewIdxto0_[zeroFaceIdx][fIdx];
64 static int getNewFaceIdxFromOldIdxto0(
int zeroFaceIdx,
int fIdx)
66 return newFaceIdxFromOldIdxto0_[zeroFaceIdx][fIdx];
69 static int getOldEdgeIdxFromNewFaceIdxto0(
int zeroFaceIdx,
int edgeIdx)
71 return oldEdgeIdxFromNewFaceIdxto0_[zeroFaceIdx][edgeIdx];
74 static int getNewEdgeIdxFromOldFaceIdxto0(
int zeroFaceIdx,
int edgeIdx)
76 return newEdgeIdxFromOldFaceIdxto0_[zeroFaceIdx][edgeIdx];
81 static const int oldElemIdxFromNewFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum];
82 static const int newElemIdxFromOldFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum];
83 static const int oldFaceIdxFromNewIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum];
84 static const int newFaceIdxFromOldIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum];
85 static const int oldEdgeIdxFromNewFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum];
86 static const int newEdgeIdxFromOldFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum];
89const int IndexTranslatorAdaptive::oldElemIdxFromNewFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum] =
91 {0, 1, 2, 3, 4, 5, 6, 7},
92 {1, 3, 0, 2, 5, 7, 4, 6},
93 {3, 2, 1, 0, 7, 6, 5, 4},
94 {2, 0, 3, 1, 6, 4, 7, 5},
95 {5, 4, 7, 6, 1, 0, 3, 2},
96 {7, 5, 6, 4, 3, 1, 2, 0},
97 {6, 7, 4, 5, 2, 3, 0, 1},
98 {4, 6, 5, 7, 0, 2, 1, 3},
99 {0, 4, 1, 5, 2, 6, 3, 7},
100 {1, 5, 3, 7, 0, 4, 2, 6},
101 {3, 7, 2, 6, 1, 5, 0, 4},
102 {2, 6, 0, 4, 3, 7, 1, 5}
105const int IndexTranslatorAdaptive::newElemIdxFromOldFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum] =
107 {0, 1, 2, 3, 4, 5, 6, 7},
108 {2, 0, 3, 1, 6, 4, 7, 5},
109 {3, 2, 1, 0, 7, 6, 5, 4},
110 {1, 3, 0, 2, 5, 7, 4, 6},
111 {5, 4, 7, 6, 1, 0, 3, 2},
112 {7, 5, 6, 4, 3, 1, 2, 0},
113 {6, 7, 4, 5, 2, 3, 0, 1},
114 {4, 6, 5, 7, 0, 2, 1, 3},
115 {0, 2, 4, 6, 1, 3, 5, 7},
116 {4, 0, 6, 2, 5, 1, 7, 3},
117 {6, 4, 2, 0, 7, 5, 3, 1},
118 {2, 6, 0, 4, 3, 7, 1, 5}
121const int IndexTranslatorAdaptive::oldFaceIdxFromNewIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum] =
123 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
124 {1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8},
125 {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9},
126 {3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10},
127 {4, 7, 6, 5, 0, 3, 2, 1, 9, 8, 11, 10},
128 {5, 4, 7, 6, 1, 0, 3, 2, 10, 9, 8, 11},
129 {6, 5, 4, 7, 2, 1, 0, 3, 11, 10, 9, 8},
130 {7, 6, 5, 4, 3, 2, 1, 0, 8, 11, 10, 9},
131 {8, 4, 9, 0, 11, 6, 10, 2, 3, 7, 5, 1},
132 {9, 5, 10, 1, 8, 7, 11, 3, 0, 4, 6, 2},
133 {10, 6, 11, 2, 9, 4, 8, 0, 1, 5, 7, 3},
134 {11, 7, 8, 3, 10, 5, 9, 1, 2, 6, 4, 0}
137const int IndexTranslatorAdaptive::newFaceIdxFromOldIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum] =
139 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
140 {3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10},
141 {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9},
142 {1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8},
143 {4, 7, 6, 5, 0, 3, 2, 1, 9, 8, 11, 10},
144 {5, 4, 7, 6, 1, 0, 3, 2, 10, 9, 8, 11},
145 {6, 5, 4, 7, 2, 1, 0, 3, 11, 10, 9, 8},
146 {7, 6, 5, 4, 3, 2, 1, 0, 8, 11, 10, 9},
147 {3, 11, 7, 8, 1, 10, 5, 9, 0, 2, 6, 4},
148 {8, 3, 11, 7, 9, 1, 10, 5, 4, 0, 2, 6},
149 {7, 8, 3, 11, 5, 9, 1, 10, 6, 4, 0, 2},
150 {11, 7, 8, 3, 10, 5, 9, 1, 2, 6, 4, 0}
153const int IndexTranslatorAdaptive::oldEdgeIdxFromNewFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum] =
169const int IndexTranslatorAdaptive::newEdgeIdxFromOldFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum] =
192template<
class TypeTag>
204 dim = GridView::dimension,
205 dimWorld = GridView::dimensionworld,
208 using Element =
typename GridView::template Codim<0>::Entity;
209 using ElementSeed =
typename Grid::template Codim<0>::EntitySeed;
213 using PrimaryVariables =
typename SolutionTypes::PrimaryVariables;
215 using DimVector = Dune::FieldVector<Scalar, dim>;
216 using FieldVectorVector = Dune::FieldVector<DimVector, dim>;
217 using FieldVectorVector2 = Dune::FieldVector<DimVector, 2>;
218 using FieldVectorVectorVector = Dune::FieldVector<FieldVectorVector2, dim>;
219 using IndexVector = Dune::FieldVector<int, dim>;
220 using BCTypeVector = std::vector<BoundaryTypes>;
221 using BCVector = std::vector<PrimaryVariables>;
265 existingLevel_.clear();
272 existingLevel_.insert(element.level());
281 hangingNodeType_ = hNType;
291 return existingLevel_.size() < 2;
294 return existingLevel_.size() < 3;
306 return existingLevel_.find(level) != existingLevel_.end();
321 return hangingNodeType_;
330 std::cout<<
"hanging node type: "<<hangingNodeType_<<
"\n";
342 int hangingNodeType_;
343 std::set<int> existingLevel_;
Class including the information of an interaction volume of a MPFA 3D method that does not change wit...
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type GetProp
get the type of a property
Definition: propertysystem.hh:141
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Class including the information of a 3d interaction volume of a MPFA L-method that does not change wi...
Definition: linteractionvolume3d.hh:115
void setSubVolumeElement(const Element &element, int subVolumeIdx)
Store a dune element as a sub volume element.
Definition: linteractionvolume3d.hh:208
void printInteractionVolumeInfo()
Print the stored interaction volume data.
Definition: linteractionvolume3d.hh:575
@ fluxFacesTotalNum
Number of flux faces in the interaction volume.
Definition: linteractionvolume3d.hh:156
@ subVolumeTotalNum
Number of sub-volumes in the interaction volume.
Definition: linteractionvolume3d.hh:155
@ fluxEdgesTotalNum
Number of edges in the interaction volume.
Definition: linteractionvolume3d.hh:157
FaceTypes
Definition: linteractionvolume3d.hh:147
@ outside
Flux face is outside the model domain.
Definition: linteractionvolume3d.hh:150
@ inside
Flux face is inside the model domain.
Definition: linteractionvolume3d.hh:148
@ boundary
Flux face is a boundary face.
Definition: linteractionvolume3d.hh:149
Class including the information of a 3d interaction volume of an adaptive MPFA L-method that does not...
Definition: linteractionvolume3dadaptive.hh:194
void setHangingNodeType(int hNType)
Store the type of hanging-node-interaction volume.
Definition: linteractionvolume3dadaptive.hh:279
int getHangingNodeType()
The type of the interaction volume as type of FvMpfaL3dInteractionVolumeAdaptive<TypeTag>::HangingNod...
Definition: linteractionvolume3dadaptive.hh:319
bool hasLevel(int level)
Check if an element of a certain grid level is stored.
Definition: linteractionvolume3dadaptive.hh:304
FvMpfaL3dInteractionVolumeAdaptive(const Grid &grid)
Constructs a FvMpfaL3dInteractionVolumeAdaptive object.
Definition: linteractionvolume3dadaptive.hh:256
void setSubVolumeElement(const Element &element, int subVolumeIdx)
Store a dune element as a sub volume element.
Definition: linteractionvolume3dadaptive.hh:269
bool isHangingNodeVolume()
Check whether the interaction volume is a hanging-node volume.
Definition: linteractionvolume3dadaptive.hh:313
bool sameLevel()
Check if elements in the interaction volume are of the same grid level.
Definition: linteractionvolume3dadaptive.hh:288
HangingNodeTypes
The different hanging node interaction volume types (see dissertation M. Wolff, http://elib....
Definition: linteractionvolume3dadaptive.hh:244
@ fourSmallCellsDiag
hanging-node interaction volume of type 4
Definition: linteractionvolume3dadaptive.hh:249
@ fourSmallCellsFace
hanging-node interaction volume of type 1
Definition: linteractionvolume3dadaptive.hh:247
@ fourSmallCellsEdge
hanging-node interaction volume of type 3
Definition: linteractionvolume3dadaptive.hh:248
@ twoSmallCells
hanging-node interaction volume of type 5 or 7
Definition: linteractionvolume3dadaptive.hh:246
@ sixSmallCells
hanging-node interaction volume of type 2 or 6
Definition: linteractionvolume3dadaptive.hh:250
@ noHangingNode
regular interaction volume
Definition: linteractionvolume3dadaptive.hh:245
void printInteractionVolumeInfo()
Print the stored interaction volume data.
Definition: linteractionvolume3dadaptive.hh:325
void reset()
Reset the interaction volume (deletes stored data)
Definition: linteractionvolume3dadaptive.hh:262