#include <GrainDropFill_fwd.hpp>
Implements general n
-d node placing algorithm, as described in https://arxiv.org/abs/1906.00636 This node generation algorithm simulates dropping grains with variable radius in a box.
First, a large bounding box is filled and only the nodes in the domain shape are kept. Thus, gaps may appear at the boundary and BasicRelax can be used to smooth them.
Usage example:
Definition at line 37 of file GrainDropFill_fwd.hpp.
Public Member Functions | |
GrainDropFill (const vec_t &bot, const vec_t &top) | |
Prepare to fill domain within [bot, top] bounding box. More... | |
GrainDropFill & | maxPoints (int max_points) |
Maximal number of points generated. More... | |
GrainDropFill & | seed (int seed) |
Set custom seed for the random number generator. More... | |
GrainDropFill & | initialSpacing (scalar_t dx) |
Set initial discretization density by specifying number of dots along each dimension. More... | |
GrainDropFill & | excessFactor (scalar_t factor) |
Set percentage of allowed generation over the top. More... | |
template<typename func_t > | |
void | operator() (DomainDiscretization< vec_t > &domain, const func_t &h, int type=0) const |
Fills domain with a quality node distribution. More... | |
void | operator() (DomainDiscretization< vec_t > &domain, const scalar_t &h, int type=0) const |
Overload for constant function. More... | |
template<typename func_t > | |
std::vector< vec_t > | fillBox (const func_t &h) const |
Actual fill algorithm which fills [bot, top] box with spacing h . More... | |
std::vector< Vec1d > | fillBox (const func_t &h) const |
Specialization for 1D. 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 | |
int | max_points = 5000000 |
Maximal number of points generated. More... | |
vec_t | bot |
Bottom left corner of the box to fill. More... | |
vec_t | top |
Top right corner of the box to fill. More... | |
scalar_t | dx = -1.0 |
Initial discretization spacing. More... | |
int | seed_ |
Seed for the random number generator. More... | |
scalar_t | excess_factor = 10 |
Fill excess_factor*dx over the top of the domain. More... | |
anonymous enum |
Store dimension of the domain.
Enumerator | |
---|---|
dim | Dimensionality of the domain. |
Definition at line 42 of file GrainDropFill_fwd.hpp.
mm::GrainDropFill< vec_t >::GrainDropFill | ( | const vec_t & | bot, |
const vec_t & | top | ||
) |
Prepare to fill domain within [bot, top]
bounding box.
Definition at line 18 of file GrainDropFill.hpp.
|
inline |
Set percentage of allowed generation over the top.
Definition at line 67 of file GrainDropFill_fwd.hpp.
std::vector< vec_t > mm::GrainDropFill< vec_t >::fillBox | ( | const func_t & | h | ) | const |
Actual fill algorithm which fills [bot, top]
box with spacing h
.
Definition at line 45 of file GrainDropFill.hpp.
std::vector< Vec1d > mm::GrainDropFill< Vec1d >::fillBox | ( | const func_t & | h | ) | const |
Specialization for 1D.
Definition at line 117 of file GrainDropFill.hpp.
|
inline |
Set initial discretization density by specifying number of dots along each dimension.
The recommended density is 10 times less than the minimal nodal spacing. Number of data points along the last dimension is ignored.
Definition at line 65 of file GrainDropFill_fwd.hpp.
|
inline |
Maximal number of points generated.
Definition at line 57 of file GrainDropFill_fwd.hpp.
void mm::GrainDropFill< vec_t >::operator() | ( | DomainDiscretization< vec_t > & | domain, |
const func_t & | h, | ||
int | type = 0 |
||
) | const |
Fills domain with a quality node distribution.
domain | Domain to fill with nodes. Can be partially filled. |
h | Nodal spacing function. |
type | Type of the nodes. If 0 the engines default value is used. |
#include <medusa/bits/domains/GrainDropFill.hpp>
must be included additionally to #include <medusa/Medusa_fwd.hpp>
. Definition at line 28 of file GrainDropFill.hpp.
|
inline |
Overload for constant function.
Definition at line 82 of file GrainDropFill_fwd.hpp.
|
inline |
Set custom seed for the random number generator.
Definition at line 59 of file GrainDropFill_fwd.hpp.
|
private |
Bottom left corner of the box to fill.
Definition at line 46 of file GrainDropFill_fwd.hpp.
|
private |
Initial discretization spacing.
Definition at line 48 of file GrainDropFill_fwd.hpp.
|
private |
Fill excess_factor*dx
over the top of the domain.
Definition at line 50 of file GrainDropFill_fwd.hpp.
|
private |
Maximal number of points generated.
Definition at line 45 of file GrainDropFill_fwd.hpp.
|
private |
Seed for the random number generator.
Definition at line 49 of file GrainDropFill_fwd.hpp.
|
private |
Top right corner of the box to fill.
Definition at line 47 of file GrainDropFill_fwd.hpp.