Dune Core Modules (2.6.0)

Dune::TensorGridFactory< Grid > Class Template Reference

A factory class for conveniently creating tensorproduct grids. More...

#include <dune/grid/utility/tensorgridfactory.hh>

Public Member Functions

std::vector< ctype > & operator[] (std::size_t d)
 allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the coordinate directories.
 
const std::vector< ctype > & operator[] (std::size_t d) const
 allow to manually tune the factory by overloading operator[] to export the coordinate vectors in the coordinate directories.
 
void setStart (int d, ctype value)
 set a starting value in a given direction d More...
 
void fillIntervals (int d, int n, ctype h)
 pushs n intervals of length h in direction d More...
 
void fillRange (int d, int n, ctype end)
 fills the range to end with n intervals in direction d More...
 
void fillUntil (int d, ctype h, ctype end)
 adds intervals in direction d until a given coordinate is reached More...
 
void geometricFillIntervals (int d, int n, ctype ratio, ctype h0=static_cast< ctype >(0))
 adds n intervals in direction d with a given length ratio and a given starting interval length. More...
 
void geometricFillUntil (int d, ctype ratio, ctype end, ctype h0=static_cast< ctype >(0))
 adds intervals in direction d according with a given length ratio until a given coordinate is reached More...
 
void geometricFillRange (int d, int n, ctype end, ctype h=static_cast< ctype >(0), bool first=true)
 fills a coordinate range in direction d with n intervals according to a geometric series More...
 
void print ()
 print the coordinate information given to the factory so far
 

Detailed Description

template<typename Grid>
class Dune::TensorGridFactory< Grid >

A factory class for conveniently creating tensorproduct grids.

Template Parameters
Gridthe grid type

Member Function Documentation

◆ fillIntervals()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::fillIntervals ( int  d,
int  n,
ctype  h 
)
inline

pushs n intervals of length h in direction d

Parameters
dthe coordinate direction
nthe number of intervals to add
hthe interval length

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that \(x_i=x_0+i*h\).

◆ fillRange()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::fillRange ( int  d,
int  n,
ctype  end 
)
inline

fills the range to end with n intervals in direction d

Parameters
dthe coordinate direction
nthe number of intervals to add
endthe coordinate on the upper border of the range

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that \(x_i=x_0+i*\frac{end-x_0}{n}\).

◆ fillUntil()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::fillUntil ( int  d,
ctype  h,
ctype  end 
)
inline

adds intervals in direction d until a given coordinate is reached

Parameters
dthe coordinate direction
hthe interval length
endthe coordinate on the upper border of the range

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that \(x_n < end < x_n + h\) and \(x_{i+1}-x_i = h\).

◆ geometricFillIntervals()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::geometricFillIntervals ( int  d,
int  n,
ctype  ratio,
ctype  h0 = static_cast<ctype> (0) 
)
inline

adds n intervals in direction d with a given length ratio and a given starting interval length.

Parameters
dthe coordinate direction
nthe number of intervals to add
ratiothe ratio of \( h_{i+1}\) to \(h_i\)
h0the starting interval length (optional)

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that \(h_{i+1}=qh_i\) for a given ratio \(q\) and interval length \(h_i=x_{i+1}-x_i\). The first interval length can either be explicitly given or be deduced by multiplying the ratio with the last interval length in the container.

◆ geometricFillRange()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::geometricFillRange ( int  d,
int  n,
ctype  end,
ctype  h = static_cast<ctype> (0),
bool  first = true 
)
inline

fills a coordinate range in direction d with n intervals according to a geometric series

Parameters
dthe coordinate direction
nthe number of intervals to add
endthe coordinate of the upper border of the range
hthe interval length to start or end with (see below) (optional)
firsttrue if the given h is to be the first interval, false if last one

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that the ratio \(h_{i+1} / h_i\) is fixed throughout the range and \(x_n=end\), while \(h_i=x_{i+1}-x_i\) is the interval length. The first interval length can either be explicitly given or be deduced by taking the last interval length in the container. By setting the optional parameter first to false, the given h can instead be used as last interval length in the range.

◆ geometricFillUntil()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::geometricFillUntil ( int  d,
ctype  ratio,
ctype  end,
ctype  h0 = static_cast<ctype> (0) 
)
inline

adds intervals in direction d according with a given length ratio until a given coordinate is reached

Parameters
dthe coordinate direction
ratiothe ratio of \(h_{i+1}\) to \(h_i\)
endthe coordinate on the right border of the range
h0the starting interval length (optional)

Given a vector with last element \(x_0\), this will add elements \(x_1,\dots ,x_n\) such that - with \(h_i=x_{i+1}-x_i\) - \(h_{i+1}=qh_i\) for a given ratio \(q\) and that \(x_n < end < x_n + h\). The first interval length can either be explicitly given or be deduced by multiplying the ratio with the last interval length in the container.

◆ setStart()

template<typename Grid >
void Dune::TensorGridFactory< Grid >::setStart ( int  d,
ctype  value 
)
inline

set a starting value in a given direction d

Parameters
dthe coordinate direction
valuethe value to set

This resizes the coordinate vector for the given direction to 1. Not using this function will result in 0.0 to be used as a lower bound of the coordinate range.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Mar 28, 23:30, 2024)