/usr/include/libmesh/nemesis_io_helper.h is in libmesh-dev 0.7.1-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | // $Id: nemesis_io_helper.h 4335 2011-04-11 19:52:03Z jwpeterson $
// The libMesh Finite Element Library.
// Copyright (C) 2002-2008 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __nemesis_io_helper_h__
#define __nemesis_io_helper_h__
#include "libmesh_config.h"
#if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API)
#include <vector>
#include "exodusII_io_helper.h"
namespace libMesh
{
// The Nemesis API header file. Should already be
// correctly extern C'd but it doesn't hurt :)
namespace Nemesis {
extern "C" {
#include "ne_nemesisI.h"
}
}
/**
* This is the \p 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.
*/
class Nemesis_IO_Helper : public ExodusII_IO_Helper
{
public:
/**
* Constructor.
*/
Nemesis_IO_Helper(bool verbose=false);
/**
* Destructor.
*/
~Nemesis_IO_Helper();
// /**
// * Set the flag indicationg if we should be verbose.
// */
// void verbose (bool set_verbosity);
// Member 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...
void get_init_global();
/**
* Fills: global_sideset_ids, num_global_side_counts, num_global_side_df_counts
* Call after: get_init_global()
* Call before:
*/
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();
// Member data
// /**
// * Instance of the Exodus IO Helper. We call the Exodus API through
// * this object. Instead of creating forwarding functions for
// * everything in the ExodusII_IO_Helper class, just call them
// * directly through this object!
// */
// ExodusII_IO_Helper ex2helper;
/**
* All (?) Nemesis functions return an int. If it's negative that signals an error!
* Internally, we use the ExodusII_IO_Helper::check_err() function to check for errors.
*/
int nemesis_err_flag;
/**
* Global initial information. The names are self-explanatory
* for the most part. Used with Nemesis::ne_get_init_global().
*/
int num_nodes_global;
int num_elems_global;
int num_elem_blks_global;
int num_node_sets_global;
int num_side_sets_global;
/**
* The number of processors for which the NEMESIS I file was created.
* To be used with Nemesis::ne_get_init_info().
*/
int num_proc;
/**
* 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().
*/
int num_proc_in_file;
/**
* 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().
*/
char ftype;
/**
* 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
*/
std::vector<int> global_sideset_ids;
std::vector<int> num_global_side_counts;
std::vector<int> num_global_side_df_counts;
/**
* 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
*/
std::vector<int> global_nodeset_ids;
std::vector<int> num_global_node_counts;
std::vector<int> num_global_node_df_counts;
/**
* 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().
*/
std::vector<int> global_elem_blk_ids;
std::vector<int> global_elem_blk_cnts;
/**
* 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.
*/
int num_internal_nodes;
/**
* 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.
*/
int num_border_nodes;
/**
* 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.
*/
int num_external_nodes;
/**
* The number of internal FEM elements. Elements local to this processor.
* To be used with the Nemesis::ne_get_loadbal_param() routine.
*/
int num_internal_elems;
/**
* 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.
*/
int num_border_elems;
/**
* The number of nodal communication maps for this processor. (One
* per neighboring proc?)
* To be used with the Nemesis::ne_get_loadbal_param() routine.
*/
int num_node_cmaps;
/**
* The number of elemental communication maps for this
* processor. (One per neighboring proc?)
* To be used with the Nemesis::ne_get_loadbal_param() routine.
*/
int num_elem_cmaps;
/**
* Vector which stores internal element IDs. Will have length
* num_internal_elems.
* To be used with Nemesis::ne_get_elem_map().
*/
std::vector<int> elem_mapi;
/**
* Vector which stores border element IDs. Will have length
* num_border_elems.
* To be used with Nemesis::ne_get_elem_map().
*/
std::vector<int> elem_mapb;
/**
* Vector which stores internal node IDs. Will have length
* num_internal_nodes.
* To be used with Nemesis::ne_get_node_map().
*/
std::vector<int> node_mapi;
/**
* Vector which stores border node IDs. Will have length
* num_border_nodes.
* To be used with Nemesis::ne_get_node_map().
*/
std::vector<int> node_mapb;
/**
* Vector which stores external node IDs. Will have length
* num_external_nodes.
* To be used with Nemesis::ne_get_node_map().
*/
std::vector<int> node_mape;
/**
* 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().
*/
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;
/**
* 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...
*/
std::vector<std::vector<int> > node_cmap_node_ids;
std::vector<std::vector<int> > node_cmap_proc_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().
*/
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;
private:
// bool _verbose;
};
} // namespace libMesh
#endif // #if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API)
#endif // #ifndef __nemesis_io_helper_h__
|