libMesh::FEComputeData Class Reference

Helper class used with FEInterface::compute_data(). More...

#include <fe_compute_data.h>

Public Member Functions

 FEComputeData (const EquationSystems &es, const Point &pin)
 
void clear ()
 
void init ()
 

Public Attributes

const EquationSystemsequation_systems
 
const Pointp
 
std::vector< Numbershape
 
Real phase
 
Real speed
 
Number frequency
 

Detailed Description

Helper class used with FEInterface::compute_data().

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.

  • With special finite elements disabled (like infinite elements), this class wraps the return values of all shape functions from FEInterface::shape() in a std::vector<Number>.
  • With infinite elements enabled, this class returns a vector of physically correct shape functions, both for finite and infinite elements.
Author
Daniel Dreyer
Date
2003

Definition at line 50 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 57 of file fe_compute_data.h.

References clear().

58  :
59  equation_systems(es),
60  p(pin)
61  {
62  this->clear();
63  }
const EquationSystems & equation_systems

Member Function Documentation

◆ clear()

void libMesh::FEComputeData::clear ( )

Clears the output data completely.

Definition at line 25 of file fe_compute_data.C.

References frequency, phase, shape, and speed.

Referenced by FEComputeData().

26 {
27  this->shape.clear();
28 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
29  this->phase = 0.;
30  this->speed = 1.;
31  this->frequency = 1.;
32 
33 #endif
34 }
std::vector< Number > shape

◆ init()

void libMesh::FEComputeData::init ( )

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

Definition at line 38 of file fe_compute_data.C.

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

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

Member Data Documentation

◆ equation_systems

const EquationSystems& libMesh::FEComputeData::equation_systems

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

Definition at line 69 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 98 of file fe_compute_data.h.

Referenced by clear(), and init().

◆ p

const Point& libMesh::FEComputeData::p

Holds the point where the data are to be computed

Definition at line 74 of file fe_compute_data.h.

◆ phase

Real libMesh::FEComputeData::phase

Storage for the computed phase lag

Definition at line 86 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 79 of file fe_compute_data.h.

Referenced by clear(), and init().

◆ speed

Real libMesh::FEComputeData::speed

The wave speed.

Definition at line 91 of file fe_compute_data.h.

Referenced by clear(), and init().


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