29 #include "libmesh/dof_map.h" 30 #include "libmesh/dirichlet_boundaries.h" 31 #include "libmesh/fe_interface.h" 32 #include "libmesh/dirichlet_boundaries.h" 33 #include "libmesh/elem.h" 34 #include "libmesh/boundary_info.h" 49 std::pair<MAST::SideBCMapType::const_iterator, MAST::SideBCMapType::const_iterator> it =
52 for ( ; it.first != it.second; it.first++)
53 libmesh_assert(it.first->second != &load);
56 _side_bc_map.insert(MAST::SideBCMapType::value_type(bid, &load));
65 std::pair<MAST::SideBCMapType::const_iterator, MAST::SideBCMapType::const_iterator> it =
68 for ( ; it.first != it.second; it.first++)
69 if (it.first->second == &load) {
85 _dirichlet_bc_map.insert(MAST::DirichletBCMapType::value_type(bid, &load)).second;
87 libmesh_assert(insert_success);
95 const unsigned int var) {
97 std::map<libMesh::subdomain_id_type, std::vector<unsigned int> >::iterator
102 (std::pair<libMesh::subdomain_id_type, std::vector<unsigned int> >
103 (sid, std::vector<unsigned int>())).first;
106 it->second.push_back(var);
114 std::pair<MAST::VolumeBCMapType::iterator, MAST::VolumeBCMapType::iterator> it =
117 for ( ; it.first != it.second; it.first++)
118 libmesh_assert(it.first->second != &load);
120 _vol_bc_map.insert(MAST::VolumeBCMapType::value_type(sid, &load));
127 std::pair<MAST::VolumeBCMapType::iterator, MAST::VolumeBCMapType::iterator> it =
130 for ( ; it.first != it.second; it.first++) {
131 if (it.first->second == &load) {
155 std::pair<MAST::VolumeBCMapType::iterator, MAST::VolumeBCMapType::iterator> it =
158 for ( ; it.first != it.second; it.first++)
159 if (it.first->second == &load) {
165 libmesh_assert(
false);
175 MAST::PropertyCardMapType::const_iterator elem_p_it =
_element_property.find(sid);
186 MAST::PropertyCardMapType::const_iterator
190 return *elem_p_it->second;
198 MAST::PropertyCardMapType::const_iterator
202 return *elem_p_it->second;
209 MAST::PropertyCardMapType::const_iterator
213 return *elem_p_it->second;
228 sys.get_dof_map().add_dirichlet_boundary(it->second->dirichlet_boundary());
243 sys.get_dof_map().remove_dirichlet_boundary(it->second->dirichlet_boundary());
252 std::set<unsigned int>& dof_ids)
const {
258 std::map<libMesh::boundary_id_type, std::vector<unsigned int> >
259 constrained_vars_map;
267 libMesh::DirichletBoundary& dirichlet_b = it->second->dirichlet_boundary();
268 sys.get_dof_map().add_dirichlet_boundary(dirichlet_b);
269 constrained_vars_map[it->first] = dirichlet_b.variables;
277 const libMesh::MeshBase& mesh = sys.get_mesh();
280 const unsigned int dim = mesh.mesh_dimension();
284 libMesh::FEType fe_type = sys.get_dof_map().variable_type(0);
286 const libMesh::DofMap& dof_map = sys.get_dof_map();
288 libMesh::MeshBase::const_element_iterator
289 el = mesh.active_local_elements_begin(),
290 end_el = mesh.active_local_elements_end();
292 for ( ; el != end_el; ++el) {
293 const libMesh::Elem* elem = *el;
296 std::map<libMesh::subdomain_id_type, std::vector<unsigned int> >::const_iterator
302 for (
unsigned int i=0; i<it->second.size(); i++) {
304 std::vector<libMesh::dof_id_type> dof_indices;
305 dof_map.dof_indices (*el, dof_indices, it->second[i]);
307 for(
unsigned int ii=0; ii<dof_indices.size(); ii++)
308 dof_ids.insert(dof_indices[ii]);
315 for (
unsigned int s=0; s<elem->n_sides(); s++)
316 if ((*el)->neighbor_ptr(s) ==
nullptr &&
317 mesh.boundary_info->n_boundary_ids(elem, s)) {
319 std::vector<libMesh::boundary_id_type> bc_ids;
320 mesh.boundary_info->boundary_ids(elem, s, bc_ids);
322 for (
unsigned int i_bid=0; i_bid<bc_ids.size(); i_bid++)
323 if (constrained_vars_map.count(bc_ids[i_bid])) {
325 const std::vector<unsigned int>&
326 vars = constrained_vars_map[bc_ids[i_bid]];
330 for (
unsigned int i_var=0; i_var<vars.size(); i_var++) {
332 std::vector<libMesh::dof_id_type> dof_indices;
333 dof_map.dof_indices (*el, dof_indices, vars[i_var]);
336 std::vector<unsigned int> side_dofs;
337 libMesh::FEInterface::dofs_on_side(*el,
343 for(
unsigned int ii=0; ii<side_dofs.size(); ii++)
344 dof_ids.insert(dof_indices[side_dofs[ii]]);
353 libMesh::DofConstraints::const_iterator
354 constraint_it = dof_map.constraint_rows_begin(),
355 constraint_end = dof_map.constraint_rows_end();
357 for ( ; constraint_it != constraint_end; constraint_it++) {
360 if (!constraint_it->second.size())
361 dof_ids.insert(constraint_it->first);
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
void clear_volume_load(libMesh::subdomain_id_type sid, MAST::BoundaryConditionBase &load)
clear the specified volume load from the applied loads
const MAST::ElementPropertyCardBase & get_property_card(const libMesh::Elem &elem) const
get property card for the specified element
virtual const libMesh::Elem & get_reference_elem() const
This class implements a system for solution of nonlinear systems.
MAST::VolumeBCMapType _vol_bc_map
volume boundary condition map of boundary id and load
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
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
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...
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.
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
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
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
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