$extrastylesheet
libMesh::Nemesis_IO_Helper Class Reference

#include <nemesis_io_helper.h>

Inheritance diagram for libMesh::Nemesis_IO_Helper:

List of all members.

Public Types

enum  ExodusVarType { NODAL = 0, ELEMENTAL = 1, GLOBAL = 2 }

Public Member Functions

 Nemesis_IO_Helper (const ParallelObject &parent, bool verbose=false, bool single_precision=false)
virtual ~Nemesis_IO_Helper ()
void get_init_global ()
void get_ss_param_global ()
void get_ns_param_global ()
void get_eb_info_global ()
void get_init_info ()
void get_loadbal_param ()
void get_elem_map ()
void get_node_map ()
void get_cmap_params ()
void get_node_cmap ()
void get_elem_cmap ()
void put_init_info (unsigned num_proc, unsigned num_proc_in_file, const char *ftype)
void put_init_global (dof_id_type num_nodes_global, dof_id_type num_elems_global, unsigned num_elem_blks_global, unsigned num_node_sets_global, unsigned num_side_sets_global)
void put_eb_info_global (std::vector< int > &global_elem_blk_ids, std::vector< int > &global_elem_blk_cnts)
void put_ns_param_global (std::vector< int > &global_nodeset_ids, std::vector< int > &num_global_node_counts, std::vector< int > &num_global_node_df_counts)
void put_ss_param_global (std::vector< int > &global_sideset_ids, std::vector< int > &num_global_side_counts, std::vector< int > &num_global_side_df_counts)
void put_loadbal_param (unsigned num_internal_nodes, unsigned num_border_nodes, unsigned num_external_nodes, unsigned num_internal_elems, unsigned num_border_elems, unsigned num_node_cmaps, unsigned num_elem_cmaps)
void put_cmap_params (std::vector< int > &node_cmap_ids, std::vector< int > &node_cmap_node_cnts, std::vector< int > &elem_cmap_ids, std::vector< int > &elem_cmap_elem_cnts)
void put_node_cmap (std::vector< std::vector< int > > &node_cmap_node_ids, std::vector< std::vector< int > > &node_cmap_proc_ids)
void put_node_map (std::vector< int > &node_mapi, std::vector< int > &node_mapb, std::vector< int > &node_mape)
void put_elem_cmap (std::vector< std::vector< int > > &elem_cmap_elem_ids, std::vector< std::vector< int > > &elem_cmap_side_ids, std::vector< std::vector< int > > &elem_cmap_proc_ids)
void put_elem_map (std::vector< int > &elem_mapi, std::vector< int > &elem_mapb)
void put_n_coord (unsigned start_node_num, unsigned num_nodes, std::vector< Real > &x_coor, std::vector< Real > &y_coor, std::vector< Real > &z_coor)
virtual void write_nodal_coordinates (const MeshBase &mesh, bool use_discontinuous=false)
virtual void write_elements (const MeshBase &mesh, bool use_discontinuous=false)
virtual void write_sidesets (const MeshBase &mesh)
virtual void write_nodesets (const MeshBase &mesh)
virtual void create (std::string filename)
virtual void initialize (std::string title, const MeshBase &mesh, bool use_discontinuous=false)
void write_nodal_solution (const std::vector< Number > &values, const std::vector< std::string > &names, int timestep)
std::string construct_nemesis_filename (const std::string &base_filename)
const char * get_elem_type () const
void open (const char *filename, bool read_only)
void read_header ()
void print_header ()
void read_nodes ()
void read_node_num_map ()
void print_nodes (std::ostream &out=libMesh::out)
void read_block_info ()
int get_block_id (int index)
std::string get_block_name (int index)
int get_side_set_id (int index)
std::string get_side_set_name (int index)
int get_node_set_id (int index)
std::string get_node_set_name (int index)
void read_elem_in_block (int block)
void read_elem_num_map ()
void read_sideset_info ()
void read_nodeset_info ()
void read_sideset (int id, int offset)
void read_nodeset (int id)
void close ()
int inquire (int req_info, std::string error_msg="")
void read_time_steps ()
void read_num_time_steps ()
void read_nodal_var_values (std::string nodal_var_name, int time_step)
void read_elemental_var_values (std::string elemental_var_name, int time_step)
void initialize_element_variables (std::vector< std::string > names)
void initialize_nodal_variables (std::vector< std::string > names)
void initialize_global_variables (std::vector< std::string > names)
void write_timestep (int timestep, Real time)
void write_element_values (const MeshBase &mesh, const std::vector< Real > &values, int timestep)
void write_nodal_values (int var_id, const std::vector< Real > &values, int timestep)
void write_information_records (const std::vector< std::string > &records)
void write_global_values (const std::vector< Real > &values, int timestep)
void use_mesh_dimension_instead_of_spatial_dimension (bool val)
void set_coordinate_offset (Point p)
std::vector< std::string > get_complex_names (const std::vector< std::string > &names) const
void message (const std::string &msg)
void message (const std::string &msg, int i)
void read_var_names (ExodusVarType type)
const Parallel::Communicatorcomm () const
processor_id_type n_processors () const
processor_id_type processor_id () const

Public Attributes

int nemesis_err_flag
int num_nodes_global
int num_elems_global
int num_elem_blks_global
int num_node_sets_global
int num_side_sets_global
int num_proc
int num_proc_in_file
char ftype
std::vector< int > global_sideset_ids
std::vector< int > num_global_side_counts
std::vector< int > num_global_side_df_counts
std::vector< int > global_nodeset_ids
std::vector< int > num_global_node_counts
std::vector< int > num_global_node_df_counts
std::vector< int > global_elem_blk_ids
std::vector< int > global_elem_blk_cnts
std::set< int > nodes_attached_to_local_elems
std::map< subdomain_id_type,
std::vector< unsigned int > > 
subdomain_map
std::map< int, std::vector< int > > block_id_to_elem_connectivity
int num_internal_nodes
int num_border_nodes
int num_external_nodes
int num_internal_elems
int num_border_elems
int num_node_cmaps
int num_elem_cmaps
std::vector< int > elem_mapi
std::vector< int > elem_mapb
std::vector< int > node_mapi
std::vector< int > node_mapb
std::vector< int > node_mape
std::vector< int > node_cmap_ids
std::vector< int > node_cmap_node_cnts
std::vector< int > elem_cmap_ids
std::vector< int > elem_cmap_elem_cnts
std::vector< std::vector< int > > node_cmap_node_ids
std::vector< std::vector< int > > node_cmap_proc_ids
std::vector< std::vector< int > > elem_cmap_elem_ids
std::vector< std::vector< int > > elem_cmap_side_ids
std::vector< std::vector< int > > elem_cmap_proc_ids
int ex_id
int ex_err
int num_dim
int num_global_vars
int num_nodes
int num_elem
int num_elem_blk
int num_node_sets
int num_side_sets
int num_elem_this_blk
int num_nodes_per_elem
int num_attr
int num_elem_all_sidesets
std::vector< int > block_ids
std::vector< int > connect
std::vector< int > ss_ids
std::vector< int > nodeset_ids
std::vector< int > num_sides_per_set
std::vector< int > num_nodes_per_set
std::vector< int > num_df_per_set
std::vector< int > num_node_df_per_set
std::vector< int > elem_list
std::vector< int > side_list
std::vector< int > node_list
std::vector< int > id_list
std::vector< int > node_num_map
std::vector< int > elem_num_map
std::vector< Realx
std::vector< Realy
std::vector< Realz
std::vector< char > title
std::vector< char > elem_type
std::map< int, int > libmesh_elem_num_to_exodus
std::vector< int > exodus_elem_num_to_libmesh
std::map< int, int > libmesh_node_num_to_exodus
std::vector< int > exodus_node_num_to_libmesh
int num_time_steps
std::vector< Realtime_steps
int num_nodal_vars
std::vector< std::string > nodal_var_names
std::vector< Realnodal_var_values
int num_elem_vars
std::vector< std::string > elem_var_names
std::vector< Realelem_var_values
std::vector< std::string > global_var_names
std::map< int, std::string > id_to_block_names
std::map< int, std::string > id_to_ss_names
std::map< int, std::string > id_to_ns_names
bool verbose
bool opened_for_writing
bool opened_for_reading
std::string current_filename

Protected Attributes

bool _run_only_on_proc0
bool _elem_vars_initialized
bool _global_vars_initialized
bool _nodal_vars_initialized
bool _use_mesh_dimension_instead_of_spatial_dimension
Point _coordinate_offset
bool _single_precision
const Parallel::Communicator_communicator

Private Types

typedef std::map< unsigned,
std::set< unsigned >
>::iterator 
proc_nodes_touched_iterator
typedef std::map< unsigned,
std::set< std::pair< unsigned,
unsigned > > >::iterator 
proc_border_elem_sets_iterator

Private Member Functions

void compute_num_global_elem_blocks (const MeshBase &pmesh)
void compute_num_global_nodesets (const MeshBase &pmesh)
void compute_num_global_sidesets (const MeshBase &pmesh)
void build_element_and_node_maps (const MeshBase &pmesh)
void compute_border_node_ids (const MeshBase &pmesh)
void compute_internal_and_border_elems_and_internal_nodes (const MeshBase &pmesh)
void compute_communication_map_parameters ()
void compute_node_communication_maps ()
void compute_node_maps ()
void compute_elem_communication_maps ()
void compute_element_maps ()
void write_exodus_initialization_info (const MeshBase &pmesh, const std::string &title)

Private Attributes

std::map< subdomain_id_type,
unsigned > 
local_subdomain_counts
std::set< unsigned > border_node_ids
std::map< unsigned, std::set
< unsigned > > 
proc_nodes_touched_intersections
std::map< unsigned, std::set
< std::pair< unsigned,
unsigned > > > 
proc_border_elem_sets
std::set< unsigned > internal_node_ids
std::set< unsigned > internal_elem_ids
std::set< unsigned > border_elem_ids

Detailed Description

This is the Nemesis_IO_Helper class. Think of it as a big struct with storage for all the stuff one might want to pull from a Nemesis file. Derived from ExodusII_IO_Helper object, since Nemesis is based on the same file format.

Author:
John W. Peterson, 2008.

Definition at line 62 of file nemesis_io_helper.h.


Member Typedef Documentation

typedef std::map<unsigned, std::set<std::pair<unsigned,unsigned> > >::iterator libMesh::Nemesis_IO_Helper::proc_border_elem_sets_iterator [private]

Typedef for an iterator into the data structure above.

Definition at line 558 of file nemesis_io_helper.h.

typedef std::map<unsigned, std::set<unsigned> >::iterator libMesh::Nemesis_IO_Helper::proc_nodes_touched_iterator [private]

Typedef for an iterator into the data structure above.

Definition at line 548 of file nemesis_io_helper.h.


Member Enumeration Documentation

Wraps calls to exII::ex_get_var_names() and exII::ex_get_var_param(). The enumeration controls whether nodal, elemental, or global variable names are read and which class members are filled in. NODAL: num_nodal_vars nodal_var_names ELEMENTAL: num_elem_vars elem_var_names GLOBAL: num_global_vars global_var_names

Enumerator:
NODAL 
ELEMENTAL 
GLOBAL 

Definition at line 533 of file exodusII_io_helper.h.

{NODAL=0, ELEMENTAL=1, GLOBAL=2};

Constructor & Destructor Documentation

libMesh::Nemesis_IO_Helper::Nemesis_IO_Helper ( const ParallelObject parent,
bool  verbose = false,
bool  single_precision = false 
) [explicit]

Constructor.

Definition at line 42 of file nemesis_io_helper.C.

                                                                             :
  ExodusII_IO_Helper(parent, verbose_in, /*run_only_on_proc0=*/false, /*single_precision=*/single_precision),
  nemesis_err_flag(0),
  num_nodes_global(0),
  num_elems_global(0),
  num_elem_blks_global(0),
  num_node_sets_global(0),
  num_side_sets_global(0),
  num_proc(0),
  num_proc_in_file(0),
  ftype('\0'),
  num_internal_nodes(0),
  num_border_nodes(0),
  num_external_nodes(0),
  num_internal_elems(0),
  num_border_elems(0),
  num_node_cmaps(0),
  num_elem_cmaps(0)
{
  // Warn about using untested code!
  libmesh_experimental();
}

Destructor.

Definition at line 67 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::close(), libMesh::ExodusII_IO_Helper::ex_err, and libMesh::ExodusII_IO_Helper::ex_id.

{
  // Our destructor is called from Nemesis_IO.  We close the Exodus file here since we have
  // responsibility for managing the file's lifetime.
  this->ex_err = exII::ex_update(this->ex_id);
  EX_EXCEPTIONLESS_CHECK_ERR(ex_err, "Error flushing buffers to file.");
  this->close();
}

Member Function Documentation

This function builds the libmesh -> exodus and exodus -> libmesh node and element maps. These maps allow us to have a consistent numbering scheme within an Exodus file, given an existing globally consistent numbering scheme from LibMesh.

Definition at line 1705 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), block_id_to_elem_connectivity, libMesh::ExodusII_IO_Helper::block_ids, libMesh::Elem::build(), libMesh::MeshBase::elem(), libMesh::ExodusII_IO_Helper::exodus_elem_num_to_libmesh, libMesh::ExodusII_IO_Helper::exodus_node_num_to_libmesh, libMesh::ExodusII_IO_Helper::Conversion::get_canonical_type(), libMesh::ExodusII_IO_Helper::Conversion::get_node_map(), libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus, libMesh::ExodusII_IO_Helper::libmesh_node_num_to_exodus, local_subdomain_counts, n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::node(), nodes_attached_to_local_elems, libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::num_nodes_per_elem, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::Elem::subdomain_id(), subdomain_map, libMesh::Elem::type(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // If we don't have any local subdomains, it had better be because
  // we don't have any local elements
#ifdef DEBUG
  if (local_subdomain_counts.empty())
    {
      libmesh_assert(pmesh.active_local_elements_begin() ==
                     pmesh.active_local_elements_end());
      libmesh_assert(this->nodes_attached_to_local_elems.empty());
    }
#endif

  // Elements have to be numbered contiguously based on what block
  // number they are in.  Therefore we have to do a bit of work to get
  // the block (ie subdomain) numbers first and store them off as
  // block_ids.

  // Make sure there is no leftover information in the subdomain_map, and reserve
  // enough space to store the elements we need.
  this->subdomain_map.clear();
  for (std::map<subdomain_id_type, unsigned>::iterator it=this->local_subdomain_counts.begin();
       it != this->local_subdomain_counts.end();
       ++it)
    {
      subdomain_id_type cur_subdomain = (*it).first;

      /*
      // We can't have a zero subdomain ID in Exodus (for some reason?)
      // so map zero subdomains to a max value...
      if (cur_subdomain == 0)
      cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
      */

      if (verbose)
        {
          libMesh::out << "[" << this->processor_id() << "] "
                       << "local_subdomain_counts [" << static_cast<unsigned>(cur_subdomain) << "]= "
                       << (*it).second
                       << std::endl;
        }

      // *it.first is the subodmain ID, *it.second is the number of elements it contains
      this->subdomain_map[ cur_subdomain ].reserve( (*it).second );
    }


  // First loop over the elements to figure out which elements are in which subdomain
  MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
  MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();

  for (; elem_it != elem_end; ++elem_it)
    {
      const Elem * elem = *elem_it;

      // Grab the nodes while we're here.
      for (unsigned int n=0; n<elem->n_nodes(); ++n)
        this->nodes_attached_to_local_elems.insert( elem->node(n) );

      subdomain_id_type cur_subdomain = elem->subdomain_id();

      /*
      // We can't have a zero subdomain ID in Exodus (for some reason?)
      // so map zero subdomains to a max value...
      if(cur_subdomain == 0)
      cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
      */

      this->subdomain_map[cur_subdomain].push_back
        (cast_int<unsigned>(elem->id()));
    }

  // Set num_nodes which is used by exodusII_io_helper
  this->num_nodes =
    cast_int<int>(this->nodes_attached_to_local_elems.size());

  // Now come up with a 1-based numbering for these nodes
  this->exodus_node_num_to_libmesh.clear(); // Make sure it's empty
  this->exodus_node_num_to_libmesh.reserve(this->nodes_attached_to_local_elems.size());

  // Also make sure there's no leftover information in the map which goes the
  // other direction.
  this->libmesh_node_num_to_exodus.clear();

  // Set the map for nodes
  for (std::set<int>::iterator it = this->nodes_attached_to_local_elems.begin();
       it != this->nodes_attached_to_local_elems.end();
       ++it)
    {
      // I.e. given exodus_node_id,
      // exodus_node_num_to_libmesh[ exodus_node_id ] returns the libmesh ID for that node.
      // Note that even though most of Exodus is 1-based, this code will map an Exodus ID of
      // zero to some libmesh node ID.  Is that a problem?
      this->exodus_node_num_to_libmesh.push_back(*it);

      // Likewise, given libmesh_node_id,
      // libmesh_node_num_to_exodus[ libmesh_node_id ] returns the *Exodus* ID for that node.
      // Unlike the exodus_node_num_to_libmesh vector above, this one is a std::map
      this->libmesh_node_num_to_exodus[*it] =
        cast_int<int>(this->exodus_node_num_to_libmesh.size()); // should never be zero...
    }

  // Now we're going to loop over the subdomain map and build a few things right
  // now that we'll use later.

  // First make sure our data structures don't have any leftover data...
  this->exodus_elem_num_to_libmesh.clear();
  this->block_ids.clear();
  this->libmesh_elem_num_to_exodus.clear();

  // Now loop over each subdomain and get a unique numbering for the elements
  for (std::map<subdomain_id_type, std::vector<unsigned int> >::iterator it = this->subdomain_map.begin();
       it != this->subdomain_map.end();
       ++it)
    {
      block_ids.push_back((*it).first);

      // Vector of element IDs for this subdomain
      std::vector<unsigned int>& elem_ids_this_subdomain = (*it).second;

      // The code below assumes this subdomain block is not empty, make sure that's the case!
      if (elem_ids_this_subdomain.size() == 0)
        libmesh_error_msg("Error, no element IDs found in subdomain " << (*it).first);

      ExodusII_IO_Helper::ElementMaps em;

      // Use the first element in this block to get representative information.
      // Note that Exodus assumes all elements in a block are of the same type!
      // We are using that same assumption here!
      const ExodusII_IO_Helper::Conversion conv = em.assign_conversion(pmesh.elem(elem_ids_this_subdomain[0])->type());
      this->num_nodes_per_elem = pmesh.elem(elem_ids_this_subdomain[0])->n_nodes();

      // Get a reference to the connectivity vector for this subdomain.  This vector
      // is most likely empty, we are going to fill it up now.
      std::vector<int>& current_block_connectivity = this->block_id_to_elem_connectivity[(*it).first];

      // Just in case it's not already empty...
      current_block_connectivity.clear();
      current_block_connectivity.resize(elem_ids_this_subdomain.size() * this->num_nodes_per_elem);

      for (unsigned int i=0; i<elem_ids_this_subdomain.size(); i++)
        {
          unsigned int elem_id = elem_ids_this_subdomain[i];

          // Set the number map for elements
          this->exodus_elem_num_to_libmesh.push_back(elem_id);
          this->libmesh_elem_num_to_exodus[elem_id] =
            cast_int<int>(this->exodus_elem_num_to_libmesh.size());

          const Elem * elem = pmesh.elem(elem_id);

          // Exodus/Nemesis want every block to have the same element type
          // libmesh_assert_equal_to (elem->type(), conv.get_canonical_type());

          // But we can get away with writing e.g. HEX8 and INFHEX8 in
          // the same block...
          libmesh_assert_equal_to (elem->n_nodes(), Elem::build(conv.get_canonical_type(), NULL)->n_nodes());

          for (unsigned int j=0; j < static_cast<unsigned int>(this->num_nodes_per_elem); j++)
            {
              const unsigned int connect_index   = (i*this->num_nodes_per_elem)+j;
              const unsigned int elem_node_index = conv.get_node_map(j);
              current_block_connectivity[connect_index] = this->libmesh_node_num_to_exodus[elem->node(elem_node_index)];
            }
        } // End loop over elems in this subdomain
    } // end loop over subdomain_map
}
void libMesh::ExodusII_IO_Helper::close ( ) [inherited]

Closes the ExodusII mesh file.

Definition at line 697 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), and libMesh::ParallelObject::processor_id().

Referenced by libMesh::ExodusII_IO::~ExodusII_IO(), and ~Nemesis_IO_Helper().

{
  // Always call close on processor 0.
  // If we're running on multiple processors, i.e. as one of several Nemesis files,
  // we call close on all processors...
  if ((this->processor_id() == 0) || (!_run_only_on_proc0))
    {
      ex_err = exII::ex_close(ex_id);
      EX_CHECK_ERR(ex_err, "Error closing Exodus file.");
      message("Exodus file closed successfully.");
    }
}
const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const [inline, inherited]
Returns:
a reference to the Parallel::Communicator object used by this mesh.

