libMesh
Public Member Functions | Public 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...
 

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...
 
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...
 

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 50 of file fe_compute_data.h.

Constructor & Destructor Documentation

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

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
Const reference to the EquationSystems object that contains simulation-specific data.
const Point & p
Holds the point where the data are to be computed.
void clear()
Clears the output data completely.

Member Function Documentation

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 #if defined(LIBMESH_ENABLE_INFINITE_ELEMENTS) && !defined(LIBMESH_USE_COMPLEX_NUMBERS)
29  this->phase = 0.;
30  this->speed = 1.;
31 #endif
32 
33 #if defined (LIBMESH_ENABLE_INFINITE_ELEMENTS) && defined(LIBMESH_USE_COMPLEX_NUMBERS)
34  //lets default speed and frequency to 1; 0 leads to troubles with the wavenumber.
35  this->speed = 1.;
36  this->frequency = 1.;
37 
38 #endif
39 }
Real phase
Storage for the computed phase lag.
Real speed
The wave speed.
Number frequency
The frequency to evaluate shape functions including the wave number depending terms.
std::vector< Number > shape
Storage for the computed shape function values.
void libMesh::FEComputeData::init ( )

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

Definition at line 43 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.

Referenced by libMesh::FEInterface::compute_data().

44 {
45  if (!(this->shape.empty()))
46  std::fill (this->shape.begin(), this->shape.end(), 0.);
47 
48 #if defined(LIBMESH_ENABLE_INFINITE_ELEMENTS) && !defined(LIBMESH_USE_COMPLEX_NUMBERS)
49  this->phase = 0.;
50 
52  this->speed = this->equation_systems.parameters.get<Real>("speed");
53 #endif
54 
55 #if defined (LIBMESH_ENABLE_INFINITE_ELEMENTS) && defined(LIBMESH_USE_COMPLEX_NUMBERS)
57  this->speed = this->equation_systems.parameters.get<Real>("speed");
58 
59  if (equation_systems.parameters.have_parameter<Real>("current frequency"))
60  {
61 
62  // please use the type Number instead.
63  libmesh_deprecated();
64  this->frequency = static_cast<Number> (this->equation_systems.parameters.get<Real>("current frequency"));
65  }
66 
67  else if (equation_systems.parameters.have_parameter<Number>("current frequency"))
68 
69  this->frequency = this->equation_systems.parameters.get<Number>("current frequency");
70 
71 #endif
72  // ensure that the wavenumber k=2. * libMesh::pi * this->frequency / this->speed
73  // in src/fe/inf_fe_static.C: 310
74  // is well-defined. 0 as well as NaN will lead to problems here.
75 #if defined(LIBMESH_ENABLE_INFINITE_ELEMENTS) && defined(LIBMESH_USE_COMPLEX_NUMBERS)
76  libmesh_assert_not_equal_to(this->frequency, 0.);
77 #endif
78 #if defined(LIBMESH_ENABLE_INFINITE_ELEMENTS)
79  libmesh_assert_not_equal_to(this->speed, 0);
80 #endif
81 
82 }
const EquationSystems & equation_systems
Const reference to the EquationSystems object that contains simulation-specific data.
Real phase
Storage for the computed phase lag.
const T & get(const std::string &) const
Definition: parameters.h:430
Real speed
The wave speed.
Number frequency
The frequency to evaluate shape functions including the wave number depending terms.
std::vector< Number > shape
Storage for the computed shape function values.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Parameters parameters
Data structure holding arbitrary parameters.
bool have_parameter(const std::string &) const
Definition: parameters.h:411

Member Data Documentation

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().

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 102 of file fe_compute_data.h.

Referenced by clear(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), and init().

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.

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), and libMesh::FEInterface::compute_data().

Real libMesh::FEComputeData::phase

Storage for the computed phase lag.

Definition at line 86 of file fe_compute_data.h.

Referenced by clear(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), and init().

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

The wave speed.

Definition at line 93 of file fe_compute_data.h.

Referenced by clear(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), and init().


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