libMesh::Nemesis_IO_Helper Class Reference

#include <nemesis_io_helper.h>

Inheritance diagram for libMesh::Nemesis_IO_Helper:

List of all members.

Public Member Functions

 Nemesis_IO_Helper (bool verbose=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)
virtual void write_elements (const MeshBase &mesh)
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)
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)
bool created ()
void verbose (bool set_verbosity)
int get_num_dim () const
int get_num_globals () const
int get_num_nodes () const
int get_num_elem () const
int get_num_elem_blk () const
int get_num_elem_this_blk () const
int get_num_nodes_per_elem () const
int get_num_side_sets () const
int get_num_node_sets () const
int get_connect (int i) const
int get_num_sides_per_set (int i) const
int get_num_nodes_per_set (int i) const
const std::vector< int > & get_elem_list () const
const std::vector< int > & get_side_list () const
const std::vector< int > & get_node_list () const
int get_nodeset_id (unsigned int i) const
const std::vector< int > & get_id_list () const
const char * get_elem_type () const
Real get_x (int i) const
Real get_y (int i) const
Real get_z (int i) const
void open (const char *filename)
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 print_sideset_info ()
void print_nodeset_info ()
void close ()
int inquire (int req_info, std::string error_msg="")
const std::vector< Real > & get_time_steps ()
int get_num_nodal_vars ()
const std::vector< std::string > & get_nodal_var_names ()
const std::vector< Real > & get_nodal_var_values (std::string nodal_var_name, int time_step)
void initialize_discontinuous (std::string title, const MeshBase &mesh)
void write_nodal_coordinates_discontinuous (const MeshBase &mesh)
void write_elements_discontinuous (const MeshBase &mesh)
void initialize_element_variables (const MeshBase &mesh, std::vector< std::string > names)
void initialize_nodal_variables (std::vector< std::string > names)
void initialize_global_variables (const std::vector< std::string > &names)
void write_timestep (int timestep, Real time)
void write_element_values (const MeshBase &mesh, const std::vector< Number > &values, int timestep)
void write_nodal_values (int var_id, const std::vector< Number > &values, int timestep)
void write_information_records (const std::vector< std::string > &records)
void write_global_values (const std::vector< Number > &values, int timestep)
void use_mesh_dimension_instead_of_spatial_dimension (bool val)
void check_err (const int error, const std::string msg)
void message (const std::string msg)
void message (const std::string msg, int i)

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 comp_ws
int io_ws
int ex_id
int ex_err
int num_dim
int num_globals
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 req_info
int ret_int
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
float ex_version
float ret_float
std::vector< Realx
std::vector< Realy
std::vector< Realz
char ret_char
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::vector< char > > vvc
std::vector< char * > strings
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

Protected Attributes

bool _created
bool _verbose
bool _run_only_on_proc0
bool _elem_vars_initialized
bool _global_vars_initialized
bool _use_mesh_dimension_instead_of_spatial_dimension

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 53 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 553 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 543 of file nemesis_io_helper.h.


Constructor & Destructor Documentation

libMesh::Nemesis_IO_Helper::Nemesis_IO_Helper ( bool  verbose = false  )  [explicit]

Constructor.

Definition at line 42 of file nemesis_io_helper.C.

00042                                                     :
00043   ExodusII_IO_Helper(verbose_in, /*run_only_on_proc0=*/false),
00044   nemesis_err_flag(0),
00045   num_nodes_global(0),
00046   num_elems_global(0),
00047   num_elem_blks_global(0),
00048   num_node_sets_global(0),
00049   num_side_sets_global(0),
00050   num_proc(0),
00051   num_proc_in_file(0),
00052   ftype('\0'),
00053   num_internal_nodes(0),
00054   num_border_nodes(0),
00055   num_external_nodes(0),
00056   num_internal_elems(0),
00057   num_border_elems(0),
00058   num_node_cmaps(0),
00059   num_elem_cmaps(0)
00060 {
00061   // Warn about using untested code!
00062   libmesh_experimental();
00063 }

libMesh::Nemesis_IO_Helper::~Nemesis_IO_Helper (  )  [virtual]

Destructor.

Definition at line 66 of file nemesis_io_helper.C.

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

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


Member Function Documentation

void libMesh::Nemesis_IO_Helper::build_element_and_node_maps ( const MeshBase pmesh  )  [private]

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 1678 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, 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(), elem_id, libMesh::err, 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::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::processor_id(), libMesh::Elem::subdomain_id(), subdomain_map, and libMesh::Elem::type().

Referenced by initialize().

01679 {
01680   // If we don't have any local subdomains, it had better be because
01681   // we don't have any local elements
01682 #ifdef DEBUG
01683   if (local_subdomain_counts.empty())
01684     {
01685       libmesh_assert(pmesh.active_local_elements_begin() ==
01686                      pmesh.active_local_elements_end());
01687       libmesh_assert(this->nodes_attached_to_local_elems.empty());
01688     }
01689 #endif
01690 
01691   // Elements have to be numbered contiguously based on what block
01692   // number they are in.  Therefore we have to do a bit of work to get
01693   // the block (ie subdomain) numbers first and store them off as
01694   // block_ids.
01695 
01696   // Make sure there is no leftover information in the subdomain_map, and reserve
01697   // enough space to store the elements we need.
01698   this->subdomain_map.clear();
01699   for (std::map<subdomain_id_type, unsigned>::iterator it=this->local_subdomain_counts.begin();
01700        it != this->local_subdomain_counts.end();
01701        ++it)
01702     {
01703       subdomain_id_type cur_subdomain = (*it).first;
01704 
01705 /*
01706       // We can't have a zero subdomain ID in Exodus (for some reason?)
01707       // so map zero subdomains to a max value...
01708       if (cur_subdomain == 0)
01709         cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
01710 */
01711 
01712       if (_verbose)
01713         {
01714           libMesh::out << "[" << libMesh::processor_id() << "] "
01715                        << "local_subdomain_counts [" << static_cast<unsigned>(cur_subdomain) << "]= "
01716                        << (*it).second
01717                        << std::endl;
01718         }
01719 
01720       // *it.first is the subodmain ID, *it.second is the number of elements it contains
01721       this->subdomain_map[ cur_subdomain ].reserve( (*it).second );
01722     }
01723 
01724 
01725   // First loop over the elements to figure out which elements are in which subdomain
01726   MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
01727   MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();
01728 
01729   for (; elem_it != elem_end; ++elem_it)
01730     {
01731       const Elem * elem = *elem_it;
01732 
01733       // Grab the nodes while we're here.
01734       for (unsigned int n=0; n<elem->n_nodes(); ++n)
01735         this->nodes_attached_to_local_elems.insert( elem->node(n) );
01736 
01737       unsigned int cur_subdomain = elem->subdomain_id();
01738 
01739 /*
01740       // We can't have a zero subdomain ID in Exodus (for some reason?)
01741       // so map zero subdomains to a max value...
01742       if(cur_subdomain == 0)
01743         cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
01744 */
01745 
01746       this->subdomain_map[cur_subdomain].push_back(elem->id());
01747     }
01748 
01749   // Set num_nodes which is used by exodusII_io_helper
01750   this->num_nodes = this->nodes_attached_to_local_elems.size();
01751 
01752   // Now come up with a 1-based numbering for these nodes
01753   this->exodus_node_num_to_libmesh.clear(); // Make sure it's empty
01754   this->exodus_node_num_to_libmesh.reserve(this->nodes_attached_to_local_elems.size());
01755 
01756   // Also make sure there's no leftover information in the map which goes the
01757   // other direction.
01758   this->libmesh_node_num_to_exodus.clear();
01759 
01760   // Set the map for nodes
01761   for(std::set<int>::iterator it = this->nodes_attached_to_local_elems.begin();
01762       it != this->nodes_attached_to_local_elems.end();
01763       ++it)
01764     {
01765       // I.e. given exodus_node_id,
01766       // exodus_node_num_to_libmesh[ exodus_node_id ] returns the libmesh ID for that node.
01767       // Note that even though most of Exodus is 1-based, this code will map an Exodus ID of
01768       // zero to some libmesh node ID.  Is that a problem?
01769       this->exodus_node_num_to_libmesh.push_back(*it);
01770 
01771       // Likewise, given libmesh_node_id,
01772       // libmesh_node_num_to_exodus[ libmesh_node_id ] returns the *Exodus* ID for that node.
01773       // Unlike the exodus_node_num_to_libmesh vector above, this one is a std::map
01774       this->libmesh_node_num_to_exodus[*it] = this->exodus_node_num_to_libmesh.size(); // should never be zero...
01775     }
01776 
01777   // Now we're going to loop over the subdomain map and build a few things right
01778   // now that we'll use later.
01779 
01780   // First make sure our data structures don't have any leftover data...
01781   this->exodus_elem_num_to_libmesh.clear();
01782   this->block_ids.clear();
01783   this->libmesh_elem_num_to_exodus.clear();
01784 
01785   // Now loop over each subdomain and get a unique numbering for the elements
01786   for(std::map<subdomain_id_type, std::vector<unsigned int> >::iterator it = this->subdomain_map.begin();
01787       it != this->subdomain_map.end();
01788       ++it)
01789     {
01790       block_ids.push_back((*it).first);
01791 
01792       // Vector of element IDs for this subdomain
01793       std::vector<unsigned int>& elem_ids_this_subdomain = (*it).second;
01794 
01795       // The code below assumes this subdomain block is not empty, make sure that's the case!
01796       if (elem_ids_this_subdomain.size() == 0)
01797         {
01798           libMesh::err << "Error, no element IDs found in subdomain " << (*it).first << std::endl;
01799           libmesh_error();
01800         }
01801 
01802       ExodusII_IO_Helper::ElementMaps em;
01803 
01804       // Use the first element in this block to get representative information.
01805       // Note that Exodus assumes all elements in a block are of the same type!
01806       // We are using that same assumption here!
01807       const ExodusII_IO_Helper::Conversion conv = em.assign_conversion(pmesh.elem(elem_ids_this_subdomain[0])->type());
01808       this->num_nodes_per_elem = pmesh.elem(elem_ids_this_subdomain[0])->n_nodes();
01809 
01810       // Get a reference to the connectivity vector for this subdomain.  This vector
01811       // is most likely empty, we are going to fill it up now.
01812       std::vector<int>& current_block_connectivity = this->block_id_to_elem_connectivity[(*it).first];
01813 
01814       // Just in case it's not already empty...
01815       current_block_connectivity.clear();
01816       current_block_connectivity.resize(elem_ids_this_subdomain.size() * this->num_nodes_per_elem);
01817 
01818       for (unsigned int i=0; i<elem_ids_this_subdomain.size(); i++)
01819         {
01820           unsigned int elem_id = elem_ids_this_subdomain[i];
01821 
01822           // Set the number map for elements
01823           this->exodus_elem_num_to_libmesh.push_back(elem_id);
01824           this->libmesh_elem_num_to_exodus[elem_id] = this->exodus_elem_num_to_libmesh.size();
01825 
01826           const Elem * elem = pmesh.elem(elem_id);
01827 
01828           // Exodus/Nemesis want every block to have the same element type
01829           // libmesh_assert_equal_to (elem->type(), conv.get_canonical_type());
01830 
01831           // But we can get away with writing e.g. HEX8 and INFHEX8 in
01832           // the same block...
01833           libmesh_assert_equal_to (elem->n_nodes(), Elem::build(conv.get_canonical_type(), NULL)->n_nodes());
01834 
01835           for (unsigned int j=0; j < static_cast<unsigned int>(this->num_nodes_per_elem); j++)
01836             {
01837               const unsigned int connect_index   = (i*this->num_nodes_per_elem)+j;
01838               const unsigned int elem_node_index = conv.get_node_map(j);
01839               current_block_connectivity[connect_index] = this->libmesh_node_num_to_exodus[elem->node(elem_node_index)];
01840             }
01841         } // End loop over elems in this subdomain
01842     } // end loop over subdomain_map
01843 }

void libMesh::ExodusII_IO_Helper::check_err ( const int  error,
const std::string  msg 
) [inherited]

All of the ExodusII API functions return an int error value. This function checks to see if the error has been set, and if it has, prints the error message contained in msg.

Definition at line 230 of file exodusII_io_helper.C.

References libMesh::err.

Referenced by libMesh::ExodusII_IO_Helper::close(), create(), libMesh::ExodusII_IO_Helper::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_discontinuous(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_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_header(), 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::write_element_values(), write_elements(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elements_discontinuous(), write_exodus_initialization_info(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO_Helper::write_information_records(), write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_timestep(), and ~Nemesis_IO_Helper().

00231 {
00232   if (err_in < 0)
00233     {
00234       libMesh::err << msg << std::endl;
00235       libmesh_error();
00236     }
00237 }

void libMesh::ExodusII_IO_Helper::close (  )  [inherited]

Closes the ExodusII mesh file.

Definition at line 649 of file exodusII_io_helper.C.

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

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

00650 {
00651   // Always call close on processor 0.
00652   // If we're running on multiple processors, i.e. as one of several Nemesis files,
00653   // we call close on all processors...
00654   if ((libMesh::processor_id() == 0) || (!_run_only_on_proc0))
00655     {
00656       ex_err = exII::ex_close(ex_id);
00657       check_err(ex_err, "Error closing Exodus file.");
00658       message("Exodus file closed successfully.");
00659     }
00660 }

void libMesh::Nemesis_IO_Helper::compute_border_node_ids ( const MeshBase pmesh  )  [private]

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 1849 of file nemesis_io_helper.C.

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

Referenced by initialize().

01850 {
01851   // The set which will eventually contain the IDs of "border nodes".  These are nodes
01852   // that lie on the boundary between one or more processors.
01853   //std::set<unsigned> border_node_ids;
01854 
01855   // map from processor ID to set of nodes which elements from this processor "touch",
01856   // that is,
01857   // proc_nodes_touched[p] = (set all node IDs found in elements owned by processor p)
01858   std::map<unsigned, std::set<unsigned> > proc_nodes_touched;
01859 
01860 
01861   // We are going to create a lot of intermediate data structures here, so make sure
01862   // as many as possible all cleaned up by creating scope!
01863   {
01864     // Loop over active (not just active local) elements, make sets of node IDs for each
01865     // processor which has an element that "touches" a node.
01866     {
01867       MeshBase::const_element_iterator elem_it = pmesh.active_elements_begin();
01868       MeshBase::const_element_iterator elem_end = pmesh.active_elements_end();
01869 
01870       for (; elem_it != elem_end; ++elem_it)
01871         {
01872           const Elem* elem = *elem_it;
01873 
01874           // Get reference to the set for this processor.  If it does not exist
01875           // it will be created.
01876           std::set<unsigned>& set_p = proc_nodes_touched[ elem->processor_id() ];
01877 
01878           // Insert all nodes touched by this element into the set
01879           for (unsigned int node=0; node<elem->n_nodes(); ++node)
01880             set_p.insert(elem->node(node));
01881         }
01882     }
01883 
01884     // The number of node communication maps is the number of other processors
01885     // with which we share nodes. (I think.) This is just the size of the map we just
01886     // created, minus 1.
01887     this->num_node_cmaps = proc_nodes_touched.size() - 1;
01888 
01889     // If we've got no elements on this processor and haven't touched
01890     // any nodes, however, then that's 0 other processors with which
01891     // we share nodes, not -1.
01892     if (this->num_node_cmaps == -1)
01893       {
01894         libmesh_assert (pmesh.active_elements_begin() == pmesh.active_elements_end());
01895         this->num_node_cmaps = 0;
01896       }
01897 
01898     // We can't be connecting to more processors than exist outside
01899     // ourselves
01900     libmesh_assert_less (static_cast<unsigned>(this->num_node_cmaps), libMesh::n_processors());
01901 
01902     if (_verbose)
01903       {
01904         libMesh::out << "[" << libMesh::processor_id()
01905                      << "] proc_nodes_touched contains "
01906                      << proc_nodes_touched.size()
01907                      << " sets of nodes."
01908                      << std::endl;
01909 
01910         for (proc_nodes_touched_iterator it = proc_nodes_touched.begin();
01911              it != proc_nodes_touched.end();
01912              ++it)
01913           {
01914             libMesh::out << "[" << libMesh::processor_id()
01915                          << "] proc_nodes_touched[" << (*it).first << "] has "
01916                          << (*it).second.size()
01917                          << " entries."
01918                          << std::endl;
01919           }
01920       }
01921 
01922 
01923     // Loop over all the sets we just created and compute intersections with the
01924     // this processor's set.  Obviously, don't intersect with ourself.
01925     for (proc_nodes_touched_iterator it = proc_nodes_touched.begin();
01926          it != proc_nodes_touched.end();
01927          ++it)
01928       {
01929         // Don't compute intersections with ourself
01930         if ((*it).first == libMesh::processor_id())
01931           continue;
01932 
01933         // Otherwise, compute intersection with other processor and ourself
01934         std::set<unsigned>& my_set = proc_nodes_touched[libMesh::processor_id()];
01935         std::set<unsigned>& other_set = (*it).second;
01936         std::set<unsigned>& result_set = this->proc_nodes_touched_intersections[ (*it).first ]; // created if does not exist
01937 
01938         std::set_intersection(my_set.begin(), my_set.end(),
01939                               other_set.begin(), other_set.end(),
01940                               std::inserter(result_set, result_set.end()));
01941       }
01942 
01943     if (_verbose)
01944       {
01945         for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
01946              it != this->proc_nodes_touched_intersections.end();
01947              ++it)
01948           {
01949             libMesh::out << "[" << libMesh::processor_id()
01950                          << "] this->proc_nodes_touched_intersections[" << (*it).first << "] has "
01951                          << (*it).second.size()
01952                          << " entries."
01953                          << std::endl;
01954           }
01955       }
01956 
01957     // Compute the set_union of all the preceding intersections.  This will be the set of
01958     // border node IDs for this processor.
01959     for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
01960          it != this->proc_nodes_touched_intersections.end();
01961          ++it)
01962       {
01963         std::set<unsigned>& other_set = (*it).second;
01964         std::set<unsigned> intermediate_result; // Don't think we can insert into one of the sets we're unioning...
01965 
01966         std::set_union(this->border_node_ids.begin(), this->border_node_ids.end(),
01967                        other_set.begin(), other_set.end(),
01968                        std::inserter(intermediate_result, intermediate_result.end()));
01969 
01970         // Swap our intermediate result into the final set
01971         this->border_node_ids.swap(intermediate_result);
01972       }
01973 
01974     if (_verbose)
01975       {
01976         libMesh::out << "[" << libMesh::processor_id()
01977                      << "] border_node_ids.size()=" << this->border_node_ids.size()
01978                      << std::endl;
01979       }
01980   } // end scope for border node ID creation
01981 
01982   // Store the number of border node IDs to be written to Nemesis file
01983   this->num_border_nodes = this->border_node_ids.size();
01984 }

void libMesh::Nemesis_IO_Helper::compute_communication_map_parameters (  )  [private]

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

Definition at line 1132 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, 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, and libMesh::processor_id().

Referenced by initialize().

01133 {
01134   // For the nodes, these are the number of entries in the sets in proc_nodes_touched_intersections
01135   // map computed above.  Note: this map does not contain self-intersections so we can loop over it
01136   // directly.
01137   this->node_cmap_node_cnts.clear(); // Make sure we don't have any leftover information...
01138   this->node_cmap_ids.clear();       // Make sure we don't have any leftover information...
01139   this->node_cmap_node_cnts.resize(this->num_node_cmaps);
01140   this->node_cmap_ids.resize(this->num_node_cmaps);
01141 
01142   {
01143     unsigned cnt=0; // Index into the vector
01144     for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
01145          it != this->proc_nodes_touched_intersections.end();
01146          ++it)
01147       {
01148         this->node_cmap_ids[cnt] = (*it).first; // The ID of the proc we communicate with
01149         this->node_cmap_node_cnts[cnt] = (*it).second.size(); // The number of nodes we communicate
01150         cnt++; // increment vector index!
01151       }
01152   }
01153 
01154   // Print the packed vectors we just filled
01155   if (_verbose)
01156     {
01157       libMesh::out << "[" << libMesh::processor_id() << "] node_cmap_node_cnts = ";
01158       for (unsigned i=0; i<node_cmap_node_cnts.size(); ++i)
01159         libMesh::out << node_cmap_node_cnts[i] << ", ";
01160       libMesh::out << std::endl;
01161 
01162       libMesh::out << "[" << libMesh::processor_id() << "] node_cmap_ids = ";
01163       for (unsigned i=0; i<node_cmap_ids.size(); ++i)
01164         libMesh::out << node_cmap_ids[i] << ", ";
01165       libMesh::out << std::endl;
01166     }
01167 
01168   // For the elements, we have not yet computed all this information..
01169   this->elem_cmap_elem_cnts.clear(); // Make sure we don't have any leftover information...
01170   this->elem_cmap_ids.clear();       // Make sure we don't have any leftover information...
01171   this->elem_cmap_elem_cnts.resize(this->num_elem_cmaps);
01172   this->elem_cmap_ids.resize(this->num_elem_cmaps);
01173 
01174   // Pack the elem_cmap_ids and elem_cmap_elem_cnts vectors
01175   {
01176     unsigned cnt=0; // Index into the vectors we're filling
01177     for (proc_border_elem_sets_iterator it = this->proc_border_elem_sets.begin();
01178          it != this->proc_border_elem_sets.end();
01179          ++it)
01180       {
01181         this->elem_cmap_ids[cnt] = (*it).first; // The ID of the proc we communicate with
01182         this->elem_cmap_elem_cnts[cnt] = (*it).second.size(); // The number of elems we communicate to/from that proc
01183         cnt++; // increment vector index!
01184       }
01185   }
01186 
01187   // Print the packed vectors we just filled
01188   if (_verbose)
01189     {
01190       libMesh::out << "[" << libMesh::processor_id() << "] elem_cmap_elem_cnts = ";
01191       for (unsigned i=0; i<elem_cmap_elem_cnts.size(); ++i)
01192         libMesh::out << elem_cmap_elem_cnts[i] << ", ";
01193       libMesh::out << std::endl;
01194 
01195       libMesh::out << "[" << libMesh::processor_id() << "] elem_cmap_ids = ";
01196       for (unsigned i=0; i<elem_cmap_ids.size(); ++i)
01197         libMesh::out << elem_cmap_ids[i] << ", ";
01198       libMesh::out << std::endl;
01199     }
01200 }

