Test for the grid finite volume element geometry for non-conforming grids. A square grid with 9 elements is created of which the central element is refined. Subsequently, all directions & connectivity of the scvfs are checked for correctness. More...
#include <config.h>
#include <cmath>
#include <iostream>
#include <utility>
#include <dune/common/float_cmp.hh>
#include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/alugrid/grid.hh>
#include <dumux/adaptive/markelements.hh>
#include <dumux/discretization/cellcentered/tpfa/fvgridgeometry.hh>
Test for the grid finite volume element geometry for non-conforming grids. A square grid with 9 elements is created of which the central element is refined. Subsequently, all directions & connectivity of the scvfs are checked for correctness.
Namespaces | |
namespace | Dumux |
make the local view function available whenever we use the grid geometry | |
namespace | Dumux::Test |
Functions | |
bool | Dumux::Test::isInCentralElement (const Dune::FieldVector< double, 2 > &pos) |
returns true if a given position is inside the central element (before refinement) More... | |
bool | Dumux::Test::isCornerElement (const Dune::FieldVector< double, 2 > ¢er) |
returns if the element with given center position is corner element More... | |
bool | Dumux::Test::isMiddleLeftElement (const Dune::FieldVector< double, 2 > ¢er) |
returns if the element is middle left element More... | |
bool | Dumux::Test::isMiddleRightElement (const Dune::FieldVector< double, 2 > ¢er) |
returns if the element is middle right element More... | |
bool | Dumux::Test::isMiddleUpperElement (const Dune::FieldVector< double, 2 > ¢er) |
returns if the element is middle upper element More... | |
bool | Dumux::Test::isMiddleLowerElement (const Dune::FieldVector< double, 2 > ¢er) |
returns if the element is middle lower element More... | |
std::string | Dumux::Test::elementTypeName (const Dune::FieldVector< double, 2 > ¢er) |
returns for a given element center the element type name used in this test More... | |
int | main (int argc, char *argv[]) |
Variables | |
constexpr double | Dumux::Test::eps = 1e-6 |
epsilon for checking direction of scvf normals More... | |
int main | ( | int | argc, |
char * | argv[] | ||
) |
make a grid
refine the central element once
if the leaf now does not have 12 elements, something went wrong
instantiate and update gridGeometry
We should have constructed 12 scvfs
We should have constructed 52 scvfs
iterate over elements and check for each element the number of scvfs
For the tpfa scheme there is always one scv per element
make sure the scv has the same center as the element
check if the right number of scvfs point in the right direction
Also, scheck how many neighbors on the two levels the element has and store the neighboring centers for output
the normal vector should point either in x- or y-direction with length 1
Outer normal must be pointing outwards
the face should never have more the one neighbor
center must always be between the corners
count up faces depending on direction of n
keep track of total number of scvfs
check levels of neighbors
check if ipGlobal & area make sense
store outside center for output
make sure the number of found scvfs makes sense
print found combination in element to terminal
in elements within the original central element or corner elements we should have only 4 scvfs (1 in each direction)
In the corners we should find two level 0 neighbor elements
In the center elements we should find two level 0 and 2 level 1 neighbor elements
In the element on the left to the center we should have 2 scvfs in positive x-direction
to the left of the center
we should find two level 0 and 2 level 1 neighbor elements
In the element on the right to the center we should have 2 scvfs in negative x-direction
to the right of the center
we should find two level 0 and 2 level 1 neighbor elements
In the element above the center we should have 2 scvfs in negative y-direction
above the center
we should find two level 0 and 2 level 1 neighbor elements
In the element below the center we should have 2 scvfs in positive y-direction
below the center
we should find two level 0 and 2 level 1 neighbor elements