Definition at line 86 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_petsc_snes_residual(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::MetisPartitioner::_do_partition(), libMesh::ParmetisPartitioner::_do_repartition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::ImplicitSystem::add_matrix(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::DofMap::attach_matrix(), libMesh::MeshTools::bounding_box(), libMesh::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::MeshRefinement::coarsen_elements(), compute_num_global_elem_blocks(), compute_num_global_nodesets(), compute_num_global_sidesets(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshSetSystem_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::ParmetisPartitioner::initialize(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::FEMSystem::mesh_position_set(), libMesh::MeshSerializer::MeshSerializer(), libMesh::ParallelMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::ParallelMesh::parallel_max_elem_id(), libMesh::ParallelMesh::parallel_max_node_id(), libMesh::ParallelMesh::parallel_n_elem(), libMesh::ParallelMesh::parallel_n_nodes(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::System::project_vector(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshRefinement::test_level_one(), libMesh::MeshRefinement::test_unflagged(), libMesh::MeshTools::total_weight(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::LegacyXdrIO::write_mesh(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), and libMesh::DivaIO::write_stream().

  { return _communicator; }

This function constructs the set of border node IDs present on the current mesh. These are nodes which live on the "border" between elements which live on different processors.

Definition at line 1877 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), border_node_ids, libMesh::libmesh_assert(), libMesh::Elem::n_nodes(), libMesh::ParallelObject::n_processors(), libMesh::Elem::node(), num_border_nodes, num_node_cmaps, libMesh::out, proc_nodes_touched_intersections, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Parallel::set_union(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // The set which will eventually contain the IDs of "border nodes".  These are nodes
  // that lie on the boundary between one or more processors.
  //std::set<unsigned> border_node_ids;

  // map from processor ID to set of nodes which elements from this processor "touch",
  // that is,
  // proc_nodes_touched[p] = (set all node IDs found in elements owned by processor p)
  std::map<unsigned, std::set<unsigned> > proc_nodes_touched;


  // We are going to create a lot of intermediate data structures here, so make sure
  // as many as possible all cleaned up by creating scope!
  {
    // Loop over active (not just active local) elements, make sets of node IDs for each
    // processor which has an element that "touches" a node.
    {
      MeshBase::const_element_iterator elem_it = pmesh.active_elements_begin();
      MeshBase::const_element_iterator elem_end = pmesh.active_elements_end();

      for (; elem_it != elem_end; ++elem_it)
        {
          const Elem* elem = *elem_it;

          // Get reference to the set for this processor.  If it does not exist
          // it will be created.
          std::set<unsigned>& set_p = proc_nodes_touched[ elem->processor_id() ];

          // Insert all nodes touched by this element into the set
          for (unsigned int node=0; node<elem->n_nodes(); ++node)
            set_p.insert(elem->node(node));
        }
    }

    // The number of node communication maps is the number of other processors
    // with which we share nodes. (I think.) This is just the size of the map we just
    // created, minus 1.
    this->num_node_cmaps =
      cast_int<int>(proc_nodes_touched.size() - 1);

    // If we've got no elements on this processor and haven't touched
    // any nodes, however, then that's 0 other processors with which
    // we share nodes, not -1.
    if (this->num_node_cmaps == -1)
      {
        libmesh_assert (pmesh.active_elements_begin() == pmesh.active_elements_end());
        this->num_node_cmaps = 0;
      }

    // We can't be connecting to more processors than exist outside
    // ourselves
    libmesh_assert_less (static_cast<unsigned>(this->num_node_cmaps), this->n_processors());

    if (verbose)
      {
        libMesh::out << "[" << this->processor_id()
                     << "] proc_nodes_touched contains "
                     << proc_nodes_touched.size()
                     << " sets of nodes."
                     << std::endl;

        for (proc_nodes_touched_iterator it = proc_nodes_touched.begin();
             it != proc_nodes_touched.end();
             ++it)
          {
            libMesh::out << "[" << this->processor_id()
                         << "] proc_nodes_touched[" << (*it).first << "] has "
                         << (*it).second.size()
                         << " entries."
                         << std::endl;
          }
      }


    // Loop over all the sets we just created and compute intersections with the
    // this processor's set.  Obviously, don't intersect with ourself.
    for (proc_nodes_touched_iterator it = proc_nodes_touched.begin();
         it != proc_nodes_touched.end();
         ++it)
      {
        // Don't compute intersections with ourself
        if ((*it).first == this->processor_id())
          continue;

        // Otherwise, compute intersection with other processor and ourself
        std::set<unsigned>& my_set = proc_nodes_touched[this->processor_id()];
        std::set<unsigned>& other_set = (*it).second;
        std::set<unsigned>& result_set = this->proc_nodes_touched_intersections[ (*it).first ]; // created if does not exist

        std::set_intersection(my_set.begin(), my_set.end(),
                              other_set.begin(), other_set.end(),
                              std::inserter(result_set, result_set.end()));
      }

    if (verbose)
      {
        for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
             it != this->proc_nodes_touched_intersections.end();
             ++it)
          {
            libMesh::out << "[" << this->processor_id()
                         << "] this->proc_nodes_touched_intersections[" << (*it).first << "] has "
                         << (*it).second.size()
                         << " entries."
                         << std::endl;
          }
      }

    // Compute the set_union of all the preceding intersections.  This will be the set of
    // border node IDs for this processor.
    for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
         it != this->proc_nodes_touched_intersections.end();
         ++it)
      {
        std::set<unsigned>& other_set = (*it).second;
        std::set<unsigned> intermediate_result; // Don't think we can insert into one of the sets we're unioning...

        std::set_union(this->border_node_ids.begin(), this->border_node_ids.end(),
                       other_set.begin(), other_set.end(),
                       std::inserter(intermediate_result, intermediate_result.end()));

        // Swap our intermediate result into the final set
        this->border_node_ids.swap(intermediate_result);
      }

    if (verbose)
      {
        libMesh::out << "[" << this->processor_id()
                     << "] border_node_ids.size()=" << this->border_node_ids.size()
                     << std::endl;
      }
  } // end scope for border node ID creation

  // Store the number of border node IDs to be written to Nemesis file
  this->num_border_nodes = cast_int<int>(this->border_node_ids.size());
}

This function determines the communication map parameters which will eventually be written to file

Definition at line 1133 of file nemesis_io_helper.C.

References elem_cmap_elem_cnts, elem_cmap_ids, node_cmap_ids, node_cmap_node_cnts, num_elem_cmaps, num_node_cmaps, libMesh::out, proc_border_elem_sets, proc_nodes_touched_intersections, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // For the nodes, these are the number of entries in the sets in proc_nodes_touched_intersections
  // map computed above.  Note: this map does not contain self-intersections so we can loop over it
  // directly.
  this->node_cmap_node_cnts.clear(); // Make sure we don't have any leftover information...
  this->node_cmap_ids.clear();       // Make sure we don't have any leftover information...
  this->node_cmap_node_cnts.resize(this->num_node_cmaps);
  this->node_cmap_ids.resize(this->num_node_cmaps);

  {
    unsigned cnt=0; // Index into the vector
    for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
         it != this->proc_nodes_touched_intersections.end();
         ++it)
      {
        this->node_cmap_ids[cnt] = (*it).first; // The ID of the proc we communicate with
        this->node_cmap_node_cnts[cnt] =
          cast_int<int>((*it).second.size());   // The number of nodes we communicate
        cnt++; // increment vector index!
      }
  }

  // Print the packed vectors we just filled
  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] node_cmap_node_cnts = ";
      for (unsigned i=0; i<node_cmap_node_cnts.size(); ++i)
        libMesh::out << node_cmap_node_cnts[i] << ", ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] node_cmap_ids = ";
      for (unsigned i=0; i<node_cmap_ids.size(); ++i)
        libMesh::out << node_cmap_ids[i] << ", ";
      libMesh::out << std::endl;
    }

  // For the elements, we have not yet computed all this information..
  this->elem_cmap_elem_cnts.clear(); // Make sure we don't have any leftover information...
  this->elem_cmap_ids.clear();       // Make sure we don't have any leftover information...
  this->elem_cmap_elem_cnts.resize(this->num_elem_cmaps);
  this->elem_cmap_ids.resize(this->num_elem_cmaps);

  // Pack the elem_cmap_ids and elem_cmap_elem_cnts vectors
  {
    unsigned cnt=0; // Index into the vectors we're filling
    for (proc_border_elem_sets_iterator it = this->proc_border_elem_sets.begin();
         it != this->proc_border_elem_sets.end();
         ++it)
      {
        this->elem_cmap_ids[cnt] = (*it).first; // The ID of the proc we communicate with
        this->elem_cmap_elem_cnts[cnt] =
          cast_int<int>((*it).second.size()); // The number of elems we communicate to/from that proc
        cnt++; // increment vector index!
      }
  }

  // Print the packed vectors we just filled
  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] elem_cmap_elem_cnts = ";
      for (unsigned i=0; i<elem_cmap_elem_cnts.size(); ++i)
        libMesh::out << elem_cmap_elem_cnts[i] << ", ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] elem_cmap_ids = ";
      for (unsigned i=0; i<elem_cmap_ids.size(); ++i)
        libMesh::out << elem_cmap_ids[i] << ", ";
      libMesh::out << std::endl;
    }
}

This function computes element communication maps (really just packs vectors) in preparation for writing them to file.

Definition at line 980 of file nemesis_io_helper.C.

References elem_cmap_elem_ids, elem_cmap_ids, elem_cmap_proc_ids, elem_cmap_side_ids, libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus, num_elem_cmaps, and proc_border_elem_sets.

Referenced by initialize().

{
  // Make sure there is no leftover information
  this->elem_cmap_elem_ids.clear();
  this->elem_cmap_side_ids.clear();
  this->elem_cmap_proc_ids.clear();

  // Allocate enough space for all our element maps
  this->elem_cmap_elem_ids.resize(this->num_elem_cmaps);
  this->elem_cmap_side_ids.resize(this->num_elem_cmaps);
  this->elem_cmap_proc_ids.resize(this->num_elem_cmaps);
  {
    unsigned cnt=0; // Index into vectors
    for (proc_border_elem_sets_iterator it=this->proc_border_elem_sets.begin();
         it != this->proc_border_elem_sets.end();
         ++it)
      {
        // Make sure the current elem_cmap_id matches the index in our map of node intersections
        libmesh_assert_equal_to ( static_cast<unsigned>(this->elem_cmap_ids[cnt]), (*it).first );

        // Get reference to the set of IDs to be packed into the vector
        std::set<std::pair<unsigned,unsigned> >& elem_set = (*it).second;

        // Resize the vectors to receive their payload
        this->elem_cmap_elem_ids[cnt].resize(elem_set.size());
        this->elem_cmap_side_ids[cnt].resize(elem_set.size());
        this->elem_cmap_proc_ids[cnt].resize(elem_set.size());

        std::set<std::pair<unsigned,unsigned> >::iterator elem_set_iter = elem_set.begin();

        // Pack the vectors with elem IDs, side IDs, and processor IDs.
        for (unsigned j=0; j<this->elem_cmap_elem_ids[cnt].size(); ++j, ++elem_set_iter)
          {
            this->elem_cmap_elem_ids[cnt][j] = libmesh_elem_num_to_exodus[(*elem_set_iter).first];//  + 1; // Elem ID, Exodus is 1-based
            this->elem_cmap_side_ids[cnt][j] = (*elem_set_iter).second;     // Side ID, this has already been converted above
            this->elem_cmap_proc_ids[cnt][j] = (*it).first; // All have the same processor ID
          }

        cnt++;// increment vector index to go to next processor
      }
  } // end scope for packing
}

This function computes element maps (really just packs vectors) which map the elements to internal and border elements.

Definition at line 951 of file nemesis_io_helper.C.

References border_elem_ids, elem_mapb, elem_mapi, internal_elem_ids, and libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus.

Referenced by initialize().

{
  // Make sure we don't have any leftover info
  this->elem_mapi.clear();
  this->elem_mapb.clear();

  // Copy set contents into vectors
  this->elem_mapi.resize(this->internal_elem_ids.size());
  this->elem_mapb.resize(this->border_elem_ids.size());

  {
    unsigned cnt = 0;
    for (std::set<unsigned>::iterator it=this->internal_elem_ids.begin();
         it != this->internal_elem_ids.end();
         ++it, ++cnt)
      this->elem_mapi[cnt] = libmesh_elem_num_to_exodus[(*it)]; // + 1; // Exodus is 1-based!
  }

  {
    unsigned cnt = 0;
    for (std::set<unsigned>::iterator it=this->border_elem_ids.begin();
         it != this->border_elem_ids.end();
         ++it, ++cnt)
      this->elem_mapb[cnt] = libmesh_elem_num_to_exodus[(*it)]; // + 1; // Exodus is 1-based!
  }
}

This function constructs the set of border and internal element IDs and internal node IDs present on the current mesh.

Definition at line 1209 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), border_elem_ids, border_node_ids, libMesh::ExodusII_IO_Helper::Conversion::get_inverse_side_map(), libMesh::DofObject::id(), internal_elem_ids, internal_node_ids, libMesh::Elem::n_neighbors(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor(), libMesh::Elem::node(), nodes_attached_to_local_elems, num_border_elems, num_border_nodes, num_elem_cmaps, num_internal_elems, num_internal_nodes, libMesh::out, proc_border_elem_sets, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Elem::type(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // Set of all local, active element IDs.  After we have identified border element
  // IDs, the set_difference between this set and the border_elem_ids set will give us
  // the set of internal_elem_ids.
  std::set<unsigned> all_elem_ids;

  // A set of processor IDs which elements on this processor have as
  // neighbors.  The size of this set will determine the number of
  // element communication maps in Exodus.
  std::set<unsigned> neighboring_processor_ids;

  // Will be used to create conversion objects capable of mapping libmesh
  // element numberings into Nemesis numberings.
  ExodusII_IO_Helper::ElementMaps element_mapper;

  MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
  MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();

  for (; elem_it != elem_end; ++elem_it)
    {
      const Elem* elem = *elem_it;

      // Add this Elem's ID to all_elem_ids, later we will take the difference
      // between this set and the set of border_elem_ids, to get the set of
      // internal_elem_ids.
      all_elem_ids.insert(elem->id());

      // Will be set to true if element is determined to be a border element
      bool is_border_elem = false;

      // Construct a conversion object for this Element.  This will help us map
      // Libmesh numberings into Nemesis numberings for sides.
      ExodusII_IO_Helper::Conversion conv = element_mapper.assign_conversion(elem->type());

      // Add all this element's node IDs to the set of all node IDs.
      // The set of internal_node_ids will be the set difference between
      // the set of all nodes and the set of border nodes.
      //
      // In addition, if any node of a local node is listed in the
      // border nodes list, then this element goes into the proc_border_elem_sets.
      // Note that there is not a 1:1 correspondence between
      // border_elem_ids and the entries which go into proc_border_elem_sets.
      // The latter is for communication purposes, ie determining which elements
      // should be shared between processors.
      for (unsigned int node=0; node<elem->n_nodes(); ++node)
        {
          this->nodes_attached_to_local_elems.insert(elem->node(node));
        } // end loop over element's nodes

      // Loop over element's neighbors, see if it has a neighbor which is off-processor
      for (unsigned int n=0; n<elem->n_neighbors(); ++n)
        {
          if (elem->neighbor(n) != NULL)
            {
              unsigned neighbor_proc_id = elem->neighbor(n)->processor_id();

              // If my neighbor has a different processor ID, I must be a border element.
              // Also track the neighboring processor ID if it is are different from our processor ID
              if (neighbor_proc_id != this->processor_id())
                {
                  is_border_elem = true;
                  neighboring_processor_ids.insert(neighbor_proc_id);

                  // Convert libmesh side(n) of this element into a side ID for Nemesis
                  unsigned nemesis_side_id = conv.get_inverse_side_map(n);

                  if (verbose)
                    libMesh::out << "[" << this->processor_id() << "] LibMesh side "
                                 << n
                                 << " mapped to (1-based) Exodus side "
                                 << nemesis_side_id
                                 << std::endl;

                  // Add this element's ID and the ID of the side which is on the boundary
                  // to the set of border elements for this processor.
                  // Note: if the set does not already exist, this creates it.
                  this->proc_border_elem_sets[ neighbor_proc_id ].insert( std::make_pair(elem->id(), nemesis_side_id) );
                }
            }
        } // end for loop over neighbors

      // If we're on a border element, add it to the set
      if (is_border_elem)
        this->border_elem_ids.insert( elem->id() );

    } // end for loop over active local elements

  // Take the set_difference between all elements and border elements to get internal
  // element IDs
  std::set_difference(all_elem_ids.begin(), all_elem_ids.end(),
                      this->border_elem_ids.begin(), this->border_elem_ids.end(),
                      std::inserter(this->internal_elem_ids, this->internal_elem_ids.end()));

  // Take the set_difference between all nodes and border nodes to get internal nodes
  std::set_difference(this->nodes_attached_to_local_elems.begin(), this->nodes_attached_to_local_elems.end(),
                      this->border_node_ids.begin(), this->border_node_ids.end(),
                      std::inserter(this->internal_node_ids, this->internal_node_ids.end()));

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] neighboring_processor_ids = ";
      for (std::set<unsigned>::iterator it = neighboring_processor_ids.begin();
           it != neighboring_processor_ids.end();
           ++it)
        {
          libMesh::out << *it << " ";
        }
      libMesh::out << std::endl;
    }

  // The size of the neighboring_processor_ids set should be the number of element communication maps
  this->num_elem_cmaps =
    cast_int<int>(neighboring_processor_ids.size());

  if (verbose)
    libMesh::out << "[" << this->processor_id() << "] "
                 << "Number of neighboring processor IDs="
                 << this->num_elem_cmaps
                 << std::endl;

  if (verbose)
    {
      // Print out counts of border elements for each processor
      for (proc_border_elem_sets_iterator it=this->proc_border_elem_sets.begin();
           it != this->proc_border_elem_sets.end(); ++it)
        {
          libMesh::out << "[" << this->processor_id() << "] "
                       << "Proc "
                       << (*it).first << " communicates "
                       << (*it).second.size() << " elements." << std::endl;
        }
    }

  // Store the number of internal and border elements, and the number of internal nodes,
  // to be written to the Nemesis file.
  this->num_internal_elems =
    cast_int<int>(this->internal_elem_ids.size());
  this->num_border_elems   =
    cast_int<int>(this->border_elem_ids.size());
  this->num_internal_nodes =
    cast_int<int>(this->internal_node_ids.size());

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] num_internal_nodes=" << this->num_internal_nodes << std::endl;
      libMesh::out << "[" << this->processor_id() << "] num_border_nodes=" << this->num_border_nodes << std::endl;
      libMesh::out << "[" << this->processor_id() << "] num_border_elems=" << this->num_border_elems << std::endl;
      libMesh::out << "[" << this->processor_id() << "] num_internal_elems=" << this->num_internal_elems << std::endl;
    }
}

Compute the node communcation maps (really just pack vectors) in preparation for writing them to file.

Definition at line 1064 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::libmesh_node_num_to_exodus, node_cmap_ids, node_cmap_node_ids, node_cmap_proc_ids, num_node_cmaps, libMesh::out, proc_nodes_touched_intersections, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // Make sure there's no left-over information
  this->node_cmap_node_ids.clear();
  this->node_cmap_proc_ids.clear();

  // Allocate enough space for all our node maps
  this->node_cmap_node_ids.resize(this->num_node_cmaps);
  this->node_cmap_proc_ids.resize(this->num_node_cmaps);
  {
    unsigned cnt=0; // Index into vectors
    for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
         it != this->proc_nodes_touched_intersections.end();
         ++it)
      {
        // Make sure the current node_cmap_id matches the index in our map of node intersections
        libmesh_assert_equal_to ( static_cast<unsigned>(this->node_cmap_ids[cnt]), (*it).first );

        // Get reference to the set of IDs to be packed into the vector.
        std::set<unsigned>& node_set = (*it).second;

        //libMesh::out << "[" << this->processor_id() << "] node_set.size()=" << node_set.size() << std::endl;

        // Resize the vectors to receive their payload
        this->node_cmap_node_ids[cnt].resize(node_set.size());
        this->node_cmap_proc_ids[cnt].resize(node_set.size());

        std::set<unsigned>::iterator node_set_iter = node_set.begin();

        // Pack the vectors with node IDs and processor IDs.
        for (unsigned j=0; j<this->node_cmap_node_ids[cnt].size(); ++j, ++node_set_iter)
          {
            this->node_cmap_node_ids[cnt][j] = this->libmesh_node_num_to_exodus[*node_set_iter];//(*node_set_iter) + 1; // Exodus is 1-based
            this->node_cmap_proc_ids[cnt][j] = (*it).first;
          }

        cnt++;// increment vector index to go to next processor
      }
  } // end scope for packing

  // if (verbose)
  //   libMesh::out << "Done packing." << std::endl;

  // Print out the vectors we just packed
  if (verbose)
    {
      for (unsigned i=0; i<this->node_cmap_node_ids.size(); ++i)
        {
          libMesh::out << "[" << this->processor_id() << "] nodes communicated to proc "
                       << this->node_cmap_ids[i]
                       << " = ";
          for (unsigned j=0; j<this->node_cmap_node_ids[i].size(); ++j)
            libMesh::out << this->node_cmap_node_ids[i][j] << " ";
          libMesh::out << std::endl;
        }

      for (unsigned i=0; i<this->node_cmap_node_ids.size(); ++i)
        {
          libMesh::out << "[" << this->processor_id() << "] processor ID node communicated to = ";
          for (unsigned j=0; j<this->node_cmap_proc_ids[i].size(); ++j)
            libMesh::out << this->node_cmap_proc_ids[i][j] << " ";
          libMesh::out << std::endl;
        }
    }
}

Compute the node maps (really just pack vectors) which map the nodes to internal, border, and external nodes in the file.

Definition at line 1027 of file nemesis_io_helper.C.

References border_node_ids, internal_node_ids, libMesh::ExodusII_IO_Helper::libmesh_node_num_to_exodus, node_mapb, node_mape, and node_mapi.

Referenced by initialize().

