libMesh
|
Reading and writing meshes in (a subset of) LS-DYNA format. More...
#include <dyna_io.h>
Classes | |
struct | ElementDefinition |
Defines mapping from libMesh element types to LS-DYNA element types or vice-versa. More... | |
struct | ElementMaps |
struct which holds a map from LS-DYNA to libMesh element numberings and vice-versa. More... | |
Public Types | |
typedef int32_t | dyna_int_type |
The integer type DYNA uses. More... | |
Public Member Functions | |
DynaIO (MeshBase &mesh, bool keep_spline_nodes=true) | |
Constructor. More... | |
virtual void | read (const std::string &name) override |
Reads in a mesh in the Dyna format from the ASCII file given by name. More... | |
void | add_spline_constraints (DofMap &dof_map, unsigned int sys_num, unsigned int var_num) |
Constrains finite element degrees of freedom in terms of spline degrees of freedom by adding user-defined constraint rows to sys . More... | |
void | clear_spline_nodes () |
Removes any spline nodes (both NodeElem and Node), leaving only the FE mesh generated from those splines. More... | |
bool | is_parallel_format () const |
Returns true iff this mesh file format and input class are parallelized, so that all processors can read their share of the data at once. More... | |
Static Public Member Functions | |
static const ElementDefinition & | find_elem_definition (dyna_int_type dyna_elem, int dim, int p) |
Finds the ElementDefinition corresponding to a particular element type. More... | |
static const ElementDefinition & | find_elem_definition (ElemType libmesh_elem, int dim, int p) |
Protected Member Functions | |
MeshBase & | mesh () |
void | set_n_partitions (unsigned int n_parts) |
Sets the number of partitions in the mesh. More... | |
void | skip_comment_lines (std::istream &in, const char comment_start) |
Reads input from in , skipping all the lines that start with the character comment_start . More... | |
Protected Attributes | |
std::vector< bool > | elems_of_dimension |
A vector of bools describing what dimension elements have been encountered when reading a mesh. More... | |
Private Types | |
typedef double | dyna_fp_type |
The floating-point type DYNA uses. More... | |
Private Member Functions | |
void | read_mesh (std::istream &in) |
Implementation of the read() function. More... | |
Static Private Member Functions | |
static ElementMaps | build_element_maps () |
A static function used to construct the _element_maps struct, statically. More... | |
Private Attributes | |
std::vector< Node * > | spline_node_ptrs |
std::unordered_map< Node *, Elem * > | spline_nodeelem_ptrs |
bool | _keep_spline_nodes |
Whether to keep or eventually discard spline nodes. More... | |
Static Private Attributes | |
static const int | max_ints_per_line = 10 |
How many can we find on a line? More... | |
static const int | max_fps_per_line = 5 |
How many can we find on a line? More... | |
static ElementMaps | _element_maps = DynaIO::build_element_maps() |
A static ElementMaps object that is built statically and used by all instances of this class. More... | |
Reading and writing meshes in (a subset of) LS-DYNA format.
The initial implementation only handles cards in the format described in "Geometry import to LS-DYNA", for isogeometric analysis.
|
private |
typedef int32_t libMesh::DynaIO::dyna_int_type |
|
explicit |
Constructor.
Takes a non-const Mesh reference which it will fill up with elements via the read() command.
By default keep_spline_nodes
is true, and when reading a BEXT file we retain the spline nodes and their constraints on FE nodes. If keep_spline_nodes
is false, we only keep the FE elements, which are no longer constrained to have higher continuity.
Definition at line 130 of file dyna_io.C.
|
staticprivate |
A static function used to construct the _element_maps struct, statically.
Definition at line 55 of file dyna_io.C.
References libMesh::DynaIO::ElementMaps::add_def(), libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX27, libMesh::HEX8, libMesh::QUAD4, and libMesh::QUAD9.
void libMesh::DynaIO::clear_spline_nodes | ( | ) |
Removes any spline nodes (both NodeElem and Node), leaving only the FE mesh generated from those splines.
Also removes node constraints to the now-missing nodes.
Definition at line 744 of file dyna_io.C.
References libMesh::MeshTools::clear_spline_nodes().
|
static |
Finds the ElementDefinition corresponding to a particular element type.
Definition at line 754 of file dyna_io.C.
References _element_maps, dim, and libMesh::DynaIO::ElementMaps::in.
Referenced by libMesh::ExodusII_IO::read(), and read_mesh().
|
static |
|
inlineinherited |
Returns true iff this mesh file format and input class are parallelized, so that all processors can read their share of the data at once.
Definition at line 87 of file mesh_input.h.
References libMesh::MeshInput< MT >::_is_parallel_format.
|
inlineprotectedinherited |
Definition at line 178 of file mesh_input.h.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::VTKIO::cells_to_vtk(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::Nemesis_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::TetGenIO::element_in(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::elements_out(), libMesh::VTKIO::get_local_node_values(), libMesh::ExodusII_IO::get_sideset_data_indices(), 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::GMVIO::read(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_bcs(), libMesh::CheckpointIO::read_connectivity(), libMesh::ExodusII_IO::read_header(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), libMesh::GmshIO::read_mesh(), 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::ExodusII_IO::read_sideset_data(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::CheckpointIO::read_subdomain_names(), libMesh::TetGenIO::write(), libMesh::Nemesis_IO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::ExodusII_IO::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::ExodusII_IO::write_elemsets(), libMesh::UCDIO::write_header(), libMesh::UCDIO::write_implementation(), libMesh::UCDIO::write_interior_elems(), libMesh::GmshIO::write_mesh(), libMesh::UCDIO::write_nodal_data(), libMesh::VTKIO::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::ExodusII_IO::write_sideset_data(), libMesh::UCDIO::write_soln(), and libMesh::CheckpointIO::write_subdomain_names().
|
overridevirtual |
Reads in a mesh in the Dyna format from the ASCII file given by name.
The patch ids defined in the Dyna file are stored as subdomain ids.
The spline nodes defined in the Dyna file are added to the mesh with type NodeElem. The only connection between spline nodes and finite element nodes will be user constraint equations, so using a space-filling-curve partitioner for these meshes might be a good idea.
Implements libMesh::MeshInput< MeshBase >.
Definition at line 139 of file dyna_io.C.
References libMesh::libmesh_assert(), libMesh::Quality::name(), read_mesh(), and libMesh::Utility::unzip_file().
Referenced by main(), libMesh::NameBasedIO::read(), MeshInputTest::testDynaFileMappings(), MeshInputTest::testDynaNoSplines(), MeshInputTest::testDynaReadElem(), and MeshInputTest::testDynaReadPatch().
|
private |
Implementation of the read() function.
This function is called by the public interface function and implements reading the file.
Definition at line 177 of file dyna_io.C.
References _keep_spline_nodes, libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_point(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::build(), libMesh::MeshBase::clear(), libMesh::MeshTools::clear_spline_nodes(), find_elem_definition(), libMesh::MeshBase::get_constraint_rows(), libMesh::DofObject::invalid_id, libMesh::make_range(), max_fps_per_line, max_ints_per_line, libMesh::MeshInput< MeshBase >::mesh(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshTools::n_elem(), libMesh::NODEELEM, libMesh::DynaIO::ElementDefinition::nodes, libMesh::ParallelObject::processor_id(), libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::Real, libMesh::MeshBase::set_default_mapping_data(), libMesh::MeshBase::set_default_mapping_type(), libMesh::DofObject::set_extra_datum(), libMesh::Elem::set_node(), spline_node_ptrs, spline_nodeelem_ptrs, libMesh::Elem::subdomain_id(), and libMesh::DynaIO::ElementDefinition::type.
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 101 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 187 of file mesh_input.h.
Referenced by libMesh::TetGenIO::read(), and libMesh::UCDIO::read_implementation().
|
staticprivate |
A static ElementMaps object that is built statically and used by all instances of this class.
Definition at line 209 of file dyna_io.h.
Referenced by find_elem_definition().
|
private |
Whether to keep or eventually discard spline nodes.
Definition at line 161 of file dyna_io.h.
Referenced by read_mesh().
|
protectedinherited |
A vector of bools describing what dimension elements have been encountered when reading a mesh.
Definition at line 107 of file mesh_input.h.
Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UNVIO::elements_in(), libMesh::UNVIO::max_elem_dimension_seen(), libMesh::AbaqusIO::max_elem_dimension_seen(), libMesh::AbaqusIO::read(), libMesh::GMVIO::read(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::UNVIO::read_implementation(), and libMesh::XdrIO::read_serialized_connectivity().
|
staticprivate |
How many can we find on a line?
Definition at line 183 of file dyna_io.h.
Referenced by read_mesh().
|
staticprivate |
How many can we find on a line?
Definition at line 173 of file dyna_io.h.
Referenced by read_mesh().
|
private |
Definition at line 155 of file dyna_io.h.
Referenced by read_mesh().
Definition at line 156 of file dyna_io.h.
Referenced by read_mesh().