libMesh
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
libMesh::XdrIO Class Reference

MeshIO class used for writing XDR (eXternal Data Representation) and XDA mesh files. More...

#include <xdr_io.h>

Inheritance diagram for libMesh::XdrIO:
[legend]

Public Types

typedef largest_id_type xdr_id_type
 
typedef uint32_t old_header_id_type
 
typedef uint64_t new_header_id_type
 

Public Member Functions

 XdrIO (MeshBase &, const bool=false)
 Constructor. More...
 
 XdrIO (const MeshBase &, const bool=false)
 Constructor. More...
 
virtual ~XdrIO ()
 Destructor. More...
 
virtual void read (const std::string &) override
 This method implements reading a mesh from a specified file. More...
 
virtual void write (const std::string &) override
 This method implements writing a mesh to a specified file. More...
 
bool binary () const
 Get/Set the flag indicating if we should read/write binary. More...
 
bool & binary ()
 
bool legacy () const
 Get/Set the flag indicating if we should read/write legacy. More...
 
bool & legacy ()
 
bool write_parallel () const
 Report whether we should write parallel files. More...
 
void set_write_parallel (bool do_parallel=true)
 Insist that we should/shouldn't write parallel files. More...
 
void set_auto_parallel ()
 Insist that we should write parallel files if and only if the mesh is an already distributed DistributedMesh. More...
 
const std::string & version () const
 
Get/Set the version string. More...
 
std::string & version ()
 
const std::string & boundary_condition_file_name () const
 Get/Set the boundary condition file name. More...
 
std::string & boundary_condition_file_name ()
 
const std::string & partition_map_file_name () const
 Get/Set the partitioning file name. More...
 
std::string & partition_map_file_name ()
 
const std::string & subdomain_map_file_name () const
 Get/Set the subdomain file name. More...
 
std::string & subdomain_map_file_name ()
 
const std::string & polynomial_level_file_name () const
 Get/Set the polynomial degree file name. More...
 
std::string & polynomial_level_file_name ()
 
bool version_at_least_0_9_2 () const
 
bool version_at_least_0_9_6 () const
 
bool version_at_least_1_1_0 () const
 
bool version_at_least_1_3_0 () const
 
virtual void write_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
 This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object. More...
 
virtual void write_discontinuous_equation_systems (const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
 This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems object. More...
 
virtual void write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &)
 This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided. More...
 
virtual void write_nodal_data (const std::string &, const NumericVector< Number > &, const std::vector< std::string > &)
 This method should be overridden by "parallel" output formats for writing nodal data. More...
 
virtual void write_nodal_data_discontinuous (const std::string &, const std::vector< Number > &, const std::vector< std::string > &)
 This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided. More...
 
unsigned int & ascii_precision ()
 Return/set the precision to use when writing ASCII files. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Protected Member Functions

MeshBasemesh ()
 
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...
 
const MeshBasemesh () const
 

Protected Attributes

std::vector< bool > elems_of_dimension
 A vector of bools describing what dimension elements have been encountered when reading a mesh. More...
 
const bool _is_parallel_format
 Flag specifying whether this format is parallel-capable. More...
 
const bool _serial_only_needed_on_proc_0
 Flag specifying whether this format can be written by only serializing the mesh to processor zero. More...
 
const Parallel::Communicator_communicator
 

Private Member Functions

void write_serialized_subdomain_names (Xdr &io) const
 Write subdomain name information - NEW in 0.9.2 format. More...
 
void write_serialized_connectivity (Xdr &io, const dof_id_type n_elem) const
 Write the connectivity for a parallel, distributed mesh. More...
 
void write_serialized_nodes (Xdr &io, const dof_id_type n_nodes) const
 Write the nodal locations for a parallel, distributed mesh. More...
 
void write_serialized_bcs_helper (Xdr &io, const new_header_id_type n_side_bcs, const std::string bc_type) const
 Helper function used in write_serialized_side_bcs, write_serialized_edge_bcs, and write_serialized_shellface_bcs. More...
 
void write_serialized_side_bcs (Xdr &io, const new_header_id_type n_side_bcs) const
 Write the side boundary conditions for a parallel, distributed mesh. More...
 
