MAST
level_set_transient_assembly.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
25 #include "base/assembly_base.h"
26 
27 
31 
32 }
33 
34 
35 
36 
39 
40 }
41 
42 
43 void
46 
47  libmesh_assert(_physics_elem);
48 
50  set_reference_solution_for_initialization(sol);
51 }
52 
53 
54 
55 void
57 elem_calculations(bool if_jac,
58  RealVectorX& f_m,
59  RealVectorX& f_x,
60  RealMatrixX& f_m_jac_xdot,
61  RealMatrixX& f_m_jac,
62  RealMatrixX& f_x_jac) {
63 
64  libmesh_assert(_physics_elem);
65 
67  dynamic_cast<MAST::LevelSetElementBase&>(*_physics_elem);
68 
69  f_m.setZero();
70  f_x.setZero();
71  f_m_jac_xdot.setZero();
72  f_m_jac.setZero();
73  f_x_jac.setZero();
74 
75  // assembly of the flux terms
76  e.internal_residual(if_jac, f_x, f_x_jac);
77  e.side_external_residual(if_jac, f_x, f_x_jac, _discipline->side_loads());
78  e.volume_external_residual(if_jac, f_x, f_x_jac, _discipline->volume_loads());
79 
80  //assembly of the capacitance term
81  e.velocity_residual(if_jac, f_m, f_m_jac_xdot, f_m_jac);
82 }
83 
84 
85 
86 void
89 
90  libmesh_error(); // should not get called
91 }
92 
93 
94 
95 void
98  RealVectorX& vec) {
99 
100  libmesh_error(); // should not get called
101 
102 }
103 
104 
105 void
108 
109  libmesh_error(); // should not get called
110 }
111 
112 
113 void
116  RealVectorX& f_m,
117  RealVectorX& f_x) {
118  libmesh_error(); // should not get called
119 }
120 
121 
122 void
124 init(const MAST::GeomElem& elem) {
125 
126  libmesh_assert(!_physics_elem);
127  libmesh_assert(_system);
128  libmesh_assert(_assembly);
129 
131  discipline = dynamic_cast<const MAST::LevelSetDiscipline&>(*_discipline);
132 
134  *e = new MAST::LevelSetElementBase(*_system, *_assembly, elem);
135 
136  if (discipline.has_velocity_function())
139 
140  _physics_elem = e;
141 }
142 
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
internal force contribution to system residual
const MAST::VolumeBCMapType & volume_loads() const
bool if_level_set_propagation() const
virtual bool velocity_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac)
inertial force contribution to system residual
virtual ~LevelSetTransientAssemblyElemOperations()
destructor resets the association of this assembly object with the system
MAST::PhysicsDisciplineBase * _discipline
virtual void elem_calculations(bool if_jac, RealVectorX &f_m, RealVectorX &f_x, RealMatrixX &f_m_jac_x_dot, RealMatrixX &f_m_jac, RealMatrixX &f_x_jac)
performs the element calculations over elem, and returns the element vector and matrix quantities in ...
virtual void init(const MAST::GeomElem &elem)
initializes the object for the geometric element elem.
void set_propagation_mode(bool f)
This can operate in one of two modes: propagation of level set given Vn, or reinitialization of level...
Matrix< Real, Dynamic, Dynamic > RealMatrixX
LevelSetTransientAssemblyElemOperations()
constructor associates this assembly object with the system
Matrix< Real, Dynamic, 1 > RealVectorX
void set_velocity_function(const MAST::FieldFunction< Real > &vel)
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
void set_elem_reference_solution(const RealVectorX &sol)
set element reference solution for reinitialization
const MAST::FieldFunction< Real > & get_velocity_function() const
const MAST::SideBCMapType & side_loads() const
virtual void elem_second_derivative_dot_solution_assembly(RealMatrixX &mat)
calculates over elem, and returns the matrix in vec .
virtual void linearized_jacobian_solution_product(RealVectorX &f)
Calculates the product of Jacobian-solution, and Jacobian-velocity over the element for a system of t...
bool volume_external_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > &bc)
volume external force contribution to system residual
virtual void elem_sensitivity_calculations(const MAST::FunctionBase &f, RealVectorX &vec)
performs the element sensitivity calculations over elem, and returns the element residual sensitivity...
bool side_external_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase * > &bc)
side external force contribution to system residual
MAST::SystemInitialization * _system