{
  // Make sure we don't have any leftover information
  this->node_mapi.clear();
  this->node_mapb.clear();
  this->node_mape.clear();

  // Make sure there's enough space to hold all our node IDs
  this->node_mapi.resize(this->internal_node_ids.size());
  this->node_mapb.resize(this->border_node_ids.size());

  // Copy set contents into vectors
  //
  // Can't use insert, since we are copying unsigned's into vector<int>...
  // this->node_mapi.insert(internal_node_ids.begin(), internal_node_ids.end());
  // this->node_mapb.insert(boundary_node_ids.begin(), boundary_node_ids.end());
  {
    unsigned cnt = 0;
    for (std::set<unsigned>::iterator it=this->internal_node_ids.begin();
         it != this->internal_node_ids.end();
         ++it, ++cnt)
      this->node_mapi[cnt] = this->libmesh_node_num_to_exodus[*it];// + 1; // Exodus is 1-based!
  }

  {
    unsigned cnt=0;
    for (std::set<unsigned>::iterator it=this->border_node_ids.begin();
         it != this->border_node_ids.end();
         ++it, ++cnt)
      this->node_mapb[cnt] = this->libmesh_node_num_to_exodus[*it];// + 1; // Exodus is 1-based!
  }
}

This function uses global communication routines to determine the number of element blocks across the entire mesh.

Definition at line 1595 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::Parallel::Communicator::allgather(), libMesh::ParallelObject::comm(), global_elem_blk_cnts, global_elem_blk_ids, local_subdomain_counts, num_elem_blks_global, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::Elem::subdomain_id(), libMesh::Parallel::Communicator::sum(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // 1.) Loop over active local elements, build up set of subdomain IDs.
  std::set<subdomain_id_type> global_subdomain_ids;

  // This map keeps track of the number of elements in each subdomain over all processors
  std::map<subdomain_id_type, unsigned> global_subdomain_counts;

  MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
  MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();

  for (; elem_it != elem_end; ++elem_it)
    {
      const Elem* elem = *elem_it;

      subdomain_id_type cur_subdomain = elem->subdomain_id();

      /*
      // We can't have a zero subdomain ID in Exodus (for some reason?)
      // so map zero subdomains to a max value...
      if (cur_subdomain == 0)
      cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
      */

      global_subdomain_ids.insert(cur_subdomain);

      // Increment the count of elements in this subdomain
      global_subdomain_counts[cur_subdomain]++;
    }

  // We're next going to this->comm().sum the subdomain counts, so save the local counts
  this->local_subdomain_counts = global_subdomain_counts;

  {
    // 2.) Copy local subdomain IDs into a vector for communication
    std::vector<subdomain_id_type> global_subdomain_ids_vector(global_subdomain_ids.begin(),
                                                               global_subdomain_ids.end());

    // 3.) Gather them into an enlarged vector
    this->comm().allgather(global_subdomain_ids_vector);

    // 4.) Insert any new IDs into the set (any duplicates will be dropped)
    global_subdomain_ids.insert(global_subdomain_ids_vector.begin(),
                                global_subdomain_ids_vector.end());
  }

  // 5.) Now global_subdomain_ids actually contains a global list of all subdomain IDs
  this->num_elem_blks_global =
    cast_int<int>(global_subdomain_ids.size());

  // Print the number of elements found locally in each subdomain
  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] ";
      for (std::map<subdomain_id_type, unsigned>::iterator it=global_subdomain_counts.begin();
           it != global_subdomain_counts.end();
           ++it)
        {
          libMesh::out << "ID: "
                       << static_cast<unsigned>((*it).first)
                       << ", Count: " << (*it).second << ", ";
        }
      libMesh::out << std::endl;
    }

  // 6.) this->comm().sum up the number of elements in each block.  We know the global
  // subdomain IDs, so pack them into a vector one by one.  Use a vector of int since
  // that is what Nemesis wants
  this->global_elem_blk_cnts.resize(global_subdomain_ids.size());

  unsigned cnt=0;
  for (std::set<subdomain_id_type>::iterator it=global_subdomain_ids.begin();
       it != global_subdomain_ids.end(); ++it)
    {
      // Find the entry in the local map, note: if not found, will be created with 0 default value, which is OK...
      this->global_elem_blk_cnts[cnt++] = global_subdomain_counts[*it];
    }

  // Sum up subdomain counts from all processors
  this->comm().sum(this->global_elem_blk_cnts);

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] global_elem_blk_cnts = ";
      for (unsigned i=0; i<this->global_elem_blk_cnts.size(); ++i)
        libMesh::out << this->global_elem_blk_cnts[i] << ", ";
      libMesh::out << std::endl;
    }

  // 7.) Create a vector<int> from the global_subdomain_ids set, for passing to Nemesis
  this->global_elem_blk_ids.clear();
  this->global_elem_blk_ids.insert(this->global_elem_blk_ids.end(), // pos
                                   global_subdomain_ids.begin(),
                                   global_subdomain_ids.end());

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] global_elem_blk_ids = ";
      for (unsigned i=0; i<this->global_elem_blk_ids.size(); ++i)
        libMesh::out << this->global_elem_blk_ids[i] << ", ";
      libMesh::out << std::endl;
    }


  // 8.) We will call put_eb_info_global later, it must be called after this->put_init_global().
}

This function uses global communication routines to determine the number of nodesets across the entire mesh.

Definition at line 1472 of file nemesis_io_helper.C.

References libMesh::BoundaryInfo::build_node_list(), libMesh::ParallelObject::comm(), libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::get_node_boundary_ids(), global_nodeset_ids, libMesh::MeshBase::node_ptr(), num_global_node_counts, num_node_sets_global, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Parallel::Communicator::set_union(), libMesh::Parallel::Communicator::sum(), libMesh::swap(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  std::set<boundary_id_type> local_node_boundary_ids;

  // 1.) Get reference to the set of node boundary IDs *for this processor*
  std::set<boundary_id_type> global_node_boundary_ids
    (pmesh.get_boundary_info().get_node_boundary_ids().begin(),
     pmesh.get_boundary_info().get_node_boundary_ids().end());

  // Save a copy of the local_node_boundary_ids...
  local_node_boundary_ids = global_node_boundary_ids;

  // 2.) Gather boundary node IDs from other processors
  this->comm().set_union(global_node_boundary_ids);

  // 3.) Now global_node_boundary_ids actually contains a global list of all node boundary IDs
  this->num_node_sets_global =
    cast_int<int>(global_node_boundary_ids.size());

  // 4.) Create a vector<int> from the global_node_boundary_ids set
  this->global_nodeset_ids.clear();
  this->global_nodeset_ids.insert(this->global_nodeset_ids.end(),
                                  global_node_boundary_ids.begin(),
                                  global_node_boundary_ids.end());

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] global_nodeset_ids = ";
      for (unsigned i=0; i<global_nodeset_ids.size(); ++i)
        libMesh::out << global_nodeset_ids[i] << ", ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] local_node_boundary_ids = ";
      for (std::set<boundary_id_type>::iterator it = local_node_boundary_ids.begin();
           it != local_node_boundary_ids.end();
           ++it)
        libMesh::out << *it << ", ";
      libMesh::out << std::endl;
    }

  // 7.) We also need to know the number of nodes which is in each of the nodesets, globally.
  // There is probably a better way to do this...
  std::vector<dof_id_type> boundary_node_list;
  std::vector<boundary_id_type> boundary_node_boundary_id_list;
  pmesh.get_boundary_info().build_node_list
    (boundary_node_list, boundary_node_boundary_id_list);

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] boundary_node_list.size()="
                   << boundary_node_list.size() << std::endl;
      libMesh::out << "[" << this->processor_id() << "] (boundary_node_id, boundary_id) = ";
      for (unsigned i=0; i<boundary_node_list.size(); ++i)
        {
          libMesh::out << "(" << boundary_node_list[i] << ", " << boundary_node_boundary_id_list[i] << ") ";
        }
      libMesh::out << std::endl;
    }

  // Now get the global information.  In this case, we only want to count boundary
  // information for nodes *owned* by this processor, so there are no duplicates.

  // Make sure we don't have any left over information
  this->num_global_node_counts.clear();
  this->num_global_node_counts.resize(this->global_nodeset_ids.size());

  // Unfortunately, we can't just count up all occurrences of a given id,
  // that would give us duplicate entries when we do the parallel summation.
  // So instead, only count entries for nodes owned by this processor.
  // Start by getting rid of all non-local node entries from the vectors.
  std::vector<dof_id_type>::iterator it_node=boundary_node_list.begin();
  std::vector<boundary_id_type>::iterator it_id=boundary_node_boundary_id_list.begin();

  // New end iterators, to be updated as we find non-local IDs
  std::vector<dof_id_type>::iterator new_node_list_end = boundary_node_list.end();
  std::vector<boundary_id_type>::iterator new_boundary_id_list_end = boundary_node_boundary_id_list.end();
  for ( ; it_node != new_node_list_end; )
    {
      if (pmesh.node_ptr( *it_node )->processor_id() != this->processor_id())
        {
          // Back up the new end iterators to prepare for swap
          --new_node_list_end;
          --new_boundary_id_list_end;

          // Swap places, the non-local node will now be "past-the-end"
          std::swap (*it_node, *new_node_list_end);
          std::swap (*it_id, *new_boundary_id_list_end);
        }
      else // node is local, go to next
        {
          ++it_node;
          ++it_id;
        }
    }

  // Erase from "new" end to old end on each vector.
  boundary_node_list.erase(new_node_list_end, boundary_node_list.end());
  boundary_node_boundary_id_list.erase(new_boundary_id_list_end, boundary_node_boundary_id_list.end());

  // Now we can do the local count for each ID...
  for (unsigned i=0; i<global_nodeset_ids.size(); ++i)
    {
      this->num_global_node_counts[i] = cast_int<int>
        (std::count(boundary_node_boundary_id_list.begin(),
                    boundary_node_boundary_id_list.end(),
                    cast_int<boundary_id_type>(this->global_nodeset_ids[i])));
    }

  // And finally we can sum them up
  this->comm().sum(this->num_global_node_counts);

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] num_global_node_counts = ";
      for (unsigned i=0; i<num_global_node_counts.size(); ++i)
        libMesh::out << num_global_node_counts[i] << ", ";
      libMesh::out << std::endl;
    }
}

This function uses global communication routines to determine the number of sidesets across the entire mesh.

Definition at line 1363 of file nemesis_io_helper.C.

References libMesh::BoundaryInfo::build_side_list(), libMesh::ParallelObject::comm(), libMesh::MeshBase::elem(), libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::get_side_boundary_ids(), global_sideset_ids, num_global_side_counts, num_side_sets_global, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::Parallel::Communicator::set_union(), libMesh::Parallel::Communicator::sum(), libMesh::swap(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{
  // 1.) Get reference to the set of side boundary IDs
  std::set<boundary_id_type> global_side_boundary_ids
    (pmesh.get_boundary_info().get_side_boundary_ids().begin(),
     pmesh.get_boundary_info().get_side_boundary_ids().end());

  // 2.) Gather boundary side IDs from other processors
  this->comm().set_union(global_side_boundary_ids);

  // 3.) Now global_side_boundary_ids actually contains a global list of all side boundary IDs
  this->num_side_sets_global =
    cast_int<int>(global_side_boundary_ids.size());

  // 4.) Pack these sidesets into a vector so they can be written by Nemesis
  this->global_sideset_ids.clear(); // Make sure there is no leftover information
  this->global_sideset_ids.insert(this->global_sideset_ids.end(),
                                  global_side_boundary_ids.begin(),
                                  global_side_boundary_ids.end());

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] global_sideset_ids = ";
      for (unsigned i=0; i<this->global_sideset_ids.size(); ++i)
        libMesh::out << this->global_sideset_ids[i] << ", ";
      libMesh::out << std::endl;
    }

  // We also need global counts of sides in each of the sidesets.  Again, there may be a
  // better way to do this...
  std::vector<dof_id_type> bndry_elem_list;
  std::vector<unsigned short int> bndry_side_list;
  std::vector<boundary_id_type> bndry_id_list;
  pmesh.get_boundary_info().build_side_list(bndry_elem_list, bndry_side_list, bndry_id_list);

  // Similarly to the nodes, we can't count any sides for elements which aren't local
  std::vector<dof_id_type>::iterator it_elem=bndry_elem_list.begin();
  std::vector<unsigned short>::iterator it_side=bndry_side_list.begin();
  std::vector<boundary_id_type>::iterator it_id=bndry_id_list.begin();

  // New end iterators, to be updated as we find non-local IDs
  std::vector<dof_id_type>::iterator new_bndry_elem_list_end = bndry_elem_list.end();
  std::vector<unsigned short>::iterator new_bndry_side_list_end = bndry_side_list.end();
  std::vector<boundary_id_type>::iterator new_bndry_id_list_end = bndry_id_list.end();

  for ( ; it_elem != new_bndry_elem_list_end; )
    {
      if (pmesh.elem( *it_elem )->processor_id() != this->processor_id())
        {
          // Back up the new end iterators to prepare for swap
          --new_bndry_elem_list_end;
          --new_bndry_side_list_end;
          --new_bndry_id_list_end;

          // Swap places, the non-local elem will now be "past-the-end"
          std::swap (*it_elem, *new_bndry_elem_list_end);
          std::swap (*it_side, *new_bndry_side_list_end);
          std::swap (*it_id, *new_bndry_id_list_end);
        }
      else // elem is local, go to next
        {
          ++it_elem;
          ++it_side;
          ++it_id;
        }
    }

  // Erase from "new" end to old end on each vector.
  bndry_elem_list.erase(new_bndry_elem_list_end, bndry_elem_list.end());
  bndry_side_list.erase(new_bndry_side_list_end, bndry_side_list.end());
  bndry_id_list.erase(new_bndry_id_list_end, bndry_id_list.end());

  this->num_global_side_counts.clear(); // Make sure we don't have any leftover information
  this->num_global_side_counts.resize(this->global_sideset_ids.size());

  // Get the count for each global sideset ID
  for (unsigned i=0; i<global_sideset_ids.size(); ++i)
    {
      this->num_global_side_counts[i] = cast_int<int>
        (std::count(bndry_id_list.begin(),
                    bndry_id_list.end(),
                    cast_int<boundary_id_type>(this->global_sideset_ids[i])));
    }

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] num_global_side_counts = ";
      for (unsigned i=0; i<this->num_global_side_counts.size(); ++i)
        libMesh::out << this->num_global_side_counts[i] << ", ";
      libMesh::out << std::endl;
    }

  // Finally sum up the result
  this->comm().sum(this->num_global_side_counts);

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] num_global_side_counts = ";
      for (unsigned i=0; i<this->num_global_side_counts.size(); ++i)
        libMesh::out << this->num_global_side_counts[i] << ", ";
      libMesh::out << std::endl;
    }
}
std::string libMesh::Nemesis_IO_Helper::construct_nemesis_filename ( const std::string &  base_filename)

Given base_filename, foo.e, constructs the Nemesis filename foo.e.X.Y, where X=n. CPUs and Y=processor ID

Definition at line 2469 of file nemesis_io_helper.C.

References libMesh::ParallelObject::n_processors(), libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Build a filename for this processor.  This code is cut-n-pasted from the read function
  // and should probably be put into a separate function...
  std::ostringstream file_oss;

  // We have to be a little careful here: Nemesis left pads its file
  // numbers based on the number of processors, so for example on 10
  // processors, we'd have:
  // mesh.e.10.00
  // mesh.e.10.01
  // mesh.e.10.02
  // ...
  // mesh.e.10.09

  // And on 100 you'd have:
  // mesh.e.100.000
  // mesh.e.100.001
  // ...
  // mesh.e.128.099

  // Find the length of the highest processor ID
  file_oss << (this->n_processors());
  unsigned int field_width = cast_int<unsigned int>(file_oss.str().size());

  if (verbose)
    libMesh::out << "field_width=" << field_width << std::endl;

  file_oss.str(""); // reset the string stream
  file_oss << base_filename
           << '.' << this->n_processors()
           << '.' << std::setfill('0') << std::setw(field_width) << this->processor_id();

  // Return the resulting string
  return file_oss.str();
}
void libMesh::Nemesis_IO_Helper::create ( std::string  filename) [virtual]

This function is specialized from ExodusII_IO_Helper to create the nodal coordinates stored on the local piece of the Mesh.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 709 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_single_precision, libMesh::ExodusII_IO_Helper::ex_id, std::min(), libMesh::ExodusII_IO_Helper::opened_for_writing, libMesh::out, libMesh::Real, and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Fall back on double precision when necessary since ExodusII
  // doesn't seem to support long double
  int
    comp_ws = 0,
    io_ws = 0;

  if(_single_precision)
    {
      comp_ws = sizeof(float);
      io_ws = sizeof(float);
    }
  else
    {
      comp_ws = cast_int<int>(std::min(sizeof(Real), sizeof(double)));
      io_ws = cast_int<int>(std::min(sizeof(Real), sizeof(double)));
    }

  this->ex_id = exII::ex_create(filename.c_str(), EX_CLOBBER, &comp_ws, &io_ws);

  EX_CHECK_ERR(ex_id, "Error creating Nemesis mesh file.");

  if (verbose)
    libMesh::out << "File created successfully." << std::endl;

  this->opened_for_writing = true;
}
int libMesh::ExodusII_IO_Helper::get_block_id ( int  index) [inherited]

Get the block number for the given block index.

Definition at line 446 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids.

Referenced by libMesh::ExodusII_IO::read(), and libMesh::ExodusII_IO_Helper::write_element_values().

{
  libmesh_assert_less (static_cast<unsigned int>(index), block_ids.size());

  return block_ids[index];
}
std::string libMesh::ExodusII_IO_Helper::get_block_name ( int  index) [inherited]

Get the block name for the given block index if supplied in the mesh file. Otherwise an empty string is returned.

Definition at line 455 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids, and libMesh::ExodusII_IO_Helper::id_to_block_names.

Referenced by libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(index), block_ids.size());

  return id_to_block_names[block_ids[index]];
}

Definition at line 317 of file nemesis_io_helper.C.

References elem_cmap_elem_cnts, elem_cmap_ids, libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_cmap_ids, node_cmap_node_cnts, num_elem_cmaps, num_node_cmaps, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  node_cmap_ids.resize(num_node_cmaps);
  node_cmap_node_cnts.resize(num_node_cmaps);
  elem_cmap_ids.resize(num_elem_cmaps);
  elem_cmap_elem_cnts.resize(num_elem_cmaps);

  nemesis_err_flag =
    Nemesis::ne_get_cmap_params(ex_id,
                                node_cmap_ids.empty()       ? NULL : &node_cmap_ids[0],
                                node_cmap_node_cnts.empty() ? NULL : &node_cmap_node_cnts[0],
                                elem_cmap_ids.empty()       ? NULL : &elem_cmap_ids[0],
                                elem_cmap_elem_cnts.empty() ? NULL : &elem_cmap_elem_cnts[0],
                                this->processor_id());
  EX_CHECK_ERR(nemesis_err_flag, "Error reading cmap parameters!");


  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] ";
      for (unsigned int i=0; i<node_cmap_ids.size(); ++i)
        libMesh::out << "node_cmap_ids["<<i<<"]=" << node_cmap_ids[i] << " ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] ";
      for (unsigned int i=0; i<node_cmap_node_cnts.size(); ++i)
        libMesh::out << "node_cmap_node_cnts["<<i<<"]=" << node_cmap_node_cnts[i] << " ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] ";
      for (unsigned int i=0; i<elem_cmap_ids.size(); ++i)
        libMesh::out << "elem_cmap_ids["<<i<<"]=" << elem_cmap_ids[i] << " ";
      libMesh::out << std::endl;

      libMesh::out << "[" << this->processor_id() << "] ";
      for (unsigned int i=0; i<elem_cmap_elem_cnts.size(); ++i)
        libMesh::out << "elem_cmap_elem_cnts["<<i<<"]=" << elem_cmap_elem_cnts[i] << " ";
      libMesh::out << std::endl;
    }
}
std::vector< std::string > libMesh::ExodusII_IO_Helper::get_complex_names ( const std::vector< std::string > &  names) const [inherited]

Returns a vector with three copies of each element in the provided name vector, starting with r_, i_ and a_ respectively.

Definition at line 1784 of file exodusII_io_helper.C.

Referenced by libMesh::ExodusII_IO::write_element_data(), libMesh::Nemesis_IO::write_global_data(), libMesh::ExodusII_IO::write_global_data(), libMesh::Nemesis_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data_discontinuous().

{
  std::vector<std::string>::const_iterator names_it = names.begin();
  std::vector<std::string>::const_iterator names_end = names.end();

  std::vector<std::string> complex_names;

  // This will loop over all names and create new "complex" names
  // (i.e. names that start with r_, i_ or a_
  for (; names_it != names_end; ++names_it)
    {
//      std::cout << "VARIABLE: " << *names_it << std::endl;
      std::stringstream name_real, name_imag, name_abs;
      name_real << "r_" << *names_it;
      name_imag << "i_" << *names_it;
      name_abs << "a_" << *names_it;

      complex_names.push_back(name_real.str());
      complex_names.push_back(name_imag.str());
      complex_names.push_back(name_abs.str());
    }

  return complex_names;
}

Definition at line 169 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, global_elem_blk_cnts, global_elem_blk_ids, nemesis_err_flag, num_elem_blks_global, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  global_elem_blk_ids.resize(num_elem_blks_global);
  global_elem_blk_cnts.resize(num_elem_blks_global);

  nemesis_err_flag =
    Nemesis::ne_get_eb_info_global(ex_id,
                                   global_elem_blk_ids.empty()  ? NULL : &global_elem_blk_ids[0],
                                   global_elem_blk_cnts.empty() ? NULL : &global_elem_blk_cnts[0]);
  EX_CHECK_ERR(nemesis_err_flag, "Error reading global element block info!");

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] " << "Global Element Block IDs and Counts:" << std::endl;
      for (unsigned int bn=0; bn<global_elem_blk_ids.size(); ++bn)
        {
          libMesh::out << "  [" << this->processor_id() << "] "
                       << "global_elem_blk_ids["<<bn<<"]=" << global_elem_blk_ids[bn]
                       << ", global_elem_blk_cnts["<<bn<<"]=" << global_elem_blk_cnts[bn]
                       << std::endl;
        }
    }
}

