MAST
structural_system_initialization.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 
21 // MAST includes
23 #include "base/nonlinear_system.h"
24 
25 
26 // libMesh includes
27 #include "libmesh/equation_systems.h"
28 
29 
32  const std::string& prefix,
33  const libMesh::FEType& fe_type):
34 MAST::SystemInitialization(sys, prefix),
35 _stress_output_sys(nullptr) {
36 
37  _vars.resize(6);
38 
39  std::string nm = prefix + "_ux";
40  _vars[0] = sys.add_variable(nm, fe_type);
41 
42  nm = prefix + "_uy";
43  _vars[1] = sys.add_variable(nm, fe_type);
44 
45  nm = prefix + "_uz";
46  _vars[2] = sys.add_variable(nm, fe_type);
47 
48  nm = prefix + "_tx";
49  _vars[3] = sys.add_variable(nm, fe_type);
50 
51  nm = prefix + "_ty";
52  _vars[4] = sys.add_variable(nm, fe_type);
53 
54  nm = prefix + "_tz";
55  _vars[5] = sys.add_variable(nm, fe_type);
56 
57 
58  // now initialize the stress system for output of stress data
60  &(sys.get_equation_systems().add_system<libMesh::ExplicitSystem>("StressOutput"));
61 
62  libMesh::FEType
63  fetype(libMesh::CONSTANT, libMesh::MONOMIAL); // constant value per element
64 
65  _stress_vars.resize(13);
66 
67  _stress_vars[0] = _stress_output_sys->add_variable("epsilon-xx", fetype);
68  _stress_vars[1] = _stress_output_sys->add_variable("epsilon-yy", fetype);
69  _stress_vars[2] = _stress_output_sys->add_variable("epsilon-zz", fetype);
70  _stress_vars[3] = _stress_output_sys->add_variable("epsilon-xy", fetype);
71  _stress_vars[4] = _stress_output_sys->add_variable("epsilon-yz", fetype);
72  _stress_vars[5] = _stress_output_sys->add_variable("epsilon-zx", fetype);
73 
74  _stress_vars[6] = _stress_output_sys->add_variable("sigma-xx", fetype);
75  _stress_vars[7] = _stress_output_sys->add_variable("sigma-yy", fetype);
76  _stress_vars[8] = _stress_output_sys->add_variable("sigma-zz", fetype);
77  _stress_vars[9] = _stress_output_sys->add_variable("sigma-xy", fetype);
78  _stress_vars[10] = _stress_output_sys->add_variable("sigma-yz", fetype);
79  _stress_vars[11] = _stress_output_sys->add_variable("sigma-zx", fetype);
80 
81  _stress_vars[12] = _stress_output_sys->add_variable("sigma-vm", fetype);
82 
83 }
84 
85 
87 
88 }
StructuralSystemInitialization(MAST::NonlinearSystem &sys, const std::string &prefix, const libMesh::FEType &fe_type)
std::vector< unsigned int > _vars
This class implements a system for solution of nonlinear systems.
const libMesh::FEType & fetype(unsigned int i) const