#include <abaqus_io.h>
Public Member Functions | |
AbaqusIO (MeshBase &mesh) | |
virtual | ~AbaqusIO () |
virtual void | read (const std::string &name) override |
Public Attributes | |
bool | build_sidesets_from_nodesets |
Protected Member Functions | |
MeshBase & | mesh () |
void | set_n_partitions (unsigned int n_parts) |
void | skip_comment_lines (std::istream &in, const char comment_start) |
Protected Attributes | |
std::vector< bool > | elems_of_dimension |
Private Types | |
typedef std::map< std::string, std::vector< dof_id_type > > | container_t |
typedef std::map< std::string, std::vector< std::pair< dof_id_type, unsigned > > > | sideset_container_t |
Private Member Functions | |
void | read_nodes (std::string nset_name) |
void | read_elements (std::string upper, std::string elset_name) |
std::string | parse_label (std::string line, std::string label_name) const |
bool | detect_generated_set (std::string upper) const |
void | read_ids (std::string set_name, container_t &container) |
void | generate_ids (std::string set_name, container_t &container) |
void | assign_subdomain_ids () |
void | read_sideset (std::string sideset_name, sideset_container_t &container) |
void | assign_boundary_node_ids () |
void | assign_sideset_ids () |
void | process_and_discard_comments () |
unsigned char | max_elem_dimension_seen () |
Private Attributes | |
container_t | _nodeset_ids |
container_t | _elemset_ids |
sideset_container_t | _sideset_ids |
std::ifstream | _in |
std::set< ElemType > | _elem_types |
std::map< dof_id_type, dof_id_type > | _abaqus_to_libmesh_elem_mapping |
std::map< dof_id_type, dof_id_type > | _abaqus_to_libmesh_node_mapping |
bool | _already_seen_part |
The AbaqusIO class is a preliminary implementation for reading Abaqus mesh files in ASCII format.
Definition at line 40 of file abaqus_io.h.
|
private |
The type of data structure used to store Node and Elemset IDs.
Definition at line 72 of file abaqus_io.h.
|
private |
Type of the data structure for storing the (elem ID, side) pairs defining sidesets. These come from the *Surface sections of the input file.
Definition at line 79 of file abaqus_io.h.
|
explicit |
Constructor. Takes a writable reference to a mesh object.
Definition at line 188 of file abaqus_io.C.
|
virtual |
|
private |
This function assigns boundary IDs to node sets based on the alphabetical order in which the sets are labeled in the Abaqus file. We choose the alphabetical ordering simply because Abaqus does not provide a numerical one within the file.
Definition at line 948 of file abaqus_io.C.
References _abaqus_to_libmesh_node_mapping, _nodeset_ids, libMesh::BoundaryInfo::add_node(), libMesh::MeshBase::get_boundary_info(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::node_ptr(), and libMesh::BoundaryInfo::nodeset_name().
Referenced by read().
|
private |
Called at the end of the read() function, assigns any sideset IDs found when reading the file to the BoundaryInfo object.
Definition at line 984 of file abaqus_io.C.
References _abaqus_to_libmesh_elem_mapping, _elemset_ids, _sideset_ids, libMesh::MeshBase::active_element_ptr_range(), libMesh::BoundaryInfo::add_side(), libMesh::as_range(), libMesh::Elem::dim(), libMesh::MeshBase::elem_ref(), libMesh::Utility::enum_to_string(), libMesh::MeshBase::get_boundary_info(), libMesh::Elem::key(), max_elem_dimension_seen(), libMesh::MeshInput< MT >::mesh(), side, libMesh::BoundaryInfo::sideset_name(), and libMesh::Elem::type().
Referenced by read().
|
private |
This function is called after all the elements have been read and assigns element subdomain IDs.
The IDs are simply chosen in the order in which the elset labels are stored in the map (roughly alphabetically). To make this easy on people who are planning to use Exodus output, we'll assign different geometric elements to different (but related) subdomains, i.e. assuming there are E elemsets:
Elemset 0, Geometric Type 0: ID 0 Elemset 0, Geometric Type 1: ID 0+E ...
Elemset 1, Geometric Type 0: ID 1 Elemset 1, Geometric Type 1: ID 1+E ... Elemset 1, Geometric Type N: ID 1+N*E etc.
Definition at line 879 of file abaqus_io.C.
References _abaqus_to_libmesh_elem_mapping, _elem_types, _elemset_ids, libMesh::Elem::dim(), libMesh::MeshBase::elem_ref(), libMesh::Utility::enum_to_string(), max_elem_dimension_seen(), libMesh::MeshInput< MT >::mesh(), libMesh::Elem::subdomain_id(), libMesh::MeshBase::subdomain_name(), and libMesh::Elem::type().
Referenced by read().
|
private |
true
if the input string is a generated elset or nset, false otherwise.The input string is assumed to already be in all upper case. Generated nsets are assumed to have the following format: *Nset, nset=Set-1, generate
Definition at line 747 of file abaqus_io.C.
Referenced by read().
|
private |
This function handles "generated" nset and elset sections. These are denoted by having the comma-separated "GENERATE" keyword in their definition, e.g. *Nset, nset=Set-1, generate
Definition at line 809 of file abaqus_io.C.
Referenced by read().
|
private |
Only valid after the elements have been read in and the elems_of_dimension array has been populated.
Definition at line 1175 of file abaqus_io.C.
References libMesh::MeshInput< MeshBase >::elems_of_dimension.
Referenced by assign_sideset_ids(), assign_subdomain_ids(), and read().
|
inlineprotectedinherited |
Definition at line 169 of file mesh_input.h.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::VTKIO::cells_to_vtk(), libMesh::TetGenIO::element_in(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::elements_out(), libMesh::UNVIO::groups_in(), libMesh::TetGenIO::node_in(), libMesh::UNVIO::nodes_in(), libMesh::UNVIO::nodes_out(), libMesh::VTKIO::nodes_to_vtk(), libMesh::Nemesis_IO::prepare_to_write_nodal_data(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GMVIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_bcs(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::CheckpointIO::read_nodes(), libMesh::CheckpointIO::read_nodesets(), libMesh::CheckpointIO::read_remote_elem(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::CheckpointIO::read_subdomain_names(), libMesh::TetGenIO::write(), libMesh::Nemesis_IO::write(), libMesh::ExodusII_IO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::Nemesis_IO::write_element_data(), libMesh::ExodusII_IO::write_element_data(), libMesh::UCDIO::write_header(), libMesh::UCDIO::write_implementation(), libMesh::UCDIO::write_interior_elems(), libMesh::GmshIO::write_mesh(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::UCDIO::write_nodes(), libMesh::CheckpointIO::write_nodesets(), libMesh::XdrIO::write_parallel(), libMesh::GmshIO::write_post(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::UCDIO::write_soln(), and libMesh::CheckpointIO::write_subdomain_names().
|
private |
This function parses a label of the form foo=bar from a comma-delimited line of the form ..., foo=bar, ... The input to the function in this case would be foo, the output would be bar
Definition at line 702 of file abaqus_io.C.
References end.
Referenced by read().
|
private |
Any of the various sections can start with some number of lines of comments, which start with "**". This function discards any lines of comments that it finds from the stream, leaving trailing data intact.
Definition at line 1132 of file abaqus_io.C.
References _in.
Referenced by read().
|
overridevirtual |
This method implements reading a mesh from a specified file.
Implements libMesh::MeshInput< MeshBase >.
Definition at line 205 of file abaqus_io.C.
References _already_seen_part, _elemset_ids, _in, _nodeset_ids, _sideset_ids, assign_boundary_node_ids(), assign_sideset_ids(), assign_subdomain_ids(), libMesh::BoundaryInfo::build_side_list_from_node_list(), build_sidesets_from_nodesets, libMesh::MeshBase::clear(), libMesh::MeshBase::delete_elem(), detect_generated_set(), libMesh::MeshBase::element_ptr_range(), libMesh::MeshInput< MeshBase >::elems_of_dimension, generate_ids(), libMesh::MeshBase::get_boundary_info(), max_elem_dimension_seen(), libMesh::MeshInput< MT >::mesh(), libMesh::BoundaryInfo::n_boundary_conds(), parse_label(), process_and_discard_comments(), read_elements(), read_ids(), read_nodes(), read_sideset(), and libMesh::MeshBase::set_mesh_dimension().
Referenced by libMesh::NameBasedIO::read().
|
private |
This function parses a block of elements in the Abaqus file. You must pass it an upper-cased version of the string declaring this section, which is typically something like: *ELEMENT, TYPE=CPS3 so that it can determine the type of elements to read.
Definition at line 497 of file abaqus_io.C.
References _abaqus_to_libmesh_elem_mapping, _abaqus_to_libmesh_node_mapping, _elem_types, _elemset_ids, _in, libMesh::MeshBase::add_elem(), libMesh::Elem::build(), libMesh::EDGE2, libMesh::EDGE3, libMesh::MeshInput< MeshBase >::elems_of_dimension, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::DofObject::id(), libMesh::INVALID_ELEM, libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::node_ptr(), libMesh::PRISM15, libMesh::PRISM6, libMesh::QUAD4, libMesh::QUAD8, libMesh::Elem::set_node(), libMesh::TET10, libMesh::TET4, libMesh::TRI3, and libMesh::TRI6.
Referenced by read().
|
private |
This function reads all the IDs for the current node or element set of the given name, storing them in the passed map using the name as key.
Definition at line 764 of file abaqus_io.C.
References _in.
Referenced by read().
|
private |
This function parses a block of nodes in the Abaqus file once such a block has been found. If the *NODE section specifies an NSET name, also pass that to this function.
Definition at line 418 of file abaqus_io.C.
References _abaqus_to_libmesh_node_mapping, _in, _nodeset_ids, libMesh::MeshBase::add_point(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshBase::n_nodes(), and libMesh::Real.
Referenced by read().
|
private |
This function reads a sideset from the input file. This is defined by a "*Surface" section in the file, and then a list of element ID and side IDs for the set.
Definition at line 846 of file abaqus_io.C.
References _in.
Referenced by read().
|
inlineprotectedinherited |
Sets the number of partitions in the mesh. Typically this gets done by the partitioner, but some parallel file formats begin "pre-partitioned".
Definition at line 91 of file mesh_input.h.
References libMesh::MeshInput< MT >::mesh().
Referenced by libMesh::Nemesis_IO::read(), and libMesh::XdrIO::read_header().
|
protectedinherited |
Reads input from in
, skipping all the lines that start with the character comment_start
.
Definition at line 179 of file mesh_input.h.
Referenced by libMesh::TetGenIO::read(), and libMesh::UCDIO::read_implementation().
|
private |
Map from libmesh element number -> abaqus element number, and the converse.
Definition at line 217 of file abaqus_io.h.
Referenced by assign_sideset_ids(), assign_subdomain_ids(), and read_elements().
|
private |
Map from abaqus node number -> sequential, 0-based libmesh node numbering.
Definition at line 227 of file abaqus_io.h.
Referenced by assign_boundary_node_ids(), read_elements(), and read_nodes().
|
private |
This flag gets set to true after the first "*PART" section we see. If it is still true when we see a second PART section, we will print an error message... we don't currently handle input files with multiple parts.
Definition at line 235 of file abaqus_io.h.
Referenced by read().
|
private |
A set of the different geometric element types detected when reading the mesh.
Definition at line 210 of file abaqus_io.h.
Referenced by assign_subdomain_ids(), and read_elements().
|
private |
Definition at line 198 of file abaqus_io.h.
Referenced by assign_sideset_ids(), assign_subdomain_ids(), read(), and read_elements().
|
private |
Stream object used to interact with the file
Definition at line 204 of file abaqus_io.h.
Referenced by generate_ids(), process_and_discard_comments(), read(), read_elements(), read_ids(), read_nodes(), and read_sideset().
|
private |
Abaqus writes nodesets and elemsets with labels. As we read them in, we'll use these maps to provide a natural ordering for them.
Definition at line 197 of file abaqus_io.h.
Referenced by assign_boundary_node_ids(), read(), and read_nodes().
|
private |
Definition at line 199 of file abaqus_io.h.
Referenced by assign_sideset_ids(), and read().
bool libMesh::AbaqusIO::build_sidesets_from_nodesets |
Default false. Set this flag to true if you want libmesh to automatically generate sidesets from Abaqus' nodesets. If the Abaqus file already contains some sidesets, we ignore this flag and don't generate sidesets, because the algorithm to do so currently does not take into account existing sidesets.
Definition at line 66 of file abaqus_io.h.
Referenced by read().
|
protectedinherited |
A vector of bools describing what dimension elements have been encountered when reading a mesh.
Definition at line 97 of file mesh_input.h.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::max_elem_dimension_seen(), max_elem_dimension_seen(), read(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GMVIO::read(), libMesh::VTKIO::read(), read_elements(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), and libMesh::XdrIO::read_serialized_connectivity().