void write_serialized_edge_bcs (Xdr &io, const new_header_id_type n_edge_bcs) const
 Write the edge boundary conditions for a parallel, distributed mesh. More...
 
void write_serialized_shellface_bcs (Xdr &io, const new_header_id_type n_shellface_bcs) const
 Write the "shell face" boundary conditions for a parallel, distributed mesh. More...
 
void write_serialized_nodesets (Xdr &io, const new_header_id_type n_nodesets) const
 Write the boundary conditions for a parallel, distributed mesh. More...
 
void write_serialized_bc_names (Xdr &io, const BoundaryInfo &info, bool is_sideset) const
 Write boundary names information (sideset and nodeset) - NEW in 0.9.2 format. More...
 
template<typename T >
void read_header (Xdr &io, std::vector< T > &meta_data)
 Read header information - templated to handle old (4-byte) or new (8-byte) header id types. More...
 
void read_serialized_subdomain_names (Xdr &io)
 Read subdomain name information - NEW in 0.9.2 format. More...
 
template<typename T >
void read_serialized_connectivity (Xdr &io, const dof_id_type n_elem, std::vector< new_header_id_type > &sizes, T)
 Read the connectivity for a parallel, distributed mesh. More...
 
void read_serialized_nodes (Xdr &io, const dof_id_type n_nodes)
 Read the nodal locations for a parallel, distributed mesh. More...
 
template<typename T >
void read_serialized_bcs_helper (Xdr &io, T, const std::string bc_type)
 Helper function used in read_serialized_side_bcs, read_serialized_edge_bcs, and read_serialized_shellface_bcs. More...
 
template<typename T >
void read_serialized_side_bcs (Xdr &io, T)
 Read the side boundary conditions for a parallel, distributed mesh. More...
 
template<typename T >
void read_serialized_edge_bcs (Xdr &io, T)
 Read the edge boundary conditions for a parallel, distributed mesh. More...
 
template<typename T >
void read_serialized_shellface_bcs (Xdr &io, T)
 Read the "shell face" boundary conditions for a parallel, distributed mesh. More...
 
template<typename T >
void read_serialized_nodesets (Xdr &io, T)
 Read the nodeset conditions for a parallel, distributed mesh. More...
 
void read_serialized_bc_names (Xdr &io, BoundaryInfo &info, bool is_sideset)
 Read boundary names information (sideset and nodeset) - NEW in 0.9.2 format. More...
 
void pack_element (std::vector< xdr_id_type > &conn, const Elem *elem, const dof_id_type parent_id=DofObject::invalid_id, const dof_id_type parent_pid=DofObject::invalid_id) const
 Pack an element into a transfer buffer for parallel communication. More...
 

Private Attributes

bool _binary
 
bool _legacy
 
bool _write_serial
 
bool _write_parallel
 
bool _write_unique_id
 
unsigned int _field_width
 
std::string _version
 
std::string _bc_file_name
 
std::string _partition_map_file
 
std::string _subdomain_map_file
 
std::string _p_level_file
 

Static Private Attributes

static const std::size_t io_blksize
 Define the block size to use for chunked IO. More...
 

Detailed Description

MeshIO class used for writing XDR (eXternal Data Representation) and XDA mesh files.

XDR/XDA is libmesh's internal data format, and allows the full refinement tree structure of the mesh to be written to file.

Author
Benjamin Kirk
John Peterson
Date
2004

Definition at line 51 of file xdr_io.h.

Member Typedef Documentation

◆ new_header_id_type

Definition at line 63 of file xdr_io.h.

◆ old_header_id_type

Definition at line 60 of file xdr_io.h.

◆ xdr_id_type

Definition at line 57 of file xdr_io.h.

Constructor & Destructor Documentation

◆ XdrIO() [1/2]

libMesh::XdrIO::XdrIO ( MeshBase ,
const bool  = false 
)
explicit

Constructor.

Takes a writable reference to a mesh object. This is the constructor required to read a mesh. The optional parameter binary can be used to switch between ASCII (false, the default) or binary (true) files.

◆ XdrIO() [2/2]