void libMesh::Nemesis_IO_Helper::compute_elem_communication_maps (  )  [private]

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

Definition at line 979 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().

00980 {
00981   // Make sure there is no leftover information
00982   this->elem_cmap_elem_ids.clear();
00983   this->elem_cmap_side_ids.clear();
00984   this->elem_cmap_proc_ids.clear();
00985 
00986   // Allocate enough space for all our element maps
00987   this->elem_cmap_elem_ids.resize(this->num_elem_cmaps);
00988   this->elem_cmap_side_ids.resize(this->num_elem_cmaps);
00989   this->elem_cmap_proc_ids.resize(this->num_elem_cmaps);
00990   {
00991     unsigned cnt=0; // Index into vectors
00992     for (proc_border_elem_sets_iterator it=this->proc_border_elem_sets.begin();
00993          it != this->proc_border_elem_sets.end();
00994          ++it)
00995       {
00996         // Make sure the current elem_cmap_id matches the index in our map of node intersections
00997         libmesh_assert_equal_to ( static_cast<unsigned>(this->elem_cmap_ids[cnt]), (*it).first );
00998 
00999         // Get reference to the set of IDs to be packed into the vector
01000         std::set<std::pair<unsigned,unsigned> >& elem_set = (*it).second;
01001 
01002         // Resize the vectors to receive their payload
01003         this->elem_cmap_elem_ids[cnt].resize(elem_set.size());
01004         this->elem_cmap_side_ids[cnt].resize(elem_set.size());
01005         this->elem_cmap_proc_ids[cnt].resize(elem_set.size());
01006 
01007         std::set<std::pair<unsigned,unsigned> >::iterator elem_set_iter = elem_set.begin();
01008 
01009         // Pack the vectors with elem IDs, side IDs, and processor IDs.
01010         for (unsigned j=0; j<this->elem_cmap_elem_ids[cnt].size(); ++j, ++elem_set_iter)
01011           {
01012             this->elem_cmap_elem_ids[cnt][j] = libmesh_elem_num_to_exodus[(*elem_set_iter).first];//  + 1; // Elem ID, Exodus is 1-based
01013             this->elem_cmap_side_ids[cnt][j] = (*elem_set_iter).second;     // Side ID, this has already been converted above
01014             this->elem_cmap_proc_ids[cnt][j] = (*it).first; // All have the same processor ID
01015           }
01016 
01017         cnt++;// increment vector index to go to next processor
01018       }
01019   } // end scope for packing
01020 }

void libMesh::Nemesis_IO_Helper::compute_element_maps (  )  [private]

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

Definition at line 950 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().

00951 {
00952   // Make sure we don't have any leftover info
00953   this->elem_mapi.clear();
00954   this->elem_mapb.clear();
00955 
00956   // Copy set contents into vectors
00957   this->elem_mapi.resize(this->internal_elem_ids.size());
00958   this->elem_mapb.resize(this->border_elem_ids.size());
00959 
00960   {
00961     unsigned cnt = 0;
00962     for (std::set<unsigned>::iterator it=this->internal_elem_ids.begin();
00963          it != this->internal_elem_ids.end();
00964          ++it, ++cnt)
00965       this->elem_mapi[cnt] = libmesh_elem_num_to_exodus[(*it)]; // + 1; // Exodus is 1-based!
00966   }
00967 
00968   {
00969     unsigned cnt = 0;
00970     for (std::set<unsigned>::iterator it=this->border_elem_ids.begin();
00971          it != this->border_elem_ids.end();
00972          ++it, ++cnt)
00973       this->elem_mapb[cnt] = libmesh_elem_num_to_exodus[(*it)]; // + 1; // Exodus is 1-based!
00974   }
00975 }

void libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes ( const MeshBase pmesh  )  [private]

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

Definition at line 1206 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, 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::processor_id(), libMesh::DofObject::processor_id(), and libMesh::Elem::type().

Referenced by initialize().

01207 {
01208   // Set of all local, active element IDs.  After we have identified border element
01209   // IDs, the set_difference between this set and the border_elem_ids set will give us
01210   // the set of internal_elem_ids.
01211   std::set<unsigned> all_elem_ids;
01212 
01213   // A set of processor IDs which elements on this processor have as
01214   // neighbors.  The size of this set will determine the number of
01215   // element communication maps in Exodus.
01216   std::set<unsigned> neighboring_processor_ids;
01217 
01218   // Will be used to create conversion objects capable of mapping libmesh
01219   // element numberings into Nemesis numberings.
01220   ExodusII_IO_Helper::ElementMaps element_mapper;
01221 
01222   MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
01223   MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();
01224 
01225   for (; elem_it != elem_end; ++elem_it)
01226     {
01227       const Elem* elem = *elem_it;
01228 
01229       // Add this Elem's ID to all_elem_ids, later we will take the difference
01230       // between this set and the set of border_elem_ids, to get the set of
01231       // internal_elem_ids.
01232       all_elem_ids.insert(elem->id());
01233 
01234       // Will be set to true if element is determined to be a border element
01235       bool is_border_elem = false;
01236 
01237       // Construct a conversion object for this Element.  This will help us map
01238       // Libmesh numberings into Nemesis numberings for sides.
01239       ExodusII_IO_Helper::Conversion conv = element_mapper.assign_conversion(elem->type());
01240 
01241       // Add all this element's node IDs to the set of all node IDs.
01242       // The set of internal_node_ids will be the set difference between
01243       // the set of all nodes and the set of border nodes.
01244       //
01245       // In addition, if any node of a local node is listed in the
01246       // border nodes list, then this element goes into the proc_border_elem_sets.
01247       // Note that there is not a 1:1 correspondence between
01248       // border_elem_ids and the entries which go into proc_border_elem_sets.
01249       // The latter is for communication purposes, ie determining which elements
01250       // should be shared between processors.
01251       for (unsigned int node=0; node<elem->n_nodes(); ++node)
01252         {
01253           this->nodes_attached_to_local_elems.insert(elem->node(node));
01254         } // end loop over element's nodes
01255 
01256       // Loop over element's neighbors, see if it has a neighbor which is off-processor
01257       for (unsigned int n=0; n<elem->n_neighbors(); ++n)
01258         {
01259           if (elem->neighbor(n) != NULL)
01260             {
01261               unsigned neighbor_proc_id = elem->neighbor(n)->processor_id();
01262 
01263               // If my neighbor has a different processor ID, I must be a border element.
01264               // Also track the neighboring processor ID if it is are different from our processor ID
01265               if (neighbor_proc_id != libMesh::processor_id())
01266                 {
01267                   is_border_elem = true;
01268                   neighboring_processor_ids.insert(neighbor_proc_id);
01269 
01270                   // Convert libmesh side(n) of this element into a side ID for Nemesis
01271                   unsigned nemesis_side_id = conv.get_inverse_side_map(n);
01272 
01273                   if (_verbose)
01274                     libMesh::out << "[" << libMesh::processor_id() << "] LibMesh side "
01275                                  << n
01276                                  << " mapped to (1-based) Exodus side "
01277                                  << nemesis_side_id
01278                                  << std::endl;
01279 
01280                   // Add this element's ID and the ID of the side which is on the boundary
01281                   // to the set of border elements for this processor.
01282                   // Note: if the set does not already exist, this creates it.
01283                   this->proc_border_elem_sets[ neighbor_proc_id ].insert( std::make_pair(elem->id(), nemesis_side_id) );
01284                 }
01285             }
01286         } // end for loop over neighbors
01287 
01288       // If we're on a border element, add it to the set
01289       if (is_border_elem)
01290         this->border_elem_ids.insert( elem->id() );
01291 
01292     } // end for loop over active local elements
01293 
01294   // Take the set_difference between all elements and border elements to get internal
01295   // element IDs
01296   std::set_difference(all_elem_ids.begin(), all_elem_ids.end(),
01297                       this->border_elem_ids.begin(), this->border_elem_ids.end(),
01298                       std::inserter(this->internal_elem_ids, this->internal_elem_ids.end()));
01299 
01300   // Take the set_difference between all nodes and border nodes to get internal nodes
01301   std::set_difference(this->nodes_attached_to_local_elems.begin(), this->nodes_attached_to_local_elems.end(),
01302                       this->border_node_ids.begin(), this->border_node_ids.end(),
01303                       std::inserter(this->internal_node_ids, this->internal_node_ids.end()));
01304 
01305   if (_verbose)
01306     {
01307       libMesh::out << "[" << libMesh::processor_id() << "] neighboring_processor_ids = ";
01308       for (std::set<unsigned>::iterator it = neighboring_processor_ids.begin();
01309            it != neighboring_processor_ids.end();
01310            ++it)
01311         {
01312           libMesh::out << *it << " ";
01313         }
01314       libMesh::out << std::endl;
01315     }
01316 
01317   // The size of the neighboring_processor_ids set should be the number of element communication maps
01318   this->num_elem_cmaps = neighboring_processor_ids.size();
01319 
01320   if (_verbose)
01321     libMesh::out << "[" << libMesh::processor_id() << "] "
01322                  << "Number of neighboring processor IDs="
01323                  << this->num_elem_cmaps
01324                  << std::endl;
01325 
01326   if (_verbose)
01327     {
01328       // Print out counts of border elements for each processor
01329       for (proc_border_elem_sets_iterator it=this->proc_border_elem_sets.begin();
01330            it != this->proc_border_elem_sets.end(); ++it)
01331         {
01332           libMesh::out << "[" << libMesh::processor_id() << "] "
01333                        << "Proc "
01334                        << (*it).first << " communicates "
01335                        << (*it).second.size() << " elements." << std::endl;
01336         }
01337     }
01338 
01339   // Store the number of internal and border elements, and the number of internal nodes,
01340   // to be written to the Nemesis file.
01341   this->num_internal_elems = this->internal_elem_ids.size();
01342   this->num_border_elems = this->border_elem_ids.size();
01343   this->num_internal_nodes = this->internal_node_ids.size();
01344 
01345   if (_verbose)
01346     {
01347       libMesh::out << "[" << libMesh::processor_id() << "] num_internal_nodes=" << this->num_internal_nodes << std::endl;
01348       libMesh::out << "[" << libMesh::processor_id() << "] num_border_nodes=" << this->num_border_nodes << std::endl;
01349       libMesh::out << "[" << libMesh::processor_id() << "] num_border_elems=" << this->num_border_elems << std::endl;
01350       libMesh::out << "[" << libMesh::processor_id() << "] num_internal_elems=" << this->num_internal_elems << std::endl;
01351     }
01352 }

void libMesh::Nemesis_IO_Helper::compute_node_communication_maps (  )  [private]

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

Definition at line 1063 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, 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, and libMesh::processor_id().

Referenced by initialize().

01064 {
01065   // Make sure there's no left-over information
01066   this->node_cmap_node_ids.clear();
01067   this->node_cmap_proc_ids.clear();
01068 
01069   // Allocate enough space for all our node maps
01070   this->node_cmap_node_ids.resize(this->num_node_cmaps);
01071   this->node_cmap_proc_ids.resize(this->num_node_cmaps);
01072   {
01073     unsigned cnt=0; // Index into vectors
01074     for (proc_nodes_touched_iterator it = this->proc_nodes_touched_intersections.begin();
01075          it != this->proc_nodes_touched_intersections.end();
01076          ++it)
01077       {
01078         // Make sure the current node_cmap_id matches the index in our map of node intersections
01079         libmesh_assert_equal_to ( static_cast<unsigned>(this->node_cmap_ids[cnt]), (*it).first );
01080 
01081         // Get reference to the set of IDs to be packed into the vector.
01082         std::set<unsigned>& node_set = (*it).second;
01083 
01084         //std::cout << "[" << libMesh::processor_id() << "] node_set.size()=" << node_set.size() << std::endl;
01085 
01086         // Resize the vectors to receive their payload
01087         this->node_cmap_node_ids[cnt].resize(node_set.size());
01088         this->node_cmap_proc_ids[cnt].resize(node_set.size());
01089 
01090         std::set<unsigned>::iterator node_set_iter = node_set.begin();
01091 
01092         // Pack the vectors with node IDs and processor IDs.
01093         for (unsigned j=0; j<this->node_cmap_node_ids[cnt].size(); ++j, ++node_set_iter)
01094           {
01095             this->node_cmap_node_ids[cnt][j] = this->libmesh_node_num_to_exodus[*node_set_iter];//(*node_set_iter) + 1; // Exodus is 1-based
01096             this->node_cmap_proc_ids[cnt][j] = (*it).first;
01097           }
01098 
01099         cnt++;// increment vector index to go to next processor
01100       }
01101   } // end scope for packing
01102 
01103   // if (_verbose)
01104   //   libMesh::out << "Done packing." << std::endl;
01105 
01106   // Print out the vectors we just packed
01107   if (_verbose)
01108     {
01109       for (unsigned i=0; i<this->node_cmap_node_ids.size(); ++i)
01110         {
01111           libMesh::out << "[" << libMesh::processor_id() << "] nodes communicated to proc "
01112                        << this->node_cmap_ids[i]
01113                        << " = ";
01114           for (unsigned j=0; j<this->node_cmap_node_ids[i].size(); ++j)
01115             libMesh::out << this->node_cmap_node_ids[i][j] << " ";
01116           libMesh::out << std::endl;
01117         }
01118 
01119       for (unsigned i=0; i<this->node_cmap_node_ids.size(); ++i)
01120         {
01121           libMesh::out << "[" << libMesh::processor_id() << "] processor ID node communicated to = ";
01122           for (unsigned j=0; j<this->node_cmap_proc_ids[i].size(); ++j)
01123             libMesh::out << this->node_cmap_proc_ids[i][j] << " ";
01124           libMesh::out << std::endl;
01125         }
01126     }
01127 }

void libMesh::Nemesis_IO_Helper::compute_node_maps (  )  [private]

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

Definition at line 1026 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().

01027 {
01028   // Make sure we don't have any leftover information
01029   this->node_mapi.clear();
01030   this->node_mapb.clear();
01031   this->node_mape.clear();
01032 
01033   // Make sure there's enough space to hold all our node IDs
01034   this->node_mapi.resize(this->internal_node_ids.size());
01035   this->node_mapb.resize(this->border_node_ids.size());
01036 
01037   // Copy set contents into vectors
01038   //
01039   // Can't use insert, since we are copying unsigned's into vector<int>...
01040   // this->node_mapi.insert(internal_node_ids.begin(), internal_node_ids.end());
01041   // this->node_mapb.insert(boundary_node_ids.begin(), boundary_node_ids.end());
01042   {
01043     unsigned cnt = 0;
01044     for (std::set<unsigned>::iterator it=this->internal_node_ids.begin();
01045          it != this->internal_node_ids.end();
01046          ++it, ++cnt)
01047       this->node_mapi[cnt] = this->libmesh_node_num_to_exodus[*it];// + 1; // Exodus is 1-based!
01048   }
01049 
01050   {
01051     unsigned cnt=0;
01052     for (std::set<unsigned>::iterator it=this->border_node_ids.begin();
01053          it != this->border_node_ids.end();
01054          ++it, ++cnt)
01055       this->node_mapb[cnt] = this->libmesh_node_num_to_exodus[*it];// + 1; // Exodus is 1-based!
01056   }
01057 }

void libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks ( const MeshBase pmesh  )  [private]

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

Definition at line 1569 of file nemesis_io_helper.C.

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

Referenced by initialize().

