Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
makering.hh File Reference
#include <memory>
#include <vector>
#include <dune/grid/common/gridfactory.hh>
#include <dune/grid/common/boundarysegment.hh>
#include <dune/fufem/arcofcircle.hh>
#include <dune/fufem/boundarypatch.hh>

Go to the source code of this file.

Functions

template<class GridType >
void makeRingSegment2D (const Dune::FieldVector< typename GridType::ctype, 2 > &center, const typename GridType::ctype thickness, const typename GridType::ctype innerRadius, const typename GridType::ctype fromAngle, const typename GridType::ctype toAngle, GridType &grid, size_t nElement, bool closeRing, bool quadrilateral=false, BoundaryPatch< typename GridType::LevelGridView > *innerBoundary=NULL, BoundaryPatch< typename GridType::LevelGridView > *outerBoundary=NULL)
 
template<class GridType >
std::unique_ptr< GridType > makeRingSegment2D (const Dune::FieldVector< typename GridType::ctype, 2 > &center, const typename GridType::ctype thickness, const typename GridType::ctype innerRadius, const typename GridType::ctype fromAngle, const typename GridType::ctype toAngle, size_t nElement, bool closeRing, bool quadrilateral=false, BoundaryPatch< typename GridType::LevelGridView > *innerBoundary=NULL, BoundaryPatch< typename GridType::LevelGridView > *outerBoundary=NULL)
 Create a 2D ring segment grid.
 
template<class GridType >
std::unique_ptr< GridType > makeTubeSegment3D (const Dune::FieldVector< typename GridType::ctype, 3 > &center, const typename GridType::ctype thickness, const typename GridType::ctype length, const typename GridType::ctype innerRadius, const typename GridType::ctype fromAngle, const typename GridType::ctype toAngle, unsigned int nElementRing, unsigned int nElementLength, bool closeTube, unsigned int axis=0, bool tetrahedra=true, bool parametrizedBoundary=true, BoundaryPatch< typename GridType::LevelGridView > *innerBoundary=NULL, BoundaryPatch< typename GridType::LevelGridView > *outerBoundary=NULL)
 Create a 3D tube segment prism grid along a prescribed Euclidean axis.
 
template<class GridType >
std::unique_ptr< GridType > makeTorus (const Dune::FieldVector< typename GridType::ctype, 3 > &center, const std::array< Dune::FieldVector< typename GridType::ctype, 3 >, 3 > plane, const typename GridType::ctype thickness, const typename GridType::ctype horizontalRadius, const typename GridType::ctype verticalRadius, unsigned int nElementHorizontal, unsigned int nElementVertical, BoundaryPatch< typename GridType::LevelGridView > *innerBoundary=NULL, BoundaryPatch< typename GridType::LevelGridView > *outerBoundary=NULL)
 Create a 3D tube segment prism grid along the x-axis.
 

Function Documentation

◆ makeRingSegment2D() [1/2]

template<class GridType >
void makeRingSegment2D ( const Dune::FieldVector< typename GridType::ctype, 2 > &  center,
const typename GridType::ctype  thickness,
const typename GridType::ctype  innerRadius,
const typename GridType::ctype  fromAngle,
const typename GridType::ctype  toAngle,
GridType &  grid,
size_t  nElement,
bool  closeRing,
bool  quadrilateral = false,
BoundaryPatch< typename GridType::LevelGridView > *  innerBoundary = NULL,
BoundaryPatch< typename GridType::LevelGridView > *  outerBoundary = NULL 
)

◆ makeRingSegment2D() [2/2]

template<class GridType >
std::unique_ptr< GridType > makeRingSegment2D ( const Dune::FieldVector< typename GridType::ctype, 2 > &  center,
const typename GridType::ctype  thickness,
const typename GridType::ctype  innerRadius,
const typename GridType::ctype  fromAngle,
const typename GridType::ctype  toAngle,
size_t  nElement,
bool  closeRing,
bool  quadrilateral = false,
BoundaryPatch< typename GridType::LevelGridView > *  innerBoundary = NULL,
BoundaryPatch< typename GridType::LevelGridView > *  outerBoundary = NULL 
)

