Medusa  1.1
Coordinate Free Mehless Method implementation
mm::GridFill< vec_t > Class Template Reference

#include <GridFill_fwd.hpp>

Detailed Description

template<typename vec_t>
class mm::GridFill< vec_t >

Discretizes the domain using n-dimensional grid with given endpoints and spacing h.

Only nodes that are inside the domain and at least h away from existing nodes are added. Gaps may appear at the boundary and BasicRelax can be used to smooth them.

Usage example:

auto sh = BoxShape<Vec2d>(-1, 1) - BallShape<Vec2d>(0, 0.5);
DomainDiscretization<Vec2d> domain(sh);
domain.fill(GridFill<Vec2d>(-1, 1), 0.5);
See also
GeneralFill, BasicRelax

Definition at line 30 of file GridFill_fwd.hpp.

Public Member Functions

 GridFill (const vec_t &bot, const vec_t &top)
 Prepare to fill domain within [bot, top] bounding box. More...
 
void operator() (DomainDiscretization< vec_t > &domain, const scalar_t &h, int type=0) const
 Fills domain with a grid node distribution with spacing h. More...
 

Public Types

enum  { dim = vec_t::dim }
 Store dimension of the domain. More...
 
typedef vec_t::scalar_t scalar_t
 Scalar type;. More...
 
typedef vec_t vector_t
 Vector type. More...
 

Private Attributes

vec_t bot
 Bottom left corner of the box to fill. More...
 
vec_t top
 Top right corner of the box to fill. More...
 

Member Enumeration Documentation

◆ anonymous enum

template<typename vec_t >
anonymous enum

Store dimension of the domain.

Enumerator
dim 

Dimensionality of the domain.

Definition at line 35 of file GridFill_fwd.hpp.

Constructor & Destructor Documentation

◆ GridFill()

template<typename vec_t >
mm::GridFill< vec_t >::GridFill ( const vec_t &  bot,
const vec_t &  top 
)

Prepare to fill domain within [bot, top] bounding box.

Definition at line 18 of file GridFill.hpp.

Member Function Documentation

◆ operator()()

template<typename vec_t >
void mm::GridFill< vec_t >::operator() ( DomainDiscretization< vec_t > &  domain,
const scalar_t h,
int  type = 0 
) const

Fills domain with a grid node distribution with spacing h.

Newly added nodes are at least h away from all previous nodes.

Parameters
domainDomain to fill with nodes. Can be partially filled.
hNodal spacing.
typeType of the nodes. If 0 the engines default value is used.
Warning
The resulting distribution can be rough near the boundary. Consider using relaxation techniques or different fill engines, if this is a problem.

Definition at line 25 of file GridFill.hpp.

Member Data Documentation

◆ bot

template<typename vec_t >
vec_t mm::GridFill< vec_t >::bot
private

Bottom left corner of the box to fill.

Definition at line 38 of file GridFill_fwd.hpp.

◆ top

template<typename vec_t >
vec_t mm::GridFill< vec_t >::top
private

Top right corner of the box to fill.

Definition at line 39 of file GridFill_fwd.hpp.


The documentation for this class was generated from the following files: