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 Member Functions | |
DynaIO (MeshBase &mesh) | |
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... | |
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 int32_t | dyna_int_type |
The integer type DYNA uses. More... | |
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::map< dof_id_type, std::vector< std::pair< dof_id_type, Real > > > | constraint_rows |
bool | constraint_rows_broadcast |
MeshBase * | _obj |
A pointer to a non-const object object. More... | |
const bool | _is_parallel_format |
Flag specifying whether this format is parallel-capable. 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 |
|
private |
|
explicit |
void libMesh::DynaIO::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
.
Definition at line 685 of file dyna_io.C.
References libMesh::DofMap::add_constraint_row(), libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::allow_renumbering(), libMesh::ParallelObject::comm(), constraint_rows, constraint_rows_broadcast, libMesh::DofObject::dof_number(), libMesh::MeshBase::is_replicated(), libMesh::libmesh_ignore(), libMesh::MeshInput< MeshBase >::mesh(), libMesh::MeshBase::node_ref(), and libMesh::MeshBase::query_node_ptr().
Referenced by MeshInputTest::testDynaReadPatch().
|
staticprivate |
A static function used to construct the _element_maps struct, statically.
Definition at line 46 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.
|
inlineprotectedinherited |
Definition at line 169 of file mesh_input.h.
|
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 129 of file dyna_io.C.
References libMesh::Quality::name(), and read_mesh().
Referenced by libMesh::NameBasedIO::read(), 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 137 of file dyna_io.C.
References _element_maps, libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_point(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::build(), libMesh::MeshBase::clear(), constraint_rows, constraint_rows_broadcast, libMesh::Elem::dim(), libMesh::DofObject::id(), libMesh::DynaIO::ElementMaps::in, libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), max_fps_per_line, max_ints_per_line, libMesh::MeshInput< MeshBase >::mesh(), libMesh::MeshInput< MT >::mesh(), libMesh::MeshTools::n_elem(), libMesh::Elem::n_nodes(), libMesh::NODEELEM, libMesh::DynaIO::ElementDefinition::nodes, 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, 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 91 of file mesh_input.h.
|
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.
|
staticprivate |
A static ElementMaps object that is built statically and used by all instances of this class.
Definition at line 189 of file dyna_io.h.
Referenced by read_mesh().
|
privateinherited |
Flag specifying whether this format is parallel-capable.
If this is false (default) I/O is only permitted when the mesh has been serialized.
Definition at line 121 of file mesh_input.h.
|
privateinherited |
A pointer to a non-const object object.
This allows us to read the object from file.
Definition at line 114 of file mesh_input.h.
|
private |
Definition at line 106 of file dyna_io.h.
Referenced by add_spline_constraints(), and read_mesh().
|
private |
Definition at line 109 of file dyna_io.h.
Referenced by add_spline_constraints(), and read_mesh().
|
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.
|
staticprivate |
How many can we find on a line?
Definition at line 136 of file dyna_io.h.
Referenced by read_mesh().
|
staticprivate |
How many can we find on a line?
Definition at line 126 of file dyna_io.h.
Referenced by read_mesh().
|
private |
Definition at line 98 of file dyna_io.h.
Referenced by read_mesh().