01570 {
01571   // 1.) Loop over active local elements, build up set of subdomain IDs.
01572   std::set<subdomain_id_type> global_subdomain_ids;
01573 
01574   // This map keeps track of the number of elements in each subdomain over all processors
01575   std::map<subdomain_id_type, unsigned> global_subdomain_counts;
01576 
01577   MeshBase::const_element_iterator elem_it = pmesh.active_local_elements_begin();
01578   MeshBase::const_element_iterator elem_end = pmesh.active_local_elements_end();
01579 
01580   for (; elem_it != elem_end; ++elem_it)
01581     {
01582       const Elem* elem = *elem_it;
01583 
01584       subdomain_id_type cur_subdomain = elem->subdomain_id();
01585 
01586 /*
01587       // We can't have a zero subdomain ID in Exodus (for some reason?)
01588       // so map zero subdomains to a max value...
01589       if (cur_subdomain == 0)
01590         cur_subdomain = std::numeric_limits<subdomain_id_type>::max();
01591 */
01592 
01593       global_subdomain_ids.insert(cur_subdomain);
01594 
01595       // Increment the count of elements in this subdomain
01596       global_subdomain_counts[cur_subdomain]++;
01597     }
01598 
01599   // We're next going to CommWorld.sum the subdomain counts, so save the local counts
01600   this->local_subdomain_counts = global_subdomain_counts;
01601 
01602   {
01603     // 2.) Copy local subdomain IDs into a vector for communication
01604     std::vector<subdomain_id_type> global_subdomain_ids_vector(global_subdomain_ids.begin(),
01605                                                                global_subdomain_ids.end());
01606 
01607     // 3.) Gather them into an enlarged vector
01608     CommWorld.allgather(global_subdomain_ids_vector);
01609 
01610     // 4.) Insert any new IDs into the set (any duplicates will be dropped)
01611     global_subdomain_ids.insert(global_subdomain_ids_vector.begin(),
01612                                 global_subdomain_ids_vector.end());
01613   }
01614 
01615   // 5.) Now global_subdomain_ids actually contains a global list of all subdomain IDs
01616   this->num_elem_blks_global = global_subdomain_ids.size();
01617 
01618   // Print the number of elements found locally in each subdomain
01619   if (_verbose)
01620     {
01621       libMesh::out << "[" << libMesh::processor_id() << "] ";
01622       for (std::map<subdomain_id_type, unsigned>::iterator it=global_subdomain_counts.begin();
01623            it != global_subdomain_counts.end();
01624            ++it)
01625         {
01626           libMesh::out << "ID: "
01627                        << static_cast<unsigned>((*it).first)
01628                        << ", Count: " << (*it).second << ", ";
01629         }
01630       libMesh::out << std::endl;
01631     }
01632 
01633   // 6.) CommWorld.sum up the number of elements in each block.  We know the global
01634   // subdomain IDs, so pack them into a vector one by one.  Use a vector of int since
01635   // that is what Nemesis wants
01636   this->global_elem_blk_cnts.resize(global_subdomain_ids.size());
01637 
01638   unsigned cnt=0;
01639   for (std::set<subdomain_id_type>::iterator it=global_subdomain_ids.begin();
01640        it != global_subdomain_ids.end(); ++it)
01641     {
01642       // Find the entry in the local map, note: if not found, will be created with 0 default value, which is OK...
01643       this->global_elem_blk_cnts[cnt++] = global_subdomain_counts[*it];
01644     }
01645 
01646   // Sum up subdomain counts from all processors
01647   CommWorld.sum(this->global_elem_blk_cnts);
01648 
01649   if (_verbose)
01650     {
01651       libMesh::out << "[" << libMesh::processor_id() << "] global_elem_blk_cnts = ";
01652       for (unsigned i=0; i<this->global_elem_blk_cnts.size(); ++i)
01653         libMesh::out << this->global_elem_blk_cnts[i] << ", ";
01654       libMesh::out << std::endl;
01655     }
01656 
01657   // 7.) Create a vector<int> from the global_subdomain_ids set, for passing to Nemesis
01658   this->global_elem_blk_ids.clear();
01659   this->global_elem_blk_ids.insert(this->global_elem_blk_ids.end(), // pos
01660                                    global_subdomain_ids.begin(),
01661                                    global_subdomain_ids.end());
01662 
01663   if (_verbose)
01664     {
01665       libMesh::out << "[" << libMesh::processor_id() << "] global_elem_blk_ids = ";
01666       for (unsigned i=0; i<this->global_elem_blk_ids.size(); ++i)
01667         libMesh::out << this->global_elem_blk_ids[i] << ", ";
01668       libMesh::out << std::endl;
01669     }
01670 
01671 
01672   // 8.) We will call put_eb_info_global later, it must be called after this->put_init_global().
01673 }

void libMesh::Nemesis_IO_Helper::compute_num_global_nodesets ( const MeshBase pmesh  )  [private]

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

Definition at line 1457 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::MeshBase::boundary_info, libMesh::CommWorld, global_nodeset_ids, libMesh::MeshBase::node_ptr(), num_global_node_counts, num_node_sets_global, libMesh::out, libMesh::DofObject::processor_id(), libMesh::processor_id(), libMesh::Parallel::Communicator::set_union(), libMesh::Parallel::Communicator::sum(), and swap().

Referenced by initialize().

01458 {
01459   std::set<boundary_id_type> local_node_boundary_ids;
01460 
01461   // 1.) Get reference to the set of node boundary IDs *for this processor*
01462   std::set<boundary_id_type> global_node_boundary_ids
01463     (pmesh.boundary_info->get_node_boundary_ids().begin(),
01464      pmesh.boundary_info->get_node_boundary_ids().end());
01465 
01466   // Save a copy of the local_node_boundary_ids...
01467   local_node_boundary_ids = global_node_boundary_ids;
01468 
01469   // 2.) Gather boundary node IDs from other processors
01470   CommWorld.set_union(global_node_boundary_ids);
01471 
01472   // 3.) Now global_node_boundary_ids actually contains a global list of all node boundary IDs
01473   this->num_node_sets_global = global_node_boundary_ids.size();
01474 
01475   // 4.) Create a vector<int> from the global_node_boundary_ids set
01476   this->global_nodeset_ids.clear();
01477   this->global_nodeset_ids.insert(this->global_nodeset_ids.end(),
01478                                   global_node_boundary_ids.begin(),
01479                                   global_node_boundary_ids.end());
01480 
01481   if (_verbose)
01482     {
01483       libMesh::out << "[" << libMesh::processor_id() << "] global_nodeset_ids = ";
01484       for (unsigned i=0; i<global_nodeset_ids.size(); ++i)
01485         libMesh::out << global_nodeset_ids[i] << ", ";
01486       libMesh::out << std::endl;
01487 
01488       libMesh::out << "[" << libMesh::processor_id() << "] local_node_boundary_ids = ";
01489       for (std::set<boundary_id_type>::iterator it = local_node_boundary_ids.begin();
01490            it != local_node_boundary_ids.end();
01491            ++it)
01492         libMesh::out << *it << ", ";
01493       libMesh::out << std::endl;
01494     }
01495 
01496   // 7.) We also need to know the number of nodes which is in each of the nodesets, globally.
01497   // There is probably a better way to do this...
01498   std::vector<dof_id_type> boundary_node_list;
01499   std::vector<boundary_id_type> boundary_node_boundary_id_list;
01500   pmesh.boundary_info->build_node_list(boundary_node_list, boundary_node_boundary_id_list);
01501 
01502   if (_verbose)
01503     {
01504       libMesh::out << "[" << libMesh::processor_id() << "] boundary_node_list.size()="
01505                    << boundary_node_list.size() << std::endl;
01506       libMesh::out << "[" << libMesh::processor_id() << "] (boundary_node_id, boundary_id) = ";
01507       for (unsigned i=0; i<boundary_node_list.size(); ++i)
01508         {
01509           libMesh::out << "(" << boundary_node_list[i] << ", " << boundary_node_boundary_id_list[i] << ") ";
01510         }
01511       libMesh::out << std::endl;
01512     }
01513 
01514   // Now get the global information.  In this case, we only want to count boundary
01515   // information for nodes *owned* by this processor, so there are no duplicates.
01516 
01517   // Make sure we don't have any left over information
01518   this->num_global_node_counts.clear();
01519   this->num_global_node_counts.resize(this->global_nodeset_ids.size());
01520 
01521   // Unfortunately, we can't just count up all occurrences of a given id,
01522   // that would give us duplicate entries when we do the parallel summation.
01523   // So instead, only count entries for nodes owned by this processor.
01524   // Start by getting rid of all non-local node entries from the vectors.
01525   std::vector<dof_id_type>::iterator it_node=boundary_node_list.begin();
01526   std::vector<boundary_id_type>::iterator it_id=boundary_node_boundary_id_list.begin();
01527   for ( ; it_node != boundary_node_list.end(); )
01528     {
01529       if (pmesh.node_ptr( *it_node )->processor_id() != libMesh::processor_id())
01530         {
01531           // Get rid of this node, but do it efficiently for a vector, by popping
01532           // it off the back.
01533           std::swap (*it_node, boundary_node_list.back() );
01534           std::swap (*it_id, boundary_node_boundary_id_list.back() );
01535 
01536           boundary_node_list.pop_back();
01537           boundary_node_boundary_id_list.pop_back();
01538         }
01539       else // node is local, go to next
01540         {
01541           ++it_node;
01542           ++it_id;
01543         }
01544     }
01545 
01546   // Now we can do the local count for each ID...
01547   for (unsigned i=0; i<global_nodeset_ids.size(); ++i)
01548     {
01549       this->num_global_node_counts[i] = std::count(boundary_node_boundary_id_list.begin(),
01550                                                    boundary_node_boundary_id_list.end(),
01551                                                    this->global_nodeset_ids[i]);
01552     }
01553 
01554   // And finally we can sum them up
01555   CommWorld.sum(this->num_global_node_counts);
01556 
01557   if (_verbose)
01558     {
01559       libMesh::out << "[" << libMesh::processor_id() << "] num_global_node_counts = ";
01560       for (unsigned i=0; i<num_global_node_counts.size(); ++i)
01561         libMesh::out << num_global_node_counts[i] << ", ";
01562       libMesh::out << std::endl;
01563     }
01564 }

void libMesh::Nemesis_IO_Helper::compute_num_global_sidesets ( const MeshBase pmesh  )  [private]

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

Definition at line 1356 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::MeshBase::boundary_info, libMesh::CommWorld, libMesh::MeshBase::elem(), global_sideset_ids, num_global_side_counts, num_side_sets_global, libMesh::out, libMesh::DofObject::processor_id(), libMesh::processor_id(), libMesh::Parallel::Communicator::set_union(), libMesh::Parallel::Communicator::sum(), and swap().

Referenced by initialize().

01357 {
01358   std::set<boundary_id_type> local_side_boundary_ids;
01359 
01360   // 1.) Get reference to the set of side boundary IDs
01361   std::set<boundary_id_type> global_side_boundary_ids
01362     (pmesh.boundary_info->get_side_boundary_ids().begin(),
01363      pmesh.boundary_info->get_side_boundary_ids().end());
01364 
01365   // Save this set of local boundary side IDs for later
01366   local_side_boundary_ids = global_side_boundary_ids;
01367 
01368   // 2.) Gather boundary side IDs from other processors
01369   CommWorld.set_union(global_side_boundary_ids);
01370 
01371   // 3.) Now global_side_boundary_ids actually contains a global list of all side boundary IDs
01372   this->num_side_sets_global = global_side_boundary_ids.size();
01373 
01374   // 4.) Pack these sidesets into a vector so they can be written by Nemesis
01375   this->global_sideset_ids.clear(); // Make sure there is no leftover information
01376   this->global_sideset_ids.insert(this->global_sideset_ids.end(),
01377                                   global_side_boundary_ids.begin(),
01378                                   global_side_boundary_ids.end());
01379 
01380   if (_verbose)
01381     {
01382       libMesh::out << "[" << libMesh::processor_id() << "] global_sideset_ids = ";
01383       for (unsigned i=0; i<this->global_sideset_ids.size(); ++i)
01384         libMesh::out << this->global_sideset_ids[i] << ", ";
01385       libMesh::out << std::endl;
01386     }
01387 
01388   // We also need global counts of sides in each of the sidesets.  Again, there may be a
01389   // better way to do this...
01390   std::vector<dof_id_type> bndry_elem_list;
01391   std::vector<unsigned short int> bndry_side_list;
01392   std::vector<boundary_id_type> bndry_id_list;
01393   pmesh.boundary_info->build_side_list(bndry_elem_list, bndry_side_list, bndry_id_list);
01394 
01395   // Similarly to the nodes, we can't count any sides for elements which aren't local
01396   std::vector<dof_id_type>::iterator it_elem=bndry_elem_list.begin();
01397   std::vector<unsigned short>::iterator it_side=bndry_side_list.begin();
01398   std::vector<boundary_id_type>::iterator it_id=bndry_id_list.begin();
01399   for ( ; it_elem != bndry_elem_list.end(); )
01400     {
01401       if (pmesh.elem( *it_elem )->processor_id() != libMesh::processor_id())
01402         {
01403           // Get rid of this elem, but do it efficiently for a vector, by popping
01404           // it off the back.
01405           std::swap (*it_elem, bndry_elem_list.back() );
01406           std::swap (*it_side, bndry_side_list.back() );
01407           std::swap (*it_id, bndry_id_list.back() );
01408 
01409           bndry_elem_list.pop_back();
01410           bndry_side_list.pop_back();
01411           bndry_id_list.pop_back();
01412         }
01413       else // elem is local, go to next
01414         {
01415           ++it_elem;
01416           ++it_side;
01417           ++it_id;
01418         }
01419     }
01420 
01421   this->num_global_side_counts.clear(); // Make sure we don't have any leftover information
01422   this->num_global_side_counts.resize(this->global_sideset_ids.size());
01423 
01424   // Get the count for each global sideset ID
01425   for (unsigned i=0; i<global_sideset_ids.size(); ++i)
01426     {
01427       this->num_global_side_counts[i] = std::count(bndry_id_list.begin(),
01428                                                    bndry_id_list.end(),
01429                                                    this->global_sideset_ids[i]);
01430     }
01431 
01432   if (_verbose)
01433     {
01434       libMesh::out << "[" << libMesh::processor_id() << "] num_global_side_counts = ";
01435       for (unsigned i=0; i<this->num_global_side_counts.size(); ++i)
01436         libMesh::out << this->num_global_side_counts[i] << ", ";
01437       libMesh::out << std::endl;
01438     }
01439 
01440   // Finally sum up the result
01441   CommWorld.sum(this->num_global_side_counts);
01442 
01443   if (_verbose)
01444     {
01445       libMesh::out << "[" << libMesh::processor_id() << "] num_global_side_counts = ";
01446       for (unsigned i=0; i<this->num_global_side_counts.size(); ++i)
01447         libMesh::out << this->num_global_side_counts[i] << ", ";
01448       libMesh::out << std::endl;
01449     }
01450 }

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 2408 of file nemesis_io_helper.C.

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

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

02409 {
02410   // Build a filename for this processor.  This code is cut-n-pasted from the read function
02411   // and should probably be put into a separate function...
02412   std::ostringstream file_oss;
02413 
02414   // We have to be a little careful here: Nemesis left pads its file
02415   // numbers based on the number of processors, so for example on 10
02416   // processors, we'd have:
02417   // mesh.e.10.00
02418   // mesh.e.10.01
02419   // mesh.e.10.02
02420   // ...
02421   // mesh.e.10.09
02422 
02423   // And on 100 you'd have:
02424   // mesh.e.100.000
02425   // mesh.e.100.001
02426   // ...
02427   // mesh.e.128.099
02428 
02429   // Find the length of the highest processor ID
02430   file_oss << (libMesh::n_processors());
02431   unsigned field_width = file_oss.str().size();
02432 
02433   if (_verbose)
02434     libMesh::out << "field_width=" << field_width << std::endl;
02435 
02436   file_oss.str(""); // reset the string stream
02437   file_oss << base_filename
02438            << '.' << libMesh::n_processors()
02439            << '.' << std::setfill('0') << std::setw(field_width) << libMesh::processor_id();
02440 
02441   // Return the resulting string
02442   return file_oss.str();
02443 }

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 718 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_created, libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::comp_ws, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::io_ws, std::min(), libMesh::out, and libMesh::Real.

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

00719 {
00720   // Fall back on double precision when necessary since ExodusII
00721   // doesn't seem to support long double
00722   comp_ws = libmesh_cast_int<int>
00723     (std::min(sizeof(Real),sizeof(double)));
00724   io_ws = libmesh_cast_int<int>
00725     (std::min(sizeof(Real),sizeof(double)));
00726 
00727   this->ex_id = exII::ex_create(filename.c_str(), EX_CLOBBER, &comp_ws, &io_ws);
00728 
00729   check_err(ex_id, "Error creating Nemesis mesh file.");
00730 
00731   if (_verbose)
00732     libMesh::out << "File created successfully." << std::endl;
00733 
00734   this->_created = true;
00735 }

bool libMesh::ExodusII_IO_Helper::created (  )  [inherited]
int libMesh::ExodusII_IO_Helper::get_block_id ( int  index  )  [inherited]

Get the block number for the given block index.

Definition at line 379 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().

00380 {
00381   libmesh_assert_less (static_cast<unsigned int>(index), block_ids.size());
00382 
00383   return block_ids[index];
00384 }

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

00389 {
00390   libmesh_assert_less (static_cast<unsigned int>(index), block_ids.size());
00391 
00392   return id_to_block_names[block_ids[index]];
00393 }

void libMesh::Nemesis_IO_Helper::get_cmap_params (  ) 

Definition at line 326 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00327 {
00328   node_cmap_ids.resize(num_node_cmaps);
00329   node_cmap_node_cnts.resize(num_node_cmaps);
00330   elem_cmap_ids.resize(num_elem_cmaps);
00331   elem_cmap_elem_cnts.resize(num_elem_cmaps);
00332 
00333   nemesis_err_flag =
00334     Nemesis::ne_get_cmap_params(ex_id,
00335                                 node_cmap_ids.empty()       ? NULL : &node_cmap_ids[0],
00336                                 node_cmap_node_cnts.empty() ? NULL : &node_cmap_node_cnts[0],
00337                                 elem_cmap_ids.empty()       ? NULL : &elem_cmap_ids[0],
00338                                 elem_cmap_elem_cnts.empty() ? NULL : &elem_cmap_elem_cnts[0],
00339                                 libMesh::processor_id());
00340   this->check_err(nemesis_err_flag, "Error reading cmap parameters!");
00341 
00342 
00343   if (_verbose)
00344     {
00345       libMesh::out << "[" << libMesh::processor_id() << "] ";
00346       for (unsigned int i=0; i<node_cmap_ids.size(); ++i)
00347         libMesh::out << "node_cmap_ids["<<i<<"]=" << node_cmap_ids[i] << " ";
00348       libMesh::out << std::endl;
00349 
00350       libMesh::out << "[" << libMesh::processor_id() << "] ";
00351       for (unsigned int i=0; i<node_cmap_node_cnts.size(); ++i)
00352         libMesh::out << "node_cmap_node_cnts["<<i<<"]=" << node_cmap_node_cnts[i] << " ";
00353       libMesh::out << std::endl;
00354 
00355       libMesh::out << "[" << libMesh::processor_id() << "] ";
00356       for (unsigned int i=0; i<elem_cmap_ids.size(); ++i)
00357         libMesh::out << "elem_cmap_ids["<<i<<"]=" << elem_cmap_ids[i] << " ";
00358       libMesh::out << std::endl;
00359 
00360       libMesh::out << "[" << libMesh::processor_id() << "] ";
00361       for (unsigned int i=0; i<elem_cmap_elem_cnts.size(); ++i)
00362         libMesh::out << "elem_cmap_elem_cnts["<<i<<"]=" << elem_cmap_elem_cnts[i] << " ";
00363       libMesh::out << std::endl;
00364     }
00365 }

int libMesh::ExodusII_IO_Helper::get_connect ( int  i  )  const [inline, inherited]
Returns:
the number of elements in all the sidesets. Effectively returns the total number of elements on the ExodusII mesh boundary.
the $ i^{th} $ node number in the element connectivity list for a given element.

Definition at line 191 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::connect.

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

00191 { return connect[i]; }

void libMesh::Nemesis_IO_Helper::get_eb_info_global (  ) 

Definition at line 178 of file nemesis_io_helper.C.

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

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

00179 {
00180   global_elem_blk_ids.resize(num_elem_blks_global);
00181   global_elem_blk_cnts.resize(num_elem_blks_global);
00182 
00183   nemesis_err_flag =
00184     Nemesis::ne_get_eb_info_global(ex_id,
00185                                    global_elem_blk_ids.empty()  ? NULL : &global_elem_blk_ids[0],
00186                                    global_elem_blk_cnts.empty() ? NULL : &global_elem_blk_cnts[0]);
00187   this->check_err(nemesis_err_flag, "Error reading global element block info!");
00188 
00189   if (_verbose)
00190     {
00191       libMesh::out << "[" << libMesh::processor_id() << "] " << "Global Element Block IDs and Counts:" << std::endl;
00192       for (unsigned int bn=0; bn<global_elem_blk_ids.size(); ++bn)
00193         {
00194           libMesh::out << "  [" << libMesh::processor_id() << "] "
00195                         << "global_elem_blk_ids["<<bn<<"]=" << global_elem_blk_ids[bn]
00196                         << ", global_elem_blk_cnts["<<bn<<"]=" << global_elem_blk_cnts[bn]
00197                         << std::endl;
00198         }
00199     }
00200 }

void libMesh::Nemesis_IO_Helper::get_elem_cmap (  ) 

Definition at line 406 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00407 {
00408   elem_cmap_elem_ids.resize(num_elem_cmaps);
00409   elem_cmap_side_ids.resize(num_elem_cmaps);
00410   elem_cmap_proc_ids.resize(num_elem_cmaps);
00411 
00412   for (unsigned int i=0; i<elem_cmap_elem_ids.size(); ++i)
00413     {
00414       elem_cmap_elem_ids[i].resize(elem_cmap_elem_cnts[i]);
00415       elem_cmap_side_ids[i].resize(elem_cmap_elem_cnts[i]);
00416       elem_cmap_proc_ids[i].resize(elem_cmap_elem_cnts[i]);
00417 
00418       nemesis_err_flag =
00419         Nemesis::ne_get_elem_cmap(ex_id,
00420                                   elem_cmap_ids.empty()         ? 0    : elem_cmap_ids[i],
00421                                   elem_cmap_elem_ids[i].empty() ? NULL : &elem_cmap_elem_ids[i][0],
00422                                   elem_cmap_side_ids[i].empty() ? NULL : &elem_cmap_side_ids[i][0],
00423                                   elem_cmap_proc_ids[i].empty() ? NULL : &elem_cmap_proc_ids[i][0],
00424                                   libMesh::processor_id());
00425       this->check_err(nemesis_err_flag, "Error reading elem cmap elem, side, and processor ids!");
00426 
00427 
00428       if (_verbose)
00429         {
00430           libMesh::out << "[" << libMesh::processor_id() << "] elem_cmap_elem_ids["<<i<<"]=";
00431           for (unsigned int j=0; j<elem_cmap_elem_ids[i].size(); ++j)
00432             libMesh::out << elem_cmap_elem_ids[i][j] << " ";
00433           libMesh::out << std::endl;
00434 
00435           // These must be the (local) side IDs (in the ExodusII face numbering scheme)
00436           // of the sides shared across processors.
00437           libMesh::out << "[" << libMesh::processor_id() << "] elem_cmap_side_ids["<<i<<"]=";
00438           for (unsigned int j=0; j<elem_cmap_side_ids[i].size(); ++j)
00439             libMesh::out << elem_cmap_side_ids[i][j] << " ";
00440           libMesh::out << std::endl;
00441 
00442           // This is basically a vector, all entries of which are = elem_cmap_ids[i]
00443           // Not sure if it's always guaranteed to be that or what...
00444           libMesh::out << "[" << libMesh::processor_id() << "] elem_cmap_proc_ids["<<i<<"]=";
00445           for (unsigned int j=0; j<elem_cmap_proc_ids[i].size(); ++j)
00446             libMesh::out << elem_cmap_proc_ids[i][j] << " ";
00447           libMesh::out << std::endl;
00448         }
00449     }
00450 }

const std::vector<int>& libMesh::ExodusII_IO_Helper::get_elem_list (  )  const [inline, inherited]
Returns:
the $ i^{th} $ entry in the element list. The element list contains the numbers of all elements on the boundary.
a constant reference to the elem_list.

Definition at line 219 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::elem_list.

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

00219 { return elem_list; }

void libMesh::Nemesis_IO_Helper::get_elem_map (  ) 

Definition at line 253 of file nemesis_io_helper.C.

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

00254 {
00255   elem_mapi.resize(num_internal_elems);
00256   elem_mapb.resize(num_border_elems);
00257 
00258   nemesis_err_flag =
00259     Nemesis::ne_get_elem_map(ex_id,
00260                              elem_mapi.empty() ? NULL : &elem_mapi[0],
00261                              elem_mapb.empty() ? NULL : &elem_mapb[0],
00262                              libMesh::processor_id()
00263                              );
00264   this->check_err(nemesis_err_flag, "Error reading element maps!");
00265 
00266 
00267   if (_verbose)
00268     {
00269       // These are not contiguous ranges....
00270       //libMesh::out << "[" << libMesh::processor_id() << "] " << "first interior elem id=" << elem_mapi[0] << std::endl;
00271       //libMesh::out << "[" << libMesh::processor_id() << "] " << "last interior elem id=" << elem_mapi.back() << std::endl;
00272       //libMesh::out << "[" << libMesh::processor_id() << "] " << "first boundary elem id=" << elem_mapb[0] << std::endl;
00273       //libMesh::out << "[" << libMesh::processor_id() << "] " << "last boundary elem id=" << elem_mapb.back() << std::endl;
00274       libMesh::out << "[" << libMesh::processor_id() << "] elem_mapi[i] = ";
00275       for (unsigned int i=0; i< static_cast<unsigned int>(num_internal_elems-1); ++i)
00276         libMesh::out << elem_mapi[i] << ", ";
00277       libMesh::out << "... " << elem_mapi.back() << std::endl;
00278 
00279       libMesh::out << "[" << libMesh::processor_id() << "] elem_mapb[i] = ";
00280       for (unsigned int i=0; i< static_cast<unsigned int>(std::min(10, num_border_elems-1)); ++i)
00281         libMesh::out << elem_mapb[i] << ", ";
00282       libMesh::out << "... " << elem_mapb.back() << std::endl;
00283     }
00284 }

const char* libMesh::ExodusII_IO_Helper::get_elem_type (  )  const [inline, 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 266 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::elem_type.

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

00266 { return &elem_type[0]; }

const std::vector<int>& libMesh::ExodusII_IO_Helper::get_id_list (  )  const [inline, inherited]
Returns:
the $ i^{th} $ entry in the id list. This is the id for the ith face on the boundary.
a constant reference to the id_list.

Definition at line 256 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::id_list.

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

00256 { return id_list; }

void libMesh::Nemesis_IO_Helper::get_init_global (  ) 

Set the flag indicationg if we should be verbose. 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 87 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00088 {
00089   nemesis_err_flag =
00090     Nemesis::ne_get_init_global(ex_id,
00091                                 &num_nodes_global,
00092                                 &num_elems_global,
00093                                 &num_elem_blks_global,
00094                                 &num_node_sets_global,
00095                                 &num_side_sets_global);
00096   this->check_err(nemesis_err_flag, "Error reading initial global data!");
00097 
00098   if (_verbose)
00099     {
00100       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_nodes_global=" << num_nodes_global << std::endl;
00101       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_elems_global=" << num_elems_global << std::endl;
00102       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_elem_blks_global=" << num_elem_blks_global << std::endl;
00103       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_node_sets_global=" << num_node_sets_global << std::endl;
00104       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_side_sets_global=" << num_side_sets_global << std::endl;
00105     }
00106 }

void libMesh::Nemesis_IO_Helper::get_init_info (  ) 

Definition at line 204 of file nemesis_io_helper.C.

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

00205 {
00206   nemesis_err_flag =
00207     Nemesis::ne_get_init_info(ex_id,
00208                               &num_proc,
00209                               &num_proc_in_file,
00210                               &ftype);
00211   this->check_err(nemesis_err_flag, "Error reading initial info!");
00212 
00213   if (_verbose)
00214     {
00215       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_proc=" << num_proc << std::endl;
00216       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_proc_in_file=" << num_proc_in_file << std::endl;
00217       libMesh::out << "[" << libMesh::processor_id() << "] " << "ftype=" << ftype << std::endl;
00218     }
00219 }

void libMesh::Nemesis_IO_Helper::get_loadbal_param (  ) 

Definition at line 223 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00224 {
00225   nemesis_err_flag =
00226     Nemesis::ne_get_loadbal_param(ex_id,
00227                                   &num_internal_nodes,
00228                                   &num_border_nodes,
00229                                   &num_external_nodes,
00230                                   &num_internal_elems,
00231                                   &num_border_elems,
00232                                   &num_node_cmaps,
00233                                   &num_elem_cmaps,
00234                                   libMesh::processor_id() // The ID of the processor for which info is to be read
00235                                   );
00236   this->check_err(nemesis_err_flag, "Error reading load balance parameters!");
00237 
00238 
00239   if (_verbose)
00240     {
00241       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_internal_nodes=" << num_internal_nodes << std::endl;
00242       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_border_nodes=" << num_border_nodes << std::endl;
00243       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_external_nodes=" << num_external_nodes << std::endl;
00244       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_internal_elems=" << num_internal_elems << std::endl;
00245       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_border_elems=" << num_border_elems << std::endl;
00246       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_node_cmaps=" << num_node_cmaps << std::endl;
00247       libMesh::out << "[" << libMesh::processor_id() << "] " << "num_elem_cmaps=" << num_elem_cmaps << std::endl;
00248     }
00249 }

const std::vector< std::string > & libMesh::ExodusII_IO_Helper::get_nodal_var_names (  )  [inherited]

Definition at line 688 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, ex_get_var_names(), libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::nodal_var_names, libMesh::ExodusII_IO_Helper::num_nodal_vars, libMesh::out, libMesh::ExodusII_IO_Helper::strings, and libMesh::ExodusII_IO_Helper::vvc.

Referenced by libMesh::ExodusII_IO_Helper::get_nodal_var_values().

00689 {
00690   // Allocate enough space for our variable name strings.
00691   nodal_var_names.resize(num_nodal_vars);
00692 
00693   // Use the vvc and strings objects to emulate the behavior of
00694   // a char** object.
00695   vvc.resize(num_nodal_vars);
00696   strings.resize(num_nodal_vars);
00697   for (int i=0;i<num_nodal_vars;i++)
00698     vvc[i].resize(MAX_STR_LENGTH+1);
00699 
00700   for (int i=0;i<num_nodal_vars;i++)
00701     strings[i]=&(vvc[i][0]); // set pointer into vvc only *after* all resizing is complete
00702 
00703   exII::ex_get_var_names(ex_id,
00704                          "n",
00705                          num_nodal_vars,
00706                          &strings[0]//var_names
00707                          );
00708 
00709   if (_verbose)
00710     {
00711       libMesh::out << "Read the variable(s) from the file:" << std::endl;
00712       for (int i=0; i<num_nodal_vars; i++)
00713         libMesh::out << "strings[" << i << "]=" << strings[i] << std::endl;
00714     }
00715 
00716 
00717   // Copy the char buffers into strings.
00718   for (int i=0;i<num_nodal_vars;i++)
00719     nodal_var_names[i]=strings[i]; // calls string::op=(const char*)
00720 
00721 
00722   return nodal_var_names;
00723 }

const std::vector< Real > & libMesh::ExodusII_IO_Helper::get_nodal_var_values ( std::string  nodal_var_name,
int  time_step 
) [inherited]

Definition at line 728 of file exodusII_io_helper.C.

References libMesh::err, ex_get_nodal_var(), libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::get_nodal_var_names(), libMesh::ExodusII_IO_Helper::nodal_var_names, libMesh::ExodusII_IO_Helper::nodal_var_values, and libMesh::ExodusII_IO_Helper::num_nodes.

00729 {
00730   nodal_var_values.resize(num_nodes);
00731 
00732   this->get_nodal_var_names();
00733 
00734   // See if we can find the variable we are looking for
00735   unsigned int var_index = 0;
00736   bool found = false;
00737 
00738   // Do a linear search for nodal_var_name in nodal_var_names
00739   for (; var_index<nodal_var_names.size(); ++var_index)
00740     {
00741       found = (nodal_var_names[var_index] == nodal_var_name);
00742       if (found)
00743         break;
00744     }
00745 
00746   if (!found)
00747     {
00748       libMesh::err << "Unable to locate variable named: " << nodal_var_name << std::endl;
00749       libMesh::err << "Available variables: " << std::endl;
00750       for (unsigned int i=0; i<nodal_var_names.size(); ++i)
00751         libMesh::err << nodal_var_names[i] << std::endl;
00752 
00753       libmesh_error();
00754     }
00755 
00756   exII::ex_get_nodal_var(ex_id, time_step, var_index+1, num_nodes, &nodal_var_values[0]);
00757 
00758   return nodal_var_values;
00759 }

void libMesh::Nemesis_IO_Helper::get_node_cmap (  ) 

Definition at line 369 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00370 {
00371   node_cmap_node_ids.resize(num_node_cmaps);
00372   node_cmap_proc_ids.resize(num_node_cmaps);
00373 
00374   for (unsigned int i=0; i<node_cmap_node_ids.size(); ++i)
00375     {
00376       node_cmap_node_ids[i].resize(node_cmap_node_cnts[i]);
00377       node_cmap_proc_ids[i].resize(node_cmap_node_cnts[i]);
00378 
00379       nemesis_err_flag =
00380         Nemesis::ne_get_node_cmap(ex_id,
00381                                   node_cmap_ids.empty()         ? 0    : node_cmap_ids[i],
00382                                   node_cmap_node_ids[i].empty() ? NULL : &node_cmap_node_ids[i][0],
00383                                   node_cmap_proc_ids[i].empty() ? NULL : &node_cmap_proc_ids[i][0],
00384                                   libMesh::processor_id());
00385       this->check_err(nemesis_err_flag, "Error reading node cmap node and processor ids!");
00386 
00387       if (_verbose)
00388         {
00389           libMesh::out << "[" << libMesh::processor_id() << "] node_cmap_node_ids["<<i<<"]=";
00390           for (unsigned int j=0; j<node_cmap_node_ids[i].size(); ++j)
00391             libMesh::out << node_cmap_node_ids[i][j] << " ";
00392           libMesh::out << std::endl;
00393 
00394           // This is basically a vector, all entries of which are = node_cmap_ids[i]
00395           // Not sure if it's always guaranteed to be that or what...
00396           libMesh::out << "[" << libMesh::processor_id() << "] node_cmap_proc_ids["<<i<<"]=";
00397           for (unsigned int j=0; j<node_cmap_proc_ids[i].size(); ++j)
00398             libMesh::out << node_cmap_proc_ids[i][j] << " ";
00399           libMesh::out << std::endl;
00400         }
00401     }
00402 }

const std::vector<int>& libMesh::ExodusII_IO_Helper::get_node_list (  )  const [inline, inherited]
Returns:
a constant reference to the node_list.

Definition at line 239 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::node_list.

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

00239 { return node_list; }

void libMesh::Nemesis_IO_Helper::get_node_map (  ) 

Definition at line 289 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00290 {
00291   node_mapi.resize(num_internal_nodes);
00292   node_mapb.resize(num_border_nodes);
00293   node_mape.resize(num_external_nodes);
00294 
00295   nemesis_err_flag =
00296     Nemesis::ne_get_node_map(ex_id,
00297                              node_mapi.empty() ? NULL : &node_mapi[0],
00298                              node_mapb.empty() ? NULL : &node_mapb[0],
00299                              node_mape.empty() ? NULL : &node_mape[0],
00300                              libMesh::processor_id()
00301                              );
00302   this->check_err(nemesis_err_flag, "Error reading node maps!");
00303 
00304   if (_verbose)
00305     {
00306       // Remark: The Exodus/Nemesis node numbring is always (?) 1-based!  This means the first interior node id will
00307       // always be == 1.
00308       libMesh::out << "[" << libMesh::processor_id() << "] " << "first interior node id=" << node_mapi[0] << std::endl;
00309       libMesh::out << "[" << libMesh::processor_id() << "] " << "last interior node id=" << node_mapi.back() << std::endl;
00310 
00311       libMesh::out << "[" << libMesh::processor_id() << "] " << "first boundary node id=" << node_mapb[0] << std::endl;
00312       libMesh::out << "[" << libMesh::processor_id() << "] " << "last boundary node id=" << node_mapb.back() << std::endl;
00313 
00314       // The number of external nodes is sometimes zero, don't try to access
00315       // node_mape.back() in this case!
00316       if (num_external_nodes > 0)
00317         {
00318           libMesh::out << "[" << libMesh::processor_id() << "] " << "first external node id=" << node_mape[0] << std::endl;
00319           libMesh::out << "[" << libMesh::processor_id() << "] " << "last external node id=" << node_mape.back() << std::endl;
00320         }
00321     }
00322 }

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 415 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::nodeset_ids.

00416 {
00417   libmesh_assert_less (static_cast<unsigned int>(index), nodeset_ids.size());
00418 
00419   return nodeset_ids[index];
00420 }

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

00425 {
00426   libmesh_assert_less (static_cast<unsigned int>(index), nodeset_ids.size());
00427 
00428   return id_to_ns_names[nodeset_ids[index]];
00429 }

int libMesh::ExodusII_IO_Helper::get_nodeset_id ( unsigned int  i  )  const [inline, inherited]
Returns:
the nodeset id corresponding to the ith nodeset.

Definition at line 244 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::nodeset_ids.

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

00244 { return nodeset_ids[i]; }

void libMesh::Nemesis_IO_Helper::get_ns_param_global (  ) 

Definition at line 146 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00147 {
00148   if (num_node_sets_global > 0)
00149     {
00150       global_nodeset_ids.resize(num_node_sets_global);
00151       num_global_node_counts.resize(num_node_sets_global);
00152       num_global_node_df_counts.resize(num_node_sets_global);
00153 
00154       nemesis_err_flag =
00155         Nemesis::ne_get_ns_param_global(ex_id,
00156                                         global_nodeset_ids.empty()        ? NULL : &global_nodeset_ids[0],
00157                                         num_global_node_counts.empty()    ? NULL : &num_global_node_counts[0],
00158                                         num_global_node_df_counts.empty() ? NULL : &num_global_node_df_counts[0]);
00159       this->check_err(nemesis_err_flag, "Error reading global nodeset parameters!");
00160 
00161       if (_verbose)
00162         {
00163           libMesh::out << "[" << libMesh::processor_id() << "] " << "Global Nodeset IDs, Node Counts, and DF counts:" << std::endl;
00164           for (unsigned int bn=0; bn<global_nodeset_ids.size(); ++bn)
00165             {
00166               libMesh::out << "  [" << libMesh::processor_id() << "] "
00167                             << "global_nodeset_ids["<<bn<<"]=" << global_nodeset_ids[bn]
00168                             << ", num_global_node_counts["<<bn<<"]=" << num_global_node_counts[bn]
00169                             << ", num_global_node_df_counts["<<bn<<"]=" << num_global_node_df_counts[bn]
00170                             << std::endl;
00171             }
00172         }
00173     }
00174 }

int libMesh::ExodusII_IO_Helper::get_num_dim (  )  const [inline, inherited]
Returns:
the ExodusII mesh dimension.

Definition at line 118 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_dim.

00118 { return num_dim; }

int libMesh::ExodusII_IO_Helper::get_num_elem (  )  const [inline, inherited]
Returns:
the total number of elements in the ExodusII mesh.

Definition at line 137 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_elem.

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

00137 { return num_elem; }

int libMesh::ExodusII_IO_Helper::get_num_elem_blk (  )  const [inline, inherited]
Returns:
the total number of element blocks in the ExodusII mesh.

Definition at line 144 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_elem_blk.

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

00144 { return num_elem_blk; }

int libMesh::ExodusII_IO_Helper::get_num_elem_this_blk (  )  const [inline, inherited]

For a given block, returns the total number of elements.

Definition at line 151 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_elem_this_blk.

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

00151 { return num_elem_this_blk; }

int libMesh::ExodusII_IO_Helper::get_num_globals (  )  const [inline, inherited]
Returns:
the total number of global variables.

Definition at line 124 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_globals.

00124 { return num_globals; }

int libMesh::ExodusII_IO_Helper::get_num_nodal_vars (  )  [inline, inherited]

Definition at line 454 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_nodal_vars.

00454 { return num_nodal_vars; }

int libMesh::ExodusII_IO_Helper::get_num_node_sets (  )  const [inline, inherited]
Returns:
the total number of nodesets in the ExodusII mesh.

Definition at line 174 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_node_sets.

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

00174 { return num_node_sets; }

int libMesh::ExodusII_IO_Helper::get_num_nodes (  )  const [inline, inherited]
Returns:
the total number of nodes in the ExodusII mesh.

Definition at line 130 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_nodes.

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

00130 { return num_nodes; }

int libMesh::ExodusII_IO_Helper::get_num_nodes_per_elem (  )  const [inline, inherited]
Returns:
the number of nodes per element in a given block. e.g. for HEX27 it returns 27.

Definition at line 159 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_nodes_per_elem.

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

00159 { return num_nodes_per_elem; }

int libMesh::ExodusII_IO_Helper::get_num_nodes_per_set ( int  i  )  const [inline, inherited]

For a single nodeset, returns the total number of nodes in the nodeset.

Definition at line 205 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_nodes_per_set.

00205 { return num_nodes_per_set[i]; }

int libMesh::ExodusII_IO_Helper::get_num_side_sets (  )  const [inline, inherited]
Returns:
the total number of sidesets in the ExodusII mesh. Each sideset contains only one type of element.

Definition at line 167 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_side_sets.

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

00167 { return num_side_sets; }

int libMesh::ExodusII_IO_Helper::get_num_sides_per_set ( int  i  )  const [inline, inherited]

For a single sideset, returns the total number of elements in the sideset.

Definition at line 198 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::num_sides_per_set.

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

00198 { return num_sides_per_set[i]; }

const std::vector<int>& libMesh::ExodusII_IO_Helper::get_side_list (  )  const [inline, inherited]
Returns:
the $ i^{th} $ entry in the side list. This is effectively the "side" (face in 3D or edge in 2D) number which lies on the boundary.
a constant reference to the side_list.

Definition at line 234 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::side_list.

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

00234 { return side_list; }

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 397 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::ss_ids.

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

00398 {
00399   libmesh_assert_less (static_cast<unsigned int>(index), ss_ids.size());
00400 
00401   return ss_ids[index];
00402 }

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

00407 {
00408   libmesh_assert_less (static_cast<unsigned int>(index), ss_ids.size());
00409 
00410   return id_to_ss_names[ss_ids[index]];
00411 }

void libMesh::Nemesis_IO_Helper::get_ss_param_global (  ) 

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

Definition at line 110 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), 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, and libMesh::processor_id().

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