Definition at line 397 of file nemesis_io_helper.C.

References elem_cmap_elem_cnts, elem_cmap_elem_ids, elem_cmap_ids, elem_cmap_proc_ids, elem_cmap_side_ids, libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, num_elem_cmaps, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  elem_cmap_elem_ids.resize(num_elem_cmaps);
  elem_cmap_side_ids.resize(num_elem_cmaps);
  elem_cmap_proc_ids.resize(num_elem_cmaps);

  for (unsigned int i=0; i<elem_cmap_elem_ids.size(); ++i)
    {
      elem_cmap_elem_ids[i].resize(elem_cmap_elem_cnts[i]);
      elem_cmap_side_ids[i].resize(elem_cmap_elem_cnts[i]);
      elem_cmap_proc_ids[i].resize(elem_cmap_elem_cnts[i]);

      nemesis_err_flag =
        Nemesis::ne_get_elem_cmap(ex_id,
                                  elem_cmap_ids.empty()         ? 0    : elem_cmap_ids[i],
                                  elem_cmap_elem_ids[i].empty() ? NULL : &elem_cmap_elem_ids[i][0],
                                  elem_cmap_side_ids[i].empty() ? NULL : &elem_cmap_side_ids[i][0],
                                  elem_cmap_proc_ids[i].empty() ? NULL : &elem_cmap_proc_ids[i][0],
                                  this->processor_id());
      EX_CHECK_ERR(nemesis_err_flag, "Error reading elem cmap elem, side, and processor ids!");


      if (verbose)
        {
          libMesh::out << "[" << this->processor_id() << "] elem_cmap_elem_ids["<<i<<"]=";
          for (unsigned int j=0; j<elem_cmap_elem_ids[i].size(); ++j)
            libMesh::out << elem_cmap_elem_ids[i][j] << " ";
          libMesh::out << std::endl;

          // These must be the (local) side IDs (in the ExodusII face numbering scheme)
          // of the sides shared across processors.
          libMesh::out << "[" << this->processor_id() << "] elem_cmap_side_ids["<<i<<"]=";
          for (unsigned int j=0; j<elem_cmap_side_ids[i].size(); ++j)
            libMesh::out << elem_cmap_side_ids[i][j] << " ";
          libMesh::out << std::endl;

          // This is basically a vector, all entries of which are = elem_cmap_ids[i]
          // Not sure if it's always guaranteed to be that or what...
          libMesh::out << "[" << this->processor_id() << "] elem_cmap_proc_ids["<<i<<"]=";
          for (unsigned int j=0; j<elem_cmap_proc_ids[i].size(); ++j)
            libMesh::out << elem_cmap_proc_ids[i][j] << " ";
          libMesh::out << std::endl;
        }
    }
}

Definition at line 244 of file nemesis_io_helper.C.

References elem_mapb, elem_mapi, libMesh::ExodusII_IO_Helper::ex_id, std::min(), nemesis_err_flag, num_border_elems, num_internal_elems, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

{
  elem_mapi.resize(num_internal_elems);
  elem_mapb.resize(num_border_elems);

  nemesis_err_flag =
    Nemesis::ne_get_elem_map(ex_id,
                             elem_mapi.empty() ? NULL : &elem_mapi[0],
                             elem_mapb.empty() ? NULL : &elem_mapb[0],
                             this->processor_id()
                             );
  EX_CHECK_ERR(nemesis_err_flag, "Error reading element maps!");


  if (verbose)
    {
      // These are not contiguous ranges....
      //libMesh::out << "[" << this->processor_id() << "] " << "first interior elem id=" << elem_mapi[0] << std::endl;
      //libMesh::out << "[" << this->processor_id() << "] " << "last interior elem id=" << elem_mapi.back() << std::endl;
      //libMesh::out << "[" << this->processor_id() << "] " << "first boundary elem id=" << elem_mapb[0] << std::endl;
      //libMesh::out << "[" << this->processor_id() << "] " << "last boundary elem id=" << elem_mapb.back() << std::endl;
      libMesh::out << "[" << this->processor_id() << "] elem_mapi[i] = ";
      for (unsigned int i=0; i< static_cast<unsigned int>(num_internal_elems-1); ++i)
        libMesh::out << elem_mapi[i] << ", ";
      libMesh::out << "... " << elem_mapi.back() << std::endl;

      libMesh::out << "[" << this->processor_id() << "] elem_mapb[i] = ";
      for (unsigned int i=0; i< static_cast<unsigned int>(std::min(10, num_border_elems-1)); ++i)
        libMesh::out << elem_mapb[i] << ", ";
      libMesh::out << "... " << elem_mapb.back() << std::endl;
    }
}
const char * libMesh::ExodusII_IO_Helper::get_elem_type ( ) const [inherited]
Returns:
the current element type. Note: the default behavior is for this value to be in all capital letters, e.g. HEX27.

Definition at line 275 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::elem_type.

Referenced by libMesh::ExodusII_IO::read().

{
  return &elem_type[0];
}

Reading functions. These just allocate memory for you and call the Nemesis routines of the same name. They also handle error checking for the Nemesis return value. Be careful calling these at random, some depend on others being called first... Fills: num_nodes_global, num_elems_global, num_elem_blks_global, num_node_sets_global, num_side_sets_global Call after: read_header() Call before: Any other get_* function from this class

Definition at line 78 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, num_elem_blks_global, num_elems_global, num_node_sets_global, num_nodes_global, num_side_sets_global, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  nemesis_err_flag =
    Nemesis::ne_get_init_global(ex_id,
                                &num_nodes_global,
                                &num_elems_global,
                                &num_elem_blks_global,
                                &num_node_sets_global,
                                &num_side_sets_global);
  EX_CHECK_ERR(nemesis_err_flag, "Error reading initial global data!");

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] " << "num_nodes_global=" << num_nodes_global << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_elems_global=" << num_elems_global << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_elem_blks_global=" << num_elem_blks_global << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_node_sets_global=" << num_node_sets_global << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_side_sets_global=" << num_side_sets_global << std::endl;
    }
}

Definition at line 195 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, ftype, nemesis_err_flag, num_proc, num_proc_in_file, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

{
  nemesis_err_flag =
    Nemesis::ne_get_init_info(ex_id,
                              &num_proc,
                              &num_proc_in_file,
                              &ftype);
  EX_CHECK_ERR(nemesis_err_flag, "Error reading initial info!");

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] " << "num_proc=" << num_proc << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_proc_in_file=" << num_proc_in_file << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "ftype=" << ftype << std::endl;
    }
}

Definition at line 214 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, num_border_elems, num_border_nodes, num_elem_cmaps, num_external_nodes, num_internal_elems, num_internal_nodes, num_node_cmaps, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  nemesis_err_flag =
    Nemesis::ne_get_loadbal_param(ex_id,
                                  &num_internal_nodes,
                                  &num_border_nodes,
                                  &num_external_nodes,
                                  &num_internal_elems,
                                  &num_border_elems,
                                  &num_node_cmaps,
                                  &num_elem_cmaps,
                                  this->processor_id() // The ID of the processor for which info is to be read
                                  );
  EX_CHECK_ERR(nemesis_err_flag, "Error reading load balance parameters!");


  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] " << "num_internal_nodes=" << num_internal_nodes << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_border_nodes=" << num_border_nodes << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_external_nodes=" << num_external_nodes << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_internal_elems=" << num_internal_elems << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_border_elems=" << num_border_elems << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_node_cmaps=" << num_node_cmaps << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "num_elem_cmaps=" << num_elem_cmaps << std::endl;
    }
}

Definition at line 360 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_cmap_ids, node_cmap_node_cnts, node_cmap_node_ids, node_cmap_proc_ids, num_node_cmaps, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  node_cmap_node_ids.resize(num_node_cmaps);
  node_cmap_proc_ids.resize(num_node_cmaps);

  for (unsigned int i=0; i<node_cmap_node_ids.size(); ++i)
    {
      node_cmap_node_ids[i].resize(node_cmap_node_cnts[i]);
      node_cmap_proc_ids[i].resize(node_cmap_node_cnts[i]);

      nemesis_err_flag =
        Nemesis::ne_get_node_cmap(ex_id,
                                  node_cmap_ids.empty()         ? 0    : node_cmap_ids[i],
                                  node_cmap_node_ids[i].empty() ? NULL : &node_cmap_node_ids[i][0],
                                  node_cmap_proc_ids[i].empty() ? NULL : &node_cmap_proc_ids[i][0],
                                  this->processor_id());
      EX_CHECK_ERR(nemesis_err_flag, "Error reading node cmap node and processor ids!");

      if (verbose)
        {
          libMesh::out << "[" << this->processor_id() << "] node_cmap_node_ids["<<i<<"]=";
          for (unsigned int j=0; j<node_cmap_node_ids[i].size(); ++j)
            libMesh::out << node_cmap_node_ids[i][j] << " ";
          libMesh::out << std::endl;

          // This is basically a vector, all entries of which are = node_cmap_ids[i]
          // Not sure if it's always guaranteed to be that or what...
          libMesh::out << "[" << this->processor_id() << "] node_cmap_proc_ids["<<i<<"]=";
          for (unsigned int j=0; j<node_cmap_proc_ids[i].size(); ++j)
            libMesh::out << node_cmap_proc_ids[i][j] << " ";
          libMesh::out << std::endl;
        }
    }
}

Definition at line 280 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_mapb, node_mape, node_mapi, num_border_nodes, num_external_nodes, num_internal_nodes, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  node_mapi.resize(num_internal_nodes);
  node_mapb.resize(num_border_nodes);
  node_mape.resize(num_external_nodes);

  nemesis_err_flag =
    Nemesis::ne_get_node_map(ex_id,
                             node_mapi.empty() ? NULL : &node_mapi[0],
                             node_mapb.empty() ? NULL : &node_mapb[0],
                             node_mape.empty() ? NULL : &node_mape[0],
                             this->processor_id()
                             );
  EX_CHECK_ERR(nemesis_err_flag, "Error reading node maps!");

  if (verbose)
    {
      // Remark: The Exodus/Nemesis node numbring is always (?) 1-based!  This means the first interior node id will
      // always be == 1.
      libMesh::out << "[" << this->processor_id() << "] " << "first interior node id=" << node_mapi[0] << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "last interior node id=" << node_mapi.back() << std::endl;

      libMesh::out << "[" << this->processor_id() << "] " << "first boundary node id=" << node_mapb[0] << std::endl;
      libMesh::out << "[" << this->processor_id() << "] " << "last boundary node id=" << node_mapb.back() << std::endl;

      // The number of external nodes is sometimes zero, don't try to access
      // node_mape.back() in this case!
      if (num_external_nodes > 0)
        {
          libMesh::out << "[" << this->processor_id() << "] " << "first external node id=" << node_mape[0] << std::endl;
          libMesh::out << "[" << this->processor_id() << "] " << "last external node id=" << node_mape.back() << std::endl;
        }
    }
}
int libMesh::ExodusII_IO_Helper::get_node_set_id ( int  index) [inherited]

Get the node set id for the given node set index.

Definition at line 482 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::nodeset_ids.

{
  libmesh_assert_less (static_cast<unsigned int>(index), nodeset_ids.size());

  return nodeset_ids[index];
}
std::string libMesh::ExodusII_IO_Helper::get_node_set_name ( int  index) [inherited]

Get the node set name for the given node set index if supplied in the mesh file. Otherwise an empty string is returned.

Definition at line 491 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::id_to_ns_names, and libMesh::ExodusII_IO_Helper::nodeset_ids.

Referenced by libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(index), nodeset_ids.size());

  return id_to_ns_names[nodeset_ids[index]];
}

Definition at line 137 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, global_nodeset_ids, nemesis_err_flag, num_global_node_counts, num_global_node_df_counts, num_node_sets_global, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  if (num_node_sets_global > 0)
    {
      global_nodeset_ids.resize(num_node_sets_global);
      num_global_node_counts.resize(num_node_sets_global);
      num_global_node_df_counts.resize(num_node_sets_global);

      nemesis_err_flag =
        Nemesis::ne_get_ns_param_global(ex_id,
                                        global_nodeset_ids.empty()        ? NULL : &global_nodeset_ids[0],
                                        num_global_node_counts.empty()    ? NULL : &num_global_node_counts[0],
                                        num_global_node_df_counts.empty() ? NULL : &num_global_node_df_counts[0]);
      EX_CHECK_ERR(nemesis_err_flag, "Error reading global nodeset parameters!");

      if (verbose)
        {
          libMesh::out << "[" << this->processor_id() << "] " << "Global Nodeset IDs, Node Counts, and DF counts:" << std::endl;
          for (unsigned int bn=0; bn<global_nodeset_ids.size(); ++bn)
            {
              libMesh::out << "  [" << this->processor_id() << "] "
                           << "global_nodeset_ids["<<bn<<"]=" << global_nodeset_ids[bn]
                           << ", num_global_node_counts["<<bn<<"]=" << num_global_node_counts[bn]
                           << ", num_global_node_df_counts["<<bn<<"]=" << num_global_node_df_counts[bn]
                           << std::endl;
            }
        }
    }
}
int libMesh::ExodusII_IO_Helper::get_side_set_id ( int  index) [inherited]

Get the side set id for the given side set index.

Definition at line 464 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ss_ids.

Referenced by libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(index), ss_ids.size());

  return ss_ids[index];
}
std::string libMesh::ExodusII_IO_Helper::get_side_set_name ( int  index) [inherited]

Get the side set name for the given side set index if supplied in the mesh file. Otherwise an empty string is returned.

Definition at line 473 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::id_to_ss_names, and libMesh::ExodusII_IO_Helper::ss_ids.

Referenced by libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(index), ss_ids.size());

  return id_to_ss_names[ss_ids[index]];
}

Fills: global_sideset_ids, num_global_side_counts, num_global_side_df_counts Call after: get_init_global()

Definition at line 101 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, global_sideset_ids, nemesis_err_flag, num_global_side_counts, num_global_side_df_counts, num_side_sets_global, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read().

{
  if (num_side_sets_global > 0)
    {
      global_sideset_ids.resize(num_side_sets_global);
      num_global_side_counts.resize(num_side_sets_global);

      // df = "distribution factor", not really sure what that is.  I don't yet have a file
      // which has distribution factors so I guess we'll worry about it later...
      num_global_side_df_counts.resize(num_side_sets_global);

      nemesis_err_flag =
        Nemesis::ne_get_ss_param_global(ex_id,
                                        global_sideset_ids.empty()        ? NULL : &global_sideset_ids[0],
                                        num_global_side_counts.empty()    ? NULL : &num_global_side_counts[0],
                                        num_global_side_df_counts.empty() ? NULL : &num_global_side_df_counts[0]);
      EX_CHECK_ERR(nemesis_err_flag, "Error reading global sideset parameters!");

      if (verbose)
        {
          libMesh::out << "[" << this->processor_id() << "] " << "Global Sideset IDs, Side Counts, and DF counts:" << std::endl;
          for (unsigned int bn=0; bn<global_sideset_ids.size(); ++bn)
            {
              libMesh::out << "  [" << this->processor_id() << "] "
                           << "global_sideset_ids["<<bn<<"]=" << global_sideset_ids[bn]
                           << ", num_global_side_counts["<<bn<<"]=" << num_global_side_counts[bn]
                           << ", num_global_side_df_counts["<<bn<<"]=" << num_global_side_df_counts[bn]
                           << std::endl;
            }
        }
    }
}
void libMesh::Nemesis_IO_Helper::initialize ( std::string  title,
const MeshBase mesh,
bool  use_discontinuous = false 
) [virtual]

Specialization of the initialize function from ExodusII_IO_Helper that also writes global initial data to file.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 745 of file nemesis_io_helper.C.

References build_element_and_node_maps(), compute_border_node_ids(), compute_communication_map_parameters(), compute_elem_communication_maps(), compute_element_maps(), compute_internal_and_border_elems_and_internal_nodes(), compute_node_communication_maps(), compute_node_maps(), compute_num_global_elem_blocks(), compute_num_global_nodesets(), compute_num_global_sidesets(), elem_cmap_elem_cnts, elem_cmap_elem_ids, elem_cmap_ids, elem_cmap_proc_ids, elem_cmap_side_ids, elem_mapb, elem_mapi, global_elem_blk_cnts, global_elem_blk_ids, global_nodeset_ids, global_sideset_ids, mesh, libMesh::ParallelObject::n_processors(), node_cmap_ids, node_cmap_node_cnts, node_cmap_node_ids, node_cmap_proc_ids, node_mapb, node_mape, node_mapi, num_border_elems, num_border_nodes, num_elem_blks_global, num_elem_cmaps, num_external_nodes, num_global_node_counts, num_global_node_df_counts, num_global_side_counts, num_global_side_df_counts, num_internal_elems, num_internal_nodes, num_node_cmaps, num_node_sets_global, num_side_sets_global, libMesh::MeshBase::parallel_n_elem(), libMesh::MeshBase::parallel_n_nodes(), put_cmap_params(), put_eb_info_global(), put_elem_cmap(), put_elem_map(), put_init_global(), put_init_info(), put_loadbal_param(), put_node_cmap(), put_node_map(), put_ns_param_global(), put_ss_param_global(), and write_exodus_initialization_info().

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Make sure that the reference passed in is really a ParallelMesh
  // const ParallelMesh& pmesh = cast_ref<const ParallelMesh&>(mesh);
  const MeshBase& pmesh = mesh;

  // According to Nemesis documentation, first call when writing should be to
  // ne_put_init_info().  Our reader doesn't actually call this, but we should
  // strive to be as close to a normal nemesis file as possible...
  this->put_init_info(this->n_processors(), 1, "p");


  // Gather global "initial" information for Nemesis.  This consists of
  // three parts labelled I, II, and III below...

  //
  // I.) Need to compute the number of global element blocks.  To be consistent with
  // Exodus, we also incorrectly associate the number of element blocks with the
  // number of libmesh subdomains...
  //
  this->compute_num_global_elem_blocks(pmesh);

  //
  // II.) Determine the global number of nodesets by communication.
  // This code relies on BoundaryInfo storing side and node
  // boundary IDs separately at the time they are added to the
  // BoundaryInfo object.
  //
  this->compute_num_global_nodesets(pmesh);

  //
  // III.) Need to compute the global number of sidesets by communication:
  // This code relies on BoundaryInfo storing side and node
  // boundary IDs separately at the time they are added to the
  // BoundaryInfo object.
  //
  this->compute_num_global_sidesets(pmesh);

  // Now write the global data obtained in steps I, II, and III to the Nemesis file
  this->put_init_global(pmesh.parallel_n_nodes(),
                        pmesh.parallel_n_elem(),
                        this->num_elem_blks_global, /* I.   */
                        this->num_node_sets_global, /* II.  */
                        this->num_side_sets_global  /* III. */
                        );

  // Next, we'll write global element block information to the file.  This was already
  // gathered in step I. above
  this->put_eb_info_global(this->global_elem_blk_ids,
                           this->global_elem_blk_cnts);


  // Next, write global nodeset information to the file.  This was already gathered in
  // step II. above.
  this->num_global_node_df_counts.clear();
  this->num_global_node_df_counts.resize(this->global_nodeset_ids.size()); // distribution factors all zero...
  this->put_ns_param_global(this->global_nodeset_ids,
                            this->num_global_node_counts,
                            this->num_global_node_df_counts);


  // Next, write global sideset information to the file.  This was already gathered in
  // step III. above.
  this->num_global_side_df_counts.clear();
  this->num_global_side_df_counts.resize(this->global_sideset_ids.size()); // distribution factors all zero...
  this->put_ss_param_global(this->global_sideset_ids,
                            this->num_global_side_counts,
                            this->num_global_side_df_counts);


  // Before we go any further we need to derive consistent node and
  // element numbering schemes for all local elems and nodes connected
  // to local elements.
  //
  // Must be called *after* the local_subdomain_counts map has been constructed
  // by the compute_num_global_elem_blocks() function!
  this->build_element_and_node_maps(pmesh);

  // Next step is to write "load balance" parameters.  Several things need to
  // be computed first though...

  // First we'll collect IDs of border nodes.
  this->compute_border_node_ids(pmesh);

  // Next we'll collect numbers of internal and border elements, and internal nodes.
  // Note: "A border node does not a border element make...", that is, just because one
  // of an element's nodes has been identified as a border node, the element is not
  // necessarily a border element.  It must have a side on the boundary between processors,
  // i.e. have a face neighbor with a different processor id...
  this->compute_internal_and_border_elems_and_internal_nodes(pmesh);

  // Finally we are ready to write the loadbal information to the file
  this->put_loadbal_param(this->num_internal_nodes,
                          this->num_border_nodes,
                          this->num_external_nodes,
                          this->num_internal_elems,
                          this->num_border_elems,
                          this->num_node_cmaps,
                          this->num_elem_cmaps);


  // Now we need to compute the "communication map" parameters.  These are basically
  // lists of nodes and elements which need to be communicated between different processors
  // when the mesh file is read back in.
  this->compute_communication_map_parameters();

  // Write communication map parameters to file.
  this->put_cmap_params(this->node_cmap_ids,
                        this->node_cmap_node_cnts,
                        this->elem_cmap_ids,
                        this->elem_cmap_elem_cnts);


  // Ready the node communication maps.  The node IDs which
  // are communicated are the ones currently stored in
  // proc_nodes_touched_intersections.
  this->compute_node_communication_maps();

  // Write the packed node communication vectors to file.
  this->put_node_cmap(this->node_cmap_node_ids,
                      this->node_cmap_proc_ids);


  // Ready the node maps.  These have nothing to do with communiction, they map
  // the nodes to internal, border, and external nodes in the file.
  this->compute_node_maps();

  // Call the Nemesis API to write the node maps to file.
  this->put_node_map(this->node_mapi,
                     this->node_mapb,
                     this->node_mape);



  // Ready the element communication maps.  This includes border
  // element IDs, sides which are on the border, and the processors to which
  // they are to be communicated...
  this->compute_elem_communication_maps();



  // Call the Nemesis API to write the packed element communication maps vectors to file
  this->put_elem_cmap(this->elem_cmap_elem_ids,
                      this->elem_cmap_side_ids,
                      this->elem_cmap_proc_ids);






  // Ready the Nemesis element maps (internal and border) for writing to file.
  this->compute_element_maps();

  // Call the Nemesis API to write the internal and border element IDs.
  this->put_elem_map(this->elem_mapi,
                     this->elem_mapb);


  // Now write Exodus-specific initialization information, some of which is
  // different when you are using Nemesis.
  this->write_exodus_initialization_info(pmesh, title_in);
} // end initialize()
void libMesh::ExodusII_IO_Helper::initialize_element_variables ( std::vector< std::string >  names) [inherited]

