abaqus_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 #ifndef LIBMESH_ABAQUS_IO_H
20 #define LIBMESH_ABAQUS_IO_H
21 
22 // Local includes
23 #include "libmesh/libmesh_common.h"
24 #include "libmesh/mesh_input.h"
25 
26 // C++ includes
27 #include <fstream>
28 #include <set>
29 
30 namespace libMesh
31 {
32 
40 class AbaqusIO : public MeshInput<MeshBase>
41 {
42 public:
46  explicit
48 
52  virtual ~AbaqusIO ();
53 
57  virtual void read (const std::string & name) override;
58 
67 
68 private:
72  typedef std::map<std::string, std::vector<dof_id_type>> container_t;
73 
79  typedef std::map<std::string, std::vector<std::pair<dof_id_type, unsigned>>> sideset_container_t;
80 
86  void read_nodes(std::string nset_name);
87 
95  void read_elements(std::string upper, std::string elset_name);
96 
104  std::string parse_label(std::string line, std::string label_name) const;
105 
114  bool detect_generated_set(std::string upper) const;
115 
121  void read_ids(std::string set_name, container_t & container);
122 
129  void generate_ids(std::string set_name, container_t & container);
130 
152  void assign_subdomain_ids();
153 
159  void read_sideset(std::string sideset_name, sideset_container_t & container);
160 
168 
173  void assign_sideset_ids();
174 
182 
190  unsigned char max_elem_dimension_seen();
191 
200 
204  std::ifstream _in;
205 
210  std::set<ElemType> _elem_types;
211 
216  // std::map<dof_id_type, dof_id_type> _libmesh_to_abaqus_elem_mapping;
217  std::map<dof_id_type, dof_id_type> _abaqus_to_libmesh_elem_mapping;
218 
227  std::map<dof_id_type, dof_id_type> _abaqus_to_libmesh_node_mapping;
228 
236 };
237 
238 } // namespace
239 
240 #endif // LIBMESH_ABAQUS_IO_H
virtual void read(const std::string &name) override
Definition: abaqus_io.C:205
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
void read_sideset(std::string sideset_name, sideset_container_t &container)
Definition: abaqus_io.C:846
void process_and_discard_comments()
Definition: abaqus_io.C:1132
bool _already_seen_part
Definition: abaqus_io.h:235
std::map< std::string, std::vector< dof_id_type > > container_t
Definition: abaqus_io.h:72
sideset_container_t _sideset_ids
Definition: abaqus_io.h:199
virtual ~AbaqusIO()
Definition: abaqus_io.C:198
void read_ids(std::string set_name, container_t &container)
Definition: abaqus_io.C:764
bool build_sidesets_from_nodesets
Definition: abaqus_io.h:66
void assign_sideset_ids()
Definition: abaqus_io.C:984
void read_nodes(std::string nset_name)
Definition: abaqus_io.C:418
Base class for Mesh.
Definition: mesh_base.h:77
std::map< dof_id_type, dof_id_type > _abaqus_to_libmesh_elem_mapping
Definition: abaqus_io.h:217
void read_elements(std::string upper, std::string elset_name)
Definition: abaqus_io.C:497
std::map< std::string, std::vector< std::pair< dof_id_type, unsigned > > > sideset_container_t
Definition: abaqus_io.h:79
std::string parse_label(std::string line, std::string label_name) const
Definition: abaqus_io.C:702
bool detect_generated_set(std::string upper) const
Definition: abaqus_io.C:747
void generate_ids(std::string set_name, container_t &container)
Definition: abaqus_io.C:809
void assign_subdomain_ids()
Definition: abaqus_io.C:879
void assign_boundary_node_ids()
Definition: abaqus_io.C:948
container_t _nodeset_ids
Definition: abaqus_io.h:197
AbaqusIO(MeshBase &mesh)
Definition: abaqus_io.C:188
std::set< ElemType > _elem_types
Definition: abaqus_io.h:210
std::map< dof_id_type, dof_id_type > _abaqus_to_libmesh_node_mapping
Definition: abaqus_io.h:227
unsigned char max_elem_dimension_seen()
Definition: abaqus_io.C:1175
container_t _elemset_ids
Definition: abaqus_io.h:198
std::ifstream _in
Definition: abaqus_io.h:204