libMesh::XdrIO::XdrIO ( const MeshBase ,
const bool  = false 
)
explicit

Constructor.

Takes a reference to a constant mesh object. This constructor will only allow us to write the mesh. The optional parameter binary can be used to switch between ASCII (false, the default) or binary (true) files.

◆ ~XdrIO()

virtual libMesh::XdrIO::~XdrIO ( )
virtual

Destructor.

Member Function Documentation

◆ ascii_precision()

unsigned int & libMesh::MeshOutput< MeshBase >::ascii_precision ( )
inherited

Return/set the precision to use when writing ASCII files.

By default we use numeric_limits<Real>::digits10 + 2, which should be enough to write out to ASCII and get the exact same Real back when reading in.

Definition at line 244 of file mesh_output.h.

245 {
246  return _ascii_precision;
247 }
unsigned int _ascii_precision
Precision to use when writing ASCII files.
Definition: mesh_output.h:182

◆ binary() [1/2]

bool libMesh::XdrIO::binary ( ) const

Get/Set the flag indicating if we should read/write binary.

Definition at line 103 of file xdr_io.h.

References _binary.

103 { return _binary; }
bool _binary
Definition: xdr_io.h:335

◆ binary() [2/2]

bool& libMesh::XdrIO::binary ( )

Definition at line 104 of file xdr_io.h.

References _binary.

104 { return _binary; }
bool _binary
Definition: xdr_io.h:335

◆ boundary_condition_file_name() [1/2]

const std::string& libMesh::XdrIO::boundary_condition_file_name ( ) const

Get/Set the boundary condition file name.

Definition at line 146 of file xdr_io.h.

References _bc_file_name.

146 { return _bc_file_name; }
std::string _bc_file_name
Definition: xdr_io.h:342

◆ boundary_condition_file_name() [2/2]

std::string& libMesh::XdrIO::boundary_condition_file_name ( )

Definition at line 147 of file xdr_io.h.

References _bc_file_name.

147 { return _bc_file_name; }
std::string _bc_file_name
Definition: xdr_io.h:342

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ legacy() [1/2]

bool libMesh::XdrIO::legacy ( ) const

Get/Set the flag indicating if we should read/write legacy.

Definition at line 109 of file xdr_io.h.

References _legacy.

109 { return _legacy; }
bool _legacy
Definition: xdr_io.h:336

◆ legacy() [2/2]

bool& libMesh::XdrIO::legacy ( )

Definition at line 110 of file xdr_io.h.

References _legacy.

110 { return _legacy; }
bool _legacy
Definition: xdr_io.h:336

◆ mesh() [1/2]

MeshBase & libMesh::MeshInput< MeshBase >::mesh ( )
protectedinherited
Returns
The object as a writable reference.

Definition at line 169 of file mesh_input.h.

Referenced by write_parallel().

170 {
171  if (_obj == nullptr)
172  libmesh_error_msg("ERROR: _obj should not be nullptr!");
173  return *_obj;
174 }
MeshBase * _obj
A pointer to a non-const object object.
Definition: mesh_input.h:114

◆ mesh() [2/2]

const MeshBase & libMesh::MeshOutput< MeshBase >::mesh ( ) const
protectedinherited
Returns
The object as a read-only reference.

Definition at line 234 of file mesh_output.h.

235 {
236  libmesh_assert(_obj);
237  return *_obj;
238 }
const MeshBase *const _obj
A pointer to a constant object.
Definition: mesh_output.h:177

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ pack_element()

void libMesh::XdrIO::pack_element ( std::vector< xdr_id_type > &  conn,
const Elem elem,
const dof_id_type  parent_id = DofObject::invalid_id,
const dof_id_type  parent_pid = DofObject::invalid_id 
) const
private

Pack an element into a transfer buffer for parallel communication.

◆ partition_map_file_name() [1/2]

const std::string& libMesh::XdrIO::partition_map_file_name ( ) const

Get/Set the partitioning file name.

Definition at line 152 of file xdr_io.h.

References _partition_map_file.

152 { return _partition_map_file; }
std::string _partition_map_file
Definition: xdr_io.h:343

◆ partition_map_file_name() [2/2]