Sets up the nodal variables

Definition at line 1471 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_elem_vars_initialized, libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_existing_vars(), libMesh::ExodusII_IO_Helper::elem_var_names, libMesh::ExodusII_IO_Helper::ELEMENTAL, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::num_elem_blk, libMesh::ExodusII_IO_Helper::num_elem_vars, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::write_var_names().

Referenced by libMesh::ExodusII_IO::write_element_data().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  // Quick return if there are no element variables to write
  if (names.size() == 0)
    return;

  // Quick return if we have already called this function
  if (_elem_vars_initialized)
    return;

  // Be sure that variables in the file match what we are asking for
  if (num_elem_vars > 0)
    {
      this->check_existing_vars(ELEMENTAL, names, this->elem_var_names);
      return;
    }

  // Set the flag so we can skip this stuff on subsequent calls to
  // initialize_element_variables()
  _elem_vars_initialized = true;

  this->write_var_names(ELEMENTAL, names);

  // Form the element variable truth table and send to Exodus.
  // This tells which variables are written to which blocks,
  // and can dramatically speed up writing element variables
  //
  // We really should initialize all entries in the truth table to 0
  // and then loop over all subdomains, setting their entries to 1
  // if a given variable exists on that subdomain.  However,
  // we don't have that information, and the element variables
  // passed to us are padded with zeroes for the blocks where
  // they aren't defined.  To be consistent with that, fill
  // the truth table with ones.
  std::vector<int> truth_tab(num_elem_blk*num_elem_vars, 1);
  ex_err = exII::ex_put_elem_var_tab(ex_id,
                                     num_elem_blk,
                                     num_elem_vars,
                                     &truth_tab[0]);
  EX_CHECK_ERR(ex_err, "Error writing element truth table.");
}
void libMesh::ExodusII_IO_Helper::initialize_global_variables ( std::vector< std::string >  names) [inherited]
void libMesh::ExodusII_IO_Helper::initialize_nodal_variables ( std::vector< std::string >  names) [inherited]

Sets up the nodal variables

Definition at line 1518 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_nodal_vars_initialized, libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_existing_vars(), libMesh::ExodusII_IO_Helper::NODAL, libMesh::ExodusII_IO_Helper::nodal_var_names, libMesh::ExodusII_IO_Helper::num_nodal_vars, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::write_var_names().

Referenced by libMesh::Nemesis_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data_common().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  // Quick return if there are no nodal variables to write
  if (names.size() == 0)
    return;

  // Quick return if we have already called this function
  if (_nodal_vars_initialized)
    return;

  // Be sure that variables in the file match what we are asking for
  if (num_nodal_vars > 0)
    {
      this->check_existing_vars(NODAL, names, this->nodal_var_names);
      return;
    }

  // Set the flag so we can skip the rest of this function on subsequent calls.
  _nodal_vars_initialized = true;

  this->write_var_names(NODAL, names);
}
int libMesh::ExodusII_IO_Helper::inquire ( int  req_info,
std::string  error_msg = "" 
) [inherited]

Generic inquiry, returns the value

Definition at line 712 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, and libMesh::ExodusII_IO_Helper::ex_id.

Referenced by libMesh::ExodusII_IO_Helper::read_num_time_steps(), libMesh::ExodusII_IO_Helper::read_sideset_info(), and libMesh::ExodusII_IO_Helper::write_information_records().

{
  int ret_int = 0;
  char ret_char = 0;
  float ret_float = 0.;

  ex_err = exII::ex_inquire(ex_id,
                            req_info_in,
                            &ret_int,
                            &ret_float,
                            &ret_char);

  EX_CHECK_ERR(ex_err, error_msg);

  return ret_int;
}
void libMesh::ExodusII_IO_Helper::message ( const std::string &  msg,
int  i 
) [inherited]

Prints the message defined in msg, and appends the number i to the end of the message. Useful for printing messages in loops. Can be turned off if verbosity is set to 0.

Definition at line 289 of file exodusII_io_helper.C.

References libMesh::out, and libMesh::ExodusII_IO_Helper::verbose.

{
  if (verbose) libMesh::out << msg << i << "." << std::endl;
}
Returns:
the number of processors in the group.

Definition at line 92 of file parallel_object.h.

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

Referenced by libMesh::ParmetisPartitioner::_do_repartition(), libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::ParallelMesh::assign_unique_ids(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::ParallelMesh::clear(), compute_border_node_ids(), construct_nemesis_filename(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EnsightIO::EnsightIO(), libMesh::MeshBase::get_info(), libMesh::EquationSystems::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), initialize(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshTools::processor_bounding_box(), libMesh::System::project_vector(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::Partitioner::repartition(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::BoundaryInfo::sync(), libMesh::ParallelMesh::update_parallel_id_counts(), libMesh::CheckpointIO::write(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

  { return cast_int<processor_id_type>(_communicator.size()); }
void libMesh::ExodusII_IO_Helper::open ( const char *  filename,
bool  read_only 
) [inherited]

Opens an ExodusII mesh file named filename. If read_only==true, the file will be opened with the EX_READ flag, otherwise it will be opened with the EX_WRITE flag.

Definition at line 296 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::current_filename, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::opened_for_reading, libMesh::ExodusII_IO_Helper::opened_for_writing, libMesh::out, libMesh::Real, and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::Nemesis_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data_common().

{
  // Version of Exodus you are using
  float ex_version = 0.;

  // Word size in bytes of the floating point variables used in the
  // application program (0, 4, or 8)
  int comp_ws = sizeof(Real);

  // Word size in bytes of the floating point data as they are stored
  // in the ExodusII file.  "If this argument is 0, the word size of the
  // floating point data already stored in the file is returned"
  int io_ws = 0;

  ex_id = exII::ex_open(filename,
                        read_only ? EX_READ : EX_WRITE,
                        &comp_ws,
                        &io_ws,
                        &ex_version);

  std::string err_msg = std::string("Error opening ExodusII mesh file: ") + std::string(filename);
  EX_CHECK_ERR(ex_id, err_msg);
  if (verbose) libMesh::out << "File opened successfully." << std::endl;

  if (read_only)
    opened_for_reading = true;
  else
    opened_for_writing = true;

  current_filename = std::string(filename);
}

Prints the ExodusII mesh file header, which includes the mesh title, the number of nodes, number of elements, mesh dimension, number of sidesets, and number of nodesets.

Definition at line 360 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::num_dim, libMesh::ExodusII_IO_Helper::num_elem, libMesh::ExodusII_IO_Helper::num_elem_blk, libMesh::ExodusII_IO_Helper::num_node_sets, libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::num_side_sets, libMesh::out, libMesh::ExodusII_IO_Helper::title, and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  if (verbose)
    libMesh::out << "Title: \t" << &title[0] << std::endl
                 << "Mesh Dimension: \t"   << num_dim << std::endl
                 << "Number of Nodes: \t" << num_nodes << std::endl
                 << "Number of elements: \t" << num_elem << std::endl
                 << "Number of elt blocks: \t" << num_elem_blk << std::endl
                 << "Number of node sets: \t" << num_node_sets << std::endl
                 << "Number of side sets: \t" << num_side_sets << std::endl;
}
void libMesh::ExodusII_IO_Helper::print_nodes ( std::ostream &  out = libMesh::out) [inherited]

Prints the nodal information, by default to libMesh::out.

Definition at line 411 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::x, libMesh::ExodusII_IO_Helper::y, and libMesh::ExodusII_IO_Helper::z.

{
  for (int i=0; i<num_nodes; i++)
    out_stream << "(" << x[i] << ", " << y[i] << ", " << z[i] << ")" << std::endl;
}
Returns:
the rank of this processor in the group.

Definition at line 98 of file parallel_object.h.

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

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::EquationSystems::_read_impl(), libMesh::SerialMesh::active_local_elements_begin(), libMesh::ParallelMesh::active_local_elements_begin(), libMesh::SerialMesh::active_local_elements_end(), libMesh::ParallelMesh::active_local_elements_end(), libMesh::SerialMesh::active_local_subdomain_elements_begin(), libMesh::ParallelMesh::active_local_subdomain_elements_begin(), libMesh::SerialMesh::active_local_subdomain_elements_end(), libMesh::ParallelMesh::active_local_subdomain_elements_end(), libMesh::SerialMesh::active_not_local_elements_begin(), libMesh::ParallelMesh::active_not_local_elements_begin(), libMesh::SerialMesh::active_not_local_elements_end(), libMesh::ParallelMesh::active_not_local_elements_end(), libMesh::ParallelMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::ParallelMesh::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::ParallelMesh::assign_unique_ids(), libMesh::EquationSystems::build_discontinuous_solution_vector(), build_element_and_node_maps(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::DofMap::build_sparsity(), libMesh::ParallelMesh::clear(), libMesh::ExodusII_IO_Helper::close(), compute_border_node_ids(), compute_communication_map_parameters(), compute_internal_and_border_elems_and_internal_nodes(), compute_node_communication_maps(), compute_num_global_elem_blocks(), compute_num_global_nodesets(), compute_num_global_sidesets(), construct_nemesis_filename(), libMesh::ExodusII_IO_Helper::create(), libMesh::ParallelMesh::delete_elem(), libMesh::ParallelMesh::delete_node(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::SerialMesh::facelocal_elements_begin(), libMesh::ParallelMesh::facelocal_elements_begin(), libMesh::SerialMesh::facelocal_elements_end(), libMesh::ParallelMesh::facelocal_elements_end(), libMesh::MeshFunction::find_element(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), get_cmap_params(), get_eb_info_global(), get_elem_cmap(), get_elem_map(), libMesh::MeshBase::get_info(), get_init_global(), get_init_info(), get_loadbal_param(), get_node_cmap(), get_node_map(), get_ns_param_global(), get_ss_param_global(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::ParallelMesh::insert_elem(), libMesh::SparsityPattern::Build::join(), libMesh::DofMap::last_dof(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::SerialMesh::local_elements_begin(), libMesh::ParallelMesh::local_elements_begin(), libMesh::SerialMesh::local_elements_end(), libMesh::ParallelMesh::local_elements_end(), libMesh::SerialMesh::local_level_elements_begin(), libMesh::ParallelMesh::local_level_elements_begin(), libMesh::SerialMesh::local_level_elements_end(), libMesh::ParallelMesh::local_level_elements_end(), libMesh::SerialMesh::local_nodes_begin(), libMesh::ParallelMesh::local_nodes_begin(), libMesh::SerialMesh::local_nodes_end(), libMesh::ParallelMesh::local_nodes_end(), libMesh::SerialMesh::local_not_level_elements_begin(), libMesh::ParallelMesh::local_not_level_elements_begin(), libMesh::SerialMesh::local_not_level_elements_end(), libMesh::ParallelMesh::local_not_level_elements_end(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::SerialMesh::not_local_elements_begin(), libMesh::ParallelMesh::not_local_elements_begin(), libMesh::SerialMesh::not_local_elements_end(), libMesh::ParallelMesh::not_local_elements_end(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::ParallelMesh::ParallelMesh(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::System::project_vector(), put_cmap_params(), put_elem_cmap(), put_elem_map(), put_loadbal_param(), put_node_cmap(), put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::MeshData::read_xdr(), libMesh::SerialMesh::semilocal_elements_begin(), libMesh::ParallelMesh::semilocal_elements_begin(), libMesh::SerialMesh::semilocal_elements_end(), libMesh::ParallelMesh::semilocal_elements_end(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::BoundaryInfo::sync(), libMesh::MeshTools::total_weight(), libMesh::ParallelMesh::update_parallel_id_counts(), libMesh::MeshTools::weight(), libMesh::NameBasedIO::write(), libMesh::ExodusII_IO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_nodesets(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sidesets(), write_sidesets(), libMesh::ExodusII_IO::write_timestep(), and libMesh::ExodusII_IO_Helper::write_timestep().

  { return cast_int<processor_id_type>(_communicator.rank()); }
void libMesh::Nemesis_IO_Helper::put_cmap_params ( std::vector< int > &  node_cmap_ids,
std::vector< int > &  node_cmap_node_cnts,
std::vector< int > &  elem_cmap_ids,
std::vector< int > &  elem_cmap_elem_cnts 
)

Outputs initial information for communication maps. Note: the order of the arguments specified in the Nemsis User's Manual is *wrong*. The correct order is (ids, counts, ids, counts). Must be called after put_loadbal_param().

Definition at line 561 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_cmap_ids, and libMesh::ParallelObject::processor_id().

Referenced by initialize().

{
  // We might not have cmaps on every processor in some corner
  // cases
  if(node_cmap_ids.size())
    {
      nemesis_err_flag =
        Nemesis::ne_put_cmap_params(ex_id,
                                    &node_cmap_ids_in[0],
                                    &node_cmap_node_cnts_in[0],
                                    &elem_cmap_ids_in[0],
                                    &elem_cmap_elem_cnts_in[0],
                                    this->processor_id());
    }

  EX_CHECK_ERR(nemesis_err_flag, "Error writing cmap parameters!");
}
void libMesh::Nemesis_IO_Helper::put_eb_info_global ( std::vector< int > &  global_elem_blk_ids,
std::vector< int > &  global_elem_blk_cnts 
)

Writes global block information to the file .) global_elem_blk_ids - list of block IDs for all blocks present in the mesh .) global_elem_blk_cnts - number of elements in each block for the global mesh

Must be called after put_init_global().

Definition at line 481 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_eb_info_global(ex_id,
                                   &global_elem_blk_ids_in[0],
                                   &global_elem_blk_cnts_in[0]);

  EX_CHECK_ERR(nemesis_err_flag, "Error writing global element block information!");
}
void libMesh::Nemesis_IO_Helper::put_elem_cmap ( std::vector< std::vector< int > > &  elem_cmap_elem_ids,
std::vector< std::vector< int > > &  elem_cmap_side_ids,
std::vector< std::vector< int > > &  elem_cmap_proc_ids 
)

Writes information about elemental communication map.

Note: this class contains vector<vectors>: elem_cmap_elem_ids elem_cmap_side_ids elem_cmap_proc_ids

Must be called after put_cmap_params().

Definition at line 644 of file nemesis_io_helper.C.

References elem_cmap_ids, libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, and libMesh::ParallelObject::processor_id().

Referenced by initialize().

{
  for (unsigned int i=0; i<elem_cmap_ids.size(); ++i)
    {
      nemesis_err_flag =
        Nemesis::ne_put_elem_cmap(ex_id,
                                  this->elem_cmap_ids[i],
                                  &elem_cmap_elem_ids_in[i][0],
                                  &elem_cmap_side_ids_in[i][0],
                                  &elem_cmap_proc_ids_in[i][0],
                                  this->processor_id());

      EX_CHECK_ERR(nemesis_err_flag, "Error writing elem communication map to file!");
    }
}
void libMesh::Nemesis_IO_Helper::put_elem_map ( std::vector< int > &  elem_mapi,
std::vector< int > &  elem_mapb 
)

Outputs IDs of internal and border elements.

Must be called after ne_put_loadbal_param().

Definition at line 665 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, and libMesh::ParallelObject::processor_id().

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_elem_map(ex_id,
                             elem_mapi_in.empty() ? NULL : &elem_mapi_in[0],
                             elem_mapb_in.empty() ? NULL : &elem_mapb_in[0],
                             this->processor_id());

  EX_CHECK_ERR(nemesis_err_flag, "Error writing Nemesis internal and border element maps to file!");
}
void libMesh::Nemesis_IO_Helper::put_init_global ( dof_id_type  num_nodes_global,
dof_id_type  num_elems_global,
unsigned  num_elem_blks_global,
unsigned  num_node_sets_global,
unsigned  num_side_sets_global 
)

Writes global information including: .) global number of nodes .) global number of elems .) global number of element blocks .) global number of node sets .) global number of side sets

Definition at line 462 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_init_global(ex_id,
                                num_nodes_global_in,
                                num_elems_global_in,
                                num_elem_blks_global_in,
                                num_node_sets_global_in,
                                num_side_sets_global_in);

  EX_CHECK_ERR(nemesis_err_flag, "Error writing initial global data!");
}
void libMesh::Nemesis_IO_Helper::put_init_info ( unsigned  num_proc,
unsigned  num_proc_in_file,
const char *  ftype 
)

Writing functions. Writes basic info about the partitioning to file .) num_proc - number of processors .) num_proc_in_file - number of processors in the current file - generally equal to 1 .) ftype = "s" for scalar load-balance file, "p" for parallel file

Definition at line 446 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_init_info(ex_id,
                              num_proc_in,
                              num_proc_in_file_in,
                              const_cast<char*>(ftype_in));

  EX_CHECK_ERR(nemesis_err_flag, "Error writing initial information!");
}
void libMesh::Nemesis_IO_Helper::put_loadbal_param ( unsigned  num_internal_nodes,
unsigned  num_border_nodes,
unsigned  num_external_nodes,
unsigned  num_internal_elems,
unsigned  num_border_elems,
unsigned  num_node_cmaps,
unsigned  num_elem_cmaps 
)

Writes load balance parameters, some of which are described below: .) num_internal_nodes - nodes "wholly" owned by the current processor .) num_border_nodes - nodes local to a processor but residing in an element which also has nodes on other processors .) num_external_nodes - nodes that reside on other processors but whose element "partially" resides on the current processor -- we assert this should be zero on reading! .) num_border_elems - elements local to this processor but whose nodes reside on other processors as well. .) processor - ID of the processor for which information is to be written

Definition at line 535 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, and libMesh::ParallelObject::processor_id().

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_loadbal_param(ex_id,
                                  num_internal_nodes_in,
                                  num_border_nodes_in,
                                  num_external_nodes_in,
                                  num_internal_elems_in,
                                  num_border_elems_in,
                                  num_node_cmaps_in,
                                  num_elem_cmaps_in,
                                  this->processor_id());

  EX_CHECK_ERR(nemesis_err_flag, "Error writing loadbal parameters!");
}
void libMesh::Nemesis_IO_Helper::put_n_coord ( unsigned  start_node_num,
unsigned  num_nodes,
std::vector< Real > &  x_coor,
std::vector< Real > &  y_coor,
std::vector< Real > &  z_coor 
)

Writes the specified number of coordinate values starting at the specified index.

Definition at line 682 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

{
  nemesis_err_flag =
    Nemesis::ne_put_n_coord(ex_id,
                            start_node_num,
                            num_nodes_in,
                            &x_coor[0],
                            &y_coor[0],
                            &z_coor[0]);

  EX_CHECK_ERR(nemesis_err_flag, "Error writing coords to file!");
}
void libMesh::Nemesis_IO_Helper::put_node_cmap ( std::vector< std::vector< int > > &  node_cmap_node_ids,
std::vector< std::vector< int > > &  node_cmap_proc_ids 
)

Outputs *all* of the nodal communication maps for this processor. Internally, this function loops over all communication maps and calls Nemesis::ne_put_node_cmap() for each one.

.) node_cmap_node_ids = Nodal IDs of the FEM nodes in this communication map .) node_cmap_proc_ids = processor IDs associated with each of the nodes in node_ids

In the Nemesis file, these all appeart to be written to the same chunks of data: n_comm_nids and n_comm_proc, but don't rely on these names...

Note: this class contains vector<vectors>: node_cmap_node_ids node_cmap_proc_ids which can be used when calling this function.

Must be called after put_cmap_params().

Definition at line 585 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_cmap_ids, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by initialize().