00111 {
00112   if (num_side_sets_global > 0)
00113     {
00114       global_sideset_ids.resize(num_side_sets_global);
00115       num_global_side_counts.resize(num_side_sets_global);
00116 
00117       // df = "distribution factor", not really sure what that is.  I don't yet have a file
00118       // which has distribution factors so I guess we'll worry about it later...
00119       num_global_side_df_counts.resize(num_side_sets_global);
00120 
00121       nemesis_err_flag =
00122         Nemesis::ne_get_ss_param_global(ex_id,
00123                                         global_sideset_ids.empty()        ? NULL : &global_sideset_ids[0],
00124                                         num_global_side_counts.empty()    ? NULL : &num_global_side_counts[0],
00125                                         num_global_side_df_counts.empty() ? NULL : &num_global_side_df_counts[0]);
00126       this->check_err(nemesis_err_flag, "Error reading global sideset parameters!");
00127 
00128       if (_verbose)
00129         {
00130           libMesh::out << "[" << libMesh::processor_id() << "] " << "Global Sideset IDs, Side Counts, and DF counts:" << std::endl;
00131           for (unsigned int bn=0; bn<global_sideset_ids.size(); ++bn)
00132             {
00133               libMesh::out << "  [" << libMesh::processor_id() << "] "
00134                         << "global_sideset_ids["<<bn<<"]=" << global_sideset_ids[bn]
00135                         << ", num_global_side_counts["<<bn<<"]=" << num_global_side_counts[bn]
00136                         << ", num_global_side_df_counts["<<bn<<"]=" << num_global_side_df_counts[bn]
00137                         << std::endl;
00138             }
00139         }
00140     }
00141 }

const std::vector< Real > & libMesh::ExodusII_IO_Helper::get_time_steps (  )  [inherited]
Real libMesh::ExodusII_IO_Helper::get_x ( int  i  )  const [inline, inherited]
Returns:
the $ i^{th} $ node's x-coordinate.

Definition at line 272 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::x.

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

00272 { return x[i]; }

Real libMesh::ExodusII_IO_Helper::get_y ( int  i  )  const [inline, inherited]
Returns:
the $ i^{th} $ node's y-coordinate.

Definition at line 278 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::y.

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

00278 { return y[i]; }

Real libMesh::ExodusII_IO_Helper::get_z ( int  i  )  const [inline, inherited]
Returns:
the $ i^{th} $ node's z-coordinate.

Definition at line 284 of file exodusII_io_helper.h.

References libMesh::ExodusII_IO_Helper::z.

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

00284 { return z[i]; }

