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-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__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 
101  void add_dirichlet_bc(libMesh::boundary_id_type bid,
103 
108  return _side_bc_map;
109  }
110 
111 
116  return _side_bc_map;
117  }
118 
123  void add_volume_load(libMesh::subdomain_id_type bid,
125 
126 
131 
132 
137  return _vol_bc_map;
138  }
139 
144  return _vol_bc_map;
145  }
146 
147 
152  return _point_loads;
153  }
154 
159  return _point_loads;
160  }
161 
162 
163 
167  void constrain_subdomain_dofs_for_var(const libMesh::subdomain_id_type sid,
168  const unsigned int var);
169 
170 
175 
176 
181 
182 
187  void get_system_dirichlet_bc_dofs(libMesh::System& sys,
188  std::set<unsigned int>& dof_ids) const;
189 
193  void set_property_for_subdomain(const libMesh::subdomain_id_type sid,
194  const MAST::ElementPropertyCardBase& prop);
195 
199  const MAST::ElementPropertyCardBase& get_property_card(const libMesh::Elem& elem) const;
200 
205 
209  const MAST::ElementPropertyCardBase& get_property_card(const unsigned int sid) const;
210 
211 
212 
213  protected:
214 
218  libMesh::EquationSystems& _eq_systems;
219 
224 
229 
234 
235 
239  std::map<libMesh::subdomain_id_type, std::vector<unsigned int> > _subdomain_var_constraint;
240 
245 
250  };
251 
252 }
253 
254 
255 #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()
const MAST::VolumeBCMapType & volume_loads() const
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
std::map< libMesh::boundary_id_type, MAST::DirichletBoundaryCondition * > DirichletBCMapType
This class implements a system for solution of nonlinear systems.
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::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
void init_system_dirichlet_bc(MAST::NonlinearSystem &sys) const
initializes the system for dirichlet boundary conditions
std::map< libMesh::subdomain_id_type, const MAST::ElementPropertyCardBase * > PropertyCardMapType
virtual ~PhysicsDisciplineBase()
virtual destructor
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)
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...
MAST::PointLoadSetType & point_loads()
void constrain_subdomain_dofs_for_var(const libMesh::subdomain_id_type sid, const unsigned int var)
constrain dofs on a subdomain to zero
const MAST::PointLoadSetType & point_loads() const
libMesh::EquationSystems & _eq_systems
libMesh::System for which analysis is to be performed
const MAST::ElementPropertyCardBase & get_property_card(const libMesh::Elem &elem) const
get property card for the specified element
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
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
void clear_system_dirichlet_bc(MAST::NonlinearSystem &sys) const
clears the system dirichlet boundary conditions
const MAST::SideBCMapType & side_loads() const