MAST
MAST::MeshFieldFunction Class Reference

This provides a wrapper FieldFunction compatible class that interpolates the solution using libMesh's MeshFunction class. More...

#include <mesh_field_function.h>

Inheritance diagram for MAST::MeshFieldFunction:
Collaboration diagram for MAST::MeshFieldFunction:

Public Member Functions

 MeshFieldFunction (MAST::SystemInitialization &sys, const std::string &nm)
 constructor More...
 
 MeshFieldFunction (libMesh::System &sys, const std::string &nm)
 constructor More...
 
virtual ~MeshFieldFunction ()
 destructor More...
 
virtual void operator() (const libMesh::Point &p, const Real t, RealVectorX &v) const
 calculates the value of the function at the specified point, p, and time, t, and returns it in v. More...
 
virtual void gradient (const libMesh::Point &p, const Real t, RealMatrixX &g) const
 calculates the gradient of value of the function at the specified point, p, and time, t, and returns it in g. More...
 
virtual void perturbation (const libMesh::Point &p, const Real t, RealVectorX &v) const
 calculates the value of perturbation in the function at the specified point, p, and time, t, and returns it in v. More...
 
virtual void derivative (const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealVectorX &v) const
 calculates the value of the function at the specified point, p, and time, t, and returns it in v. More...
 
void init (const libMesh::NumericVector< Real > &sol, const libMesh::NumericVector< Real > *dsol=nullptr)
 initializes the data structures to perform the interpolation function of sol. More...
 
libMesh::MeshFunction & get_function ()
 
libMesh::MeshFunction & get_perturbed_function ()
 
virtual void set_element_quadrature_point_solution (RealVectorX &sol)
 When a mesh field function is attached to an assembly routine during system assembly, then the current solution can be provided by the element quadrature point update. More...
 
virtual void clear_element_quadrature_point_solution ()
 clears the quadrature point solution provided by the corresponding set method above. More...
 
void clear ()
 clear the solution More...
 
- Public Member Functions inherited from MAST::FieldFunction< RealVectorX >
 FieldFunction (const std::string &nm)
 
virtual void operator() (RealVectorX &v) const
 calculates the value of the function and returns it in v. More...
 
virtual void perturbation (RealVectorX &v) const
 calculates the perturbation and returns it in v. More...
 
virtual void derivative (const MAST::FunctionBase &f, RealVectorX &v) const
 calculates the value of the function derivative and returns it in v. More...
 
- Public Member Functions inherited from MAST::FunctionBase
 FunctionBase (const std::string &nm, const bool is_field_func)
 initializes the parameter to the given name More...
 
 FunctionBase (const MAST::FunctionBase &f)
 Copy constructor. More...
 
virtual ~FunctionBase ()
 virtual destructor More...
 
const std::string & name () const
 returns the name of this function More...
 
virtual bool depends_on (const MAST::FunctionBase &f) const
 returns true if the function depends on the provided value More...
 
virtual bool is_shape_parameter () const
 
virtual void set_as_shape_parameter (bool f)
 
virtual bool is_topology_parameter () const
 
virtual void set_as_topology_parameter (bool f)
 

Protected Attributes

bool _use_qp_sol
 flag is set to true when the quadrature point solution is provided by an element More...
 
RealVectorX _qp_sol
 quadrature point solution of the element More...
 
libMesh::System * _sys
 current system for which solution is to be interpolated More...
 
libMesh::NumericVector< Real > * _sol
 current solution that is going to be interpolated More...
 
libMesh::NumericVector< Real > * _dsol
 
libMesh::MeshFunction * _function
 the MeshFunction object that performs the interpolation More...
 
libMesh::MeshFunction * _perturbed_function
 
- Protected Attributes inherited from MAST::FunctionBase
std::string _name
 name of this parameter More...
 
bool _is_field_func
 flag to store the nature of field function More...
 
bool _is_shape_parameter
 
bool _is_topology_parameter
 
std::set< const MAST::FunctionBase * > _functions
 set of functions that this function depends on More...
 

Detailed Description

This provides a wrapper FieldFunction compatible class that interpolates the solution using libMesh's MeshFunction class.

Definition at line 44 of file mesh_field_function.h.

Constructor & Destructor Documentation

MAST::MeshFieldFunction::MeshFieldFunction ( MAST::SystemInitialization sys,
const std::string &  nm 
)

constructor

Definition at line 30 of file mesh_field_function.cpp.

