KASKADE 7 development version
|
Grid creation or input. More...
Modules | |
Platonian solids | |
Namespaces | |
namespace | Kaskade::AmiraMeshReader |
Reader for Amira meshes. | |
Classes | |
class | Kaskade::AnsysMeshReader |
Reader for Ansys *.inp grid files. More... | |
class | Kaskade::VTKReader |
A class to create a grid and load coefficients from a VTK file. More... | |
Functions | |
std::unique_ptr< Dune::UGGrid< 2 > > | readPolyData (std::string const &name, std::vector< int > *boundaryMarker=nullptr) |
Construct an unstructured UG grid from .node and .ele files (Triangle output). More... | |
template<class Grid , class Type > | |
std::unique_ptr< Grid > | Kaskade::createGrid (std::vector< Type > const &cubes) |
Extract simplicial grid from list of cubes. More... | |
template<class Grid , class Scalar , int dim, class EdgeLength > | |
std::unique_ptr< Grid > | Kaskade::createCuboid (Dune::FieldVector< Scalar, dim > const &x0, Dune::FieldVector< Scalar, dim > const &dx, EdgeLength const &dh, bool symmetric=true) |
Creates a uniform simplicial grid on a rectangular or cuboid domain. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | Kaskade::createUnitSquare (double dh=1., bool symmetric=true) |
Creates a unit square, filled regularly. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | Kaskade::createUnitCube (double dh=1., bool symmetric=true) |
Creates a unit cube. More... | |
template<class Grid , class Scalar > | |
std::unique_ptr< Grid > | Kaskade::createRectangle (Dune::FieldVector< Scalar, 2 > const &x0, Dune::FieldVector< Scalar, 2 > const &dx, Scalar dh, bool symmetric=true) |
Fill rectangle with squares. More... | |
template<class Grid , class Scalar , int dim> | |
std::unique_ptr< Grid > | Kaskade::createLShape (Dune::FieldVector< Scalar, dim > const &x0, Scalar dx, Scalar dy, Dune::FieldVector< Scalar, dim > const &thickness, Scalar dh, bool symmetric=true) |
Fill L-shaped domain with cubes. More... | |
template<class Grid , class Scalar , int dim> | |
std::unique_ptr< Grid > | Kaskade::createTShape (Dune::FieldVector< Scalar, dim > const &x0, Scalar dx, Scalar dy, Dune::FieldVector< Scalar, dim > const &thickness, Scalar dh, bool symmetric=true) |
Fill L-shaped domain with cubes. More... | |
template<class Grid , class Scalar , int dim> | |
std::unique_ptr< Grid > | Kaskade::createTwoLayerCuboid (Dune::FieldVector< Scalar, dim > const &x0, Dune::FieldVector< Scalar, dim > const &dx1, Dune::FieldVector< Scalar, dim > const &dx2, Dune::FieldVector< Scalar, dim > const &dh1, Scalar dh2, bool symmetric=true) |
template<class Grid , class Scalar , int dim> | |
std::unique_ptr< Grid > | Kaskade::createTwoLayerCuboid (Dune::FieldVector< Scalar, dim > const &x0, Dune::FieldVector< Scalar, dim > const &dx1, Dune::FieldVector< Scalar, dim > const &dx2, Dune::FieldVector< Scalar, dim > const &dh1, Dune::FieldVector< Scalar, dim > const &dh2, bool symmetric=true) |
template<class Grid > | |
std::unique_ptr< Grid > | Kaskade::createCylinder (double radius, double height, int layers, int circumEdges=6) |
Creates a cylinder. More... | |
template<class Grid , class Deformation > | |
std::unique_ptr< Grid > | Kaskade::createCylinder (double radius, double height, int layers, int circumEdges, Deformation const &deformation) |
Creates a deformed cylinder. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | Kaskade::createPentagon (double radius=1) |
Creates an regular pentagon consisting of five triangles, centered at the origin and with radius r. More... | |
template<class Grid > | |
std::unique_ptr< Grid > | Kaskade::createUshape (double l, double d, double eps) |
Creates an U-shaped domain. More... | |
Grid creation or input.
std::unique_ptr< Grid > Kaskade::createCuboid | ( | Dune::FieldVector< Scalar, dim > const & | x0, |
Dune::FieldVector< Scalar, dim > const & | dx, | ||
EdgeLength const & | dh, | ||
bool | symmetric = true |
||
) |
Creates a uniform simplicial grid on a rectangular or cuboid domain.
Grid | type of grid to create |
Scalar | |
dim | spatial dimension (usually 2 or 3) |
EdgeLength | either a scalar or a Dune::FieldVector type |
x0 | left, lower, front corner of the cuboid |
dx | desired side lengths of the hexahedron to fill |
dh | side length(s) of hexahedra that are used to fill the cuboid |
symmetric | true: each cube provides a symmetric tetrahedal decomposition |
If the edge length dh is a scalar, exact cubes are created. If it is a vector (of size dim), hexahedra with the given edge length are created.
Note that the desired size dx of the domain to be filled is just an indication - the resulting grid will approximately have this size. In contrast, the hexahedra used for filling the domain will always have the shape given by dh.
Definition at line 414 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createCylinder | ( | double | radius, |
double | height, | ||
int | layers, | ||
int | circumEdges, | ||
Deformation const & | deformation | ||
) |
Creates a deformed cylinder.
This creates a grid for the cyclinder domain \( \{ (x,y,z) \mid x^2 + y^2 \le r, 0\le z \le H \} \), and deforms it as specified. The grid consists of a series of prisms along the cylinder's axis.
radius | the cylinder's radius \( r \) |
height | the cylinder's height \( H \) |
layers | the number of anti-prsimatic disks making up the grid |
circumEdges | the number of edges (or vertices) around the circumference |
deformation | a callable object Dune::FieldVector<double,3> deformation(Dune::FieldVector<double,3>) |
Cell quality (in terms of aspect ratio) depends on the parameter values (and the deformation, of course). Reasonable cell quality is achieved for values approximately satisfying radius*layers = height and circumEdges = 6.
Definition at line 705 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createCylinder | ( | double | radius, |
double | height, | ||
int | layers, | ||
int | circumEdges = 6 |
||
) |
Creates a cylinder.
This creates a grid for the cyclinder domain \( \{ (x,y,z) \mid x^2 + y^2 \le r, 0\le z \le H \} \), i.e. the cylinder's axis is the z-axis. The grid consists of a series of prisms along the cylinder's axis.
radius | the cylinder's radius \( r \) |
height | the cylinder's height \( H \) |
layers | the number of anti-prsimatic disks making up the grid |
circumEdges | the number of edges (or vertices) around the circumference |
Cell | quality (in terms of aspect ratio) depends on the parameter values. Reasonable cell quality is achieved for values approximately satisfying radius*layers = height and circumEdges = 6. |
Definition at line 683 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createGrid | ( | std::vector< Type > const & | cubes | ) |
Extract simplicial grid from list of cubes.
From a given list of (conforming) cubes or rectangles, this creates a simplicial grid.
Grid | the type of grid to create |
Type |
Usage:
Definition at line 371 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createLShape | ( | Dune::FieldVector< Scalar, dim > const & | x0, |
Scalar | dx, | ||
Scalar | dy, | ||
Dune::FieldVector< Scalar, dim > const & | thickness, | ||
Scalar | dh, | ||
bool | symmetric = true |
||
) |
Fill L-shaped domain with cubes.
x0 | left, lower, front corner of the L-shaped domain |
dx | length of horizontal line |
dy | length of vertical line |
thickness | |
dh | side length of cubes that are used to fill the cuboid |
symmetric | true: each cube provides a symmetric tetrahedal decomposition |
Definition at line 477 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createPentagon | ( | double | radius = 1 | ) |
Creates an regular pentagon consisting of five triangles, centered at the origin and with radius r.
radius | of the circumcircle of the pentagon |
Grid | the type of grid to create |
Definition at line 775 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createRectangle | ( | Dune::FieldVector< Scalar, 2 > const & | x0, |
Dune::FieldVector< Scalar, 2 > const & | dx, | ||
Scalar | dh, | ||
bool | symmetric = true |
||
) |
Fill rectangle with squares.
x0 | left, lower, front corner of the cuboid |
dx | side lengths |
dh | side length of cubes that are used to fill the cuboid |
symmetric | true: each cube provides a symmetric tetrahedal decomposition |
Definition at line 460 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createTShape | ( | Dune::FieldVector< Scalar, dim > const & | x0, |
Scalar | dx, | ||
Scalar | dy, | ||
Dune::FieldVector< Scalar, dim > const & | thickness, | ||
Scalar | dh, | ||
bool | symmetric = true |
||
) |
Fill L-shaped domain with cubes.
x0 | center on lower boundary of the T-shaped domain |
dx | length of horizontal line |
dy | length of vertical line |
thickness | |
dh | side length of cubes that are used to fill the cuboid |
symmetric | true: each cube provides a symmetric tetrahedal decomposition |
Definition at line 496 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createTwoLayerCuboid | ( | Dune::FieldVector< Scalar, dim > const & | x0, |
Dune::FieldVector< Scalar, dim > const & | dx1, | ||
Dune::FieldVector< Scalar, dim > const & | dx2, | ||
Dune::FieldVector< Scalar, dim > const & | dh1, | ||
Dune::FieldVector< Scalar, dim > const & | dh2, | ||
bool | symmetric = true |
||
) |
Definition at line 515 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createTwoLayerCuboid | ( | Dune::FieldVector< Scalar, dim > const & | x0, |
Dune::FieldVector< Scalar, dim > const & | dx1, | ||
Dune::FieldVector< Scalar, dim > const & | dx2, | ||
Dune::FieldVector< Scalar, dim > const & | dh1, | ||
Scalar | dh2, | ||
bool | symmetric = true |
||
) |
Definition at line 505 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createUnitCube | ( | double | dh = 1. , |
bool | symmetric = true |
||
) |
Creates a unit cube.
dh | desired side length of the subcubes. |
Definition at line 443 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createUnitSquare | ( | double | dh = 1. , |
bool | symmetric = true |
||
) |
Creates a unit square, filled regularly.
dh | side length of the subsquares. |
symmetric | if true, each subsquare is filled symmetrically with four triangles |
Definition at line 431 of file gridGeneration.hh.
std::unique_ptr< Grid > Kaskade::createUshape | ( | double | l, |
double | d, | ||
double | eps | ||
) |
Creates an U-shaped domain.
=======================|
=======================|
Grid | the type of grid to create |
l | side length |
d | thickness of gemetry |
eps | slit width of geometry |
Definition at line 830 of file gridGeneration.hh.
std::unique_ptr< Dune::UGGrid< 2 > > readPolyData | ( | std::string const & | name, |
std::vector< int > * | boundaryMarker = nullptr |
||
) |
Construct an unstructured UG grid from .node and .ele files (Triangle output).
name | the base name of the files (without the .node/.ele extension). |
boundaryMarker | a pointer to a vector of boundary markers. If not the nullpointer, the given vector is resized to the number of boundary segments (which is the number of boundary edges), and the corresponding markers are stored. These are stored in arbitrary order. |
If the reading of boundary markers is requested, i.e. boundaryMarker != nullptr
, a ".edge" file must exist. This can be generated by triangle using the -e option.
Dune boundary intersections have a method boundarySegmentIndex()
returning the index of the coarse grid boundary segment on which the intersection resides. Use this index to look up the marker in the boundaryMarker
array.