{

  // Print to screen what we are about to print to Nemesis file
  if (verbose)
    {
      for (unsigned i=0; i<node_cmap_node_ids_in.size(); ++i)
        {
          libMesh::out << "[" << this->processor_id() << "] put_node_cmap() : nodes communicated to proc "
                       << this->node_cmap_ids[i]
                       << " = ";
          for (unsigned j=0; j<node_cmap_node_ids_in[i].size(); ++j)
            libMesh::out << node_cmap_node_ids_in[i][j] << " ";
          libMesh::out << std::endl;
        }

      for (unsigned i=0; i<node_cmap_node_ids_in.size(); ++i)
        {
          libMesh::out << "[" << this->processor_id() << "] put_node_cmap() : processor IDs = ";
          for (unsigned j=0; j<node_cmap_proc_ids_in[i].size(); ++j)
            libMesh::out << node_cmap_proc_ids_in[i][j] << " ";
          libMesh::out << std::endl;
        }
    }

  for (unsigned int i=0; i<node_cmap_node_ids_in.size(); ++i)
    {
      nemesis_err_flag =
        Nemesis::ne_put_node_cmap(ex_id,
                                  this->node_cmap_ids[i],
                                  &node_cmap_node_ids_in[i][0],
                                  &node_cmap_proc_ids_in[i][0],
                                  this->processor_id());

      EX_CHECK_ERR(nemesis_err_flag, "Error writing node communication map to file!");
    }
}
void libMesh::Nemesis_IO_Helper::put_node_map ( std::vector< int > &  node_mapi,
std::vector< int > &  node_mapb,
std::vector< int > &  node_mape 
)

Outputs IDs of internal, border, and external nodes. LibMesh asserts that the number of external nodes is zero in the Nemesis files it reads

Definition at line 627 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, and libMesh::ParallelObject::processor_id().

Referenced by initialize().

{
  nemesis_err_flag =
    Nemesis::ne_put_node_map(ex_id,
                             node_mapi_in.empty() ? NULL : &node_mapi_in[0],
                             node_mapb_in.empty() ? NULL : &node_mapb_in[0],
                             node_mape_in.empty() ? NULL : &node_mape_in[0], // Don't take address of empty vector...
                             this->processor_id());

  EX_CHECK_ERR(nemesis_err_flag, "Error writing Nemesis internal and border node maps to file!");
}
void libMesh::Nemesis_IO_Helper::put_ns_param_global ( std::vector< int > &  global_nodeset_ids,
std::vector< int > &  num_global_node_counts,
std::vector< int > &  num_global_node_df_counts 
)

This function writes information about global node sets. .) global_nodeset_ids - vector of global node set IDs .) num_global_node_counts - vector of global node counts contained in each global node set .) num_global_df_count - vector of global distribution factors in each global node set

Must be called after put_init_global()

Definition at line 495 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, global_nodeset_ids, and nemesis_err_flag.

Referenced by initialize().

{
  // Only add nodesets if there are some
  if(global_nodeset_ids.size())
    {
      nemesis_err_flag =
        Nemesis::ne_put_ns_param_global(ex_id,
                                        &global_nodeset_ids_in[0],
                                        &num_global_node_counts_in[0],
                                        &num_global_node_df_counts_in[0]);
    }

  EX_CHECK_ERR(nemesis_err_flag, "Error writing global nodeset parameters!");
}
void libMesh::Nemesis_IO_Helper::put_ss_param_global ( std::vector< int > &  global_sideset_ids,
std::vector< int > &  num_global_side_counts,
std::vector< int > &  num_global_side_df_counts 
)

This function writes information about global side sets. .) global_sideset_ids - vector of global side set IDs .) num_global_side_counts - vector of global side counts contained in each global side set .) num_global_df_count - vector of global distribution factors in each global side set

Must be called after put_init_global()

Definition at line 515 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_id, global_sideset_ids, and nemesis_err_flag.

Referenced by initialize().

{
  // Only add sidesets if there are some
  if(global_sideset_ids.size())
    {
      nemesis_err_flag =
        Nemesis::ne_put_ss_param_global(ex_id,
                                        &global_sideset_ids_in[0],
                                        &num_global_side_counts_in[0],
                                        &num_global_side_df_counts_in[0]);
    }

  EX_CHECK_ERR(nemesis_err_flag, "Error writing global sideset parameters!");
}

Reads information for all of the blocks in the ExodusII mesh file.

Definition at line 419 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::id_to_block_names, libMesh::ExodusII_IO_Helper::message(), and libMesh::ExodusII_IO_Helper::num_elem_blk.

Referenced by libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), and libMesh::ExodusII_IO::write_nodal_data_common().

{
  block_ids.resize(num_elem_blk);
  // Get all element block IDs.
  ex_err = exII::ex_get_elem_blk_ids(ex_id,
                                     block_ids.empty() ? NULL : &block_ids[0]);
  // Usually, there is only one
  // block since there is only
  // one type of element.
  // However, there could be more.

  EX_CHECK_ERR(ex_err, "Error getting block IDs.");
  message("All block IDs retrieved successfully.");

  char name_buffer[MAX_STR_LENGTH+1];
  for (int i=0; i<num_elem_blk; ++i)
    {
      ex_err = exII::ex_get_name(ex_id, exII::EX_ELEM_BLOCK,
                                 block_ids[i], name_buffer);
      EX_CHECK_ERR(ex_err, "Error getting block name.");
      id_to_block_names[block_ids[i]] = name_buffer;
    }
  message("All block names retrieved successfully.");
}
void libMesh::ExodusII_IO_Helper::read_elem_in_block ( int  block) [inherited]

Reads all of the element connectivity for block block in the ExodusII mesh file.

Definition at line 501 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids, libMesh::ExodusII_IO_Helper::connect, libMesh::ExodusII_IO_Helper::elem_type, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::num_attr, libMesh::ExodusII_IO_Helper::num_elem_this_blk, libMesh::ExodusII_IO_Helper::num_nodes_per_elem, libMesh::out, and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(block), block_ids.size());

  ex_err = exII::ex_get_elem_block(ex_id,
                                   block_ids[block],
                                   &elem_type[0],
                                   &num_elem_this_blk,
                                   &num_nodes_per_elem,
                                   &num_attr);
  if (verbose)
    libMesh::out << "Reading a block of " << num_elem_this_blk
                 << " " << &elem_type[0] << "(s)"
                 << " having " << num_nodes_per_elem
                 << " nodes per element." << std::endl;

  EX_CHECK_ERR(ex_err, "Error getting block info.");
  message("Info retrieved successfully for block: ", block);



  // Read in the connectivity of the elements of this block,
  // watching out for the case where we actually have no
  // elements in this block (possible with parallel files)
  connect.resize(num_nodes_per_elem*num_elem_this_blk);

  if (!connect.empty())
    {
      ex_err = exII::ex_get_elem_conn(ex_id,
                                      block_ids[block],
                                      &connect[0]);

      EX_CHECK_ERR(ex_err, "Error reading block connectivity.");
      message("Connectivity retrieved successfully for block: ", block);
    }
}

Reads the optional node_num_map from the ExodusII mesh file.

Definition at line 541 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::elem_num_map, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), std::min(), libMesh::ExodusII_IO_Helper::num_elem, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  elem_num_map.resize(num_elem);

  ex_err = exII::ex_get_elem_num_map (ex_id,
                                      elem_num_map.empty() ? NULL : &elem_num_map[0]);

  EX_CHECK_ERR(ex_err, "Error retrieving element number map.");
  message("Element numbering map retrieved successfully.");


  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] elem_num_map[i] = ";
      for (unsigned int i=0; i<static_cast<unsigned int>(std::min(10, num_elem-1)); ++i)
        libMesh::out << elem_num_map[i] << ", ";
      libMesh::out << "... " << elem_num_map.back() << std::endl;
    }
}
void libMesh::ExodusII_IO_Helper::read_elemental_var_values ( std::string  elemental_var_name,
int  time_step 
) [inherited]

Reads elemental values for the variable 'elemental_var_name' at the specified timestep into the 'elem_var_values' array.

Definition at line 910 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids, libMesh::ExodusII_IO_Helper::elem_num_map, libMesh::ExodusII_IO_Helper::elem_var_names, libMesh::ExodusII_IO_Helper::elem_var_values, libMesh::ExodusII_IO_Helper::ELEMENTAL, libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::num_elem, libMesh::ExodusII_IO_Helper::num_elem_blk, libMesh::ExodusII_IO_Helper::num_elem_this_blk, and libMesh::ExodusII_IO_Helper::read_var_names().

Referenced by libMesh::ExodusII_IO::copy_elemental_solution().

{
  // There is no way to get the whole elemental field from the
  // exodus file, so we have to go block by block.
  elem_var_values.resize(num_elem);

  this->read_var_names(ELEMENTAL);

  // See if we can find the variable we are looking for
  unsigned var_index = 0;
  bool found = false;

  // Do a linear search for nodal_var_name in nodal_var_names
  for (; var_index<elem_var_names.size(); ++var_index)
    {
      found = (elem_var_names[var_index] == elemental_var_name);
      if (found)
        break;
    }

  if (!found)
    {
      libMesh::err << "Available variables: " << std::endl;
      for (unsigned i=0; i<elem_var_names.size(); ++i)
        libMesh::err << elem_var_names[i] << std::endl;

      libmesh_error_msg("Unable to locate variable named: " << elemental_var_name);
    }

  // Sequential index which we can use to look up the element ID in the elem_num_map.
  unsigned ex_el_num = 0;

  for (unsigned i=0; i<static_cast<unsigned>(num_elem_blk); i++)
    {
      ex_err = exII::ex_get_elem_block(ex_id,
                                       block_ids[i],
                                       NULL,
                                       &num_elem_this_blk,
                                       NULL,
                                       NULL);
      EX_CHECK_ERR(ex_err, "Error getting number of elements in block.");

      std::vector<Real> block_elem_var_values(num_elem);
      ex_err = exII::ex_get_elem_var(ex_id,
                                     time_step,
                                     var_index+1,
                                     block_ids[i],
                                     num_elem_this_blk,
                                     &block_elem_var_values[0]);
      EX_CHECK_ERR(ex_err, "Error getting elemental values.");

      for (unsigned j=0; j<static_cast<unsigned>(num_elem_this_blk); j++)
        {
          // Use the elem_num_map to obtain the ID of this element in the Exodus file,
          // and remember to subtract 1 since libmesh is zero-based and Exodus is 1-based.
          unsigned mapped_elem_id = this->elem_num_map[ex_el_num] - 1;

          // Make sure we can actually write into this location in the elem_var_values vector
          if (mapped_elem_id >= elem_var_values.size())
            libmesh_error_msg("Error reading elemental variable values in Exodus!");

          // Write into the mapped_elem_id entry of the
          // elem_var_values vector.
          elem_var_values[mapped_elem_id] = block_elem_var_values[j];

          // Go to the next sequential element ID.
          ex_el_num++;
        }
    }
}

Reads an ExodusII mesh file header.

Definition at line 330 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::num_dim, libMesh::ExodusII_IO_Helper::num_elem, libMesh::ExodusII_IO_Helper::num_elem_blk, libMesh::ExodusII_IO_Helper::num_elem_vars, libMesh::ExodusII_IO_Helper::num_global_vars, libMesh::ExodusII_IO_Helper::num_nodal_vars, libMesh::ExodusII_IO_Helper::num_node_sets, libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::num_side_sets, libMesh::ExodusII_IO_Helper::read_num_time_steps(), and libMesh::ExodusII_IO_Helper::title.

Referenced by libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::Nemesis_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data_common().

{
  ex_err = exII::ex_get_init(ex_id,
                             &title[0],
                             &num_dim,
                             &num_nodes,
                             &num_elem,
                             &num_elem_blk,
                             &num_node_sets,
                             &num_side_sets);

  EX_CHECK_ERR(ex_err, "Error retrieving header info.");

  this->read_num_time_steps();

  ex_err = exII::ex_get_var_param(ex_id, "n", &num_nodal_vars);
  EX_CHECK_ERR(ex_err, "Error reading number of nodal variables.");

  ex_err = exII::ex_get_var_param(ex_id, "e", &num_elem_vars);
  EX_CHECK_ERR(ex_err, "Error reading number of elemental variables.");

  ex_err = exII::ex_get_var_param(ex_id, "g", &num_global_vars);
  EX_CHECK_ERR(ex_err, "Error reading number of global variables.");

  message("Exodus header info retrieved successfully.");
}
void libMesh::ExodusII_IO_Helper::read_nodal_var_values ( std::string  nodal_var_name,
int  time_step 
) [inherited]

Reads the nodal values for the variable 'nodal_var_name' at the specified time into the 'nodal_var_values' array.

Definition at line 754 of file exodusII_io_helper.C.

References libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::NODAL, libMesh::ExodusII_IO_Helper::nodal_var_names, libMesh::ExodusII_IO_Helper::nodal_var_values, libMesh::ExodusII_IO_Helper::num_nodes, and libMesh::ExodusII_IO_Helper::read_var_names().

Referenced by libMesh::ExodusII_IO::copy_nodal_solution().

{
  // Read the nodal variable names from file, so we can see if we have the one we're looking for
  this->read_var_names(NODAL);

  // See if we can find the variable we are looking for
  unsigned int var_index = 0;
  bool found = false;

  // Do a linear search for nodal_var_name in nodal_var_names
  for (; var_index<nodal_var_names.size(); ++var_index)
    {
      found = (nodal_var_names[var_index] == nodal_var_name);
      if (found)
        break;
    }

  if (!found)
    {
      libMesh::err << "Available variables: " << std::endl;
      for (unsigned int i=0; i<nodal_var_names.size(); ++i)
        libMesh::err << nodal_var_names[i] << std::endl;

      libmesh_error_msg("Unable to locate variable named: " << nodal_var_name);
    }

  // Allocate enough space to store the nodal variable values
  nodal_var_values.resize(num_nodes);

  // Call the Exodus API to read the nodal variable values
  ex_err = exII::ex_get_nodal_var(ex_id,
                                  time_step,
                                  var_index+1,
                                  num_nodes,
                                  &nodal_var_values[0]);
  EX_CHECK_ERR(ex_err, "Error reading nodal variable values!");
}

Reads the optional node_num_map from the ExodusII mesh file.

Definition at line 391 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), std::min(), libMesh::ExodusII_IO_Helper::node_num_map, libMesh::ExodusII_IO_Helper::num_nodes, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  node_num_map.resize(num_nodes);

  ex_err = exII::ex_get_node_num_map (ex_id,
                                      node_num_map.empty() ? NULL : &node_num_map[0]);

  EX_CHECK_ERR(ex_err, "Error retrieving nodal number map.");
  message("Nodal numbering map retrieved successfully.");

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] node_num_map[i] = ";
      for (unsigned int i=0; i<static_cast<unsigned int>(std::min(10, num_nodes-1)); ++i)
        libMesh::out << node_num_map[i] << ", ";
      libMesh::out << "... " << node_num_map.back() << std::endl;
    }
}

Reads the nodal data (x,y,z coordinates) from the ExodusII mesh file.

Definition at line 374 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::x, libMesh::ExodusII_IO_Helper::y, and libMesh::ExodusII_IO_Helper::z.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  x.resize(num_nodes);
  y.resize(num_nodes);
  z.resize(num_nodes);

  ex_err = exII::ex_get_coord(ex_id,
                              static_cast<void*>(&x[0]),
                              static_cast<void*>(&y[0]),
                              static_cast<void*>(&z[0]));

  EX_CHECK_ERR(ex_err, "Error retrieving nodal data.");
  message("Nodal data retrieved successfully.");
}
void libMesh::ExodusII_IO_Helper::read_nodeset ( int  id) [inherited]

Reads information about nodeset id and inserts it into the global nodeset array at the position offset.

Definition at line 667 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::node_list, libMesh::ExodusII_IO_Helper::nodeset_ids, libMesh::ExodusII_IO_Helper::num_node_df_per_set, and libMesh::ExodusII_IO_Helper::num_nodes_per_set.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(id), nodeset_ids.size());
  libmesh_assert_less (static_cast<unsigned int>(id), num_nodes_per_set.size());
  libmesh_assert_less (static_cast<unsigned int>(id), num_node_df_per_set.size());

  ex_err = exII::ex_get_node_set_param(ex_id,
                                       nodeset_ids[id],
                                       &num_nodes_per_set[id],
                                       &num_node_df_per_set[id]);
  EX_CHECK_ERR(ex_err, "Error retrieving nodeset parameters.");
  message("Parameters retrieved successfully for nodeset: ", id);

  node_list.resize(num_nodes_per_set[id]);

  // Don't call ex_get_node_set unless there are actually nodes there to get.
  // Exodus prints an annoying warning message in DEBUG mode otherwise...
  if (num_nodes_per_set[id] > 0)
    {
      ex_err = exII::ex_get_node_set(ex_id,
                                     nodeset_ids[id],
                                     &node_list[0]);

      EX_CHECK_ERR(ex_err, "Error retrieving nodeset data.");
      message("Data retrieved successfully for nodeset: ", id);
    }
}

Reads information about all of the nodesets in the ExodusII mesh file.

Definition at line 596 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::id_to_ns_names, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::nodeset_ids, libMesh::ExodusII_IO_Helper::num_node_df_per_set, libMesh::ExodusII_IO_Helper::num_node_sets, and libMesh::ExodusII_IO_Helper::num_nodes_per_set.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  nodeset_ids.resize(num_node_sets);
  if (num_node_sets > 0)
    {
      ex_err = exII::ex_get_node_set_ids(ex_id,
                                         &nodeset_ids[0]);
      EX_CHECK_ERR(ex_err, "Error retrieving nodeset information.");
      message("All nodeset information retrieved successfully.");

      // Resize appropriate data structures -- only do this once outnode the loop
      num_nodes_per_set.resize(num_node_sets);
      num_node_df_per_set.resize(num_node_sets);
    }

  char name_buffer[MAX_STR_LENGTH+1];
  for (int i=0; i<num_node_sets; ++i)
    {
      ex_err = exII::ex_get_name(ex_id, exII::EX_NODE_SET,
                                 nodeset_ids[i], name_buffer);
      EX_CHECK_ERR(ex_err, "Error getting node set name.");
      id_to_ns_names[nodeset_ids[i]] = name_buffer;
    }
  message("All node set names retrieved successfully.");
}

Reads the number of timesteps currently stored in the Exodus file and stores it in the num_time_steps variable.

Definition at line 746 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::inquire(), and libMesh::ExodusII_IO_Helper::num_time_steps.

Referenced by libMesh::ExodusII_IO::get_num_time_steps(), libMesh::ExodusII_IO_Helper::read_header(), and libMesh::ExodusII_IO_Helper::read_time_steps().

{
  num_time_steps =
    this->inquire(exII::EX_INQ_TIME, "Error retrieving number of time steps");
}
void libMesh::ExodusII_IO_Helper::read_sideset ( int  id,
int  offset 
) [inherited]

Reads information about sideset id and inserts it into the global sideset array at the position offset.

Definition at line 624 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::elem_list, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::id_list, libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::num_df_per_set, libMesh::ExodusII_IO_Helper::num_sides_per_set, libMesh::ExodusII_IO_Helper::side_list, and libMesh::ExodusII_IO_Helper::ss_ids.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  libmesh_assert_less (static_cast<unsigned int>(id), ss_ids.size());
  libmesh_assert_less (static_cast<unsigned int>(id), num_sides_per_set.size());
  libmesh_assert_less (static_cast<unsigned int>(id), num_df_per_set.size());
  libmesh_assert_less_equal (static_cast<unsigned int>(offset), elem_list.size());
  libmesh_assert_less_equal (static_cast<unsigned int>(offset), side_list.size());

  ex_err = exII::ex_get_side_set_param(ex_id,
                                       ss_ids[id],
                                       &num_sides_per_set[id],
                                       &num_df_per_set[id]);
  EX_CHECK_ERR(ex_err, "Error retrieving sideset parameters.");
  message("Parameters retrieved successfully for sideset: ", id);


  // It's OK for offset==elem_list.size() as long as num_sides_per_set[id]==0
  // because in that case we don't actually read anything...
#ifdef DEBUG
  if (static_cast<unsigned int>(offset) == elem_list.size() ||
      static_cast<unsigned int>(offset) == side_list.size() )
    libmesh_assert_equal_to (num_sides_per_set[id], 0);
#endif


  // Don't call ex_get_side_set unless there are actually sides there to get.
  // Exodus prints an annoying warning in DEBUG mode otherwise...
  if (num_sides_per_set[id] > 0)
    {
      ex_err = exII::ex_get_side_set(ex_id,
                                     ss_ids[id],
                                     &elem_list[offset],
                                     &side_list[offset]);
      EX_CHECK_ERR(ex_err, "Error retrieving sideset data.");
      message("Data retrieved successfully for sideset: ", id);

      for (int i=0; i<num_sides_per_set[id]; i++)
        id_list[i+offset] = ss_ids[id];
    }
}

Reads information about all of the sidesets in the ExodusII mesh file.

Definition at line 563 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::elem_list, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::id_list, libMesh::ExodusII_IO_Helper::id_to_ss_names, libMesh::ExodusII_IO_Helper::inquire(), libMesh::ExodusII_IO_Helper::message(), libMesh::ExodusII_IO_Helper::num_df_per_set, libMesh::ExodusII_IO_Helper::num_elem_all_sidesets, libMesh::ExodusII_IO_Helper::num_side_sets, libMesh::ExodusII_IO_Helper::num_sides_per_set, libMesh::ExodusII_IO_Helper::side_list, and libMesh::ExodusII_IO_Helper::ss_ids.

Referenced by libMesh::Nemesis_IO::read(), and libMesh::ExodusII_IO::read().

{
  ss_ids.resize(num_side_sets);
  if (num_side_sets > 0)
    {
      ex_err = exII::ex_get_side_set_ids(ex_id,
                                         &ss_ids[0]);
      EX_CHECK_ERR(ex_err, "Error retrieving sideset information.");
      message("All sideset information retrieved successfully.");

      // Resize appropriate data structures -- only do this once outside the loop
      num_sides_per_set.resize(num_side_sets);
      num_df_per_set.resize(num_side_sets);

      // Inquire about the length of the concatenated side sets element list
      num_elem_all_sidesets = inquire(exII::EX_INQ_SS_ELEM_LEN, "Error retrieving length of the concatenated side sets element list!");

      elem_list.resize (num_elem_all_sidesets);
      side_list.resize (num_elem_all_sidesets);
      id_list.resize   (num_elem_all_sidesets);
    }

  char name_buffer[MAX_STR_LENGTH+1];
  for (int i=0; i<num_side_sets; ++i)
    {
      ex_err = exII::ex_get_name(ex_id, exII::EX_SIDE_SET,
                                 ss_ids[i], name_buffer);
      EX_CHECK_ERR(ex_err, "Error getting side set name.");
      id_to_ss_names[ss_ids[i]] = name_buffer;
    }
  message("All side set names retrieved successfully.");
}