void libMesh::Nemesis_IO_Helper::initialize ( std::string  title,
const MeshBase mesh 
) [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 744 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, libMesh::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().

00745 {
00746   // Make sure that the reference passed in is really a ParallelMesh
00747   // const ParallelMesh& pmesh = libmesh_cast_ref<const ParallelMesh&>(mesh);
00748   const MeshBase& pmesh = mesh;
00749 
00750   // According to Nemesis documentation, first call when writing should be to
00751   // ne_put_init_info().  Our reader doesn't actually call this, but we should
00752   // strive to be as close to a normal nemesis file as possible...
00753   this->put_init_info(libMesh::n_processors(), 1, "p");
00754 
00755 
00756   // Gather global "initial" information for Nemesis.  This consists of
00757   // three parts labelled I, II, and III below...
00758 
00759   //
00760   // I.) Need to compute the number of global element blocks.  To be consistent with
00761   // Exodus, we also incorrectly associate the number of element blocks with the
00762   // number of libmesh subdomains...
00763   //
00764   this->compute_num_global_elem_blocks(pmesh);
00765 
00766   //
00767   // II.) Determine the global number of nodesets by communication.
00768   // This code relies on BoundaryInfo storing side and node
00769   // boundary IDs separately at the time they are added to the
00770   // BoundaryInfo object.
00771   //
00772   this->compute_num_global_nodesets(pmesh);
00773 
00774   //
00775   // III.) Need to compute the global number of sidesets by communication:
00776   // This code relies on BoundaryInfo storing side and node
00777   // boundary IDs separately at the time they are added to the
00778   // BoundaryInfo object.
00779   //
00780   this->compute_num_global_sidesets(pmesh);
00781 
00782   // Now write the global data obtained in steps I, II, and III to the Nemesis file
00783   this->put_init_global(pmesh.parallel_n_nodes(),
00784                         pmesh.parallel_n_elem(),
00785                         this->num_elem_blks_global, /* I.   */
00786                         this->num_node_sets_global, /* II.  */
00787                         this->num_side_sets_global  /* III. */
00788                         );
00789 
00790   // Next, we'll write global element block information to the file.  This was already
00791   // gathered in step I. above
00792   this->put_eb_info_global(this->global_elem_blk_ids,
00793                            this->global_elem_blk_cnts);
00794 
00795 
00796   // Next, write global nodeset information to the file.  This was already gathered in
00797   // step II. above.
00798   this->num_global_node_df_counts.clear();
00799   this->num_global_node_df_counts.resize(this->global_nodeset_ids.size()); // distribution factors all zero...
00800   this->put_ns_param_global(this->global_nodeset_ids,
00801                             this->num_global_node_counts,
00802                             this->num_global_node_df_counts);
00803 
00804 
00805   // Next, write global sideset information to the file.  This was already gathered in
00806   // step III. above.
00807   this->num_global_side_df_counts.clear();
00808   this->num_global_side_df_counts.resize(this->global_sideset_ids.size()); // distribution factors all zero...
00809   this->put_ss_param_global(this->global_sideset_ids,
00810                             this->num_global_side_counts,
00811                             this->num_global_side_df_counts);
00812 
00813 
00814   // Before we go any further we need to derive consistent node and
00815   // element numbering schemes for all local elems and nodes connected
00816   // to local elements.
00817   //
00818   // Must be called *after* the local_subdomain_counts map has been constructed
00819   // by the compute_num_global_elem_blocks() function!
00820   this->build_element_and_node_maps(pmesh);
00821 
00822   // Next step is to write "load balance" parameters.  Several things need to
00823   // be computed first though...
00824 
00825   // First we'll collect IDs of border nodes.
00826   this->compute_border_node_ids(pmesh);
00827 
00828   // Next we'll collect numbers of internal and border elements, and internal nodes.
00829   // Note: "A border node does not a border element make...", that is, just because one
00830   // of an element's nodes has been identified as a border node, the element is not
00831   // necessarily a border element.  It must have a side on the boundary between processors,
00832   // i.e. have a face neighbor with a different processor id...
00833   this->compute_internal_and_border_elems_and_internal_nodes(pmesh);
00834 
00835   // Finally we are ready to write the loadbal information to the file
00836   this->put_loadbal_param(this->num_internal_nodes,
00837                           this->num_border_nodes,
00838                           this->num_external_nodes,
00839                           this->num_internal_elems,
00840                           this->num_border_elems,
00841                           this->num_node_cmaps,
00842                           this->num_elem_cmaps);
00843 
00844 
00845   // Now we need to compute the "communication map" parameters.  These are basically
00846   // lists of nodes and elements which need to be communicated between different processors
00847   // when the mesh file is read back in.
00848   this->compute_communication_map_parameters();
00849 
00850   // Write communication map parameters to file.
00851   this->put_cmap_params(this->node_cmap_ids,
00852                         this->node_cmap_node_cnts,
00853                         this->elem_cmap_ids,
00854                         this->elem_cmap_elem_cnts);
00855 
00856 
00857   // Ready the node communication maps.  The node IDs which
00858   // are communicated are the ones currently stored in
00859   // proc_nodes_touched_intersections.
00860   this->compute_node_communication_maps();
00861 
00862   // Write the packed node communication vectors to file.
00863   this->put_node_cmap(this->node_cmap_node_ids,
00864                       this->node_cmap_proc_ids);
00865 
00866 
00867   // Ready the node maps.  These have nothing to do with communiction, they map
00868   // the nodes to internal, border, and external nodes in the file.
00869   this->compute_node_maps();
00870 
00871   // Call the Nemesis API to write the node maps to file.
00872   this->put_node_map(this->node_mapi,
00873                      this->node_mapb,
00874                      this->node_mape);
00875 
00876 
00877 
00878   // Ready the element communication maps.  This includes border
00879   // element IDs, sides which are on the border, and the processors to which
00880   // they are to be communicated...
00881   this->compute_elem_communication_maps();
00882 
00883 
00884 
00885   // Call the Nemesis API to write the packed element communication maps vectors to file
00886   this->put_elem_cmap(this->elem_cmap_elem_ids,
00887                       this->elem_cmap_side_ids,
00888                       this->elem_cmap_proc_ids);
00889 
00890 
00891 
00892 
00893 
00894 
00895   // Ready the Nemesis element maps (internal and border) for writing to file.
00896   this->compute_element_maps();
00897 
00898   // Call the Nemesis API to write the internal and border element IDs.
00899   this->put_elem_map(this->elem_mapi,
00900                      this->elem_mapb);
00901 
00902 
00903   // Now write Exodus-specific initialization information, some of which is
00904   // different when you are using Nemesis.
00905   this->write_exodus_initialization_info(pmesh, title_in);
00906 } // end initialize()

void libMesh::ExodusII_IO_Helper::initialize_discontinuous ( std::string  title,
const MeshBase mesh 
) [inherited]

Initializes the Exodus file

Definition at line 792 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_use_mesh_dimension_instead_of_spatial_dimension, libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::MeshBase::boundary_info, libMesh::ExodusII_IO_Helper::check_err(), end, libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_init(), libMesh::DofObject::id(), libMesh::MeshBase::mesh_dimension(), libMesh::MeshBase::n_elem(), 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::processor_id(), libMesh::MeshBase::spatial_dimension(), and libMesh::Elem::subdomain_id().

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

00793 {
00794   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
00795     return;
00796 
00797   if (_use_mesh_dimension_instead_of_spatial_dimension)
00798     num_dim = mesh.mesh_dimension();
00799   else
00800     num_dim = mesh.spatial_dimension();
00801 
00802   MeshBase::const_element_iterator       it  = mesh.active_elements_begin();
00803   const MeshBase::const_element_iterator end = mesh.active_elements_end();
00804   for ( ; it != end; ++it)
00805         num_nodes += (*it)->n_nodes();
00806 
00807   num_elem = mesh.n_elem();
00808 
00809   std::vector<boundary_id_type> unique_side_boundaries;
00810   std::vector<boundary_id_type> unique_node_boundaries;
00811 
00812   mesh.boundary_info->build_side_boundary_ids(unique_side_boundaries);
00813   mesh.boundary_info->build_node_boundary_ids(unique_node_boundaries);
00814 
00815   num_side_sets = unique_side_boundaries.size();
00816   num_node_sets = unique_node_boundaries.size();
00817 
00818   //loop through element and map between block and element vector
00819   std::map<subdomain_id_type, std::vector<unsigned int>  > subdomain_map;
00820 
00821   for(it = mesh.active_elements_begin(); it != end; ++it)
00822     {
00823       const Elem * elem = *it;
00824       subdomain_id_type cur_subdomain = elem->subdomain_id();
00825 
00826       subdomain_map[cur_subdomain].push_back(elem->id());
00827     }
00828   num_elem_blk = subdomain_map.size();
00829 
00830   if (str_title.size() > MAX_LINE_LENGTH)
00831     {
00832       libMesh::err << "Warning, Exodus files cannot have titles longer than "
00833                    << MAX_LINE_LENGTH
00834                    << " characters.  Your title will be truncated."
00835                    << std::endl;
00836       str_title.resize(MAX_LINE_LENGTH);
00837     }
00838 
00839   ex_err = exII::ex_put_init(ex_id,
00840                              str_title.c_str(),
00841                              num_dim,
00842                              num_nodes,
00843                              num_elem,
00844                              num_elem_blk,
00845                              num_node_sets,
00846                              num_side_sets);
00847 
00848   check_err(ex_err, "Error initializing new Exodus file.");
00849 }

void libMesh::ExodusII_IO_Helper::initialize_element_variables ( const MeshBase mesh,
std::vector< std::string >  names 
) [inherited]

Sets up the nodal variables

Definition at line 1304 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::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_elem_var_tab(), ex_put_var_names(), ex_put_var_param(), libMesh::ExodusII_IO_Helper::num_elem_blk, libMesh::ExodusII_IO_Helper::num_elem_vars, libMesh::out, libMesh::processor_id(), libMesh::ExodusII_IO_Helper::strings, and libMesh::ExodusII_IO_Helper::vvc.

01306 {
01307   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01308     return;
01309 
01310   num_elem_vars = names.size();
01311 
01312   if ( num_elem_vars == 0 )
01313     return;
01314 
01315   if (_elem_vars_initialized)
01316     return;
01317   _elem_vars_initialized = true;
01318 
01319   ex_err = exII::ex_put_var_param(ex_id, "e", num_elem_vars);
01320   check_err(ex_err, "Error setting number of element vars.");
01321 
01322   // Form the element variable truth table and send to Exodus.
01323   // This tells which variables are written to which blocks,
01324   // and can dramatically speed up writing element variables
01325 
01326   // We really should initialize all entries in the truth table to 0
01327   // and then loop over all subdomains, setting their entries to 1
01328   // if a given variable exists on that subdomain.  However,
01329   // we don't have that information, and the element variables
01330   // passed to us are padded with zeroes for the blocks where
01331   // they aren't defined.  To be consistent with that, fill
01332   // the truth table with ones.
01333 
01334   std::vector<int> truth_tab(num_elem_blk*num_elem_vars,1);
01335   ex_err = exII::ex_put_elem_var_tab(ex_id, num_elem_blk, num_elem_vars, &truth_tab[0]);
01336   check_err(ex_err, "Error writing element truth table.");
01337 
01338   // Use the vvc and strings objects to emulate the behavior of
01339   // a char** object.
01340   vvc.resize(num_elem_vars);
01341   strings.resize(num_elem_vars);
01342 
01343   // For each string in names, allocate enough space in vvc and copy from
01344   // the C++ string into vvc for passing to the C interface.
01345   for (int i=0; i<num_elem_vars; ++i)
01346     {
01347       // Note: the one additional character is to hold the trailing '\0'
01348       vvc[i].resize(names[i].size() + 1);
01349       //std::strcpy(&(vvc[i][0]), names[i].c_str());
01350       vvc[i][ names[i].copy(&vvc[i][0], vvc[i].size()-1) ] = '\0';
01351     }
01352 
01353   for (int i=0; i<num_elem_vars; ++i)
01354     strings[i] = &(vvc[i][0]); // set pointer into vvc only *after* all resizing is complete
01355 
01356   if (_verbose)
01357     {
01358       libMesh::out << "Writing variable name(s) to file: " << std::endl;
01359       for (int i=0; i < num_elem_vars; ++i)
01360         libMesh::out << "strings[" << i << "]=" << strings[i] << std::endl;
01361     }
01362 
01363   ex_err = exII::ex_put_var_names(ex_id,
01364                                   "e",
01365                                   num_elem_vars,
01366                                   &strings[0]//var_names
01367                                   );
01368 
01369   check_err(ex_err, "Error setting element variable names.");
01370 }

void libMesh::ExodusII_IO_Helper::initialize_global_variables ( const std::vector< std::string > &  names  )  [inherited]

Sets up the global variables

Definition at line 1419 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_global_vars_initialized, libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_var_names(), ex_put_var_param(), libMesh::ExodusII_IO_Helper::num_globals, libMesh::out, libMesh::processor_id(), libMesh::ExodusII_IO_Helper::strings, and libMesh::ExodusII_IO_Helper::vvc.

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

01420 {
01421   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01422     return;
01423 
01424   if (_global_vars_initialized)
01425   {
01426     return;
01427   }
01428   _global_vars_initialized = true;
01429 
01430   num_globals = names.size();
01431 
01432   ex_err = exII::ex_put_var_param(ex_id, "g", num_globals);
01433   check_err(ex_err, "Error setting number of global vars.");
01434 
01435   // Use the vvc and strings objects to emulate the behavior of
01436   // a char** object.
01437   vvc.resize(num_globals);
01438   strings.resize(num_globals);
01439 
01440   // For each string in names, allocate enough space in vvc and copy from
01441   // the C++ string into vvc for passing to the C interface.
01442   for (int i=0; i<num_globals; i++)
01443     {
01444       vvc[i].resize(names[i].size()+1);
01445       // std::strcpy(&(vvc[i][0]), names[i].c_str());
01446       vvc[i][ names[i].copy(&vvc[i][0], vvc[i].size()-1) ] = '\0';
01447     }
01448 
01449   for (int i=0; i<num_globals; i++)
01450     strings[i] = &(vvc[i][0]); // set pointer into vvc only *after* all resizing is complete
01451 
01452   if (_verbose)
01453     {
01454       libMesh::out << "Writing variable name(s) to file: " << std::endl;
01455       for (int i=0; i < num_globals; ++i)
01456         libMesh::out << "strings[" << i << "]=" << strings[i] << std::endl;
01457     }
01458 
01459   ex_err = exII::ex_put_var_names(ex_id,
01460                                   "g",
01461                                   num_globals,
01462                                   &strings[0]
01463                                   );
01464 
01465   check_err(ex_err, "Error setting global variable names.");
01466 }

void libMesh::ExodusII_IO_Helper::initialize_nodal_variables ( std::vector< std::string >  names  )  [inherited]

Sets up the nodal variables

Definition at line 1374 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_var_names(), ex_put_var_param(), libMesh::ExodusII_IO_Helper::num_nodal_vars, libMesh::out, libMesh::processor_id(), libMesh::ExodusII_IO_Helper::strings, and libMesh::ExodusII_IO_Helper::vvc.

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

01375 {
01376   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01377     return;
01378 
01379   num_nodal_vars = names.size();
01380 
01381   ex_err = exII::ex_put_var_param(ex_id, "n", num_nodal_vars);
01382   check_err(ex_err, "Error setting number of nodal vars.");
01383 
01384   // Use the vvc and strings objects to emulate the behavior of
01385   // a char** object.
01386   vvc.resize(num_nodal_vars);
01387   strings.resize(num_nodal_vars);
01388 
01389   // For each string in names, allocate enough space in vvc and copy from
01390   // the C++ string into vvc for passing to the C interface.
01391   for (int i=0; i<num_nodal_vars; i++)
01392     {
01393       vvc[i].resize(names[i].size()+1);
01394       //std::strcpy(&(vvc[i][0]), names[i].c_str());
01395       vvc[i][ names[i].copy(&vvc[i][0], vvc[i].size()-1) ] = '\0';
01396     }
01397 
01398   for (int i=0; i<num_nodal_vars; i++)
01399     strings[i] = &(vvc[i][0]); // set pointer into vvc only *after* all resizing is complete
01400 
01401   if (_verbose)
01402     {
01403       libMesh::out << "Writing variable name(s) to file: " << std::endl;
01404       for (int i=0;i<num_nodal_vars;i++)
01405         libMesh::out << "strings[" << i << "]=" << strings[i] << std::endl;
01406     }
01407 
01408   ex_err = exII::ex_put_var_names(ex_id,
01409                                   "n",
01410                                   num_nodal_vars,
01411                                   strings.empty() ? NULL : &strings[0]//var_names
01412                                   );
01413 
01414   check_err(ex_err, "Error setting nodal variable names.");
01415 }

int libMesh::ExodusII_IO_Helper::inquire ( int  req_info,
std::string  error_msg = "" 
) [inherited]
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 248 of file exodusII_io_helper.C.

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

00249 {
00250   if (_verbose) libMesh::out << msg << i << "." << std::endl;
00251 }

void libMesh::ExodusII_IO_Helper::open ( const char *  filename  )  [inherited]

Opens an ExodusII mesh file named filename for reading.

Definition at line 255 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::comp_ws, libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::ex_version, libMesh::ExodusII_IO_Helper::io_ws, and libMesh::out.

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

00256 {
00257   ex_id = exII::ex_open(filename,
00258                         EX_READ,
00259                         &comp_ws,
00260                         &io_ws,
00261                         &ex_version);
00262 
00263   std::string err_msg = std::string("Error opening ExodusII mesh file: ") + std::string(filename);
00264   check_err(ex_id, err_msg);
00265   if (_verbose) libMesh::out << "File opened successfully." << std::endl;
00266 }

void libMesh::ExodusII_IO_Helper::print_header (  )  [inherited]

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 293 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, 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, and libMesh::ExodusII_IO_Helper::title.

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

00294 {
00295   if (_verbose)
00296     libMesh::out << "Title: \t" << &title[0] << std::endl
00297                   << "Mesh Dimension: \t"   << num_dim << std::endl
00298                   << "Number of Nodes: \t" << num_nodes << std::endl
00299                   << "Number of elements: \t" << num_elem << std::endl
00300                   << "Number of elt blocks: \t" << num_elem_blk << std::endl
00301                   << "Number of node sets: \t" << num_node_sets << std::endl
00302                   << "Number of side sets: \t" << num_side_sets << std::endl;
00303 }

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 344 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.

00345 {
00346   for (int i=0; i<num_nodes; i++)
00347     out_stream << "(" << x[i] << ", " << y[i] << ", " << z[i] << ")" << std::endl;
00348 }

void libMesh::ExodusII_IO_Helper::print_nodeset_info (  )  [inherited]

Prints information about all the nodesets.

void libMesh::ExodusII_IO_Helper::print_sideset_info (  )  [inherited]

Prints information about all the sidesets.

Definition at line 639 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::elem_list, libMesh::ExodusII_IO_Helper::num_elem_all_sidesets, libMesh::out, and libMesh::ExodusII_IO_Helper::side_list.

00640 {
00641   for (int i=0; i<num_elem_all_sidesets; i++)
00642     {
00643       libMesh::out << elem_list[i] << " " << side_list[i] << std::endl;
00644     }
00645 }

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 570 of file nemesis_io_helper.C.

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

Referenced by initialize().

00574 {
00575   // We might not have cmaps on every processor in some corner
00576   // cases
00577   if(node_cmap_ids.size())
00578     {
00579       nemesis_err_flag =
00580         Nemesis::ne_put_cmap_params(ex_id,
00581                                     &node_cmap_ids_in[0],
00582                                     &node_cmap_node_cnts_in[0],
00583                                     &elem_cmap_ids_in[0],
00584                                     &elem_cmap_elem_cnts_in[0],
00585                                     libMesh::processor_id());
00586     }
00587 
00588   this->check_err(nemesis_err_flag, "Error writing cmap parameters!");
00589 }

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 490 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

00492 {
00493   nemesis_err_flag =
00494     Nemesis::ne_put_eb_info_global(ex_id,
00495                                    &global_elem_blk_ids_in[0],
00496                                    &global_elem_blk_cnts_in[0]);
00497 
00498   this->check_err(nemesis_err_flag, "Error writing global element block information!");
00499 }

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 653 of file nemesis_io_helper.C.

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

Referenced by initialize().

00656 {
00657   for (unsigned int i=0; i<elem_cmap_ids.size(); ++i)
00658     {
00659       nemesis_err_flag =
00660         Nemesis::ne_put_elem_cmap(ex_id,
00661                                   this->elem_cmap_ids[i],
00662                                   &elem_cmap_elem_ids_in[i][0],
00663                                   &elem_cmap_side_ids_in[i][0],
00664                                   &elem_cmap_proc_ids_in[i][0],
00665                                   libMesh::processor_id());
00666 
00667       this->check_err(nemesis_err_flag, "Error writing elem communication map to file!");
00668     }
00669 }

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 674 of file nemesis_io_helper.C.

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

Referenced by initialize().

00676 {
00677   nemesis_err_flag =
00678     Nemesis::ne_put_elem_map(ex_id,
00679                              elem_mapi_in.empty() ? NULL : &elem_mapi_in[0],
00680                              elem_mapb_in.empty() ? NULL : &elem_mapb_in[0],
00681                              libMesh::processor_id());
00682 
00683   this->check_err(nemesis_err_flag, "Error writing Nemesis internal and border element maps to file!");
00684 }

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 471 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

00476 {
00477   nemesis_err_flag =
00478     Nemesis::ne_put_init_global(ex_id,
00479                                 num_nodes_global_in,
00480                                 num_elems_global_in,
00481                                 num_elem_blks_global_in,
00482                                 num_node_sets_global_in,
00483                                 num_side_sets_global_in);
00484 
00485   this->check_err(nemesis_err_flag, "Error writing initial global data!");
00486 }

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 455 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

Referenced by initialize().

00458 {
00459   nemesis_err_flag =
00460     Nemesis::ne_put_init_info(ex_id,
00461                               num_proc_in,
00462                               num_proc_in_file_in,
00463                               const_cast<char*>(ftype_in));
00464 
00465   this->check_err(nemesis_err_flag, "Error writing initial information!");
00466 }

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 544 of file nemesis_io_helper.C.

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

Referenced by initialize().

00551 {
00552   nemesis_err_flag =
00553     Nemesis::ne_put_loadbal_param(ex_id,
00554                                   num_internal_nodes_in,
00555                                   num_border_nodes_in,
00556                                   num_external_nodes_in,
00557                                   num_internal_elems_in,
00558                                   num_border_elems_in,
00559                                   num_node_cmaps_in,
00560                                   num_elem_cmaps_in,
00561                                   libMesh::processor_id());
00562 
00563   this->check_err(nemesis_err_flag, "Error writing loadbal parameters!");
00564 }

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 691 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, and nemesis_err_flag.

00696 {
00697   nemesis_err_flag =
00698     Nemesis::ne_put_n_coord(ex_id,
00699                             start_node_num,
00700                             num_nodes_in,
00701                             &x_coor[0],
00702                             &y_coor[0],
00703                             &z_coor[0]);
00704 
00705   this->check_err(nemesis_err_flag, "Error writing coords to file!");
00706 }

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 594 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, nemesis_err_flag, node_cmap_ids, libMesh::out, and libMesh::processor_id().

Referenced by initialize().

00596 {
00597 
00598   // Print to screen what we are about to print to Nemesis file
00599   if (_verbose)
00600     {
00601       for (unsigned i=0; i<node_cmap_node_ids_in.size(); ++i)
00602         {
00603           libMesh::out << "[" << libMesh::processor_id() << "] put_node_cmap() : nodes communicated to proc "
00604                        << this->node_cmap_ids[i]
00605                        << " = ";
00606           for (unsigned j=0; j<node_cmap_node_ids_in[i].size(); ++j)
00607             libMesh::out << node_cmap_node_ids_in[i][j] << " ";
00608           libMesh::out << std::endl;
00609         }
00610 
00611       for (unsigned i=0; i<node_cmap_node_ids_in.size(); ++i)
00612         {
00613           libMesh::out << "[" << libMesh::processor_id() << "] put_node_cmap() : processor IDs = ";
00614           for (unsigned j=0; j<node_cmap_proc_ids_in[i].size(); ++j)
00615             libMesh::out << node_cmap_proc_ids_in[i][j] << " ";
00616           libMesh::out << std::endl;
00617         }
00618     }
00619 
00620   for (unsigned int i=0; i<node_cmap_node_ids_in.size(); ++i)
00621     {
00622       nemesis_err_flag =
00623         Nemesis::ne_put_node_cmap(ex_id,
00624                                   this->node_cmap_ids[i],
00625                                   &node_cmap_node_ids_in[i][0],
00626                                   &node_cmap_proc_ids_in[i][0],
00627                                   libMesh::processor_id());
00628 
00629       this->check_err(nemesis_err_flag, "Error writing node communication map to file!");
00630     }
00631 }

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 636 of file nemesis_io_helper.C.

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

Referenced by initialize().

00639 {
00640   nemesis_err_flag =
00641     Nemesis::ne_put_node_map(ex_id,
00642                              node_mapi_in.empty() ? NULL : &node_mapi_in[0],
00643                              node_mapb_in.empty() ? NULL : &node_mapb_in[0],
00644                              node_mape_in.empty() ? NULL : &node_mape_in[0], // Don't take address of empty vector...
00645                              libMesh::processor_id());
00646 
00647   this->check_err(nemesis_err_flag, "Error writing Nemesis internal and border node maps to file!");
00648 }

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 504 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, global_nodeset_ids, and nemesis_err_flag.

Referenced by initialize().

00507 {
00508   // Only add nodesets if there are some
00509   if(global_nodeset_ids.size())
00510   {
00511     nemesis_err_flag =
00512       Nemesis::ne_put_ns_param_global(ex_id,
00513                                       &global_nodeset_ids_in[0],
00514                                       &num_global_node_counts_in[0],
00515                                       &num_global_node_df_counts_in[0]);
00516   }
00517 
00518   this->check_err(nemesis_err_flag, "Error writing global nodeset parameters!");
00519 }

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 524 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_id, global_sideset_ids, and nemesis_err_flag.

Referenced by initialize().

00527 {
00528   // Only add sidesets if there are some
00529   if(global_sideset_ids.size())
00530   {
00531     nemesis_err_flag =
00532       Nemesis::ne_put_ss_param_global(ex_id,
00533                                       &global_sideset_ids_in[0],
00534                                       &num_global_side_counts_in[0],
00535                                       &num_global_side_df_counts_in[0]);
00536   }
00537 
00538   this->check_err(nemesis_err_flag, "Error writing global sideset parameters!");
00539 }

void libMesh::ExodusII_IO_Helper::read_block_info (  )  [inherited]

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

Definition at line 352 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::block_ids, libMesh::ExodusII_IO_Helper::check_err(), EX_ELEM_BLOCK, libMesh::ExodusII_IO_Helper::ex_err, ex_get_elem_blk_ids(), ex_get_name(), 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(), and libMesh::ExodusII_IO::read().

00353 {
00354   block_ids.resize(num_elem_blk);
00355   // Get all element block IDs.
00356   ex_err = exII::ex_get_elem_blk_ids(ex_id,
00357                                      block_ids.empty() ? NULL : &block_ids[0]);
00358   // Usually, there is only one
00359   // block since there is only
00360   // one type of element.
00361   // However, there could be more.
00362 
00363   check_err(ex_err, "Error getting block IDs.");
00364   message("All block IDs retrieved successfully.");
00365 
00366   char name_buffer[MAX_STR_LENGTH+1];
00367   for (int i=0; i<num_elem_blk; ++i)
00368   {
00369     ex_err = exII::ex_get_name(ex_id, exII::EX_ELEM_BLOCK,
00370                                block_ids[i], name_buffer);
00371     check_err(ex_err, "Error getting block name.");
00372     id_to_block_names[block_ids[i]] = name_buffer;
00373   }
00374   message("All block mames retrieved successfully.");
00375 }

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 434 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::block_ids, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::connect, libMesh::ExodusII_IO_Helper::elem_type, libMesh::ExodusII_IO_Helper::ex_err, ex_get_elem_block(), ex_get_elem_conn(), 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, and libMesh::out.

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

00435 {
00436   libmesh_assert_less (static_cast<unsigned int>(block), block_ids.size());
00437 
00438   ex_err = exII::ex_get_elem_block(ex_id,
00439                                    block_ids[block],
00440                                    &elem_type[0],
00441                                    &num_elem_this_blk,
00442                                    &num_nodes_per_elem,
00443                                    &num_attr);
00444   if (_verbose)
00445     libMesh::out << "Reading a block of " << num_elem_this_blk
00446               << " " << &elem_type[0] << "(s)"
00447               << " having " << num_nodes_per_elem
00448               << " nodes per element." << std::endl;
00449 
00450   check_err(ex_err, "Error getting block info.");
00451   message("Info retrieved successfully for block: ", block);
00452 
00453 
00454 
00455   // Read in the connectivity of the elements of this block,
00456   // watching out for the case where we actually have no
00457   // elements in this block (possible with parallel files)
00458   connect.resize(num_nodes_per_elem*num_elem_this_blk);
00459 
00460   if (!connect.empty())
00461     {
00462       ex_err = exII::ex_get_elem_conn(ex_id,
00463                                       block_ids[block],
00464                                       &connect[0]);
00465 
00466       check_err(ex_err, "Error reading block connectivity.");
00467       message("Connectivity retrieved successfully for block: ", block);
00468     }
00469 }

void libMesh::ExodusII_IO_Helper::read_elem_num_map (  )  [inherited]

Reads the optional node_num_map from the ExodusII mesh file.

Definition at line 474 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::elem_num_map, libMesh::ExodusII_IO_Helper::ex_err, ex_get_elem_num_map(), libMesh::ExodusII_IO_Helper::ex_id, libMesh::ExodusII_IO_Helper::message(), std::min(), libMesh::ExodusII_IO_Helper::num_elem, libMesh::out, and libMesh::processor_id().

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

00475 {
00476   elem_num_map.resize(num_elem);
00477 
00478   ex_err = exII::ex_get_elem_num_map (ex_id,
00479                                       elem_num_map.empty() ? NULL : &elem_num_map[0]);
00480 
00481   check_err(ex_err, "Error retrieving element number map.");
00482   message("Element numbering map retrieved successfully.");
00483 
00484 
00485   if (_verbose)
00486     {
00487       libMesh::out << "[" << libMesh::processor_id() << "] elem_num_map[i] = ";
00488       for (unsigned int i=0; i< static_cast<unsigned int>(std::min(10, num_elem-1)); ++i)
00489         libMesh::out << elem_num_map[i] << ", ";
00490       libMesh::out << "... " << elem_num_map.back() << std::endl;
00491     }
00492 }

void libMesh::ExodusII_IO_Helper::read_node_num_map (  )  [inherited]

Reads the optional node_num_map from the ExodusII mesh file.

Definition at line 324 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, ex_get_node_num_map(), 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, and libMesh::processor_id().

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

00325 {
00326   node_num_map.resize(num_nodes);
00327 
00328   ex_err = exII::ex_get_node_num_map (ex_id,
00329                                       node_num_map.empty() ? NULL : &node_num_map[0]);
00330 
00331   check_err(ex_err, "Error retrieving nodal number map.");
00332   message("Nodal numbering map retrieved successfully.");
00333 
00334   if (_verbose)
00335     {
00336       libMesh::out << "[" << libMesh::processor_id() << "] node_num_map[i] = ";
00337       for (unsigned int i=0; i< static_cast<unsigned int>(std::min(10, num_nodes-1)); ++i)
00338         libMesh::out << node_num_map[i] << ", ";
00339       libMesh::out << "... " << node_num_map.back() << std::endl;
00340     }
00341 }

void libMesh::ExodusII_IO_Helper::read_nodes (  )  [inherited]

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

Definition at line 307 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, ex_get_coord(), 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().

00308 {
00309   x.resize(num_nodes);
00310   y.resize(num_nodes);
00311   z.resize(num_nodes);
00312 
00313   ex_err = exII::ex_get_coord(ex_id,
00314                               static_cast<void*>(&x[0]),
00315                               static_cast<void*>(&y[0]),
00316                               static_cast<void*>(&z[0]));
00317 
00318   check_err(ex_err, "Error retrieving nodal data.");
00319   message("Nodal data retrieved successfully.");
00320 }

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 609 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, ex_get_node_set(), ex_get_node_set_param(), 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().

00610 {
00611   libmesh_assert_less (static_cast<unsigned int>(id), nodeset_ids.size());
00612   libmesh_assert_less (static_cast<unsigned int>(id), num_nodes_per_set.size());
00613   libmesh_assert_less (static_cast<unsigned int>(id), num_node_df_per_set.size());
00614 
00615   ex_err = exII::ex_get_node_set_param(ex_id,
00616                                        nodeset_ids[id],
00617                                        &num_nodes_per_set[id],
00618                                        &num_node_df_per_set[id]);
00619   check_err(ex_err, "Error retrieving nodeset parameters.");
00620   message("Parameters retrieved successfully for nodeset: ", id);
00621 
00622   node_list.resize(num_nodes_per_set[id]);
00623 
00624   // Don't call ex_get_node_set unless there are actually nodes there to get.
00625   // Exodus prints an annoying warning message in DEBUG mode otherwise...
00626   if (num_nodes_per_set[id] > 0)
00627     {
00628       ex_err = exII::ex_get_node_set(ex_id,
00629                                      nodeset_ids[id],
00630                                      &node_list[0]);
00631 
00632       check_err(ex_err, "Error retrieving nodeset data.");
00633       message("Data retrieved successfully for nodeset: ", id);
00634     }
00635 }

void libMesh::ExodusII_IO_Helper::read_nodeset_info (  )  [inherited]

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

Definition at line 538 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, ex_get_name(), ex_get_node_set_ids(), libMesh::ExodusII_IO_Helper::ex_id, EX_NODE_SET, 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().

00539 {
00540   nodeset_ids.resize(num_node_sets);
00541   if (num_node_sets > 0)
00542     {
00543       ex_err = exII::ex_get_node_set_ids(ex_id,
00544                                          &nodeset_ids[0]);
00545       check_err(ex_err, "Error retrieving nodeset information.");
00546       message("All nodeset information retrieved successfully.");
00547 
00548       // Resize appropriate data structures -- only do this once outnode the loop
00549       num_nodes_per_set.resize(num_node_sets);
00550       num_node_df_per_set.resize(num_node_sets);
00551     }
00552 
00553   char name_buffer[MAX_STR_LENGTH+1];
00554   for (int i=0; i<num_node_sets; ++i)
00555   {
00556     ex_err = exII::ex_get_name(ex_id, exII::EX_NODE_SET,
00557                                nodeset_ids[i], name_buffer);
00558     check_err(ex_err, "Error getting node set name.");
00559     id_to_ns_names[nodeset_ids[i]] = name_buffer;
00560   }
00561   message("All node set mames retrieved successfully.");
00562 }

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 566 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::elem_list, libMesh::ExodusII_IO_Helper::ex_err, ex_get_side_set(), ex_get_side_set_param(), 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().

00567 {
00568   libmesh_assert_less (static_cast<unsigned int>(id), ss_ids.size());
00569   libmesh_assert_less (static_cast<unsigned int>(id), num_sides_per_set.size());
00570   libmesh_assert_less (static_cast<unsigned int>(id), num_df_per_set.size());
00571   libmesh_assert_less_equal (static_cast<unsigned int>(offset), elem_list.size());
00572   libmesh_assert_less_equal (static_cast<unsigned int>(offset), side_list.size());
00573 
00574   ex_err = exII::ex_get_side_set_param(ex_id,
00575                                        ss_ids[id],
00576                                        &num_sides_per_set[id],
00577                                        &num_df_per_set[id]);
00578   check_err(ex_err, "Error retrieving sideset parameters.");
00579   message("Parameters retrieved successfully for sideset: ", id);
00580 
00581 
00582   // It's OK for offset==elem_list.size() as long as num_sides_per_set[id]==0
00583   // because in that case we don't actually read anything...
00584 #ifdef DEBUG
00585   if (static_cast<unsigned int>(offset) == elem_list.size() ||
00586       static_cast<unsigned int>(offset) == side_list.size() )
00587     libmesh_assert_equal_to (num_sides_per_set[id], 0);
00588 #endif
00589 
00590 
00591   // Don't call ex_get_side_set unless there are actually sides there to get.
00592   // Exodus prints an annoying warning in DEBUG mode otherwise...
00593   if (num_sides_per_set[id] > 0)
00594     {
00595       ex_err = exII::ex_get_side_set(ex_id,
00596                                      ss_ids[id],
00597                                      &elem_list[offset],
00598                                      &side_list[offset]);
00599       check_err(ex_err, "Error retrieving sideset data.");
00600       message("Data retrieved successfully for sideset: ", id);
00601 
00602       for (int i=0; i<num_sides_per_set[id]; i++)
00603         id_list[i+offset] = ss_ids[id];
00604     }
00605 }

void libMesh::ExodusII_IO_Helper::read_sideset_info (  )  [inherited]

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

Definition at line 496 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::elem_list, libMesh::ExodusII_IO_Helper::ex_err, ex_get_name(), ex_get_side_set_ids(), libMesh::ExodusII_IO_Helper::ex_id, EX_INQ_SS_ELEM_LEN, ex_inquire(), EX_SIDE_SET, libMesh::ExodusII_IO_Helper::id_list, libMesh::ExodusII_IO_Helper::id_to_ss_names, 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::req_info, libMesh::ExodusII_IO_Helper::ret_char, libMesh::ExodusII_IO_Helper::ret_float, libMesh::ExodusII_IO_Helper::ret_int, libMesh::ExodusII_IO_Helper::side_list, and libMesh::ExodusII_IO_Helper::ss_ids.

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

00497 {
00498   ss_ids.resize(num_side_sets);
00499   if (num_side_sets > 0)
00500     {
00501       ex_err = exII::ex_get_side_set_ids(ex_id,
00502                                          &ss_ids[0]);
00503       check_err(ex_err, "Error retrieving sideset information.");
00504       message("All sideset information retrieved successfully.");
00505 
00506       // Resize appropriate data structures -- only do this once outside the loop
00507       num_sides_per_set.resize(num_side_sets);
00508       num_df_per_set.resize(num_side_sets);
00509 
00510       // Inquire about the length of the
00511       // concatenated side sets element list
00512       req_info = exII::EX_INQ_SS_ELEM_LEN;
00513       ex_err = exII::ex_inquire(ex_id,
00514                                 req_info,
00515                                 &ret_int,
00516                                 &ret_float,
00517                                 &ret_char);
00518       check_err(ex_err, "Error inquiring about side set element list length.");
00519 
00520       //libMesh::out << "Value returned by ex_inquire was: " << ret_int << std::endl;
00521       num_elem_all_sidesets = ret_int;
00522       elem_list.resize (num_elem_all_sidesets);
00523       side_list.resize (num_elem_all_sidesets);
00524       id_list.resize   (num_elem_all_sidesets);
00525     }
00526 
00527   char name_buffer[MAX_STR_LENGTH+1];
00528   for (int i=0; i<num_side_sets; ++i)
00529   {
00530     ex_err = exII::ex_get_name(ex_id, exII::EX_SIDE_SET,
00531                                ss_ids[i], name_buffer);
00532     check_err(ex_err, "Error getting side set name.");
00533     id_to_ss_names[ss_ids[i]] = name_buffer;
00534   }
00535   message("All side set mames retrieved successfully.");
00536 }

void libMesh::ExodusII_IO_Helper::use_mesh_dimension_instead_of_spatial_dimension ( bool  val  )  [inherited]

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 1596 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::verbose ( bool  set_verbosity  )  [inherited]

Get/set flag telling whether message printing is on or off.

Definition at line 223 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose.

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

00224 {
00225   _verbose = set_verbosity;
00226 }

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

Writes the vector of values to the element variables.

Definition at line 1484 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::Elem::active(), libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::ExodusII_IO_Helper::check_err(), data, end, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_elem_var(), ex_update(), libMesh::ExodusII_IO_Helper::get_block_id(), libMesh::DofObject::id(), libMesh::ExodusII_IO_Helper::num_elem, libMesh::processor_id(), and libMesh::Elem::subdomain_id().

01485 {
01486   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01487     return;
01488 
01489   // Loop over the element blocks and write the data one block at a time
01490   std::map<unsigned int, std::vector<unsigned int>  > subdomain_map;
01491 
01492   const unsigned int num_vars = values.size() / num_elem;
01493 
01494   MeshBase::const_element_iterator mesh_it = mesh.active_elements_begin();
01495   const MeshBase::const_element_iterator end = mesh.active_elements_end();
01496   //loop through element and map between block and element vector
01497   for( ; mesh_it != end; ++mesh_it)
01498     {
01499       const Elem * elem = *mesh_it;
01500 
01501       //Only write out the active elements
01502       if(elem->active())
01503       {
01504         unsigned int cur_subdomain = elem->subdomain_id();
01505 
01506         subdomain_map[cur_subdomain].push_back(elem->id());
01507       }
01508     }
01509 
01510   for (unsigned int l=0; l < num_vars; ++l)
01511   {
01512     // The size of the subdomain map is the number of blocks.
01513     std::map<unsigned int, std::vector<unsigned int>  >::iterator it( subdomain_map.begin() );
01514 
01515     for(unsigned int j=0; it != subdomain_map.end(); ++it, ++j)
01516     {
01517       const std::vector<unsigned int> & elem_nums = (*it).second;
01518       const unsigned int num_elems_this_block = elem_nums.size();
01519       std::vector<Number> data( num_elems_this_block );
01520       for (unsigned int k=0; k < num_elems_this_block; ++k)
01521       {
01522         data[k] = values[l*num_elem+elem_nums[k]];
01523       }
01524 
01525       ex_err = exII::ex_put_elem_var(ex_id, timestep, l+1, get_block_id(j), num_elems_this_block, &data[0]);
01526       check_err(ex_err, "Error writing element values.");
01527 
01528     }
01529   }
01530 
01531   ex_err = exII::ex_update(ex_id);
01532   check_err(ex_err, "Error flushing buffers to file.");
01533 }

void libMesh::Nemesis_IO_Helper::write_elements ( const MeshBase mesh  )  [virtual]

This function is specialized to write the connectivity.

Reimplemented from libMesh::ExodusII_IO_Helper.

Definition at line 2322 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), block_id_to_elem_connectivity, libMesh::ExodusII_IO_Helper::check_err(), libMesh::MeshBase::elem(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_elem_block(), ex_put_elem_conn(), ex_put_elem_num_map(), 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().

02323 {
02324 
02325   // Loop over all blocks, even if we don't have elements in each block.
02326   // If we don't have elements we need to write out a 0 for that block...
02327   for (unsigned int i=0; i<static_cast<unsigned>(this->num_elem_blks_global); ++i)
02328     {
02329       // Search for the current global block ID in the map
02330       std::map<int, std::vector<int> >::iterator it =
02331         this->block_id_to_elem_connectivity.find( this->global_elem_blk_ids[i] );
02332 
02333       // If not found, write a zero to file....
02334       if (it == this->block_id_to_elem_connectivity.end())
02335         {
02336           this->ex_err = exII::ex_put_elem_block(this->ex_id,
02337                                                  this->global_elem_blk_ids[i],
02338                                                  "Empty",
02339                                                  0, /* n. elements in this block */
02340                                                  0, /* n. nodes per element */
02341                                                  0);  /* number of attributes per element */
02342 
02343           this->check_err(this->ex_err, "Error writing element block from Nemesis.");
02344         }
02345 
02346       // Otherwise, write the actual block information and connectivity to file
02347       else
02348         {
02349           int block = (*it).first;
02350           std::vector<int> & this_block_connectivity = (*it).second;
02351           std::vector<unsigned int> & elements_in_this_block = subdomain_map[block];
02352 
02353           ExodusII_IO_Helper::ElementMaps em;
02354 
02355           //Use the first element in this block to get representative information.
02356           //Note that Exodus assumes all elements in a block are of the same type!
02357           //We are using that same assumption here!
02358           const ExodusII_IO_Helper::Conversion conv =
02359             em.assign_conversion(mesh.elem(elements_in_this_block[0])->type());
02360 
02361           this->num_nodes_per_elem = mesh.elem(elements_in_this_block[0])->n_nodes();
02362 
02363           ex_err = exII::ex_put_elem_block(ex_id,
02364                                            block,
02365                                            conv.exodus_elem_type().c_str(),
02366                                            elements_in_this_block.size(),
02367                                            num_nodes_per_elem,
02368                                            0);
02369           check_err(ex_err, "Error writing element block from Nemesis.");
02370 
02371           ex_err = exII::ex_put_elem_conn(ex_id,
02372                                           block,
02373                                           &this_block_connectivity[0]);
02374           check_err(ex_err, "Error writing element connectivities from Nemesis.");
02375         }
02376     } // end loop over global block IDs
02377 
02378   // Only call this once, not in the loop above!
02379   ex_err = exII::ex_put_elem_num_map(ex_id,
02380     exodus_elem_num_to_libmesh.empty() ? NULL : &exodus_elem_num_to_libmesh[0]);
02381   check_err(ex_err, "Error writing element map");
02382 }

void libMesh::ExodusII_IO_Helper::write_elements_discontinuous ( const MeshBase mesh  )  [inherited]

Writes the elements contained in "mesh" FIXME: This only works for Mesh's having a single type of element!

Definition at line 1107 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::_verbose, libMesh::Elem::active(), libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::connect, libMesh::MeshBase::elem(), elem_id, end, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_elem_block(), ex_put_elem_conn(), ex_put_elem_num_map(), ex_update(), libMesh::ExodusII_IO_Helper::Conversion::exodus_elem_type(), libMesh::ExodusII_IO_Helper::Conversion::get_inverse_node_map(), libMesh::DofObject::id(), libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus, libMesh::Elem::n_nodes(), libMesh::ExodusII_IO_Helper::num_nodes_per_elem, libMesh::out, libMesh::processor_id(), libMesh::Elem::subdomain_id(), and libMesh::Elem::type().

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

01108 {
01109   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01110     return;
01111 
01112   std::map<unsigned int, std::vector<unsigned int>  > subdomain_map;
01113 
01114   MeshBase::const_element_iterator mesh_it = mesh.active_elements_begin();
01115   const MeshBase::const_element_iterator end = mesh.active_elements_end();
01116   //loop through element and map between block and element vector
01117   for(; mesh_it != end; ++mesh_it)
01118     {
01119       const Elem * elem = *mesh_it;
01120 
01121       //Only write out the active elements
01122       if(elem->active())
01123       {
01124         unsigned int cur_subdomain = elem->subdomain_id();
01125 
01126         subdomain_map[cur_subdomain].push_back(elem->id());
01127       }
01128     }
01129 
01130   std::vector<int> elem_num_map_out;
01131 
01132   std::map<unsigned int, std::vector<unsigned int>  >::iterator it;
01133 
01134   for(it = subdomain_map.begin() ; it != subdomain_map.end(); it++)
01135     {
01136       std::vector<unsigned int> & tmp_vec = (*it).second;
01137 
01138       ExodusII_IO_Helper::ElementMaps em;
01139 
01140       //Use the first element in this block to get representative information.
01141       //Note that Exodus assumes all elements in a block are of the same type!
01142       //We are using that same assumption here!
01143       const ExodusII_IO_Helper::Conversion conv = em.assign_conversion(mesh.elem(tmp_vec[0])->type());
01144       num_nodes_per_elem = mesh.elem(tmp_vec[0])->n_nodes();
01145 
01146       ex_err = exII::ex_put_elem_block(ex_id, (*it).first, conv.exodus_elem_type().c_str(), tmp_vec.size(),num_nodes_per_elem,0);
01147 
01148       check_err(ex_err, "Error writing element block.");
01149 
01150       connect.resize(tmp_vec.size()*num_nodes_per_elem);
01151 
01152       for (unsigned int i=0; i<tmp_vec.size(); i++)
01153         {
01154           unsigned int elem_id = tmp_vec[i];
01155           elem_num_map_out.push_back(elem_id);
01156           libmesh_elem_num_to_exodus[elem_id] = elem_num_map_out.size();
01157 
01158           for (unsigned int j=0; j < static_cast<unsigned int>(num_nodes_per_elem); j++)
01159             {
01160               const unsigned int connect_index   = (i*num_nodes_per_elem)+j;
01161               const unsigned int elem_node_index = conv.get_inverse_node_map(j); // Inverse node map is for writing
01162               if (_verbose)
01163                 {
01164                   libMesh::out << "Exodus node index: " << j
01165                                 << "=LibMesh node index " << elem_node_index << std::endl;
01166                 }
01167               connect[connect_index] = i*num_nodes_per_elem+elem_node_index+1;
01168             }
01169         }
01170     ex_err = exII::ex_put_elem_conn(ex_id, (*it).first, &connect[0]);
01171     check_err(ex_err, "Error writing element connectivities");
01172 
01173     // write out the element number map
01174     std::vector<unsigned int> elem_map(tmp_vec.size());
01175     std::transform(tmp_vec.begin(), tmp_vec.end(), elem_map.begin(),
01176                    std::bind2nd(std::plus<unsigned int>(), 1));  // Add one to each id for exodus!
01177     ex_err = exII::ex_put_elem_num_map(ex_id, (int *)&elem_map[0]);
01178     check_err(ex_err, "Error writing element map");
01179   }
01180 
01181 //  ex_err = exII::ex_put_elem_num_map(ex_id, &elem_num_map_out[0]);
01182   check_err(ex_err, "Error writing element connectivities");
01183 
01184   ex_err = exII::ex_update(ex_id);
01185   check_err(ex_err, "Error flushing buffers to file.");
01186 }

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 913 of file nemesis_io_helper.C.

References libMesh::MeshBase::active_local_elements_begin(), libMesh::MeshBase::active_local_elements_end(), libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_init(), 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().

00915 {
00916   // This follows the convention of Exodus: we always write out the mesh as LIBMESH_DIM-dimensional,
00917   // even if it is 2D...
00918   this->num_dim = pmesh.spatial_dimension();
00919 
00920   this->num_elem = static_cast<unsigned int>(std::distance (pmesh.active_local_elements_begin(),
00921                                                             pmesh.active_local_elements_end()));
00922 
00923   // Exodus will also use *global* number of side and node sets,
00924   // though it will not write out entries for all of them...
00925   this->num_side_sets =
00926     libmesh_cast_int<int>(this->global_sideset_ids.size());
00927   this->num_node_sets =
00928     libmesh_cast_int<int>(this->global_nodeset_ids.size());
00929 
00930   // We need to write the global number of blocks, even though this processor might not have
00931   // elements in some of them!
00932   this->num_elem_blk = this->num_elem_blks_global;
00933 
00934   ex_err = exII::ex_put_init(ex_id,
00935                              title_in.c_str(),
00936                              this->num_dim,
00937                              this->num_nodes,
00938                              this->num_elem,
00939                              this->num_elem_blk,
00940                              this->num_node_sets,
00941                              this->num_side_sets);
00942 
00943   check_err(ex_err, "Error initializing new Nemesis file.");
00944 }

void libMesh::ExodusII_IO_Helper::write_global_values ( const std::vector< Number > &  values,
int  timestep 
) [inherited]

Writes the vector of global variables.

Definition at line 1582 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_glob_vars(), ex_update(), libMesh::ExodusII_IO_Helper::num_globals, and libMesh::processor_id().

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

01583 {
01584   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01585     return;
01586 
01587   ex_err = exII::ex_put_glob_vars(ex_id, timestep, num_globals, &values[0]);
01588   check_err(ex_err, "Error writing global values.");
01589 
01590   ex_err = exII::ex_update(ex_id);
01591   check_err(ex_err, "Error flushing buffers to file.");
01592 }

void libMesh::ExodusII_IO_Helper::write_information_records ( const std::vector< std::string > &  records  )  [inherited]

Writes the vector of information records.

Definition at line 1551 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_err(), libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_info(), ex_update(), and libMesh::processor_id().

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

01552 {
01553   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01554     return;
01555 
01556   int num_records = records.size();
01557   std::vector<char*> info(num_records);
01558 
01559   // This is an abuse of the const char* returned by std::string, we trust that Exodus won't
01560   // modify these when it's writing them out...
01561   for (unsigned i=0; i<records.size(); ++i)
01562   {
01563     // Records cannot be longer than MAX_LINE_LENGTH, as defined in exodusII.h
01564     if (records[i].size() > MAX_LINE_LENGTH)
01565       {
01566         libMesh::err << "Error, cannot write records longer than " << MAX_LINE_LENGTH << " characters!" << std::endl;
01567         libmesh_error();
01568       }
01569 
01570     info[i] = const_cast<char*>(records[i].c_str());
01571   }
01572 
01573   ex_err = exII::ex_put_info(ex_id, num_records, &info[0]);
01574   check_err(ex_err, "Error writing global values.");
01575 
01576   ex_err = exII::ex_update(ex_id);
01577   check_err(ex_err, "Error flushing buffers to file.");
01578 }

void libMesh::Nemesis_IO_Helper::write_nodal_coordinates ( const MeshBase mesh  )  [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 2278 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_coord(), ex_put_node_num_map(), 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().

02279 {
02280   // Make sure that the reference passed in is really a ParallelMesh
02281   // const ParallelMesh& pmesh = libmesh_cast_ref<const ParallelMesh&>(mesh);
02282 
02283   unsigned local_num_nodes = this->exodus_node_num_to_libmesh.size();
02284 
02285   x.resize(local_num_nodes);
02286   y.resize(local_num_nodes);
02287   z.resize(local_num_nodes);
02288 
02289   // Just loop over our list outputing the nodes the way we built the map
02290   for (unsigned int i=0; i<local_num_nodes; ++i)
02291   {
02292     const Node & node = *mesh.node_ptr(this->exodus_node_num_to_libmesh[i]);
02293     x[i]=node(0);
02294     y[i]=node(1);
02295     z[i]=node(2);
02296   }
02297 
02298   if (local_num_nodes)
02299     {
02300       // Call Exodus API to write nodal coordinates...
02301       ex_err = exII::ex_put_coord(ex_id, &x[0], &y[0], &z[0]);
02302       check_err(ex_err, "Error writing node coordinates");
02303 
02304       // And write the nodal map we created for them
02305       ex_err = exII::ex_put_node_num_map(ex_id, &(this->exodus_node_num_to_libmesh[0]));
02306       check_err(ex_err, "Error writing node num map");
02307     }
02308   else // Does the Exodus API want us to write empty nodal coordinates?
02309     {
02310       ex_err = exII::ex_put_coord(ex_id, NULL, NULL, NULL);
02311       check_err(ex_err, "Error writing empty node coordinates");
02312 
02313       ex_err = exII::ex_put_node_num_map(ex_id, NULL);
02314       check_err(ex_err, "Error writing empty node num map");
02315     }
02316 }

void libMesh::ExodusII_IO_Helper::write_nodal_coordinates_discontinuous ( const MeshBase mesh  )  [inherited]

Writes the nodal coordinates contained in "mesh"

Definition at line 958 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::MeshBase::active_elements_begin(), libMesh::MeshBase::active_elements_end(), libMesh::ExodusII_IO_Helper::check_err(), end, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_coord(), libMesh::ExodusII_IO_Helper::num_nodes, libMesh::processor_id(), libMesh::ExodusII_IO_Helper::x, libMesh::ExodusII_IO_Helper::y, and libMesh::ExodusII_IO_Helper::z.

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

00959 {
00960   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
00961     return;
00962 
00963   x.resize(num_nodes);
00964   y.resize(num_nodes);
00965   z.resize(num_nodes);
00966 
00967   MeshBase::const_element_iterator       it  = mesh.active_elements_begin();
00968   const MeshBase::const_element_iterator end = mesh.active_elements_end();
00969 
00970   unsigned int i = 0;
00971   for ( ; it != end; ++it)
00972         for (unsigned int n=0; n<(*it)->n_nodes(); n++)
00973     {
00974       x[i]=(*it)->point(n)(0);
00975 #if LIBMESH_DIM > 1
00976       y[i]=(*it)->point(n)(1);
00977 #else
00978       y[i]=0.;
00979 #endif
00980 #if LIBMESH_DIM > 2
00981       z[i]=(*it)->point(n)(2);
00982 #else
00983       z[i]=0.;
00984 #endif
00985       i++;
00986     }
00987 
00988   ex_err = exII::ex_put_coord(ex_id,
00989                               x.empty() ? NULL : &x[0],
00990                               y.empty() ? NULL : &y[0],
00991                               z.empty() ? NULL : &z[0]);
00992 
00993   check_err(ex_err, "Error writing coordinates to Exodus file.");
00994 }

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 2388 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::exodus_node_num_to_libmesh, libMesh::ExodusII_IO_Helper::num_nodes, and libMesh::ExodusII_IO_Helper::write_nodal_values().

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

02389 {
02390   int num_vars = names.size();
02391   //int num_values = values.size(); // Not used?
02392 
02393   for (int c=0; c<num_vars; c++)
02394   {
02395     std::vector<Number> cur_soln(num_nodes);
02396 
02397     //Copy out this variable's solution
02398     for(int i=0; i<num_nodes; i++)
02399       cur_soln[i] = values[this->exodus_node_num_to_libmesh[i]*num_vars + c];
02400 
02401     write_nodal_values(c+1,cur_soln,timestep);
02402   }
02403 }

void libMesh::ExodusII_IO_Helper::write_nodal_values ( int  var_id,
const std::vector< Number > &  values,
int  timestep 
) [inherited]

Writes the vector of values to a nodal variable.

Definition at line 1537 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_nodal_var(), ex_update(), libMesh::ExodusII_IO_Helper::num_nodes, and libMesh::processor_id().

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

01538 {
01539   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01540     return;
01541 
01542   ex_err = exII::ex_put_nodal_var(ex_id, timestep, var_id, num_nodes, &values[0]);
01543   check_err(ex_err, "Error writing nodal values.");
01544 
01545   ex_err = exII::ex_update(ex_id);
01546   check_err(ex_err, "Error flushing buffers to file.");
01547 }

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 1990 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::MeshBase::boundary_info, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_node_set(), ex_put_node_set_param(), global_nodeset_ids, libMesh::ExodusII_IO_Helper::libmesh_node_num_to_exodus, libMesh::out, and libMesh::processor_id().

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

01991 {
01992   // Write the nodesets.  In Nemesis, the idea is to "create space" for the global
01993   // set of boundary nodesets, but to only write node IDs which are local to the current
01994   // processor.  This is what is done in Nemesis files created by the "loadbal" script.
01995 
01996   // Store a map of vectors for boundary node IDs on this processor.
01997   // Use a vector of int here so it can be passed directly to Exodus.
01998   std::map<boundary_id_type, std::vector<int> > local_node_boundary_id_lists;
01999   typedef std::map<boundary_id_type, std::vector<int> >::iterator local_node_boundary_id_lists_iterator;
02000 
02001   // FIXME: We should build this list only one time!!  We already built it above, but we
02002   // did not have the libmesh to exodus node mapping at that time... for now we'll just
02003   // build it here again, hopefully it's small relative to the size of the entire mesh.
02004   std::vector<dof_id_type> boundary_node_list;
02005   std::vector<boundary_id_type> boundary_node_boundary_id_list;
02006   mesh.boundary_info->build_node_list(boundary_node_list, boundary_node_boundary_id_list);
02007 
02008   if (_verbose)
02009     {
02010       libMesh::out << "[" << libMesh::processor_id() << "] boundary_node_list.size()="
02011                    << boundary_node_list.size() << std::endl;
02012       libMesh::out << "[" << libMesh::processor_id() << "] (boundary_node_id, boundary_id) = ";
02013       for (unsigned i=0; i<boundary_node_list.size(); ++i)
02014         {
02015           libMesh::out << "(" << boundary_node_list[i] << ", " << boundary_node_boundary_id_list[i] << ") ";
02016         }
02017       libMesh::out << std::endl;
02018     }
02019 
02020   // For each node in the node list, add it to the vector of node IDs for that
02021   // set for the local processor.  This will be used later when writing Exodus
02022   // nodesets.
02023   for (unsigned i=0; i<boundary_node_list.size(); ++i)
02024     {
02025       // Don't try to grab a reference to the vector unless the current node is attached
02026       // to a local element.  Otherwise, another processor will be responsible for writing it in its nodeset.
02027       std::map<int, int>::iterator it = this->libmesh_node_num_to_exodus.find( boundary_node_list[i] );
02028 
02029       if ( it != this->libmesh_node_num_to_exodus.end() )
02030         {
02031           // Get reference to the vector where this node ID will be inserted.  If it
02032           // doesn't yet exist, this will create it.
02033           std::vector<int>& current_id_set = local_node_boundary_id_lists[ boundary_node_boundary_id_list[i] ];
02034 
02035           // Push back Exodus-mapped node ID for this set
02036           // TODO: reserve space in these vectors somehow.
02037           current_id_set.push_back( (*it).second );
02038         }
02039     }
02040 
02041   // See what we got
02042   if (_verbose)
02043     {
02044       for(std::map<boundary_id_type, std::vector<int> >::iterator it = local_node_boundary_id_lists.begin();
02045           it != local_node_boundary_id_lists.end();
02046           ++it)
02047         {
02048           libMesh::out << "[" << libMesh::processor_id() << "] ID: " << (*it).first << ", ";
02049 
02050           std::vector<int>& current_id_set = (*it).second;
02051 
02052           // Libmesh node ID (Exodus Node ID)
02053           for (unsigned j=0; j<current_id_set.size(); ++j)
02054             libMesh::out << current_id_set[j]
02055                          << ", ";
02056 
02057           libMesh::out << std::endl;
02058         }
02059     }
02060 
02061   // Loop over *global* nodeset IDs, call the Exodus API.  Note that some nodesets may be empty
02062   // for a given processor.
02063   for (unsigned i=0; i<this->global_nodeset_ids.size(); ++i)
02064     {
02065       if (_verbose)
02066         {
02067           libMesh::out << "[" << libMesh::processor_id()
02068                        << "] Writing out Exodus nodeset info for ID: " << global_nodeset_ids[i] << std::endl;
02069         }
02070 
02071       // Convert current global_nodeset_id into an exodus ID, which can't be zero...
02072       int exodus_id = global_nodeset_ids[i];
02073 
02074 /*
02075       // Exodus can't handle zero nodeset IDs (?)  Use max short here since
02076       // when libmesh reads it back in, it will want to store it as a short...
02077       if (exodus_id==0)
02078         exodus_id = std::numeric_limits<short>::max();
02079 */
02080 
02081       // Try to find this boundary ID in the local list we created
02082       local_node_boundary_id_lists_iterator it =
02083         local_node_boundary_id_lists.find(this->global_nodeset_ids[i]);
02084 
02085       // No nodes found for this boundary ID on this processor
02086       if (it == local_node_boundary_id_lists.end())
02087         {
02088           if (_verbose)
02089             libMesh::out << "[" << libMesh::processor_id()
02090                          << "] No nodeset data for ID: " << global_nodeset_ids[i]
02091                          << " on this processor." << std::endl;
02092 
02093           // Call the Exodus interface to write the parameters of this node set
02094           this->ex_err = exII::ex_put_node_set_param(this->ex_id,
02095                                                      exodus_id,
02096                                                      0, /* No nodes for this ID */
02097                                                      0  /* No distribution factors */);
02098           this->check_err(this->ex_err, "Error writing nodeset parameters in Nemesis");
02099 
02100         }
02101       else // Boundary ID *was* found in list
02102         {
02103           // Get reference to the vector of node IDs
02104           std::vector<int>& current_nodeset_ids = (*it).second;
02105 
02106           // Call the Exodus interface to write the parameters of this node set
02107           this->ex_err = exII::ex_put_node_set_param(this->ex_id,
02108                                                      exodus_id,
02109                                                      current_nodeset_ids.size(),
02110                                                      0  /* No distribution factors */);
02111 
02112           this->check_err(this->ex_err, "Error writing nodeset parameters in Nemesis");
02113 
02114           // Call Exodus interface to write the actual node IDs for this boundary ID
02115           this->ex_err = exII::ex_put_node_set(this->ex_id,
02116                                                exodus_id,
02117                                                &current_nodeset_ids[0]);
02118 
02119           this->check_err(this->ex_err, "Error writing nodesets in Nemesis");
02120 
02121         }
02122     } // end loop over global nodeset IDs
02123 }

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 2128 of file nemesis_io_helper.C.

References libMesh::ExodusII_IO_Helper::_verbose, libMesh::Elem::active_family_tree_by_side(), libMesh::ExodusII_IO_Helper::ElementMaps::assign_conversion(), libMesh::MeshBase::boundary_info, libMesh::ExodusII_IO_Helper::check_err(), libMesh::MeshBase::elem(), libMesh::err, libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_side_set(), ex_put_side_set_param(), libMesh::ExodusII_IO_Helper::Conversion::get_inverse_side_map(), global_sideset_ids, libMesh::ExodusII_IO_Helper::libmesh_elem_num_to_exodus, libMesh::out, libMesh::processor_id(), and libMesh::DofObject::processor_id().

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

02129 {
02130   // Write the sidesets.  In Nemesis, the idea is to "create space" for the global
02131   // set of boundary sidesets, but to only write sideset IDs which are local to the current
02132   // processor.  This is what is done in Nemesis files created by the "loadbal" script.
02133   // See also: ExodusII_IO_Helper::write_sidesets()...
02134 
02135 
02136   // Store a map of vectors for boundary side IDs on this processor.
02137   // Use a vector of int here so it can be passed directly to Exodus.
02138   std::map<boundary_id_type, std::vector<int> > local_elem_boundary_id_lists;
02139   std::map<boundary_id_type, std::vector<int> > local_elem_boundary_id_side_lists;
02140   typedef std::map<boundary_id_type, std::vector<int> >::iterator local_elem_boundary_id_lists_iterator;
02141 
02142   ExodusII_IO_Helper::ElementMaps em;
02143 
02144   // FIXME: We already built this list once, we should reuse that information!
02145   std::vector< dof_id_type > bndry_elem_list;
02146   std::vector< unsigned short int > bndry_side_list;
02147   std::vector< boundary_id_type > bndry_id_list;
02148 
02149   mesh.boundary_info->build_side_list(bndry_elem_list, bndry_side_list, bndry_id_list);
02150 
02151   // Integer looping, skipping non-local elements
02152   for (unsigned i=0; i<bndry_elem_list.size(); ++i)
02153     {
02154       // Get pointer to current Elem
02155       const Elem* elem = mesh.elem(bndry_elem_list[i]);
02156 
02157       // If element is local, process it
02158       if (elem->processor_id() == libMesh::processor_id())
02159         {
02160           std::vector<const Elem*> family;
02161 #ifdef LIBMESH_ENABLE_AMR
02162           // We need to build up active elements if AMR is enabled and add
02163           // them to the exodus sidesets instead of the potentially inactive "parent" elements
02164           // Technically we don't need to "reset" the tree since the vector was just created.
02165           elem->active_family_tree_by_side(family, bndry_side_list[i], /*reset tree=*/false);
02166 #else
02167           // If AMR is not even enabled, just push back the element itself
02168           family.push_back( elem );
02169 #endif
02170 
02171           // Loop over all the elements in the family tree, store their converted IDs
02172           // and side IDs to the map's vectors.  TODO: Somehow reserve enough space for these
02173           // push_back's...
02174           for(unsigned int j=0; j<family.size(); ++j)
02175             {
02176               const ExodusII_IO_Helper::Conversion conv = em.assign_conversion(mesh.elem(family[j]->id())->type());
02177 
02178               // Use the libmesh to exodus datastructure map to get the proper sideset IDs
02179               // The datastructure contains the "collapsed" contiguous ids.
02180               //
02181               // We know the parent element is local, but let's be absolutely sure that all the children have been
02182               // actually mapped to Exodus IDs before we blindly try to add them...
02183               std::map<int,int>::iterator it = this->libmesh_elem_num_to_exodus.find( family[j]->id() );
02184               if (it != this->libmesh_elem_num_to_exodus.end())
02185                 {
02186                   local_elem_boundary_id_lists[ bndry_id_list[i] ].push_back( (*it).second );
02187                   local_elem_boundary_id_side_lists[ bndry_id_list[i] ].push_back(conv.get_inverse_side_map( bndry_side_list[i] ));
02188                 }
02189               else
02190                 {
02191                   libMesh::err << "Error, no Exodus mapping for Elem "
02192                                << family[j]->id()
02193                                << " on processor "
02194                                << libMesh::processor_id()
02195                                << std::endl;
02196                   libmesh_error();
02197                 }
02198             }
02199         }
02200     }
02201 
02202 
02203   // Loop over *global* sideset IDs, call the Exodus API.  Note that some sidesets may be empty
02204   // for a given processor.
02205   for (unsigned i=0; i<this->global_sideset_ids.size(); ++i)
02206     {
02207       if (_verbose)
02208         {
02209           libMesh::out << "[" << libMesh::processor_id()
02210                        << "] Writing out Exodus sideset info for ID: " << global_sideset_ids[i] << std::endl;
02211         }
02212 
02213       // Convert current global_sideset_id into an exodus ID, which can't be zero...
02214       int exodus_id = global_sideset_ids[i];
02215 
02216 /*
02217       // Exodus can't handle zero sideset IDs (?)  Use max short here since
02218       // when libmesh reads it back in, it will want to store it as a short...
02219       if (exodus_id==0)
02220         exodus_id = std::numeric_limits<short>::max();
02221 */
02222 
02223       // Try to find this boundary ID in the local list we created
02224       local_elem_boundary_id_lists_iterator it =
02225         local_elem_boundary_id_lists.find(this->global_sideset_ids[i]);
02226 
02227       // No sides found for this boundary ID on this processor
02228       if (it == local_elem_boundary_id_lists.end())
02229         {
02230           if (_verbose)
02231             libMesh::out << "[" << libMesh::processor_id()
02232                          << "] No sideset data for ID: " << global_sideset_ids[i]
02233                          << " on this processor." << std::endl;
02234 
02235           // Call the Exodus interface to write the parameters of this side set
02236           this->ex_err = exII::ex_put_side_set_param(this->ex_id,
02237                                                      exodus_id,
02238                                                      0, /* No sides for this ID */
02239                                                      0  /* No distribution factors */);
02240           this->check_err(this->ex_err, "Error writing sideset parameters in Nemesis");
02241 
02242         }
02243       else // Boundary ID *was* found in list
02244         {
02245           // Get iterator to sides vector as well
02246           local_elem_boundary_id_lists_iterator it_sides =
02247             local_elem_boundary_id_side_lists.find(this->global_sideset_ids[i]);
02248 
02249           libmesh_assert (it_sides != local_elem_boundary_id_side_lists.end());
02250 
02251           // Get reference to the vector of elem IDs
02252           std::vector<int>& current_sideset_elem_ids = (*it).second;
02253 
02254           // Get reference to the vector of side IDs
02255           std::vector<int>& current_sideset_side_ids = (*it_sides).second;
02256 
02257           // Call the Exodus interface to write the parameters of this side set
02258           this->ex_err = exII::ex_put_side_set_param(this->ex_id,
02259                                                      exodus_id,
02260                                                      current_sideset_elem_ids.size(),
02261                                                      0  /* No distribution factors */);
02262 
02263           this->check_err(this->ex_err, "Error writing sideset parameters in Nemesis");
02264 
02265           // Call Exodus interface to write the actual side IDs for this boundary ID
02266           this->ex_err = exII::ex_put_side_set(this->ex_id,
02267                                                exodus_id,
02268                                                &current_sideset_elem_ids[0],
02269                                                &current_sideset_side_ids[0]);
02270 
02271           this->check_err(this->ex_err, "Error writing sidesets in Nemesis");
02272         }
02273     } // end for loop over global sideset IDs
02274 }

void libMesh::ExodusII_IO_Helper::write_timestep ( int  timestep,
Real  time 
) [inherited]

Writes the time for the timestep

Definition at line 1470 of file exodusII_io_helper.C.

References libMesh::ExodusII_IO_Helper::_run_only_on_proc0, libMesh::ExodusII_IO_Helper::check_err(), libMesh::ExodusII_IO_Helper::ex_err, libMesh::ExodusII_IO_Helper::ex_id, ex_put_time(), ex_update(), and libMesh::processor_id().

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

01471 {
01472   if ((_run_only_on_proc0) && (libMesh::processor_id() != 0))
01473     return;
01474 
01475   ex_err = exII::ex_put_time(ex_id, timestep, &time);
01476   check_err(ex_err, "Error writing timestep.");
01477 
01478   ex_err = exII::ex_update(ex_id);
01479   check_err(ex_err, "Error flushing buffers to file.");
01480 }


Member Data Documentation

If true, use the Mesh's dimension (as determined by the dimension of the elements comprising the mesh) instead of the mesh's spatial dimension, when writing. By default this is false.

Definition at line 711 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), and libMesh::ExodusII_IO_Helper::use_mesh_dimension_instead_of_spatial_dimension().

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 391 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 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::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 531 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 513 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 515 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 514 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 458 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 451 of file nemesis_io_helper.h.

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

std::vector<int> libMesh::ExodusII_IO_Helper::elem_num_map [inherited]

Definition at line 626 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::close(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_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_header(), 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::Nemesis_IO::write(), libMesh::ExodusII_IO_Helper::write_element_values(), write_elements(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elements_discontinuous(), write_exodus_initialization_info(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO_Helper::write_information_records(), write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_timestep(), and ~Nemesis_IO_Helper().

Definition at line 625 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::close(), create(), libMesh::ExodusII_IO_Helper::create(), get_cmap_params(), get_eb_info_global(), get_elem_cmap(), get_elem_map(), get_init_global(), get_init_info(), get_loadbal_param(), libMesh::ExodusII_IO_Helper::get_nodal_var_names(), libMesh::ExodusII_IO_Helper::get_nodal_var_values(), get_node_cmap(), get_node_map(), get_ns_param_global(), get_ss_param_global(), libMesh::ExodusII_IO_Helper::get_time_steps(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_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_header(), 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::Nemesis_IO::write(), libMesh::ExodusII_IO_Helper::write_element_values(), write_elements(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elements_discontinuous(), write_exodus_initialization_info(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO_Helper::write_information_records(), write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_timestep(), and ~Nemesis_IO_Helper().

Definition at line 654 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::open().

Definition at line 667 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 343 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 374 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 364 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 352 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::map<int, std::string> libMesh::ExodusII_IO_Helper::id_to_block_names [inherited]

Maps of Ids to named entities

Definition at line 695 of file exodusII_io_helper.h.

Referenced by libMesh::ExodusII_IO_Helper::get_block_name(), and libMesh::ExodusII_IO_Helper::read_block_info().

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

A set of internal elem IDs for this processor.

Definition at line 563 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 558 of file nemesis_io_helper.h.

Referenced by compute_internal_and_border_elems_and_internal_nodes(), and compute_node_maps().

Map of all node numbers connected to local node numbers to their exodus numbering.

The exodus numbers are stored in here starting with 1

Definition at line 674 of file exodusII_io_helper.h.

Referenced by build_element_and_node_maps(), compute_node_communication_maps(), compute_node_maps(), and write_nodesets().

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

Definition at line 525 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 490 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 504 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 474 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 481 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 467 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 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().

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 408 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 442 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 415 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 421 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 401 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 435 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 319 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 329 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 336 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 548 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 538 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 385 of file nemesis_io_helper.h.

Referenced by build_element_and_node_maps(), and write_elements().

Definition at line 679 of file exodusII_io_helper.h.

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


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:30 UTC

Hosted By:
SourceForge.net Logo