MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::PartialSpacingFunction Class Reference

Partial spacing function, defined as part of an existing spacing function. More...

#include <spacing.hpp>

Inheritance diagram for mfem::PartialSpacingFunction:
[legend]
Collaboration diagram for mfem::PartialSpacingFunction:
[legend]

Public Member Functions

 PartialSpacingFunction (int n, bool r, int rel_first_elem, int rel_num_elems, int rel_num_elems_full, Array< int > const &ipar, Vector const &dpar, SpacingType typeFull)
 
 PartialSpacingFunction (const PartialSpacingFunction &sf)
 Copy constructor (deep-copy all data, including SpacingFunction pieces)
 
PartialSpacingFunctionoperator= (const PartialSpacingFunction &sf)
 
 PartialSpacingFunction (PartialSpacingFunction &&sf)=default
 
PartialSpacingFunctionoperator= (PartialSpacingFunction &&sf)=default
 
void SetSize (int size) override
 Sets the size, or number of intervals (elements).
 
real_t Eval (int p) const override
 Returns the width of interval p (between 0 and Size() - 1).
 
void ScaleParameters (real_t a) override
 Scales parameters by the factor a associated with Size().
 
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).
 
std::unique_ptr< SpacingFunctionClone () const override
 Returns a clone (deep-copy) of this spacing function.
 
void SetupFull (SpacingType typeFull, Array< int > const &ipar, Vector const &dpar)
 
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.
 
- 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.
 
bool GetReverse () const
 
void Flip ()
 
void EvalAll (Vector &s) const
 Returns the width of all intervals, resizing s to Size().
 
void FullyCoarsen ()
 
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.
 

Detailed Description

Partial spacing function, defined as part of an existing spacing function.

Definition at line 790 of file spacing.hpp.

Constructor & Destructor Documentation

◆ PartialSpacingFunction() [1/3]

mfem::PartialSpacingFunction::PartialSpacingFunction ( int n,
bool r,
int rel_first_elem,
int rel_num_elems,
int rel_num_elems_full,
Array< int > const & ipar,
Vector const & dpar,
SpacingType typeFull )
inline

Definition at line 793 of file spacing.hpp.

◆ PartialSpacingFunction() [2/3]

mfem::PartialSpacingFunction::PartialSpacingFunction ( const PartialSpacingFunction & sf)
inline

Copy constructor (deep-copy all data, including SpacingFunction pieces)

Definition at line 805 of file spacing.hpp.

◆ PartialSpacingFunction() [3/3]

mfem::PartialSpacingFunction::PartialSpacingFunction ( PartialSpacingFunction && sf)
default

Member Function Documentation

◆ Clone()

std::unique_ptr< SpacingFunction > mfem::PartialSpacingFunction::Clone ( ) const
inlineoverridevirtual

Returns a clone (deep-copy) of this spacing function.

Reimplemented from mfem::SpacingFunction.

Definition at line 837 of file spacing.hpp.

◆ Eval()

real_t mfem::PartialSpacingFunction::Eval ( int p) const
inlineoverridevirtual

Returns the width of interval p (between 0 and Size() - 1).

Implements mfem::SpacingFunction.

Definition at line 827 of file spacing.hpp.

◆ GetDoubleParameters()

void mfem::PartialSpacingFunction::GetDoubleParameters ( Vector & p) const
inlineoverridevirtual

Returns the array of double parameters defining the spacing function.

Parameters
[out]pArray of double parameters, resized appropriately.

Implements mfem::SpacingFunction.

Definition at line 866 of file spacing.hpp.

◆ GetIntParameters()

void mfem::PartialSpacingFunction::GetIntParameters ( Array< int > & p) const
inlineoverridevirtual

Returns the array of integer parameters defining the spacing function.

Parameters
[out]pArray of integer parameters, resized appropriately.

Implements mfem::SpacingFunction.

Definition at line 850 of file spacing.hpp.

◆ GetSpacingType()

SpacingType mfem::PartialSpacingFunction::GetSpacingType ( ) const
inlineoverridevirtual

Returns the spacing type, indicating the derived class.

Implements mfem::SpacingFunction.

Definition at line 846 of file spacing.hpp.

◆ Nested()

bool mfem::PartialSpacingFunction::Nested ( ) const
inlineoverridevirtual

Returns true if the spacing function is nested during refinement.

Implements mfem::SpacingFunction.

Definition at line 872 of file spacing.hpp.

◆ NumDoubleParameters()

int mfem::PartialSpacingFunction::NumDoubleParameters ( ) const
inlineoverridevirtual

Returns the number of double parameters defining the spacing function.

Implements mfem::SpacingFunction.

Definition at line 848 of file spacing.hpp.

◆ NumIntParameters()

int mfem::PartialSpacingFunction::NumIntParameters ( ) const
inlineoverridevirtual

Returns the number of integer parameters defining the spacing function.

Implements mfem::SpacingFunction.

Definition at line 847 of file spacing.hpp.

◆ operator=() [1/2]

PartialSpacingFunction & mfem::PartialSpacingFunction::operator= ( const PartialSpacingFunction & sf)
inline

Definition at line 811 of file spacing.hpp.

◆ operator=() [2/2]

PartialSpacingFunction & mfem::PartialSpacingFunction::operator= ( PartialSpacingFunction && sf)
default

◆ Print()

void mfem::PartialSpacingFunction::Print ( std::ostream & os) const
overridevirtual

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 662 of file spacing.cpp.

◆ ScaleParameters()

void mfem::PartialSpacingFunction::ScaleParameters ( real_t a)
overridevirtual

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 657 of file spacing.cpp.

◆ SetSize()

void mfem::PartialSpacingFunction::SetSize ( int size)
inlineoverridevirtual

Sets the size, or number of intervals (elements).

Implements mfem::SpacingFunction.

Definition at line 821 of file spacing.hpp.

◆ SetupFull()

void mfem::PartialSpacingFunction::SetupFull ( SpacingType typeFull,
Array< int > const & ipar,
Vector const & dpar )

Definition at line 620 of file spacing.cpp.


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