Reads and stores the timesteps in the 'time_steps' array.

Definition at line 731 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::num_time_steps, libMesh::ExodusII_IO_Helper::read_num_time_steps(), and libMesh::ExodusII_IO_Helper::time_steps.

Referenced by libMesh::ExodusII_IO::get_time_steps().

{
  // Make sure we have an up-to-date count of the number of time steps in the file.
  this->read_num_time_steps();

  if (num_time_steps > 0)
    {
      time_steps.resize(num_time_steps);
      ex_err = exII::ex_get_all_times(ex_id, &time_steps[0]);
      EX_CHECK_ERR(ex_err, "Error reading timesteps!");
    }
}

Allows you to set a vector that is added to the coordinates of all of the nodes. Effectively, this "moves" the mesh to a particular position

Definition at line 1778 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_coordinate_offset.

Referenced by libMesh::ExodusII_IO::set_coordinate_offset().

Sets the underlying value of the boolean flag _use_mesh_dimension_instead_of_spatial_dimension. By default, the value of this flag is false.

See the ExodusII_IO class documentation for a detailed description of this flag.

Definition at line 1773 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_use_mesh_dimension_instead_of_spatial_dimension.

Referenced by libMesh::ExodusII_IO::use_mesh_dimension_instead_of_spatial_dimension().

void libMesh::ExodusII_IO_Helper::write_element_values ( const MeshBase mesh,
const std::vector< Real > &  values,
int  timestep 
) [inherited]

Writes the vector of values to the element variables.

Definition at line 1615 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_single_precision, libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), data, end, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::get_block_id(), libMesh::DofObject::id(), libMesh::MeshBase::n_elem(), libMesh::MeshTools::n_elem(), libMesh::ExodusII_IO_Helper::num_elem_vars, libMesh::ParallelObject::processor_id(), and libMesh::Elem::subdomain_id().

Referenced by libMesh::ExodusII_IO::write_element_data().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  // Loop over the element blocks and write the data one block at a time
  std::map<unsigned int, std::vector<unsigned int> > subdomain_map;

  // Ask the file how many element vars it has, store it in the num_elem_vars variable.
  ex_err = exII::ex_get_var_param(ex_id, "e", &num_elem_vars);
  EX_CHECK_ERR(ex_err, "Error reading number of elemental variables.");

  MeshBase::const_element_iterator mesh_it = mesh.active_elements_begin();
  const MeshBase::const_element_iterator end = mesh.active_elements_end();

  // loop through element and map between block and element vector
  for (; mesh_it!=end; ++mesh_it)
    {
      const Elem * elem = *mesh_it;
      subdomain_map[elem->subdomain_id()].push_back(elem->id());
    }

  // Use mesh.n_elem() to access into the values vector rather than
  // the number of elements the Exodus writer thinks the mesh has,
  // which may not include inactive elements.
  dof_id_type n_elem = mesh.n_elem();

  // For each variable, create a 'data' array which holds all the elemental variable
  // values *for a given block* on this processor, then write that data vector to file
  // before moving onto the next block.
  for (unsigned int i=0; i<static_cast<unsigned>(num_elem_vars); ++i)
    {
      // The size of the subdomain map is the number of blocks.
      std::map<unsigned int, std::vector<unsigned int> >::iterator it = subdomain_map.begin();

      for (unsigned int j=0; it!=subdomain_map.end(); ++it, ++j)
        {
          const std::vector<unsigned int> & elem_nums = (*it).second;
          const unsigned int num_elems_this_block =
            cast_int<unsigned int>(elem_nums.size());
          std::vector<Real> data(num_elems_this_block);

          for (unsigned int k=0; k<num_elems_this_block; ++k)
            data[k] = values[i*n_elem + elem_nums[k]];

          if (_single_precision)
            {
              std::vector<float> cast_data(data.begin(), data.end());

              ex_err = exII::ex_put_elem_var(ex_id,
                                             timestep,
                                             i+1,
                                             this->get_block_id(j),
                                             num_elems_this_block,
                                             &cast_data[0]);
            }
          else
            {
              ex_err = exII::ex_put_elem_var(ex_id,
                                             timestep,
                                             i+1,
                                             this->get_block_id(j),
                                             num_elems_this_block,
                                             &data[0]);
            }
          EX_CHECK_ERR(ex_err, "Error writing element values.");
        }
    }

  ex_err = exII::ex_update(ex_id);
  EX_CHECK_ERR(ex_err, "Error flushing buffers to file.");
}
void libMesh::Nemesis_IO_Helper::write_elements ( const MeshBase mesh,
bool  use_discontinuous = false 
) [virtual]

This function is specialized to write the connectivity.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 2362 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), block_id_to_elem_connectivity, libMesh::MeshBase::elem(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::exodus_elem_num_to_libmesh, libMesh::ExodusII_IO_Helper::Conversion::exodus_elem_type(), global_elem_blk_ids, libMesh::Elem::n_nodes(), num_elem_blks_global, libMesh::ExodusII_IO_Helper::num_nodes_per_elem, subdomain_map, and libMesh::Elem::type().

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{

  // Loop over all blocks, even if we don't have elements in each block.
  // If we don't have elements we need to write out a 0 for that block...
  for (unsigned int i=0; i<static_cast<unsigned>(this->num_elem_blks_global); ++i)
    {
      // Search for the current global block ID in the map
      std::map<int, std::vector<int> >::iterator it =
        this->block_id_to_elem_connectivity.find( this->global_elem_blk_ids[i] );

      // If not found, write a zero to file....
      if (it == this->block_id_to_elem_connectivity.end())
        {
          this->ex_err = exII::ex_put_elem_block(this->ex_id,
                                                 this->global_elem_blk_ids[i],
                                                 "Empty",
                                                 0, /* n. elements in this block */
                                                 0, /* n. nodes per element */
                                                 0);  /* number of attributes per element */

          EX_CHECK_ERR(this->ex_err, "Error writing element block from Nemesis.");
        }

      // Otherwise, write the actual block information and connectivity to file
      else
        {
          subdomain_id_type block =
            cast_int<subdomain_id_type>((*it).first);
          std::vector<int> & this_block_connectivity = (*it).second;
          std::vector<unsigned int> & elements_in_this_block = subdomain_map[block];

          ExodusII_IO_Helper::ElementMaps em;

          //Use the first element in this block to get representative information.
          //Note that Exodus assumes all elements in a block are of the same type!
          //We are using that same assumption here!
          const ExodusII_IO_Helper::Conversion conv =
            em.assign_conversion(mesh.elem(elements_in_this_block[0])->type());

          this->num_nodes_per_elem = mesh.elem(elements_in_this_block[0])->n_nodes();

          ex_err = exII::ex_put_elem_block(ex_id,
                                           block,
                                           conv.exodus_elem_type().c_str(),
                                           elements_in_this_block.size(),
                                           num_nodes_per_elem,
                                           0);
          EX_CHECK_ERR(ex_err, "Error writing element block from Nemesis.");

          ex_err = exII::ex_put_elem_conn(ex_id,
                                          block,
                                          &this_block_connectivity[0]);
          EX_CHECK_ERR(ex_err, "Error writing element connectivities from Nemesis.");
        }
    } // end loop over global block IDs

  // Only call this once, not in the loop above!
  ex_err = exII::ex_put_elem_num_map(ex_id,
                                     exodus_elem_num_to_libmesh.empty() ? NULL : &exodus_elem_num_to_libmesh[0]);
  EX_CHECK_ERR(ex_err, "Error writing element map");
}
void libMesh::Nemesis_IO_Helper::write_exodus_initialization_info ( const MeshBase pmesh,
const std::string &  title 
) [private]

This function writes exodus-specific initialization information. This information is slightly different when you are working with Nemesis, as it depends on some global information being known.

Definition at line 914 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, global_nodeset_ids, global_sideset_ids, libMesh::ExodusII_IO_Helper::num_dim, libMesh::ExodusII_IO_Helper::num_elem, libMesh::ExodusII_IO_Helper::num_elem_blk, num_elem_blks_global, libMesh::ExodusII_IO_Helper::num_node_sets, libMesh::ExodusII_IO_Helper::num_nodes, libMesh::ExodusII_IO_Helper::num_side_sets, and libMesh::MeshBase::spatial_dimension().

Referenced by initialize().

{
  // This follows the convention of Exodus: we always write out the mesh as LIBMESH_DIM-dimensional,
  // even if it is 2D...
  this->num_dim = pmesh.spatial_dimension();

  this->num_elem = static_cast<unsigned int>(std::distance (pmesh.active_local_elements_begin(),
                                                            pmesh.active_local_elements_end()));

  // Exodus will also use *global* number of side and node sets,
  // though it will not write out entries for all of them...
  this->num_side_sets =
    cast_int<int>(this->global_sideset_ids.size());
  this->num_node_sets =
    cast_int<int>(this->global_nodeset_ids.size());

  // We need to write the global number of blocks, even though this processor might not have
  // elements in some of them!
  this->num_elem_blk = this->num_elem_blks_global;

  ex_err = exII::ex_put_init(ex_id,
                             title_in.c_str(),
                             this->num_dim,
                             this->num_nodes,
                             this->num_elem,
                             this->num_elem_blk,
                             this->num_node_sets,
                             this->num_side_sets);

  EX_CHECK_ERR(ex_err, "Error initializing new Nemesis file.");
}
void libMesh::ExodusII_IO_Helper::write_global_values ( const std::vector< Real > &  values,
int  timestep 
) [inherited]

Writes the vector of global variables.

Definition at line 1751 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_single_precision, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::num_global_vars, and libMesh::ParallelObject::processor_id().

Referenced by libMesh::Nemesis_IO::write_global_data(), and libMesh::ExodusII_IO::write_global_data().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  if (_single_precision)
    {
      std::vector<float> cast_values(values.begin(), values.end());
      ex_err = exII::ex_put_glob_vars(ex_id, timestep, num_global_vars, &cast_values[0]);
    }
  else
    {
      ex_err = exII::ex_put_glob_vars(ex_id, timestep, num_global_vars, &values[0]);
    }
  EX_CHECK_ERR(ex_err, "Error writing global values.");

  ex_err = exII::ex_update(ex_id);
  EX_CHECK_ERR(ex_err, "Error flushing buffers to file.");
}
void libMesh::ExodusII_IO_Helper::write_information_records ( const std::vector< std::string > &  records) [inherited]

Writes the vector of information records.

Definition at line 1712 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::NamesData::get_char_star_star(), libMesh::ExodusII_IO_Helper::inquire(), libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::NamesData::push_back_entry().

Referenced by libMesh::Nemesis_IO::write_information_records(), and libMesh::ExodusII_IO::write_information_records().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  // There may already be information records in the file (for
  // example, if we're appending) and in that case, according to the
  // Exodus documentation, writing more information records is not
  // supported.
  int num_info = inquire(exII::EX_INQ_INFO, "Error retrieving the number of information records from file!");
  if (num_info > 0)
    {
      libMesh::err << "Warning! The Exodus file already contains information records.\n"
                   << "Exodus does not support writing additional records in this situation."
                   << std::endl;
      return;
    }

  int num_records = cast_int<int>(records.size());

  if (num_records > 0)
    {
      NamesData info(num_records, MAX_LINE_LENGTH);

      // If an entry is longer than MAX_LINE_LENGTH characters it's not an error, we just
      // write the first MAX_LINE_LENGTH characters to the file.
      for (unsigned i=0; i<records.size(); ++i)
        info.push_back_entry(records[i]);

      ex_err = exII::ex_put_info(ex_id, num_records, info.get_char_star_star());
      EX_CHECK_ERR(ex_err, "Error writing global values.");

      ex_err = exII::ex_update(ex_id);
      EX_CHECK_ERR(ex_err, "Error flushing buffers to file.");
    }
}
void libMesh::Nemesis_IO_Helper::write_nodal_coordinates ( const MeshBase mesh,
bool  use_discontinuous = false 
) [virtual]

This function is specialized from ExodusII_IO_Helper to write only the nodal coordinates stored on the local piece of the Mesh.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 2305 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_single_precision, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::exodus_node_num_to_libmesh, libMesh::MeshBase::node_ptr(), libMesh::ExodusII_IO_Helper::x, libMesh::ExodusII_IO_Helper::y, and libMesh::ExodusII_IO_Helper::z.

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Make sure that the reference passed in is really a ParallelMesh
  // const ParallelMesh& pmesh = cast_ref<const ParallelMesh&>(mesh);

  unsigned local_num_nodes =
    cast_int<unsigned int>(this->exodus_node_num_to_libmesh.size());

  x.resize(local_num_nodes);
  y.resize(local_num_nodes);
  z.resize(local_num_nodes);

  // Just loop over our list outputing the nodes the way we built the map
  for (unsigned int i=0; i<local_num_nodes; ++i)
    {
      const Node & node = *mesh.node_ptr(this->exodus_node_num_to_libmesh[i]);
      x[i]=node(0);
      y[i]=node(1);
      z[i]=node(2);
    }

  if (local_num_nodes)
    {
      if (_single_precision)
        {
          std::vector<float>
            x_single(x.begin(), x.end()),
            y_single(y.begin(), y.end()),
            z_single(z.begin(), z.end());

          ex_err = exII::ex_put_coord(ex_id, &x_single[0], &y_single[0], &z_single[0]);
        }
      else
        {
          // Call Exodus API to write nodal coordinates...
          ex_err = exII::ex_put_coord(ex_id, &x[0], &y[0], &z[0]);
        }
      EX_CHECK_ERR(ex_err, "Error writing node coordinates");

      // And write the nodal map we created for them
      ex_err = exII::ex_put_node_num_map(ex_id, &(this->exodus_node_num_to_libmesh[0]));
      EX_CHECK_ERR(ex_err, "Error writing node num map");
    }
  else // Does the Exodus API want us to write empty nodal coordinates?
    {
      ex_err = exII::ex_put_coord(ex_id, NULL, NULL, NULL);
      EX_CHECK_ERR(ex_err, "Error writing empty node coordinates");

      ex_err = exII::ex_put_node_num_map(ex_id, NULL);
      EX_CHECK_ERR(ex_err, "Error writing empty node num map");
    }
}
void libMesh::Nemesis_IO_Helper::write_nodal_solution ( const std::vector< Number > &  values,
const std::vector< std::string > &  names,
int  timestep 
)

Takes a solution vector containing the solution for all variables and outputs it to the files

Definition at line 2430 of file nemesis_io_helper.C.

References std::abs().

Referenced by libMesh::Nemesis_IO::write_nodal_data().

{
  int num_vars = cast_int<int>(names.size());
  //int num_values = values.size(); // Not used?

  for (int c=0; c<num_vars; c++)
    {
#ifdef LIBMESH_USE_COMPLEX_NUMBERS
      std::vector<Real> real_parts(num_nodes);
      std::vector<Real> imag_parts(num_nodes);
      std::vector<Real> magnitudes(num_nodes);

      for (int i=0; i<num_nodes; ++i)
        {
          Number value = values[this->exodus_node_num_to_libmesh[i]*num_vars + c];
          real_parts[i] = value.real();
          imag_parts[i] = value.imag();
          magnitudes[i] = std::abs(value);
        }
      write_nodal_values(3*c+1,real_parts,timestep);
      write_nodal_values(3*c+2,imag_parts,timestep);
      write_nodal_values(3*c+3,magnitudes,timestep);
#else
      std::vector<Number> cur_soln(num_nodes);

      // Copy out this variable's solution
      for (int i=0; i<num_nodes; i++)
        cur_soln[i] = values[this->exodus_node_num_to_libmesh[i]*num_vars + c];

      write_nodal_values(c+1,cur_soln,timestep);
#endif
    }
}
void libMesh::ExodusII_IO_Helper::write_nodal_values ( int  var_id,
const std::vector< Real > &  values,
int  timestep 
) [inherited]

Writes the vector of values to a nodal variable.

Definition at line 1690 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_single_precision, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::num_nodes, and libMesh::ParallelObject::processor_id().

Referenced by libMesh::ExodusII_IO::write_nodal_data(), and libMesh::ExodusII_IO::write_nodal_data_discontinuous().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  if (_single_precision)
    {
      std::vector<float> cast_values(values.begin(), values.end());
      ex_err = exII::ex_put_nodal_var(ex_id, timestep, var_id, num_nodes, &cast_values[0]);
    }
  else
    {
      ex_err = exII::ex_put_nodal_var(ex_id, timestep, var_id, num_nodes, &values[0]);
    }
  EX_CHECK_ERR(ex_err, "Error writing nodal values.");

  ex_err = exII::ex_update(ex_id);
  EX_CHECK_ERR(ex_err, "Error flushing buffers to file.");
}
void libMesh::Nemesis_IO_Helper::write_nodesets ( const MeshBase mesh) [virtual]

Writes the nodesets for this processor.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 2019 of file nemesis_io_helper.C.

References libMesh::BoundaryInfo::build_node_list(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::MeshBase::get_boundary_info(), global_nodeset_ids, libMesh::ExodusII_IO_Helper::libmesh_node_num_to_exodus, libMesh::out, libMesh::ParallelObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Write the nodesets.  In Nemesis, the idea is to "create space" for the global
  // set of boundary nodesets, but to only write node IDs which are local to the current
  // processor.  This is what is done in Nemesis files created by the "loadbal" script.

  // Store a map of vectors for boundary node IDs on this processor.
  // Use a vector of int here so it can be passed directly to Exodus.
  std::map<boundary_id_type, std::vector<int> > local_node_boundary_id_lists;
  typedef std::map<boundary_id_type, std::vector<int> >::iterator local_node_boundary_id_lists_iterator;

  // FIXME: We should build this list only one time!!  We already built it above, but we
  // did not have the libmesh to exodus node mapping at that time... for now we'll just
  // build it here again, hopefully it's small relative to the size of the entire mesh.
  std::vector<dof_id_type> boundary_node_list;
  std::vector<boundary_id_type> boundary_node_boundary_id_list;
  mesh.get_boundary_info().build_node_list
    (boundary_node_list, boundary_node_boundary_id_list);

  if (verbose)
    {
      libMesh::out << "[" << this->processor_id() << "] boundary_node_list.size()="
                   << boundary_node_list.size() << std::endl;
      libMesh::out << "[" << this->processor_id() << "] (boundary_node_id, boundary_id) = ";
      for (unsigned i=0; i<boundary_node_list.size(); ++i)
        {
          libMesh::out << "(" << boundary_node_list[i] << ", " << boundary_node_boundary_id_list[i] << ") ";
        }
      libMesh::out << std::endl;
    }

  // For each node in the node list, add it to the vector of node IDs for that
  // set for the local processor.  This will be used later when writing Exodus
  // nodesets.
  for (unsigned i=0; i<boundary_node_list.size(); ++i)
    {
      // Don't try to grab a reference to the vector unless the current node is attached
      // to a local element.  Otherwise, another processor will be responsible for writing it in its nodeset.
      std::map<int, int>::iterator it = this->libmesh_node_num_to_exodus.find( boundary_node_list[i] );

      if ( it != this->libmesh_node_num_to_exodus.end() )
        {
          // Get reference to the vector where this node ID will be inserted.  If it
          // doesn't yet exist, this will create it.
          std::vector<int>& current_id_set = local_node_boundary_id_lists[ boundary_node_boundary_id_list[i] ];

          // Push back Exodus-mapped node ID for this set
          // TODO: reserve space in these vectors somehow.
          current_id_set.push_back( (*it).second );
        }
    }

  // See what we got
  if (verbose)
    {
      for (std::map<boundary_id_type, std::vector<int> >::iterator it = local_node_boundary_id_lists.begin();
           it != local_node_boundary_id_lists.end();
           ++it)
        {
          libMesh::out << "[" << this->processor_id() << "] ID: " << (*it).first << ", ";

          std::vector<int>& current_id_set = (*it).second;

          // Libmesh node ID (Exodus Node ID)
          for (unsigned j=0; j<current_id_set.size(); ++j)
            libMesh::out << current_id_set[j]
                         << ", ";

          libMesh::out << std::endl;
        }
    }

  // Loop over *global* nodeset IDs, call the Exodus API.  Note that some nodesets may be empty
  // for a given processor.
  for (unsigned i=0; i<this->global_nodeset_ids.size(); ++i)
    {
      if (verbose)
        {
          libMesh::out << "[" << this->processor_id()
                       << "] Writing out Exodus nodeset info for ID: " << global_nodeset_ids[i] << std::endl;
        }

      // Convert current global_nodeset_id into an exodus ID, which can't be zero...
      int exodus_id = global_nodeset_ids[i];

      /*
      // Exodus can't handle zero nodeset IDs (?)  Use max short here since
      // when libmesh reads it back in, it will want to store it as a short...
      if (exodus_id==0)
      exodus_id = std::numeric_limits<short>::max();
      */

      // Try to find this boundary ID in the local list we created
      local_node_boundary_id_lists_iterator it =
        local_node_boundary_id_lists.find (cast_int<boundary_id_type>(this->global_nodeset_ids[i]));

      // No nodes found for this boundary ID on this processor
      if (it == local_node_boundary_id_lists.end())
        {
          if (verbose)
            libMesh::out << "[" << this->processor_id()
                         << "] No nodeset data for ID: " << global_nodeset_ids[i]
                         << " on this processor." << std::endl;

          // Call the Exodus interface to write the parameters of this node set
          this->ex_err = exII::ex_put_node_set_param(this->ex_id,
                                                     exodus_id,
                                                     0, /* No nodes for this ID */
                                                     0  /* No distribution factors */);
          EX_CHECK_ERR(this->ex_err, "Error writing nodeset parameters in Nemesis");

        }
      else // Boundary ID *was* found in list
        {
          // Get reference to the vector of node IDs
          std::vector<int>& current_nodeset_ids = (*it).second;

          // Call the Exodus interface to write the parameters of this node set
          this->ex_err = exII::ex_put_node_set_param(this->ex_id,
                                                     exodus_id,
                                                     current_nodeset_ids.size(),
                                                     0  /* No distribution factors */);

          EX_CHECK_ERR(this->ex_err, "Error writing nodeset parameters in Nemesis");

          // Call Exodus interface to write the actual node IDs for this boundary ID
          this->ex_err = exII::ex_put_node_set(this->ex_id,
                                               exodus_id,
                                               &current_nodeset_ids[0]);

          EX_CHECK_ERR(this->ex_err, "Error writing nodesets in Nemesis");

        }
    } // end loop over global nodeset IDs
}
void libMesh::Nemesis_IO_Helper::write_sidesets ( const MeshBase mesh) [virtual]