MAST::MeshFieldFunction::MeshFieldFunction ( libMesh::System &  sys,
const std::string &  nm 
)

constructor

Definition at line 45 of file mesh_field_function.cpp.

MAST::MeshFieldFunction::~MeshFieldFunction ( )
virtual

destructor

Definition at line 60 of file mesh_field_function.cpp.

Here is the call graph for this function:

Member Function Documentation

void MAST::MeshFieldFunction::clear ( )

clear the solution

Definition at line 247 of file mesh_field_function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void MAST::MeshFieldFunction::clear_element_quadrature_point_solution ( )
virtual

clears the quadrature point solution provided by the corresponding set method above.

Definition at line 287 of file mesh_field_function.cpp.

Here is the caller graph for this function:

void MAST::MeshFieldFunction::derivative ( const MAST::FunctionBase f,
const libMesh::Point &  p,
const Real  t,
RealVectorX v 
) const
virtual

calculates the value of the function at the specified point, p, and time, t, and returns it in v.

Reimplemented from MAST::FieldFunction< RealVectorX >.

Definition at line 173 of file mesh_field_function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

libMesh::MeshFunction& MAST::MeshFieldFunction::get_function ( )
inline
Returns
a reference to the libMesh mesh function

Definition at line 116 of file mesh_field_function.h.

Here is the caller graph for this function:

libMesh::MeshFunction& MAST::MeshFieldFunction::get_perturbed_function ( )
inline
Returns
a reference to the libMesh mesh function for the perturbation in solution

Definition at line 126 of file mesh_field_function.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void MAST::MeshFieldFunction::gradient ( const libMesh::Point &  p,
const Real  t,
RealMatrixX g 
) const
virtual

calculates the gradient of value of the function at the specified point, p, and time, t, and returns it in g.

g(i,j) = dv(i)/dx(j)

Definition at line 105 of file mesh_field_function.cpp.

Here is the caller graph for this function:

void MAST::MeshFieldFunction::init ( const libMesh::NumericVector< Real > &  sol,
const libMesh::NumericVector< Real > *  dsol = nullptr 
)

initializes the data structures to perform the interpolation function of sol.

If dsol is provided, then it is used as the perturbation of sol.

Definition at line 188 of file mesh_field_function.cpp.

Here is the caller graph for this function:

void MAST::MeshFieldFunction::operator() ( const libMesh::Point &  p,
const Real  t,
RealVectorX v 
) const
virtual

calculates the value of the function at the specified point, p, and time, t, and returns it in v.

Reimplemented from MAST::FieldFunction< RealVectorX >.

Definition at line 72 of file mesh_field_function.cpp.

void MAST::MeshFieldFunction::perturbation ( const libMesh::Point &  p,
const Real  t,
RealVectorX v 
) const
virtual

calculates the value of perturbation in the function at the specified point, p, and time, t, and returns it in v.

Reimplemented from MAST::FieldFunction< RealVectorX >.

Definition at line 139 of file mesh_field_function.cpp.

Here is the caller graph for this function:

void MAST::MeshFieldFunction::set_element_quadrature_point_solution ( RealVectorX sol)
virtual

When a mesh field function is attached to an assembly routine during system assembly, then the current solution can be provided by the element quadrature point update.

This method allows the element to provide the solution and in turn override the mesh function evaluation.

Definition at line 277 of file mesh_field_function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

libMesh::NumericVector<Real> * MAST::MeshFieldFunction::_dsol
protected

Definition at line 177 of file mesh_field_function.h.

libMesh::MeshFunction* MAST::MeshFieldFunction::_function
protected

the MeshFunction object that performs the interpolation

Definition at line 182 of file mesh_field_function.h.

libMesh::MeshFunction * MAST::MeshFieldFunction::_perturbed_function
protected

Definition at line 182 of file mesh_field_function.h.

RealVectorX MAST::MeshFieldFunction::_qp_sol
protected

quadrature point solution of the element

Definition at line 167 of file mesh_field_function.h.

libMesh::NumericVector<Real>* MAST::MeshFieldFunction::_sol
protected

current solution that is going to be interpolated

Definition at line 177 of file mesh_field_function.h.

libMesh::System* MAST::MeshFieldFunction::_sys
protected

current system for which solution is to be interpolated

Definition at line 172 of file mesh_field_function.h.

bool MAST::MeshFieldFunction::_use_qp_sol
protected

flag is set to true when the quadrature point solution is provided by an element

Definition at line 161 of file mesh_field_function.h.


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