MAST
elem_base.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
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 
84  const MAST::GeomElem& elem);
85 
86 
90  virtual ~ElementBase();
91 
92 
97  return _system;
98  }
99 
104  return _assembly;
105  }
106 
107 
112 
113 
117  const MAST::GeomElem& elem() const {
118  return _elem;
119  }
120 
121 
126  const RealVectorX& sol(bool if_sens = false) const;
127 
128 
133  virtual void set_solution(const RealVectorX& vec,
134  bool if_sens = false);
135 
136 
142  virtual void set_perturbed_solution(const RealVectorX& vec,
143  bool if_sens = false);
144 
145 
151  virtual void set_complex_solution(const ComplexVectorX& vec,
152  bool if_sens = false);
153 
154 
159  virtual void set_velocity(const RealVectorX& vec,
160  bool if_sens = false);
161 
162 
167  virtual void set_perturbed_velocity(const RealVectorX& vec,
168  bool if_sens = false);
169 
170 
171 
176  virtual void set_acceleration(const RealVectorX& vec,
177  bool if_sens = false);
178 
179 
184  virtual void set_perturbed_acceleration(const RealVectorX& vec,
185  bool if_sens = false);
186 
187 
188 
193 
194 
200 
201 
202  protected:
203 
204 
209 
214 
219 
227 
228 
232  const Real& _time;
233 
234 
239 
240 
245 
246 
251 
252 
257 
258 
263 
264 
269 
274 
275 
280 
281 
286 
287 
292 
293 
298 
299 
304 
305 
310 
311 
316 
317  };
318 }
319 
320 
321 #endif // __mast__elem_base__
MAST::FunctionBase * _active_sol_function
pointer to the active solution mesh field function.
Definition: elem_base.h:226
const RealVectorX & sol(bool if_sens=false) const
Definition: elem_base.cpp:53
RealVectorX _accel
local acceleration
Definition: elem_base.h:297
const MAST::GeomElem & _elem
geometric element for which the computations are performed
Definition: elem_base.h:218
This class implements a system for solution of nonlinear systems.
MAST::NonlinearSystem & system()
Definition: elem_base.cpp:45
RealVectorX _delta_vel
local velocity
Definition: elem_base.h:285
ElementBase(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem)
The default constructor.
Definition: elem_base.cpp:27
RealVectorX _delta_sol_sens
local solution used for linearized analysis
Definition: elem_base.h:268
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:100
RealVectorX _accel_sens
local acceleration
Definition: elem_base.h:303
RealVectorX _delta_accel
local acceleration
Definition: elem_base.h:309
RealVectorX _vel_sens
local velocity
Definition: elem_base.h:279
RealVectorX _delta_accel_sens
local acceleration
Definition: elem_base.h:315
ComplexVectorX _complex_sol
local solution used for frequency domain analysis
Definition: elem_base.h:250
void detach_active_solution_function()
Detaches the function object that may have been attached to the element.
Definition: elem_base.cpp:158
const MAST::GeomElem & elem() const
Definition: elem_base.h:117
Matrix< Complex, Dynamic, 1 > ComplexVectorX
RealVectorX _vel
local velocity
Definition: elem_base.h:273
libMesh::Real Real
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
Definition: elem_base.h:208
MAST::AssemblyBase & assembly()
Definition: elem_base.h:103
MAST::SystemInitialization & system_initialization()
Definition: elem_base.h:96
RealVectorX _delta_sol
local solution used for linearized analysis
Definition: elem_base.h:262
virtual ~ElementBase()
Default virtual destructor.
Definition: elem_base.cpp:39
ComplexVectorX _complex_sol_sens
local solution used for frequency domain analysis
Definition: elem_base.h:256
Matrix< Real, Dynamic, 1 > RealVectorX
RealVectorX _sol_sens
local solution sensitivity
Definition: elem_base.h:244
RealVectorX _sol
local solution
Definition: elem_base.h:238
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:74
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
MAST::AssemblyBase & _assembly
Assembly object.
Definition: elem_base.h:213
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:62
void attach_active_solution_function(MAST::FunctionBase &f)
Attaches the function that represents the system solution.
Definition: elem_base.cpp:148
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:112
const Real & _time
time for which system is being assembled
Definition: elem_base.h:232
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:136
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:86
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:124
RealVectorX _delta_vel_sens
local velocity
Definition: elem_base.h:291
This is the base class for elements that implement calculation of finite element quantities over the ...
Definition: elem_base.h:72