5 out << marker.toString();
14 _cellCentre(event.getX()),
16 _cellIsLocal(event.getIsCellLocal()),
18 _isLocal( event.getIsFaceLocal() ),
19 _isAdjacentToParallelBoundary(event.getIsFaceAdjacentToParallelDomainBoundary()),
20 _relativePositionOfCellWithinFatherCell(event.getRelativePositionToFather()) {
21 for (
int faceNumber=0; faceNumber<2*Dimensions; faceNumber++) {
25 const int normal = faceNumber % Dimensions;
27 std::bitset<Dimensions> studiedVertex = i;
28 studiedVertex.set(
normal,faceNumber>=Dimensions);
38 int normal = i % Dimensions;
39 result(normal) += i >= Dimensions ? _h(normal)/2.0 : -_h(normal)/2.0;
51 int index = i % Dimensions;
52 result(index) += i<Dimensions ? -_h(index) : _h(index);
58 return normal(_select);
64 int index = i % Dimensions;
65 bool negativeSign = i<Dimensions;
66 if ( not _cellIsLocal ) negativeSign = not negativeSign;
67 result(index) += negativeSign ? - _h(index) : _h(index);
73 return outerNormal(_select);
78 std::ostringstream msg;
79 msg <<
"(cell-centre=" << _cellCentre
81 <<
",select=" << _select
82 <<
",is-cell-local=" << _cellIsLocal
83 <<
",is-face-local=" << isLocal()
84 <<
",has-face-been-refined=" << hasBeenRefined()
85 <<
",will-face-be-refined=" << willBeRefined()
86 <<
",rel-pos=" << _relativePositionOfCellWithinFatherCell
109 return _hasBeenRefined[i];
114 return hasBeenRefined(_select);
119 return _willBeRefined[i];
124 return willBeRefined(_select);
134 return isLocal(_select);
138 return isAdjacentToParallelBoundary(_select);
142 return _isAdjacentToParallelBoundary[i];
148 return getRelativePositionWithinFatherCell(_select);
155 const int normal = i % Dimensions;
156 result(normal) += i>=Dimensions ? 1 : 0;
163 const int normal = getSelectedFaceNumber()%Dimensions;
165 for(
int d=0; d<Dimensions; d++){
167 result[pos] = _relativePositionOfCellWithinFatherCell[d];
176 int normal = getSelectedFaceNumber() % Dimensions;
178 getRelativePositionWithinFatherCell()(normal)==1
180 getRelativePositionWithinFatherCell()(normal)==2;
#define assertion2(expr, param0, param1)
#define assertion1(expr, param)
std::ostream & operator<<(std::ostream &out, const peano4::datamanagement::FaceMarker &marker)
std::string toString(Filter filter)
Provide information about selected face.
std::bitset< 2 *Dimensions > _willBeRefined
std::string toString() const
bool willBeRefined() const
tarch::la::Vector< Dimensions, double > outerNormal() const
FaceMarker(const peano4::grid::GridTraversalEvent &event, int select=0)
The derivation of _isLocal and _isRefined is very similar to peano4::grid::Spacetree::getFaceType().
bool hasBeenRefined() const
Has a face been refined.
int getSelectedFaceNumber() const
Return the number of the face.
tarch::la::Vector< Dimensions, double > x() const
A marker is always tied to one particular face.
tarch::la::Vector< Dimensions, double > normal() const
FaceMarker & select(int face)
Selects a face within a cell, i.e.
tarch::la::Vector< Dimensions-1, int > getRelativePositionWithinFatherFace() const
Return relative position of a subface within its father face.
std::bitset< 2 *Dimensions > _hasBeenRefined
bool isInteriorFaceWithinPatch() const
The term patch here refers to a 3x3 or 3x3x3 refinement.
tarch::la::Vector< Dimensions, int > getRelativePositionWithinFatherCell() const
Return relative position within father cell.
bool isAdjacentToParallelBoundary() const
tarch::la::Vector< Dimensions, double > h() const
Size of the underlying cell.
std::bitset< TwoPowerD > getHasBeenRefined() const
std::bitset< TwoPowerD > getWillBeRefined() const