libMesh
Public Member Functions | Public Attributes | Private Attributes | List of all members
libMesh::FEComputeData Class Reference

class FEComputeData hides arbitrary data to be passed to and from children of FEBase through the FEInterface::compute_data() method. More...

#include <fe_compute_data.h>

Public Member Functions

 FEComputeData (const EquationSystems &es, const Point &pin)
 Constructor. More...
 
void clear ()
 Clears the output data completely. More...
 
void init ()
 Inits the output data to default values, provided the fields are correctly resized. More...
 
void enable_derivative ()
 Enable the computation of shape gradients (dshape). More...
 
void disable_derivative ()
 Disable the computation of shape gradients (dshape). More...
 
bool need_derivative ()
 Check whether derivatives should be computed or not. More...
 

Public Attributes

const EquationSystemsequation_systems
 Const reference to the EquationSystems object that contains simulation-specific data. More...
 
const Pointp
 Holds the point where the data are to be computed. More...
 
std::vector< Numbershape
 Storage for the computed shape function values. More...
 
std::vector< Gradientdshape
 Storage for the computed shape derivative values. More...
 
std::vector< std::vector< Real > > local_transform
 Storage for local to global mapping at p. More...
 
Real phase
 Storage for the computed phase lag. More...
 
Real speed
 The wave speed. More...
 
Number frequency
 The frequency to evaluate shape functions including the wave number depending terms. More...
 

Private Attributes

bool _need_dshape
 variable indicating whether the shape-derivative should be computed or not. More...
 

Detailed Description

class FEComputeData hides arbitrary data to be passed to and from children of FEBase through the FEInterface::compute_data() method.

This enables the efficient computation of data on the finite element level, while maintaining library integrity.

Author
Daniel Dreyer
Date
2003

Helper class used with FEInterface::compute_data().

Definition at line 51 of file fe_compute_data.h.

Constructor & Destructor Documentation

◆ FEComputeData()

libMesh::FEComputeData::FEComputeData ( const EquationSystems es,
const Point pin 
)
inline

Constructor.

Takes the required input data and clears the output data using clear().

Definition at line 58 of file fe_compute_data.h.

59  :
60  equation_systems(es),
61  p(pin),
62  _need_dshape(false)
63  {
64  this->clear();
65  }

References clear().

Member Function Documentation

◆ clear()

void libMesh::FEComputeData::clear ( )

Clears the output data completely.

Definition at line 25 of file fe_compute_data.C.

26 {
27  this->shape.clear();
28  this->dshape.clear();
29  this->local_transform.clear();
30 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
31  this->phase = 0.;
32  this->speed = 1.;
33  this->frequency = 1.;
34 
35 #endif
36 }

References dshape, frequency, local_transform, phase, shape, and speed.

Referenced by FEComputeData().

◆ disable_derivative()

void libMesh::FEComputeData::disable_derivative ( )
inline

Disable the computation of shape gradients (dshape).

Default is disabled.

Definition at line 137 of file fe_compute_data.h.

138  {_need_dshape=false; }

References _need_dshape.

◆ enable_derivative()

void libMesh::FEComputeData::enable_derivative ( )

Enable the computation of shape gradients (dshape).

Definition at line 75 of file fe_compute_data.C.

76 {
77  _need_dshape=true;
78  if (!(this->dshape.empty()))
79  std::fill (this->dshape.begin(), this->dshape.end(), 0);
80 }

References _need_dshape, and dshape.

Referenced by libMesh::System::point_gradient().

◆ init()

void libMesh::FEComputeData::init ( )

Inits the output data to default values, provided the fields are correctly resized.

Definition at line 40 of file fe_compute_data.C.

41 {
42  if (!(this->shape.empty()))
43  std::fill (this->shape.begin(), this->shape.end(), 0.);
44 
45 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
47  this->speed = this->equation_systems.parameters.get<Real>("speed");
48 
49  libmesh_assert_not_equal_to(this->speed, 0);
50 
51  if (equation_systems.parameters.have_parameter<Number>("current frequency"))
52  this->frequency = this->equation_systems.parameters.get<Number>("current frequency");
53 
54 #if LIBMESH_USE_COMPLEX_NUMBERS
55  else if (equation_systems.parameters.have_parameter<Real>("current frequency"))
56  {
57  // please use the type Number instead.
58  libmesh_deprecated();
59  this->frequency = static_cast<Number> (this->equation_systems.parameters.get<Real>("current frequency"));
60  }
61 #endif
62 
63  // ensure that the wavenumber k=2. * libMesh::pi * this->frequency / this->speed
64  // in src/fe/inf_fe_static.C: 310
65  // is well-defined. 0 as well as NaN will lead to problems here.
66  libmesh_assert_not_equal_to(this->frequency, 0.);
67 
68  this->phase = 0.;
69 
70 #endif //LIBMESH_ENABLE_INFINITE_ELEMENTS
71 
72 }

