MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
physics_discipline_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__physics_discipline_base__
21 #define __mast__physics_discipline_base__
22 
23 // C++ includes
24 #include <map>
25 
26 // MAST includes
27 #include "base/mast_data_types.h"
28 
29 // libMesh includes
30 #include "libmesh/equation_systems.h"
31 
32 
33 namespace MAST {
34 
35  // Forward declerations
36  class BoundaryConditionBase;
37  class DirichletBoundaryCondition;
38  class PropertyCardBase;
39  class FunctionBase;
40  class FunctionSetBase;
41  class ElementPropertyCardBase;
42  class SystemInitialization;
43  class Parameter;
44  class PointLoadCondition;
45  class NonlinearSystem;
46  class GeomElem;
47 
48 
49  // typedefs
50  typedef std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*> SideBCMapType;
51  typedef std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*> VolumeBCMapType;
52  typedef std::map<libMesh::subdomain_id_type, const MAST::ElementPropertyCardBase*> PropertyCardMapType;
53  typedef std::map<libMesh::boundary_id_type, MAST::DirichletBoundaryCondition*> DirichletBCMapType;
54  typedef std::set<MAST::PointLoadCondition*> PointLoadSetType;
55 
57  public:
58 
59 
60  // Constructor
61  PhysicsDisciplineBase(libMesh::EquationSystems& eq_sys):
62  _eq_systems(eq_sys)
63  { }
64 
69  { }
70 
71 
75  libMesh::EquationSystems& get_equation_systems() {
76  return _eq_systems;
77  }
78 
83  void clear_loads();
84 
88  void clear_volume_load(libMesh::subdomain_id_type sid,
90 
94  void add_side_load(libMesh::boundary_id_type bid,
96 
100  void remove_side_load(libMesh::boundary_id_type bid,
102 
107  void add_dirichlet_bc(libMesh::boundary_id_type bid,
109 
114  return _side_bc_map;
115  }
116 
117 
122  return _side_bc_map;
123  }
124 
129  void add_volume_load(libMesh::subdomain_id_type bid,
131 
136  void remove_volume_load(libMesh::subdomain_id_type bid,
138 
139 
144 
145 
150  return _vol_bc_map;
151  }
152 
157  return _vol_bc_map;
158  }
159 
160 
165  return _point_loads;
166  }
167 
172  return _point_loads;
173  }
174 
175 
176 
180  void constrain_subdomain_dofs_for_var(const libMesh::subdomain_id_type sid,
181  const unsigned int var);
182 
183 
188 
189 
194 
195 
200  void get_system_dirichlet_bc_dofs(libMesh::System& sys,
201  std::set<unsigned int>& dof_ids) const;
202 
206  void set_property_for_subdomain(const libMesh::subdomain_id_type sid,
207  const MAST::ElementPropertyCardBase& prop);
208 
212  const MAST::ElementPropertyCardBase& get_property_card(const libMesh::Elem& elem) const;
213 
218 
222  const MAST::ElementPropertyCardBase& get_property_card(const unsigned int sid) const;
223 
224 
225 
226  protected:
227 
231  libMesh::EquationSystems& _eq_systems;
232 
237 
242 
247 
248 
252  std::map<libMesh::subdomain_id_type, std::vector<unsigned int> > _subdomain_var_constraint;
253 
258 
263  };
264 
265 }
266 
267 
268 #endif // __mast__physics_discipline_base__
void add_volume_load(libMesh::subdomain_id_type bid, MAST::BoundaryConditionBase &load)
adds the specified volume loads for the elements with subdomain tag s_id
MAST::SideBCMapType & side_loads()
void clear_volume_load(libMesh::subdomain_id_type sid, MAST::BoundaryConditionBase &load)
clear the specified volume load from the applied loads
std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > VolumeBCMapType
const MAST::ElementPropertyCardBase & get_property_card(const libMesh::Elem &elem) const
get property card for the specified element
std::map< libMesh::boundary_id_type, MAST::DirichletBoundaryCondition * > DirichletBCMapType
This class implements a system for solution of nonlinear systems.
MAST::VolumeBCMapType _vol_bc_map
volume boundary condition map of boundary id and load
libMesh::EquationSystems & get_equation_systems()
returns a reference to the libMesh::System object
std::map< libMesh::subdomain_id_type, const MAST::ElementPropertyCardBase * > PropertyCardMapType
virtual ~PhysicsDisciplineBase()
virtual destructor
void init_system_dirichlet_bc(MAST::NonlinearSystem &sys) const
initializes the system for dirichlet boundary conditions
void remove_volume_load(libMesh::subdomain_id_type bid, MAST::BoundaryConditionBase &load)
remove the specified volume loads for the elements with subdomain tag s_id
const MAST::PointLoadSetType & point_loads() const
void add_dirichlet_bc(libMesh::boundary_id_type bid, MAST::DirichletBoundaryCondition &load)
adds the specified Dirichlet boundary condition for the boundary with tag b_id
void add_side_load(libMesh::boundary_id_type bid, MAST::BoundaryConditionBase &load)
adds the specified side loads for the boudnary with tag b_id
void clear_loads()
clear the loads and pointer to static solution system for this structural model
std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase * > SideBCMapType
PhysicsDisciplineBase(libMesh::EquationSystems &eq_sys)
void remove_side_load(libMesh::boundary_id_type bid, MAST::BoundaryConditionBase &load)
remove the specified side loads for the boudnary with tag b_id
std::map< libMesh::subdomain_id_type, std::vector< unsigned int > > _subdomain_var_constraint
variables constrained on subdomain
This class allows for the specification of load associated with specified nodes in a user-provided se...
const MAST::SideBCMapType & side_loads() const
void get_system_dirichlet_bc_dofs(libMesh::System &sys, std::set< unsigned int > &dof_ids) const
Prepares a list of the constrained dofs for system sys and returns in dof_ids.
MAST::PointLoadSetType & point_loads()
void clear_system_dirichlet_bc(MAST::NonlinearSystem &sys) const
clears the system dirichlet boundary conditions
void constrain_subdomain_dofs_for_var(const libMesh::subdomain_id_type sid, const unsigned int var)
constrain dofs on a subdomain to zero
libMesh::EquationSystems & _eq_systems
libMesh::System for which analysis is to be performed
MAST::VolumeBCMapType & volume_loads()
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
Definition: geom_elem.h:59
void add_point_load(MAST::PointLoadCondition &load)
adds the specified point load
const MAST::VolumeBCMapType & volume_loads() const
MAST::DirichletBCMapType _dirichlet_bc_map
Dirichlet boundary condition map of boundary id and load.
void set_property_for_subdomain(const libMesh::subdomain_id_type sid, const MAST::ElementPropertyCardBase &prop)
sets the same property for all elements in the specified subdomain
MAST::PointLoadSetType _point_loads
point loads
std::set< MAST::PointLoadCondition * > PointLoadSetType
MAST::PropertyCardMapType _element_property
map of element property cards for each element
MAST::SideBCMapType _side_bc_map
side boundary condition map of boundary id and load