MAST
material_patch.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_material_patch_h__
21 #define __mast_material_patch_h__
22 
23 // C++ includes
24 #include <vector>
25 
26 // MAST includes
27 #include "base/mast_data_types.h"
28 
29 // libMesh includes
30 #include "libmesh/elem.h"
31 
32 
33 namespace MAST {
34 
35  // Forward declerations
36  template <typename ValType> class FieldFunction;
37 
48  class MaterialPatch {
49 
50  public:
51  MaterialPatch();
52 
53  virtual ~MaterialPatch();
54 
58  void init(const libMesh::Elem& elem,
59  const libMesh::Node& node,
60  const MAST::FieldFunction<Real>& phi,
61  const Real t);
62 
63  void clear();
64 
65  const std::set<const libMesh::Elem*>&
67 
68  libmesh_assert(_initialized);
69 
70  return _elems_to_factor;
71  }
72 
73  protected:
74 
75 
76  bool _quad4_material_levels(const libMesh::Elem& elem,
77  const libMesh::Node& node,
78  const std::set<const libMesh::Elem*>& elem_neighbors,
79  const MAST::FieldFunction<Real>& phi,
80  const Real t);
81 
83 
84  std::set<const libMesh::Elem*> _elems_to_factor;
85  };
86 
87 }
88 
89 #endif //__mast_material_patch_h__
void init(const libMesh::Elem &elem, const libMesh::Node &node, const MAST::FieldFunction< Real > &phi, const Real t)
initialize the patch around node of elem.
const std::set< const libMesh::Elem * > & get_elems_to_factor() const
libMesh::Real Real
bool _quad4_material_levels(const libMesh::Elem &elem, const libMesh::Node &node, const std::set< const libMesh::Elem * > &elem_neighbors, const MAST::FieldFunction< Real > &phi, const Real t)
A patch is defines as the set of elements sharing a node.
std::set< const libMesh::Elem * > _elems_to_factor