MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
elem_base.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __mast__elem_base__
21 #define __mast__elem_base__
22 
23 // C++ includes
24 #include <map>
25 #include <memory>
26 
27 // MAST includes
28 #include "base/mast_data_types.h"
29 
30 // libMesh includes
31 #include "libmesh/elem.h"
32 #include "libmesh/system.h"
33 
34 
35 
36 namespace MAST {
37 
38  // Forward declerations
39  class FunctionBase;
40  class SystemInitialization;
41  class GeomElem;
42  class NonlinearSystem;
43  class FEBase;
44  class AssemblyBase;
45 
72  class ElementBase {
73  public:
74 
83  const MAST::GeomElem& elem);
84 
85 
89  virtual ~ElementBase();
90 
91 
96  return _system;
97  }
98 
99 
104 
105 
109  const MAST::GeomElem& elem() const {
110  return _elem;
111  }
112 
113 
118  const RealVectorX& sol(bool if_sens = false) const;
119 
120 
125  virtual void set_solution(const RealVectorX& vec,
126  bool if_sens = false);
127 
128 
134  virtual void set_perturbed_solution(const RealVectorX& vec,
135  bool if_sens = false);
136 
137 
143  virtual void set_complex_solution(const ComplexVectorX& vec,
144  bool if_sens = false);
145 
146 
151  virtual void set_velocity(const RealVectorX& vec,
152  bool if_sens = false);
153 
154 
159  virtual void set_perturbed_velocity(const RealVectorX& vec,
160  bool if_sens = false);
161 
162 
163 
168  virtual void set_acceleration(const RealVectorX& vec,
169  bool if_sens = false);
170 
171 
176  virtual void set_perturbed_acceleration(const RealVectorX& vec,
177  bool if_sens = false);
178 
179 
180 
185 
186 
192 
193 
194  protected:
195 
196 
201 
206 
214 
215 
219  const Real& _time;
220 
221 
226 
227 
232 
233 
238 
239 
244 
245 
250 
251 
256 
261 
262 
267 
268 
273 
274 
279 
280 
285 
286 
291 
292 
297 
298 
303 
304  };
305 }
306 
307 
308 #endif // __mast__elem_base__
MAST::FunctionBase * _active_sol_function
pointer to the active solution mesh field function.
Definition: elem_base.h:213
RealVectorX _accel
local acceleration
Definition: elem_base.h:284
const MAST::GeomElem & _elem
geometric element for which the computations are performed
Definition: elem_base.h:205
This class implements a system for solution of nonlinear systems.
MAST::NonlinearSystem & system()
Definition: elem_base.cpp:43
RealVectorX _delta_vel
local velocity
Definition: elem_base.h:272
RealVectorX _delta_sol_sens
local solution used for linearized analysis
Definition: elem_base.h:255
virtual void set_velocity(const RealVectorX &vec, bool if_sens=false)
stores vec as velocity for element level calculations, or its sensitivity if if_sens is true...
Definition: elem_base.cpp:98
RealVectorX _accel_sens
local acceleration
Definition: elem_base.h:290
RealVectorX _delta_accel
local acceleration
Definition: elem_base.h:296
const RealVectorX & sol(bool if_sens=false) const
Definition: elem_base.cpp:51
RealVectorX _vel_sens
local velocity
Definition: elem_base.h:266
RealVectorX _delta_accel_sens
local acceleration
Definition: elem_base.h:302
ComplexVectorX _complex_sol
local solution used for frequency domain analysis
Definition: elem_base.h:237
void detach_active_solution_function()
Detaches the function object that may have been attached to the element.
Definition: elem_base.cpp:156
Matrix< Complex, Dynamic, 1 > ComplexVectorX
RealVectorX _vel
local velocity
Definition: elem_base.h:260
ElementBase(MAST::SystemInitialization &sys, const MAST::GeomElem &elem)
The default constructor.
Definition: elem_base.cpp:27
libMesh::Real Real
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
Definition: elem_base.h:200
MAST::SystemInitialization & system_initialization()
Definition: elem_base.h:95
RealVectorX _delta_sol
local solution used for linearized analysis
Definition: elem_base.h:249
virtual ~ElementBase()
Default virtual destructor.
Definition: elem_base.cpp:37
ComplexVectorX _complex_sol_sens
local solution used for frequency domain analysis
Definition: elem_base.h:243
Matrix< Real, Dynamic, 1 > RealVectorX
RealVectorX _sol_sens
local solution sensitivity
Definition: elem_base.h:231
RealVectorX _sol
local solution
Definition: elem_base.h:225
virtual void set_perturbed_solution(const RealVectorX &vec, bool if_sens=false)
This provides the perturbed solution (or its sensitivity if if_sens is true.) for linearized analysis...
Definition: elem_base.cpp:72
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
const MAST::GeomElem & elem() const
Definition: elem_base.h:109
virtual void set_solution(const RealVectorX &vec, bool if_sens=false)
stores vec as solution for element level calculations, or its sensitivity if if_sens is true...
Definition: elem_base.cpp:60
void attach_active_solution_function(MAST::FunctionBase &f)
Attaches the function that represents the system solution.
Definition: elem_base.cpp:146
virtual void set_perturbed_velocity(const RealVectorX &vec, bool if_sens=false)
stores vec as perturbed velocity for element level calculations, or its sensitivity if if_sens is tru...
Definition: elem_base.cpp:110
const Real & _time
time for which system is being assembled
Definition: elem_base.h:219
virtual void set_perturbed_acceleration(const RealVectorX &vec, bool if_sens=false)
stores vec as perturbed acceleration for element level calculations, or its sensitivity if if_sens is...
Definition: elem_base.cpp:134
virtual void set_complex_solution(const ComplexVectorX &vec, bool if_sens=false)
This provides the complex solution (or its sensitivity if if_sens is true.) for frequecy-domain analy...
Definition: elem_base.cpp:84
virtual void set_acceleration(const RealVectorX &vec, bool if_sens=false)
stores vec as acceleration for element level calculations, or its sensitivity if if_sens is true...
Definition: elem_base.cpp:122
RealVectorX _delta_vel_sens
local velocity
Definition: elem_base.h:278
This is the base class for elements that implement calculation of finite element quantities over the ...
Definition: elem_base.h:72