Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2025 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 : 25 7769567 : void FEComputeData::clear () 26 : { 27 298803 : this->shape.clear(); 28 298803 : this->dshape.clear(); 29 7470764 : this->local_transform.clear(); 30 : #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 31 716838 : this->phase = 0.; 32 716838 : this->speed = 1.; 33 597606 : this->frequency = 1.; 34 : 35 : #endif 36 7769567 : } 37 : 38 : 39 : 40 7769287 : void FEComputeData::init () 41 : { 42 7769287 : if (!(this->shape.empty())) 43 298795 : std::fill (this->shape.begin(), this->shape.end(), 0.); 44 : 45 : #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 46 716822 : if (equation_systems.parameters.have_parameter<Real>("speed")) 47 0 : this->speed = this->equation_systems.parameters.get<Real>("speed"); 48 : 49 : // ensure that the wavenumber k=2. * libMesh::pi * frequency / speed is well-defined. 50 298795 : libmesh_assert_not_equal_to(this->speed, 0); 51 : 52 716822 : if (equation_systems.parameters.have_parameter<Number>("current frequency")) 53 0 : this->frequency = this->equation_systems.parameters.get<Number>("current frequency"); 54 : 55 : #if LIBMESH_USE_COMPLEX_NUMBERS 56 119232 : else if (equation_systems.parameters.have_parameter<Real>("current frequency")) 57 : { 58 : // please use the type Number instead. 59 : libmesh_deprecated(); 60 0 : this->frequency = static_cast<Number> (this->equation_systems.parameters.get<Real>("current frequency")); 61 : } 62 : #endif 63 : 64 716822 : this->phase = 0.; 65 : 66 : #endif //LIBMESH_ENABLE_INFINITE_ELEMENTS 67 : 68 7769287 : } 69 : 70 : 71 0 : void FEComputeData::enable_derivative () 72 : { 73 0 : _need_dshape=true; 74 0 : if (!(this->dshape.empty())) 75 0 : std::fill (this->dshape.begin(), this->dshape.end(), 0); 76 0 : } 77 : 78 : 79 : } // namespace libMesh