References equation_systems, frequency, libMesh::Parameters::get(), libMesh::Parameters::have_parameter(), libMesh::EquationSystems::parameters, phase, libMesh::Real, shape, and speed.

◆ need_derivative()

bool libMesh::FEComputeData::need_derivative ( )
inline

Check whether derivatives should be computed or not.

Definition at line 143 of file fe_compute_data.h.

144  {return _need_dshape; }

References _need_dshape.

Member Data Documentation

◆ _need_dshape

bool libMesh::FEComputeData::_need_dshape
private

variable indicating whether the shape-derivative should be computed or not.

Default is false to save time and be compatible with elements where derivatives are not implemented/ cannot be computed.

Definition at line 152 of file fe_compute_data.h.

Referenced by disable_derivative(), enable_derivative(), and need_derivative().

◆ dshape

std::vector<Gradient> libMesh::FEComputeData::dshape

Storage for the computed shape derivative values.

Definition at line 86 of file fe_compute_data.h.

Referenced by clear(), enable_derivative(), and libMesh::System::point_gradient().

◆ equation_systems

const EquationSystems& libMesh::FEComputeData::equation_systems

Const reference to the EquationSystems object that contains simulation-specific data.

Definition at line 71 of file fe_compute_data.h.

Referenced by init().

◆ frequency

Number libMesh::FEComputeData::frequency

The frequency to evaluate shape functions including the wave number depending terms.

Use imaginary contributions for exponential damping

Definition at line 114 of file fe_compute_data.h.

Referenced by clear(), and init().

◆ local_transform

std::vector<std::vector<Real> > libMesh::FEComputeData::local_transform

Storage for local to global mapping at p.

This is needed when the gradient in physical coordinates is of interest. FIXME: What kind of type should one use for it? The matrix-class don't look as if they were made for it and neither are the TensorTool-members.

Definition at line 96 of file fe_compute_data.h.

Referenced by clear(), and libMesh::System::point_gradient().

◆ p

const Point& libMesh::FEComputeData::p

Holds the point where the data are to be computed.

Definition at line 76 of file fe_compute_data.h.

◆ phase

Real libMesh::FEComputeData::phase

Storage for the computed phase lag.

Definition at line 102 of file fe_compute_data.h.

Referenced by clear(), and init().

◆ shape

std::vector<Number> libMesh::FEComputeData::shape

Storage for the computed shape function values.

Definition at line 81 of file fe_compute_data.h.

Referenced by clear(), and init().

◆ speed

Real libMesh::FEComputeData::speed

The wave speed.

Definition at line 107 of file fe_compute_data.h.

Referenced by clear(), and init().


The documentation for this class was generated from the following files:
libMesh::FEComputeData::p
const Point & p
Holds the point where the data are to be computed.
Definition: fe_compute_data.h:76
libMesh::Number
Real Number
Definition: libmesh_common.h:195
libMesh::FEComputeData::phase
Real phase
Storage for the computed phase lag.
Definition: fe_compute_data.h:102
libMesh::FEComputeData::frequency
Number frequency
The frequency to evaluate shape functions including the wave number depending terms.
Definition: fe_compute_data.h:114
libMesh::Parameters::have_parameter
bool have_parameter(const std::string &) const
Definition: parameters.h:402
libMesh::FEComputeData::equation_systems
const EquationSystems & equation_systems
Const reference to the EquationSystems object that contains simulation-specific data.
Definition: fe_compute_data.h:71
libMesh::FEComputeData::speed
Real speed
The wave speed.
Definition: fe_compute_data.h:107
libMesh::FEComputeData::clear
void clear()
Clears the output data completely.
Definition: fe_compute_data.C:25
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::FEComputeData::shape
std::vector< Number > shape
Storage for the computed shape function values.
Definition: fe_compute_data.h:81
libMesh::FEComputeData::_need_dshape
bool _need_dshape
variable indicating whether the shape-derivative should be computed or not.
Definition: fe_compute_data.h:152
libMesh::Parameters::get
const T & get(const std::string &) const
Definition: parameters.h:421
libMesh::FEComputeData::local_transform
std::vector< std::vector< Real > > local_transform
Storage for local to global mapping at p.
Definition: fe_compute_data.h:96
libMesh::FEComputeData::dshape
std::vector< Gradient > dshape
Storage for the computed shape derivative values.
Definition: fe_compute_data.h:86
libMesh::EquationSystems::parameters
Parameters parameters
Data structure holding arbitrary parameters.
Definition: equation_systems.h:557