std::string& libMesh::XdrIO::partition_map_file_name ( )

Definition at line 153 of file xdr_io.h.

References _partition_map_file.

153 { return _partition_map_file; }
std::string _partition_map_file
Definition: xdr_io.h:343

◆ polynomial_level_file_name() [1/2]

const std::string& libMesh::XdrIO::polynomial_level_file_name ( ) const

Get/Set the polynomial degree file name.

Definition at line 164 of file xdr_io.h.

References _p_level_file.

164 { return _p_level_file; }
std::string _p_level_file
Definition: xdr_io.h:345

◆ polynomial_level_file_name() [2/2]

std::string& libMesh::XdrIO::polynomial_level_file_name ( )

Definition at line 165 of file xdr_io.h.

References _p_level_file.

165 { return _p_level_file; }
std::string _p_level_file
Definition: xdr_io.h:345

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

◆ read()

virtual void libMesh::XdrIO::read ( const std::string &  )
overridevirtual

This method implements reading a mesh from a specified file.

Implements libMesh::MeshInput< MeshBase >.

◆ read_header()

template<typename T >
void libMesh::XdrIO::read_header ( Xdr io,
std::vector< T > &  meta_data 
)
private

Read header information - templated to handle old (4-byte) or new (8-byte) header id types.

◆ read_serialized_bc_names()

void libMesh::XdrIO::read_serialized_bc_names ( Xdr io,
BoundaryInfo info,
bool  is_sideset 
)
private

Read boundary names information (sideset and nodeset) - NEW in 0.9.2 format.

◆ read_serialized_bcs_helper()

template<typename T >
void libMesh::XdrIO::read_serialized_bcs_helper ( Xdr io,
,
const std::string  bc_type 
)
private

Helper function used in read_serialized_side_bcs, read_serialized_edge_bcs, and read_serialized_shellface_bcs.

◆ read_serialized_connectivity()

template<typename T >
void libMesh::XdrIO::read_serialized_connectivity ( Xdr io,
const dof_id_type  n_elem,
std::vector< new_header_id_type > &  sizes,
 
)
private

Read the connectivity for a parallel, distributed mesh.

◆ read_serialized_edge_bcs()

template<typename T >
void libMesh::XdrIO::read_serialized_edge_bcs ( Xdr io,
 
)
private

Read the edge boundary conditions for a parallel, distributed mesh.

NEW in 1.1.0 format.

Returns
The number of bcs read

◆ read_serialized_nodes()

void libMesh::XdrIO::read_serialized_nodes ( Xdr io,
const dof_id_type  n_nodes 
)
private

Read the nodal locations for a parallel, distributed mesh.

◆ read_serialized_nodesets()

template<typename T >
void libMesh::XdrIO::read_serialized_nodesets ( Xdr io,
 
)
private

Read the nodeset conditions for a parallel, distributed mesh.

Returns
The number of nodesets read

◆ read_serialized_shellface_bcs()

template<typename T >
void libMesh::XdrIO::read_serialized_shellface_bcs ( Xdr io,
 
)
private

Read the "shell face" boundary conditions for a parallel, distributed mesh.

NEW in 1.1.0 format.

Returns
The number of bcs read

◆ read_serialized_side_bcs()

template<typename T >
void libMesh::XdrIO::read_serialized_side_bcs ( Xdr io,
 
)
private

Read the side boundary conditions for a parallel, distributed mesh.

Returns
The number of bcs read

◆ read_serialized_subdomain_names()

void libMesh::XdrIO::read_serialized_subdomain_names ( Xdr io)
private

Read subdomain name information - NEW in 0.9.2 format.

◆ set_auto_parallel()

void libMesh::XdrIO::set_auto_parallel ( )

Insist that we should write parallel files if and only if the mesh is an already distributed DistributedMesh.

Definition at line 389 of file xdr_io.h.

References _write_parallel, and _write_serial.

390 {
391  this->_write_serial = false;
392  this->_write_parallel = false;
393 }
bool _write_parallel
Definition: xdr_io.h:338
bool _write_serial
Definition: xdr_io.h:337

◆ set_n_partitions()

