fe_compute_data.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 
19 
20 namespace libMesh
21 {
22 
23 
24 
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 }
35 
36 
37 
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 }
71 
72 
73 } // namespace libMesh
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