Create a 2D ring segment grid.

Parameters
center- The center of the ring.
thickness- Thickness of the ring segment.
innerRadius- Radius of the inner circle.
fromAngle- Angle where the segment starts.
toAngle- Angle where the segment stops.
nElement- The number of initial elements. Avoid meshing problems by making a good choice.
closeRing- Close the ring, needs fromAngle = toAngle
quadrilateral- Make ring segment consist of quadrilaterals
innerBoundary- If given, make a level 0 boundary patch containing the inner nodes
outerBoundary- If given, make a level 0 boundary patch containing the outer nodes
Returns
A std::unique_ptr to the created grid.

◆ makeTorus()

template<class GridType >
std::unique_ptr< GridType > makeTorus ( const Dune::FieldVector< typename GridType::ctype, 3 > &  center,
const std::array< Dune::FieldVector< typename GridType::ctype, 3 >, 3 >  plane,
const typename GridType::ctype  thickness,
const typename GridType::ctype  horizontalRadius,
const typename GridType::ctype  verticalRadius,
unsigned int  nElementHorizontal,
unsigned int  nElementVertical,
BoundaryPatch< typename GridType::LevelGridView > *  innerBoundary = NULL,
BoundaryPatch< typename GridType::LevelGridView > *  outerBoundary = NULL 
)

Create a 3D tube segment prism grid along the x-axis.

If the tube is very thin the boundary parametrization can require the improvement of the inner grid vertices. This is for example implemented in the dune-biomech/prismlayer.hh class.

Parameters
center- The center of the tube.
planeThe plane in which the torus lives, the first two give the horizontal plane, the first and third the vertical plane
thickness- Thickness of the ring segment.
horizontalRadius- Radius of the horizontal circle.
verticalRadius- Radius of the vertical circle.
nElementHorizontal- The number of initial elements in the horizontal ring direction.
nElementVertical- The number of initial elements in the vertical ring direction.
innerBoundary- If given, make a level 0 boundary patch containing the inner nodes
outerBoundary- If given, make a level 0 boundary patch containing the outer nodes

◆ makeTubeSegment3D()

template<class GridType >
std::unique_ptr< GridType > makeTubeSegment3D ( const Dune::FieldVector< typename GridType::ctype, 3 > &  center,
const typename GridType::ctype  thickness,
const typename GridType::ctype  length,
const typename GridType::ctype  innerRadius,
const typename GridType::ctype  fromAngle,
const typename GridType::ctype  toAngle,
unsigned int  nElementRing,
unsigned int  nElementLength,
bool  closeTube,
unsigned int  axis = 0,
bool  tetrahedra = true,
bool  parametrizedBoundary = true,
BoundaryPatch< typename GridType::LevelGridView > *  innerBoundary = NULL,
BoundaryPatch< typename GridType::LevelGridView > *  outerBoundary = NULL 
)

Create a 3D tube segment prism grid along a prescribed Euclidean axis.

If the tube is very thin the boundary parametrization can require the improvement of the inner grid vertices. This is for example implemented in the dune-biomech/prismlayer.hh class.

Parameters
center- The center of the tube.
thickness- Thickness of the ring segment.
length- Length of the ring segment.
innerRadius- Radius of the inner circle.
fromAngle- Angle where the segment starts.
toAngle- Angle where the segment stops.
nElementRing- The number of initial elements in the ring direction.
nElementLength- The number of initial elements in the length direction.
closeTube- Close the tube, needs fromAngle == 0, toAngle == 2*PI
axis- The axis along the tube should be build 0 <= axis <= 2
tetrahedraIf true, generate tetrahedra, otherwise prisms
parametrizedBoundaryIf true, insert parameterizations of the boundary
innerBoundary- If given, make a level 0 boundary patch containing the inner nodes
outerBoundary- If given, make a level 0 boundary patch containing the outer nodes
Returns
A std::unique_ptr to the created grid.