void libMesh::MeshInput< MeshBase >::set_n_partitions ( unsigned int  n_parts)
protectedinherited

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().

91 { this->mesh().set_n_partitions() = n_parts; }
unsigned int & set_n_partitions()
Definition: mesh_base.h:1371

◆ set_write_parallel()

void libMesh::XdrIO::set_write_parallel ( bool  do_parallel = true)

Insist that we should/shouldn't write parallel files.

Definition at line 379 of file xdr_io.h.

References _write_parallel, and _write_serial.

380 {
381  this->_write_parallel = do_parallel;
382 
383  this->_write_serial = !do_parallel;
384 }
bool _write_parallel
Definition: xdr_io.h:338
bool _write_serial
Definition: xdr_io.h:337

◆ skip_comment_lines()

void libMesh::MeshInput< MeshBase >::skip_comment_lines ( std::istream &  in,
const char  comment_start 
)
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.

181 {
182  char c, line[256];
183 
184  while (in.get(c), c==comment_start)
185  in.getline (line, 255);
186 
187  // put back first character of
188  // first non-comment line
189  in.putback (c);
190 }

◆ subdomain_map_file_name() [1/2]

const std::string& libMesh::XdrIO::subdomain_map_file_name ( ) const

Get/Set the subdomain file name.

Definition at line 158 of file xdr_io.h.

References _subdomain_map_file.

158 { return _subdomain_map_file; }
std::string _subdomain_map_file
Definition: xdr_io.h:344

◆ subdomain_map_file_name() [2/2]

std::string& libMesh::XdrIO::subdomain_map_file_name ( )

Definition at line 159 of file xdr_io.h.

References _subdomain_map_file.

159 { return _subdomain_map_file; }
std::string _subdomain_map_file
Definition: xdr_io.h:344

◆ version() [1/2]

const std::string& libMesh::XdrIO::version ( ) const


Get/Set the version string.

Valid version strings:

* "libMesh-0.7.0+"
* "libMesh-0.7.0+ parallel"
* 

If "libMesh" is not detected in the version string the LegacyXdrIO class will be used to read older (pre version 0.7.0) mesh files.

Definition at line 140 of file xdr_io.h.

References _version.

140 { return _version; }
std::string _version
Definition: xdr_io.h:341

◆ version() [2/2]

std::string& libMesh::XdrIO::version ( )

Definition at line 141 of file xdr_io.h.

References _version.

141 { return _version; }
std::string _version
Definition: xdr_io.h:341

◆ version_at_least_0_9_2()

bool libMesh::XdrIO::version_at_least_0_9_2 ( ) const
Returns
true if the current file has an XDR/XDA version that matches or exceeds 0.9.2.

As of this version we encode integer field widths, nodesets, subdomain names, boundary names, and element unique_id values (if they exist) into our files.

◆ version_at_least_0_9_6()

bool libMesh::XdrIO::version_at_least_0_9_6 ( ) const
Returns
true if the current file has an XDR/XDA version that matches or exceeds 0.9.6.

In this version we add node unique_id values to our files, if they exist.

◆ version_at_least_1_1_0()

bool libMesh::XdrIO::version_at_least_1_1_0 ( ) const
Returns
true if the current file has an XDR/XDA version that matches or exceeds 1.1.0.

In this version we add edge and shellface boundary conditions to our files.

◆ version_at_least_1_3_0()

bool libMesh::XdrIO::version_at_least_1_3_0 ( ) const
Returns
true if the current file has an XDR/XDA version that matches or exceeds 1.3.0.

In this version we fix handling of uint64_t binary values on Linux, which were previously miswritten as 32 bit via xdr_long.

◆ write()

virtual void libMesh::XdrIO::write ( const std::string &  )
overridevirtual

This method implements writing a mesh to a specified file.

Implements libMesh::MeshOutput< MeshBase >.

◆ write_discontinuous_equation_systems()

virtual void libMesh::MeshOutput< MeshBase >::write_discontinuous_equation_systems ( const std::string &  ,
const EquationSystems ,
const std::set< std::string > *  system_names = nullptr 
)
virtualinherited

This method implements writing a mesh with discontinuous data to a specified file where the data is taken from the EquationSystems object.

