20#ifndef DUMUX_FVMPFAL3DINTERACTIONVOLUME_ADAPTIVE_HH
21#define DUMUX_FVMPFAL3DINTERACTIONVOLUME_ADAPTIVE_HH
35class IndexTranslatorAdaptive:
public IndexTranslator
40 subVolumeTotalNum = 8,
41 fluxFacesTotalNum = 12,
42 fluxFacesNumOnSubVolume = 3,
43 fluxEdgesTotalNum = 6,
44 edgesNumOnFluxFace = 2
47 static int getOldElemIdxFromNewFaceIdxto0(
int zeroFaceIdx,
int elementIdx)
49 return oldElemIdxFromNewFaceIdxto0_[zeroFaceIdx][elementIdx];
52 static int getNewElemIdxFromOldFaceIdxto0(
int zeroFaceIdx,
int elementIdx)
54 return newElemIdxFromOldFaceIdxto0_[zeroFaceIdx][elementIdx];
57 static int getOldFaceIdxFromNewIdxto0(
int zeroFaceIdx,
int fIdx)
59 return oldFaceIdxFromNewIdxto0_[zeroFaceIdx][fIdx];
62 static int getNewFaceIdxFromOldIdxto0(
int zeroFaceIdx,
int fIdx)
64 return newFaceIdxFromOldIdxto0_[zeroFaceIdx][fIdx];
67 static int getOldEdgeIdxFromNewFaceIdxto0(
int zeroFaceIdx,
int edgeIdx)
69 return oldEdgeIdxFromNewFaceIdxto0_[zeroFaceIdx][edgeIdx];
72 static int getNewEdgeIdxFromOldFaceIdxto0(
int zeroFaceIdx,
int edgeIdx)
74 return newEdgeIdxFromOldFaceIdxto0_[zeroFaceIdx][edgeIdx];
79 static const int oldElemIdxFromNewFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum];
80 static const int newElemIdxFromOldFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum];
81 static const int oldFaceIdxFromNewIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum];
82 static const int newFaceIdxFromOldIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum];
83 static const int oldEdgeIdxFromNewFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum];
84 static const int newEdgeIdxFromOldFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum];
87const int IndexTranslatorAdaptive::oldElemIdxFromNewFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum] =
89 {0, 1, 2, 3, 4, 5, 6, 7},
90 {1, 3, 0, 2, 5, 7, 4, 6},
91 {3, 2, 1, 0, 7, 6, 5, 4},
92 {2, 0, 3, 1, 6, 4, 7, 5},
93 {5, 4, 7, 6, 1, 0, 3, 2},
94 {7, 5, 6, 4, 3, 1, 2, 0},
95 {6, 7, 4, 5, 2, 3, 0, 1},
96 {4, 6, 5, 7, 0, 2, 1, 3},
97 {0, 4, 1, 5, 2, 6, 3, 7},
98 {1, 5, 3, 7, 0, 4, 2, 6},
99 {3, 7, 2, 6, 1, 5, 0, 4},
100 {2, 6, 0, 4, 3, 7, 1, 5}
103const int IndexTranslatorAdaptive::newElemIdxFromOldFaceIdxto0_[fluxFacesTotalNum][subVolumeTotalNum] =
105 {0, 1, 2, 3, 4, 5, 6, 7},
106 {2, 0, 3, 1, 6, 4, 7, 5},
107 {3, 2, 1, 0, 7, 6, 5, 4},
108 {1, 3, 0, 2, 5, 7, 4, 6},
109 {5, 4, 7, 6, 1, 0, 3, 2},
110 {7, 5, 6, 4, 3, 1, 2, 0},
111 {6, 7, 4, 5, 2, 3, 0, 1},
112 {4, 6, 5, 7, 0, 2, 1, 3},
113 {0, 2, 4, 6, 1, 3, 5, 7},
114 {4, 0, 6, 2, 5, 1, 7, 3},
115 {6, 4, 2, 0, 7, 5, 3, 1},
116 {2, 6, 0, 4, 3, 7, 1, 5}
119const int IndexTranslatorAdaptive::oldFaceIdxFromNewIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum] =
121 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
122 {1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8},
123 {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9},
124 {3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10},
125 {4, 7, 6, 5, 0, 3, 2, 1, 9, 8, 11, 10},
126 {5, 4, 7, 6, 1, 0, 3, 2, 10, 9, 8, 11},
127 {6, 5, 4, 7, 2, 1, 0, 3, 11, 10, 9, 8},
128 {7, 6, 5, 4, 3, 2, 1, 0, 8, 11, 10, 9},
129 {8, 4, 9, 0, 11, 6, 10, 2, 3, 7, 5, 1},
130 {9, 5, 10, 1, 8, 7, 11, 3, 0, 4, 6, 2},
131 {10, 6, 11, 2, 9, 4, 8, 0, 1, 5, 7, 3},
132 {11, 7, 8, 3, 10, 5, 9, 1, 2, 6, 4, 0}
135const int IndexTranslatorAdaptive::newFaceIdxFromOldIdxto0_[fluxFacesTotalNum][fluxFacesTotalNum] =
137 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
138 {3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10},
139 {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9},
140 {1, 2, 3, 0, 5, 6, 7, 4, 9, 10, 11, 8},
141 {4, 7, 6, 5, 0, 3, 2, 1, 9, 8, 11, 10},
142 {5, 4, 7, 6, 1, 0, 3, 2, 10, 9, 8, 11},
143 {6, 5, 4, 7, 2, 1, 0, 3, 11, 10, 9, 8},
144 {7, 6, 5, 4, 3, 2, 1, 0, 8, 11, 10, 9},
145 {3, 11, 7, 8, 1, 10, 5, 9, 0, 2, 6, 4},
146 {8, 3, 11, 7, 9, 1, 10, 5, 4, 0, 2, 6},
147 {7, 8, 3, 11, 5, 9, 1, 10, 6, 4, 0, 2},
148 {11, 7, 8, 3, 10, 5, 9, 1, 2, 6, 4, 0}
151const int IndexTranslatorAdaptive::oldEdgeIdxFromNewFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum] =
167const int IndexTranslatorAdaptive::newEdgeIdxFromOldFaceIdxto0_[fluxFacesTotalNum][fluxEdgesTotalNum] =
190template<
class TypeTag>
202 dim = GridView::dimension,
203 dimWorld = GridView::dimensionworld,
206 using Element =
typename GridView::template Codim<0>::Entity;
207 using ElementSeed =
typename Grid::template Codim<0>::EntitySeed;
211 using PrimaryVariables =
typename SolutionTypes::PrimaryVariables;
213 using DimVector = Dune::FieldVector<Scalar, dim>;
214 using FieldVectorVector = Dune::FieldVector<DimVector, dim>;
215 using FieldVectorVector2 = Dune::FieldVector<DimVector, 2>;
216 using FieldVectorVectorVector = Dune::FieldVector<FieldVectorVector2, dim>;
217 using IndexVector = Dune::FieldVector<int, dim>;
218 using BCTypeVector = std::vector<BoundaryTypes>;
219 using BCVector = std::vector<PrimaryVariables>;
263 existingLevel_.clear();
270 existingLevel_.insert(element.level());
279 hangingNodeType_ = hNType;
289 return existingLevel_.size() < 2;
292 return existingLevel_.size() < 3;
304 return existingLevel_.find(level) != existingLevel_.end();
319 return hangingNodeType_;
328 std::cout<<
"hanging node type: "<<hangingNodeType_<<
"\n";
340 int hangingNodeType_;
341 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 (equivalent to old macro GET_PROP(...))
Definition: propertysystem.hh:140
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
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
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
@ 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
Class including the information of a 3d interaction volume of an adaptive MPFA L-method that does not...
Definition: linteractionvolume3dadaptive.hh:192
void setHangingNodeType(int hNType)
Store the type of hanging-node-interaction volume.
Definition: linteractionvolume3dadaptive.hh:277
int getHangingNodeType()
The type of the interaction volume as type of FvMpfaL3dInteractionVolumeAdaptive<TypeTag>::HangingNod...
Definition: linteractionvolume3dadaptive.hh:317
bool hasLevel(int level)
Check if an element of a certain grid level is stored.
Definition: linteractionvolume3dadaptive.hh:302
FvMpfaL3dInteractionVolumeAdaptive(const Grid &grid)
Constructs a FvMpfaL3dInteractionVolumeAdaptive object.
Definition: linteractionvolume3dadaptive.hh:254
void setSubVolumeElement(const Element &element, int subVolumeIdx)
Store a dune element as a sub volume element.
Definition: linteractionvolume3dadaptive.hh:267
bool isHangingNodeVolume()
Check whether the interaction volume is a hanging-node volume.
Definition: linteractionvolume3dadaptive.hh:311
bool sameLevel()
Check if elements in the interaction volume are of the same grid level.
Definition: linteractionvolume3dadaptive.hh:286
HangingNodeTypes
The different hanging node interaction volume types (see dissertation M. Wolff, http://elib....
Definition: linteractionvolume3dadaptive.hh:242
@ fourSmallCellsDiag
hanging-node interaction volume of type 4
Definition: linteractionvolume3dadaptive.hh:247
@ fourSmallCellsFace
hanging-node interaction volume of type 1
Definition: linteractionvolume3dadaptive.hh:245
@ fourSmallCellsEdge
hanging-node interaction volume of type 3
Definition: linteractionvolume3dadaptive.hh:246
@ twoSmallCells
hanging-node interaction volume of type 5 or 7
Definition: linteractionvolume3dadaptive.hh:244
@ sixSmallCells
hanging-node interaction volume of type 2 or 6
Definition: linteractionvolume3dadaptive.hh:248
@ noHangingNode
regular interaction volume
Definition: linteractionvolume3dadaptive.hh:243
void printInteractionVolumeInfo()
Print the stored interaction volume data.
Definition: linteractionvolume3dadaptive.hh:323
void reset()
Reset the interaction volume (deletes stored data)
Definition: linteractionvolume3dadaptive.hh:260