MFEM v4.7.0
Finite element discretization library
|
Gaussian spacing function of the general form g(x) = a exp(-(x-m)^2 / c^2) for some scalar parameters a, m, c. More...
#include <spacing.hpp>
Public Member Functions | |
GaussianSpacingFunction (int n, bool r, real_t s0, real_t s1, bool s) | |
Constructor for BellSpacingFunction. | |
void | SetSize (int size) override |
Sets the size, or number of intervals (elements). | |
void | ScaleParameters (real_t a) override |
Scales parameters by the factor a associated with Size(). | |
real_t | Eval (int p) const override |
Returns the width of interval p (between 0 and Size() - 1). | |
void | Print (std::ostream &os) const override |
Prints all the data necessary to define the spacing function and its current state (size and other parameters). | |
SpacingType | GetSpacingType () const override |
Returns the spacing type, indicating the derived class. | |
int | NumIntParameters () const override |
Returns the number of integer parameters defining the spacing function. | |
int | NumDoubleParameters () const override |
Returns the number of double parameters defining the spacing function. | |
void | GetIntParameters (Array< int > &p) const override |
void | GetDoubleParameters (Vector &p) const override |
bool | Nested () const override |
Returns true if the spacing function is nested during refinement. | |
std::unique_ptr< SpacingFunction > | Clone () const override |
Returns a clone (deep-copy) of this spacing function. | |
Public Member Functions inherited from mfem::SpacingFunction | |
SpacingFunction (int n, bool r=false, bool s=false) | |
Base class constructor. | |
int | Size () const |
Returns the size, or number of intervals (elements). | |
void | SetReverse (bool r) |
Sets the property that determines whether the spacing is reversed. | |
void | EvalAll (Vector &s) const |
Returns the width of all intervals, resizing s to Size(). | |
virtual | ~SpacingFunction ()=default |
Additional Inherited Members | |
Protected Attributes inherited from mfem::SpacingFunction | |
int | n |
Size, or number of intervals (elements) | |
bool | reverse |
Whether to reverse the spacing. | |
bool | scale |
Whether to scale parameters in ScaleParameters. | |
Gaussian spacing function of the general form g(x) = a exp(-(x-m)^2 / c^2) for some scalar parameters a, m, c.
The widths of the first and last intervals (elements) are prescribed, and the remaining interior spacings are computed by using Newton's method to compute parameters that fit the endpoint widths. The results of this spacing function are very similar to those of BellSpacingFunction, but they may differ by about 1%. If the first and last intervals are wide enough, the spacing may decrease in the middle of the domain. The first and last interval widths can be scaled. This function is not nested.
Definition at line 447 of file spacing.hpp.
|
inline |
Constructor for BellSpacingFunction.
[in] | n | Size or number of intervals, which defines elements. |
[in] | r | Whether to reverse the spacings. |
[in] | s0 | Width of the first interval (element). |
[in] | s1 | Width of the last interval (element). |
[in] | s | Whether to scale parameters by the refinement or coarsening factor, in the function SpacingFunction::ScaleParameters. |
Definition at line 458 of file spacing.hpp.
|
inlineoverridevirtual |
Returns a clone (deep-copy) of this spacing function.
Reimplemented from mfem::SpacingFunction.
Definition at line 514 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the width of interval p (between 0 and Size() - 1).
Implements mfem::SpacingFunction.
Definition at line 480 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the array of double parameters defining the spacing function.
[out] | p | Array of double parameters, resized appropriately. |
Implements mfem::SpacingFunction.
Definition at line 505 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the array of integer parameters defining the spacing function.
[out] | p | Array of integer parameters, resized appropriately. |
Implements mfem::SpacingFunction.
Definition at line 497 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the spacing type, indicating the derived class.
Implements mfem::SpacingFunction.
Definition at line 493 of file spacing.hpp.
|
inlineoverridevirtual |
Returns true if the spacing function is nested during refinement.
Implements mfem::SpacingFunction.
Definition at line 512 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the number of double parameters defining the spacing function.
Implements mfem::SpacingFunction.
Definition at line 495 of file spacing.hpp.
|
inlineoverridevirtual |
Returns the number of integer parameters defining the spacing function.
Implements mfem::SpacingFunction.
Definition at line 494 of file spacing.hpp.
|
inlineoverridevirtual |
Prints all the data necessary to define the spacing function and its current state (size and other parameters).
The format is generally SpacingType numIntParam numDoubleParam {int params} {double params}
Implements mfem::SpacingFunction.
Definition at line 486 of file spacing.hpp.
|
inlineoverridevirtual |
Scales parameters by the factor a associated with Size().
Note that parameters may be scaled inversely during coarsening and refining, so the scaling should be linear in the sense that scaling by a number followed by scaling by its inverse has no effect on parameters.
Reimplemented from mfem::SpacingFunction.
Definition at line 470 of file spacing.hpp.
|
inlineoverridevirtual |
Sets the size, or number of intervals (elements).
Implements mfem::SpacingFunction.
Definition at line 464 of file spacing.hpp.