◆ write_equation_systems()

virtual void libMesh::MeshOutput< MeshBase >::write_equation_systems ( const std::string &  ,
const EquationSystems ,
const std::set< std::string > *  system_names = nullptr 
)
virtualinherited

This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object.

Reimplemented in libMesh::NameBasedIO.

◆ write_nodal_data() [1/2]

virtual void libMesh::MeshOutput< MeshBase >::write_nodal_data ( const std::string &  ,
const std::vector< Number > &  ,
const std::vector< std::string > &   
)
virtualinherited

This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.

Reimplemented in libMesh::ExodusII_IO, libMesh::Nemesis_IO, libMesh::UCDIO, libMesh::NameBasedIO, libMesh::GmshIO, libMesh::GMVIO, libMesh::VTKIO, libMesh::MEDITIO, libMesh::GnuPlotIO, and libMesh::TecplotIO.

Definition at line 105 of file mesh_output.h.

108  { libmesh_not_implemented(); }

◆ write_nodal_data() [2/2]

virtual void libMesh::MeshOutput< MeshBase >::write_nodal_data ( const std::string &  ,
const NumericVector< Number > &  ,
const std::vector< std::string > &   
)
virtualinherited

This method should be overridden by "parallel" output formats for writing nodal data.

Instead of getting a localized copy of the nodal solution vector, it is passed a NumericVector of type=PARALLEL which is in node-major order i.e. (u0,v0,w0, u1,v1,w1, u2,v2,w2, u3,v3,w3, ...) and contains n_nodes*n_vars total entries. Then, it is up to the individual I/O class to extract the required solution values from this vector and write them in parallel.

If not implemented, localizes the parallel vector into a std::vector and calls the other version of this function.

Reimplemented in libMesh::Nemesis_IO.

◆ write_nodal_data_discontinuous()

virtual void libMesh::MeshOutput< MeshBase >::write_nodal_data_discontinuous ( const std::string &  ,
const std::vector< Number > &  ,
const std::vector< std::string > &   
)
virtualinherited

This method implements writing a mesh with discontinuous data to a specified file where the nodal data and variables names are provided.

Reimplemented in libMesh::ExodusII_IO.

Definition at line 114 of file mesh_output.h.

117  { libmesh_not_implemented(); }

◆ write_parallel()

bool libMesh::XdrIO::write_parallel ( ) const

Report whether we should write parallel files.

Definition at line 358 of file xdr_io.h.

References _write_parallel, _write_serial, libMesh::MeshBase::is_serial(), libMesh::MeshInput< MeshBase >::mesh(), and libMesh::MeshOutput< MT >::mesh().

359 {
360  // We can't insist on both serial and parallel
361  libmesh_assert (!this->_write_serial || !this->_write_parallel);
362 
363  // If we insisted on serial, do that
364  if (this->_write_serial)
365  return false;
366 
367  // If we insisted on parallel, do that
368  if (this->_write_parallel)
369  return true;
370 
371  // If we're doing things automatically, check the mesh
372  const MeshBase & mesh = MeshOutput<MeshBase>::mesh();
373  return !mesh.is_serial();
374 }
const MT & mesh() const
Definition: mesh_output.h:234
bool _write_parallel
Definition: xdr_io.h:338
virtual bool is_serial() const
Definition: mesh_base.h:154
bool _write_serial
Definition: xdr_io.h:337

◆ write_serialized_bc_names()

void libMesh::XdrIO::write_serialized_bc_names ( Xdr io,
const BoundaryInfo info,
bool  is_sideset 
) const
private

Write boundary names information (sideset and nodeset) - NEW in 0.9.2 format.

◆ write_serialized_bcs_helper()

void libMesh::XdrIO::write_serialized_bcs_helper ( Xdr io,
const new_header_id_type  n_side_bcs,
const std::string  bc_type 
) const
private

Helper function used in write_serialized_side_bcs, write_serialized_edge_bcs, and write_serialized_shellface_bcs.

◆ write_serialized_connectivity()

void libMesh::XdrIO::write_serialized_connectivity ( Xdr io,
const dof_id_type  n_elem 
) const
private

Write the connectivity for a parallel, distributed mesh.