Writes the sidesets for this processor.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 2158 of file nemesis_io_helper.C.

References libMesh::Elem::active_family_tree_by_side(), libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), libMesh::BoundaryInfo::build_side_list(), libMesh::MeshBase::elem(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, libMesh::MeshBase::get_boundary_info(), libMesh::ExodusII_IO_Helper::Conversion::get_inverse_side_map(), global_sideset_ids, libMesh::libmesh_assert(), libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus, libMesh::out, libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), and libMesh::ExodusII_IO_Helper::verbose.

Referenced by libMesh::Nemesis_IO::write(), and libMesh::Nemesis_IO::write_nodal_data().

{
  // Write the sidesets.  In Nemesis, the idea is to "create space" for the global
  // set of boundary sidesets, but to only write sideset IDs which are local to the current
  // processor.  This is what is done in Nemesis files created by the "loadbal" script.
  // See also: ExodusII_IO_Helper::write_sidesets()...


  // Store a map of vectors for boundary side IDs on this processor.
  // Use a vector of int here so it can be passed directly to Exodus.
  std::map<boundary_id_type, std::vector<int> > local_elem_boundary_id_lists;
  std::map<boundary_id_type, std::vector<int> > local_elem_boundary_id_side_lists;
  typedef std::map<boundary_id_type, std::vector<int> >::iterator local_elem_boundary_id_lists_iterator;

  ExodusII_IO_Helper::ElementMaps em;

  // FIXME: We already built this list once, we should reuse that information!
  std::vector< dof_id_type > bndry_elem_list;
  std::vector< unsigned short int > bndry_side_list;
  std::vector< boundary_id_type > bndry_id_list;

  mesh.get_boundary_info().build_side_list
    (bndry_elem_list, bndry_side_list, bndry_id_list);

  // Integer looping, skipping non-local elements
  for (unsigned i=0; i<bndry_elem_list.size(); ++i)
    {
      // Get pointer to current Elem
      const Elem* elem = mesh.elem(bndry_elem_list[i]);

      // If element is local, process it
      if (elem->processor_id() == this->processor_id())
        {
          std::vector<const Elem*> family;
#ifdef LIBMESH_ENABLE_AMR
          // We need to build up active elements if AMR is enabled and add
          // them to the exodus sidesets instead of the potentially inactive "parent" elements
          // Technically we don't need to "reset" the tree since the vector was just created.
          elem->active_family_tree_by_side(family, bndry_side_list[i], /*reset tree=*/false);
#else
          // If AMR is not even enabled, just push back the element itself
          family.push_back( elem );
#endif

          // Loop over all the elements in the family tree, store their converted IDs
          // and side IDs to the map's vectors.  TODO: Somehow reserve enough space for these
          // push_back's...
          for (unsigned int j=0; j<family.size(); ++j)
            {
              const ExodusII_IO_Helper::Conversion conv = em.assign_conversion(mesh.elem(family[j]->id())->type());

              // Use the libmesh to exodus datastructure map to get the proper sideset IDs
              // The datastructure contains the "collapsed" contiguous ids.
              //
              // We know the parent element is local, but let's be absolutely sure that all the children have been
              // actually mapped to Exodus IDs before we blindly try to add them...
              std::map<int,int>::iterator it = this->libmesh_elem_num_to_exodus.find( family[j]->id() );
              if (it != this->libmesh_elem_num_to_exodus.end())
                {
                  local_elem_boundary_id_lists[ bndry_id_list[i] ].push_back( (*it).second );
                  local_elem_boundary_id_side_lists[ bndry_id_list[i] ].push_back(conv.get_inverse_side_map( bndry_side_list[i] ));
                }
              else
                libmesh_error_msg("Error, no Exodus mapping for Elem " \
                                  << family[j]->id()                  \
                                  << " on processor "                 \
                                  << this->processor_id());
            }
        }
    }


  // Loop over *global* sideset IDs, call the Exodus API.  Note that some sidesets may be empty
  // for a given processor.
  for (unsigned i=0; i<this->global_sideset_ids.size(); ++i)
    {
      if (verbose)
        {
          libMesh::out << "[" << this->processor_id()
                       << "] Writing out Exodus sideset info for ID: " << global_sideset_ids[i] << std::endl;
        }

      // Convert current global_sideset_id into an exodus ID, which can't be zero...
      int exodus_id = global_sideset_ids[i];

      /*
      // Exodus can't handle zero sideset IDs (?)  Use max short here since
      // when libmesh reads it back in, it will want to store it as a short...
      if (exodus_id==0)
      exodus_id = std::numeric_limits<short>::max();
      */

      // Try to find this boundary ID in the local list we created
      local_elem_boundary_id_lists_iterator it =
        local_elem_boundary_id_lists.find (cast_int<boundary_id_type>(this->global_sideset_ids[i]));

      // No sides found for this boundary ID on this processor
      if (it == local_elem_boundary_id_lists.end())
        {
          if (verbose)
            libMesh::out << "[" << this->processor_id()
                         << "] No sideset data for ID: " << global_sideset_ids[i]
                         << " on this processor." << std::endl;

          // Call the Exodus interface to write the parameters of this side set
          this->ex_err = exII::ex_put_side_set_param(this->ex_id,
                                                     exodus_id,
                                                     0, /* No sides for this ID */
                                                     0  /* No distribution factors */);
          EX_CHECK_ERR(this->ex_err, "Error writing sideset parameters in Nemesis");

        }
      else // Boundary ID *was* found in list
        {
          // Get iterator to sides vector as well
          local_elem_boundary_id_lists_iterator it_sides =
            local_elem_boundary_id_side_lists.find (cast_int<boundary_id_type>(this->global_sideset_ids[i]));

          libmesh_assert (it_sides != local_elem_boundary_id_side_lists.end());

          // Get reference to the vector of elem IDs
          std::vector<int>& current_sideset_elem_ids = (*it).second;

          // Get reference to the vector of side IDs
          std::vector<int>& current_sideset_side_ids = (*it_sides).second;

          // Call the Exodus interface to write the parameters of this side set
          this->ex_err = exII::ex_put_side_set_param(this->ex_id,
                                                     exodus_id,
                                                     current_sideset_elem_ids.size(),
                                                     0  /* No distribution factors */);

          EX_CHECK_ERR(this->ex_err, "Error writing sideset parameters in Nemesis");

          // Call Exodus interface to write the actual side IDs for this boundary ID
          this->ex_err = exII::ex_put_side_set(this->ex_id,
                                               exodus_id,
                                               &current_sideset_elem_ids[0],
                                               &current_sideset_side_ids[0]);

          EX_CHECK_ERR(this->ex_err, "Error writing sidesets in Nemesis");
        }
    } // end for loop over global sideset IDs
}
void libMesh::ExodusII_IO_Helper::write_timestep ( int  timestep,
Real  time 
) [inherited]

Writes the time for the timestep

Definition at line 1601 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, and libMesh::ParallelObject::processor_id().

Referenced by libMesh::Nemesis_IO::write_timestep(), and libMesh::ExodusII_IO::write_timestep().

{
  if ((_run_only_on_proc0) && (this->processor_id() != 0))
    return;

  ex_err = exII::ex_put_time(ex_id, timestep, &time);
  EX_CHECK_ERR(ex_err, "Error writing timestep.");

  ex_err = exII::ex_update(ex_id);
  EX_CHECK_ERR(ex_err, "Error flushing buffers to file.");
}

Member Data Documentation

This is the block connectivity, i.e. for each subdomain (block) there is an element connectivity list. This map associates the block ID to that vector.

Definition at line 398 of file nemesis_io_helper.h.

Referenced by build_element_and_node_maps(), and write_elements().

std::set<unsigned> libMesh::Nemesis_IO_Helper::border_elem_ids [private]

A set of border elem IDs for this processor.

Definition at line 573 of file nemesis_io_helper.h.

Referenced by compute_element_maps(), and compute_internal_and_border_elems_and_internal_nodes().

std::set<unsigned> libMesh::Nemesis_IO_Helper::border_node_ids [private]

The set which will eventually contain the IDs of "border nodes". These are nodes that lie on the boundary between one or more processors.

Definition at line 536 of file nemesis_io_helper.h.

Referenced by compute_border_node_ids(), compute_internal_and_border_elems_and_internal_nodes(), and compute_node_maps().

std::vector<std::vector<int> > libMesh::Nemesis_IO_Helper::elem_cmap_elem_ids

3 vectors of vectors for storing element communication IDs for this processor. There will be num_elem_cmaps rows, row i will have elem_cmap_elem_cnts[i] entries. To be used with Nemesis::ne_get_elem_cmap().

Definition at line 520 of file nemesis_io_helper.h.

Referenced by compute_elem_communication_maps(), get_elem_cmap(), and initialize().

std::vector<std::vector<int> > libMesh::Nemesis_IO_Helper::elem_cmap_proc_ids

Definition at line 522 of file nemesis_io_helper.h.

Referenced by compute_elem_communication_maps(), get_elem_cmap(), and initialize().

std::vector<std::vector<int> > libMesh::Nemesis_IO_Helper::elem_cmap_side_ids

Definition at line 521 of file nemesis_io_helper.h.

Referenced by compute_elem_communication_maps(), get_elem_cmap(), and initialize().

Vector which stores border element IDs. Will have length num_border_elems. To be used with Nemesis::ne_get_elem_map().

Definition at line 465 of file nemesis_io_helper.h.

Referenced by compute_element_maps(), get_elem_map(), and initialize().

Vector which stores internal element IDs. Will have length num_internal_elems. To be used with Nemesis::ne_get_elem_map().

Definition at line 458 of file nemesis_io_helper.h.

Referenced by compute_element_maps(), get_elem_map(), and initialize().

Definition at line 370 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::close(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::inquire(), libMesh::ExodusII_IO_Helper::read_block_info(), libMesh::ExodusII_IO_Helper::read_elem_in_block(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_elemental_var_values(), libMesh::ExodusII_IO_Helper::read_header(), libMesh::ExodusII_IO_Helper::read_nodal_var_values(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::ExodusII_IO_Helper::read_nodes(), libMesh::ExodusII_IO_Helper::read_nodeset(), libMesh::ExodusII_IO_Helper::read_nodeset_info(), libMesh::ExodusII_IO_Helper::read_sideset(), libMesh::ExodusII_IO_Helper::read_sideset_info(), libMesh::ExodusII_IO_Helper::read_time_steps(), libMesh::ExodusII_IO_Helper::read_var_names_impl(), libMesh::Nemesis_IO::write(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), write_elements(), write_exodus_initialization_info(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_nodesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), write_sidesets(), libMesh::ExodusII_IO_Helper::write_timestep(), libMesh::ExodusII_IO_Helper::write_var_names_impl(), and ~Nemesis_IO_Helper().

Definition at line 367 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::close(), libMesh::ExodusII_IO_Helper::create(), create(), get_cmap_params(), get_eb_info_global(), get_elem_cmap(), get_elem_map(), get_init_global(), get_init_info(), get_loadbal_param(), get_node_cmap(), get_node_map(), get_ns_param_global(), get_ss_param_global(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::inquire(), libMesh::ExodusII_IO_Helper::open(), put_cmap_params(), put_eb_info_global(), put_elem_cmap(), put_elem_map(), put_init_global(), put_init_info(), put_loadbal_param(), put_n_coord(), put_node_cmap(), put_node_map(), put_ns_param_global(), put_ss_param_global(), libMesh::ExodusII_IO_Helper::read_block_info(), libMesh::ExodusII_IO_Helper::read_elem_in_block(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_elemental_var_values(), libMesh::ExodusII_IO_Helper::read_header(), libMesh::ExodusII_IO_Helper::read_nodal_var_values(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::ExodusII_IO_Helper::read_nodes(), libMesh::ExodusII_IO_Helper::read_nodeset(), libMesh::ExodusII_IO_Helper::read_nodeset_info(), libMesh::ExodusII_IO_Helper::read_sideset(), libMesh::ExodusII_IO_Helper::read_sideset_info(), libMesh::ExodusII_IO_Helper::read_time_steps(), libMesh::ExodusII_IO_Helper::read_var_names_impl(), libMesh::Nemesis_IO::write(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), write_elements(), write_exodus_initialization_info(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_nodesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), write_sidesets(), libMesh::ExodusII_IO_Helper::write_timestep(), libMesh::ExodusII_IO_Helper::write_var_names_impl(), and ~Nemesis_IO_Helper().

Definition at line 465 of file exodusII_io_helper.h.

Referenced by build_element_and_node_maps(), and write_elements().

The type of file to be written. Either 's', for a scalar load-balance file, or 'p' for a parallel file. To be used with Nemesis::ne_get_init_info().

Definition at line 350 of file nemesis_io_helper.h.

Referenced by get_init_info().

Read the global element block IDs and counts. These vectors will eventually have num_elem_blks_global entries. To be used with Nemesis::ne_get_eb_info_global().

Definition at line 381 of file nemesis_io_helper.h.

Referenced by compute_num_global_elem_blocks(), get_eb_info_global(), initialize(), and write_elements().

Containers for reading global nodeset information. One vector entry per nodeset. Each vector will eventually have num_node_sets_global entries, and will be used in calls to Nemesis::ne_get_ns_param_global().

It's an error to call ne_get_ns_param_global when num_node_sets_global==0

Definition at line 371 of file nemesis_io_helper.h.

Referenced by compute_num_global_nodesets(), get_ns_param_global(), initialize(), put_ns_param_global(), write_exodus_initialization_info(), and write_nodesets().

Containers for reading global sideset (boundary conditions) information. Each vector will eventually have num_side_sets_global entries, and be used in calls to Nemesis::ne_get_ss_param_global().

It's an error to call ne_get_ss_param_global when num_side_sets_global==0

Definition at line 359 of file nemesis_io_helper.h.

Referenced by compute_num_global_sidesets(), get_ss_param_global(), initialize(), put_ss_param_global(), libMesh::Nemesis_IO::read(), write_exodus_initialization_info(), and write_sidesets().

std::set<unsigned> libMesh::Nemesis_IO_Helper::internal_elem_ids [private]

A set of internal elem IDs for this processor.

Definition at line 568 of file nemesis_io_helper.h.

Referenced by compute_element_maps(), and compute_internal_and_border_elems_and_internal_nodes().

std::set<unsigned> libMesh::Nemesis_IO_Helper::internal_node_ids [private]

A set of internal node IDs for this processor.

Definition at line 563 of file nemesis_io_helper.h.

Referenced by compute_internal_and_border_elems_and_internal_nodes(), and compute_node_maps().

This map keeps track of the number of elements in each subdomain (block) for *this* processor.

Definition at line 530 of file nemesis_io_helper.h.

Referenced by build_element_and_node_maps(), and compute_num_global_elem_blocks().

Vectors for storing the communication map parameters. Each will eventually have length num_node_cmaps OR num_elem_cmaps as appropriate. For use with Nemesis::ne_get_cmap_params().

Definition at line 497 of file nemesis_io_helper.h.

Referenced by compute_communication_map_parameters(), compute_node_communication_maps(), get_cmap_params(), get_node_cmap(), initialize(), put_cmap_params(), put_node_cmap(), and libMesh::Nemesis_IO::read().

std::vector<std::vector<int> > libMesh::Nemesis_IO_Helper::node_cmap_node_ids

2 vectors of vectors for storing the node communication IDs for this processor. There will be num_node_cmaps rows, row i will have node_cmap_node_cnts[i] entries. To be used with Nemesis::ne_get_node_cmap().

Remark: node_cmap_proc_ids is a vector, all entries of which are = node_cmap_ids[i] Not sure what the point of that is...

Definition at line 511 of file nemesis_io_helper.h.

Referenced by compute_node_communication_maps(), get_node_cmap(), initialize(), and libMesh::Nemesis_IO::read().

Vector which stores border node IDs. Will have length num_border_nodes. To be used with Nemesis::ne_get_node_map().

Definition at line 481 of file nemesis_io_helper.h.

Referenced by compute_node_maps(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

Vector which stores external node IDs. Will have length num_external_nodes. To be used with Nemesis::ne_get_node_map().

Definition at line 488 of file nemesis_io_helper.h.

Referenced by compute_node_maps(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

Vector which stores internal node IDs. Will have length num_internal_nodes. To be used with Nemesis::ne_get_node_map().

Definition at line 474 of file nemesis_io_helper.h.

Referenced by compute_node_maps(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

The number of border FEM elements. Elements local to this processor but whose FEM nodes reside on other processors as well. To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 435 of file nemesis_io_helper.h.

Referenced by compute_internal_and_border_elems_and_internal_nodes(), get_elem_map(), get_loadbal_param(), initialize(), and libMesh::Nemesis_IO::read().

The number of FEM nodes local to a processor but residing in an element which also has FEM nodes on other processors. To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 415 of file nemesis_io_helper.h.

Referenced by compute_border_node_ids(), compute_internal_and_border_elems_and_internal_nodes(), get_loadbal_param(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

The number of elemental communication maps for this processor. (One per neighboring proc?) To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 449 of file nemesis_io_helper.h.

Referenced by compute_communication_map_parameters(), compute_elem_communication_maps(), compute_internal_and_border_elems_and_internal_nodes(), get_cmap_params(), get_elem_cmap(), get_loadbal_param(), initialize(), and libMesh::Nemesis_IO::read().

The number of FEM nodes that reside on another processor but whose element partially resides on the current processor. To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 422 of file nemesis_io_helper.h.

Referenced by get_loadbal_param(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

The number of internal FEM elements. Elements local to this processor. To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 428 of file nemesis_io_helper.h.

Referenced by compute_internal_and_border_elems_and_internal_nodes(), get_elem_map(), get_loadbal_param(), initialize(), and libMesh::Nemesis_IO::read().

To be used with the Nemesis::ne_get_loadbal_param() routine. The number of FEM nodes contained in FEM elements wholly owned by the current processor. To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 408 of file nemesis_io_helper.h.

Referenced by compute_internal_and_border_elems_and_internal_nodes(), get_loadbal_param(), get_node_map(), initialize(), and libMesh::Nemesis_IO::read().

The number of nodal communication maps for this processor. (One per neighboring proc?) To be used with the Nemesis::ne_get_loadbal_param() routine.

Definition at line 442 of file nemesis_io_helper.h.

Referenced by compute_border_node_ids(), compute_communication_map_parameters(), compute_node_communication_maps(), get_cmap_params(), get_loadbal_param(), get_node_cmap(), initialize(), and libMesh::Nemesis_IO::read().

Global initial information. The names are self-explanatory for the most part. Used with Nemesis::ne_get_init_global().

Definition at line 326 of file nemesis_io_helper.h.

Referenced by get_init_global(), and libMesh::Nemesis_IO::read().

The number of processors for which the NEMESIS I file was created. To be used with Nemesis::ne_get_init_info().

Definition at line 336 of file nemesis_io_helper.h.

Referenced by get_init_info().

The number of processors for which the NEMESIS I file stores information. This is generally equal to 1 (1 CPU/file) at least for the splitting Derek gave us. To be used with Nemesis::ne_get_init_info().

Definition at line 343 of file nemesis_io_helper.h.

Referenced by get_init_info().

std::map<unsigned, std::set<std::pair<unsigned,unsigned> > > libMesh::Nemesis_IO_Helper::proc_border_elem_sets [private]

Map between processor ID and (element,side) pairs bordering that processor ID.

Definition at line 553 of file nemesis_io_helper.h.

Referenced by compute_communication_map_parameters(), compute_elem_communication_maps(), and compute_internal_and_border_elems_and_internal_nodes().

std::map<unsigned, std::set<unsigned> > libMesh::Nemesis_IO_Helper::proc_nodes_touched_intersections [private]

Another map to store sets of intersections with each other processor (other than ourself, of course). A node which appears in one of these vectors belongs to element owned by at least this processor and one other.

Definition at line 543 of file nemesis_io_helper.h.

Referenced by compute_border_node_ids(), compute_communication_map_parameters(), and compute_node_communication_maps().

std::map<subdomain_id_type, std::vector<unsigned int> > libMesh::Nemesis_IO_Helper::subdomain_map

Map of subdomains to element numbers.

Definition at line 392 of file nemesis_io_helper.h.

Referenced by build_element_and_node_maps(), and write_elements().


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