MAST
assembly_elem_operation.cpp
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 // MAST includes
22 #include "base/elem_base.h"
23 #include "base/assembly_base.h"
24 #include "mesh/fe_base.h"
25 
26 
27 
28 
29 
30 
32 _system (nullptr),
33 _discipline (nullptr),
34 _assembly (nullptr),
35 _physics_elem (nullptr) {
36 
37 }
38 
39 
41 
42  this->clear_elem();
43 }
44 
45 
46 void
50 
51  libmesh_assert_msg(!_discipline && !_system,
52  "Error: Assembly should be cleared before attaching System.");
53 
54  _discipline = &discipline;
55  _system = &system;
56 }
57 
58 
59 
60 void
63 
64  _discipline = nullptr;
65  _system = nullptr;
66 }
67 
68 
69 void
71 
72  libmesh_assert(!_assembly);
73  _assembly = &assembly;
74 }
75 
76 
77 void
79 
80  _assembly = nullptr;
81 }
82 
83 
86 
87  return *_system;
88 }
89 
90 
93 
94  return *_discipline;
95 }
96 
97 
100 
101  libmesh_assert(_assembly);
102  return *_assembly;
103 }
104 
105 
106 
107 void
109 
110  libmesh_assert(_physics_elem);
111 
113 }
114 
115 
116 void
118 
119  libmesh_assert(_physics_elem);
120 
121  _physics_elem->set_solution(sol, true);
122 }
123 
124 
125 
126 void
128 
129  libmesh_assert(_physics_elem);
130 
132 }
133 
134 
135 void
137 
138  libmesh_assert(_physics_elem);
139 
140  _physics_elem->set_velocity(vel, true);
141 }
142 
143 
144 
145 void
147 
148  libmesh_assert(_physics_elem);
149 
151 }
152 
153 
154 void
156 
157  libmesh_assert(_physics_elem);
158 
159  _physics_elem->set_acceleration(accel, true);
160 }
161 
162 
163 void
165 
166  libmesh_assert(_physics_elem);
167 
169 }
170 
171 
172 void
174 
175  libmesh_assert(_physics_elem);
176 
178 }
179 
180 
181 void
183 
184  libmesh_assert(_physics_elem);
185 
187 }
188 
189 
190 void
192 
193  if (_physics_elem)
194  delete _physics_elem;
195 
196  _physics_elem = nullptr;
197 }
virtual void set_elem_perturbed_solution(const RealVectorX &sol)
sets the element perturbed solution
virtual void set_elem_acceleration_sensitivity(const RealVectorX &accel)
sets the element acceleration
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
virtual void set_elem_solution_sensitivity(const RealVectorX &sol)
sets the element solution sensitivity
virtual void set_assembly(MAST::AssemblyBase &assembly)
sets the assembly object
virtual void set_elem_solution(const RealVectorX &sol)
sets the element solution
virtual void clear_discipline_and_system()
clears association with a system to this discipline
MAST::PhysicsDisciplineBase * _discipline
MAST::SystemInitialization & get_system_initialization()
MAST::PhysicsDisciplineBase & get_discipline()
virtual void clear_assembly()
clears the assembly object
virtual MAST::AssemblyBase & get_assembly()
virtual void set_discipline_and_system(MAST::PhysicsDisciplineBase &discipline, MAST::SystemInitialization &system)
attaches a system to this discipline
Matrix< Real, Dynamic, 1 > RealVectorX
virtual void set_elem_perturbed_acceleration(const RealVectorX &accel)
sets the element perturbed acceleration
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
virtual void set_elem_velocity(const RealVectorX &vel)
sets the element velocity
virtual void set_elem_velocity_sensitivity(const RealVectorX &vel)
sets the element velocity sensitivity
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
virtual void clear_elem()
clears the element initialization
virtual void set_elem_perturbed_velocity(const RealVectorX &vel)
sets the element perturbed velocity
virtual void set_elem_acceleration(const RealVectorX &accel)
sets the element acceleration
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
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_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
MAST::SystemInitialization * _system