MFEM v4.7.0
Finite element discretization library
|
#include <spacing.hpp>
Public Member Functions | |
SpacingFunction (int n, bool r=false, bool s=false) | |
Base class constructor. | |
int | Size () const |
Returns the size, or number of intervals (elements). | |
virtual void | SetSize (int size)=0 |
Sets the size, or number of intervals (elements). | |
void | SetReverse (bool r) |
Sets the property that determines whether the spacing is reversed. | |
virtual real_t | Eval (int p) const =0 |
Returns the width of interval p (between 0 and Size() - 1). | |
void | EvalAll (Vector &s) const |
Returns the width of all intervals, resizing s to Size(). | |
virtual void | ScaleParameters (real_t a) |
Scales parameters by the factor a associated with Size(). | |
virtual SpacingType | GetSpacingType () const =0 |
Returns the spacing type, indicating the derived class. | |
virtual void | Print (std::ostream &os) const =0 |
Prints all the data necessary to define the spacing function and its current state (size and other parameters). | |
virtual int | NumIntParameters () const =0 |
Returns the number of integer parameters defining the spacing function. | |
virtual int | NumDoubleParameters () const =0 |
Returns the number of double parameters defining the spacing function. | |
virtual void | GetIntParameters (Array< int > &p) const =0 |
virtual void | GetDoubleParameters (Vector &p) const =0 |
virtual bool | Nested () const =0 |
Returns true if the spacing function is nested during refinement. | |
virtual std::unique_ptr< SpacingFunction > | Clone () const |
Returns a clone (deep-copy) of this spacing function. | |
virtual | ~SpacingFunction ()=default |
Protected Attributes | |
int | n |
Size, or number of intervals (elements) | |
bool | reverse |
Whether to reverse the spacing. | |
bool | scale |
Whether to scale parameters in ScaleParameters. | |
Class for spacing functions that define meshes in a dimension, using a formula or method implemented in a derived class.
Definition at line 29 of file spacing.hpp.
|
inline |
Base class constructor.
[in] | n | Size or number of intervals, which defines elements. |
[in] | r | Whether to reverse the spacings, false by default. |
[in] | s | Whether to scale parameters by the refinement or coarsening factor, in the function SpacingFunction::ScaleParameters. |
Definition at line 38 of file spacing.hpp.
|
virtualdefault |
|
virtual |
Returns a clone (deep-copy) of this spacing function.
Reimplemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
Definition at line 78 of file spacing.cpp.
|
pure virtual |
Returns the width of interval p (between 0 and Size() - 1).
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
inline |
Returns the width of all intervals, resizing s to Size().
Definition at line 54 of file spacing.hpp.
|
pure virtual |
Returns the array of double parameters defining the spacing function.
[out] | p | Array of double parameters, resized appropriately. |
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
Returns the array of integer parameters defining the spacing function.
[out] | p | Array of integer parameters, resized appropriately. |
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
Returns the spacing type, indicating the derived class.
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
Returns true if the spacing function is nested during refinement.
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
Returns the number of double parameters defining the spacing function.
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
Returns the number of integer parameters defining the spacing function.
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
pure virtual |
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}
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
inlinevirtual |
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 in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, and mfem::PiecewiseSpacingFunction.
Definition at line 68 of file spacing.hpp.
|
inline |
Sets the property that determines whether the spacing is reversed.
Definition at line 48 of file spacing.hpp.
|
pure virtual |
Sets the size, or number of intervals (elements).
Implemented in mfem::BellSpacingFunction, mfem::GaussianSpacingFunction, mfem::GeometricSpacingFunction, mfem::LinearSpacingFunction, mfem::LogarithmicSpacingFunction, mfem::PiecewiseSpacingFunction, and mfem::UniformSpacingFunction.
|
inline |
Returns the size, or number of intervals (elements).
Definition at line 42 of file spacing.hpp.
|
protected |
Size, or number of intervals (elements)
Definition at line 103 of file spacing.hpp.
|
protected |
Whether to reverse the spacing.
Definition at line 104 of file spacing.hpp.
|
protected |
Whether to scale parameters in ScaleParameters.
Definition at line 105 of file spacing.hpp.