◆ write_serialized_edge_bcs()

void libMesh::XdrIO::write_serialized_edge_bcs ( Xdr io,
const new_header_id_type  n_edge_bcs 
) const
private

Write the edge boundary conditions for a parallel, distributed mesh.

NEW in 1.1.0 format.

◆ write_serialized_nodes()

void libMesh::XdrIO::write_serialized_nodes ( Xdr io,
const dof_id_type  n_nodes 
) const
private

Write the nodal locations for a parallel, distributed mesh.

◆ write_serialized_nodesets()

void libMesh::XdrIO::write_serialized_nodesets ( Xdr io,
const new_header_id_type  n_nodesets 
) const
private

Write the boundary conditions for a parallel, distributed mesh.

◆ write_serialized_shellface_bcs()

void libMesh::XdrIO::write_serialized_shellface_bcs ( Xdr io,
const new_header_id_type  n_shellface_bcs 
) const
private

Write the "shell face" boundary conditions for a parallel, distributed mesh.

NEW in 1.1.0 format.

◆ write_serialized_side_bcs()

void libMesh::XdrIO::write_serialized_side_bcs ( Xdr io,
const new_header_id_type  n_side_bcs 
) const
private

Write the side boundary conditions for a parallel, distributed mesh.

◆ write_serialized_subdomain_names()

void libMesh::XdrIO::write_serialized_subdomain_names ( Xdr io) const
private

Write subdomain name information - NEW in 0.9.2 format.

Member Data Documentation

◆ _bc_file_name

std::string libMesh::XdrIO::_bc_file_name
private

Definition at line 342 of file xdr_io.h.

Referenced by boundary_condition_file_name().

◆ _binary

bool libMesh::XdrIO::_binary
private

Definition at line 335 of file xdr_io.h.

Referenced by binary().

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _field_width

unsigned int libMesh::XdrIO::_field_width
private

Definition at line 340 of file xdr_io.h.

◆ _is_parallel_format

const bool libMesh::MeshOutput< MeshBase >::_is_parallel_format
protectedinherited

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 159 of file mesh_output.h.

◆ _legacy

bool libMesh::XdrIO::_legacy
private

Definition at line 336 of file xdr_io.h.

Referenced by legacy().

◆ _p_level_file

std::string libMesh::XdrIO::_p_level_file
private

Definition at line 345 of file xdr_io.h.

Referenced by polynomial_level_file_name().

◆ _partition_map_file

std::string libMesh::XdrIO::_partition_map_file
private

Definition at line 343 of file xdr_io.h.

Referenced by partition_map_file_name().

◆ _serial_only_needed_on_proc_0

const bool libMesh::MeshOutput< MeshBase >::_serial_only_needed_on_proc_0
protectedinherited

Flag specifying whether this format can be written by only serializing the mesh to processor zero.

If this is false (default) the mesh will be serialized to all processors

Definition at line 168 of file mesh_output.h.

◆ _subdomain_map_file

std::string libMesh::XdrIO::_subdomain_map_file
private

Definition at line 344 of file xdr_io.h.

Referenced by subdomain_map_file_name().

◆ _version

std::string libMesh::XdrIO::_version
private

Definition at line 341 of file xdr_io.h.

Referenced by version().

◆ _write_parallel

bool libMesh::XdrIO::_write_parallel
private

Definition at line 338 of file xdr_io.h.

Referenced by set_auto_parallel(), set_write_parallel(), and write_parallel().

◆ _write_serial

bool libMesh::XdrIO::_write_serial
private

Definition at line 337 of file xdr_io.h.

Referenced by set_auto_parallel(), set_write_parallel(), and write_parallel().

◆ _write_unique_id

bool libMesh::XdrIO::_write_unique_id
private

Definition at line 339 of file xdr_io.h.

◆ elems_of_dimension

std::vector<bool> libMesh::MeshInput< MeshBase >::elems_of_dimension
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.

◆ io_blksize

const std::size_t libMesh::XdrIO::io_blksize
staticprivate

Define the block size to use for chunked IO.

Definition at line 350 of file xdr_io.h.


The documentation for this class was generated from the following file: