libMesh
fe_compute_data.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 
17 #include "libmesh/fe_compute_data.h"
18 #include "libmesh/equation_systems.h"
19 
20 namespace libMesh
21 {
22 
23 
24 
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 }
37 
38 
39 
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 }
73 
74 
76 {
77  _need_dshape=true;
78  if (!(this->dshape.empty()))
79  std::fill (this->dshape.begin(), this->dshape.end(), 0);
80 }
81 
82 
83 } // namespace libMesh
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
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
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::FEComputeData::init
void init()
Inits the output data to default values, provided the fields are correctly resized.
Definition: fe_compute_data.C:40
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::enable_derivative
void enable_derivative()
Enable the computation of shape gradients (dshape).
Definition: fe_compute_data.C:75
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