Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFC_Window_base Class Reference

A window is a collection of panes. More...

#include <RFC_Window_base.h>

Inheritance diagram for RFC_Window_base:
Collaboration diagram for RFC_Window_base:

Public Types

typedef RFC_Window_base Self
 
typedef COM::Window Base
 
typedef COM::Attribute Attribute
 
typedef RFC_Pane_base Pane
 
typedef std::map< int, Pane * > Pane_set
 

Public Member Functions

 RFC_Window_base (Base *b, int c, MPI_Comm)
 Construct an object with base b and color c. More...
 
virtual ~RFC_Window_base ()
 Default destructor. More...
 
std::string name () const
 The name of the window. More...
 
const RFC_Pane_basepane (const int pid) const
 
RFC_Pane_basepane (const int pid)
 
const COM::Window * base () const
 Get a reference to the base COM::Window object. More...
 
int color () const
 The color of the window for overlay or for data transfer (BLUE or GREEN). More...
 
int size_of_nodes () const
 Get the total number of nodes contained the window. More...
 
int size_of_faces () const
 Get the total number of faces contained the window. More...
 
int size_of_primary_nodes () const
 Get the total number of nodes contained the window. More...
 
Bbox_3 get_bounding_box () const
 Get the bounding box of the window. More...
 
int size_of_panes () const
 Number of local panes in the window. More...
 
const Attributeattribute (const char *f) const
 Retrieve an attribute object from the base using the attribute name. More...
 
void export_window (RFC_Window_base *) const
 
void write_tec_ascii (const char *prefix) const
 Ouptut a mesh in Tecplot format. More...
 
void write_tec_sub (const char *prefix) const
 Ouptut a subdivision of a mesh in Tecplot format. More...
 
void new_sdv_attributes (const std::string &wname) const
 New attributes. More...
 
void read_sdv (const char *prefix, const char *format=NULL)
 Read in local panes in native binary format or using Rocin. More...
 
void write_sdv (const char *prefix, const char *format=NULL) const
 Write out panes in native binary format or using Rocout. More...
 
void build_pc_tables ()
 Build the pane connectivity table. More...
 

Protected Types

enum  { SDV_BINARY, SDV_HDF, SDV_CGNS }
 

Static Protected Member Functions

static std::string get_sdv_fname (const char *prefix, int pane_id, const int format=SDV_BINARY)
 
static const char * get_prefix_base (const char *prefix)
 
static int get_sdv_format (const char *format)
 

Protected Attributes

Base_base
 A reference to its base COM::Window object. More...
 
Pane_set _pane_set
 The set of panes contained in the window. More...
 
int _verbose
 
int _color
 
MAP::Pane_communicator _map_comm
 

Static Protected Attributes

static const char * _bufwin_prefix = "buf_"
 

Private Member Functions

 RFC_Window_base ()
 
 RFC_Window_base (const Self &)
 
Selfoperator= (const Self &)
 

Detailed Description

A window is a collection of panes.

See Also
RFC_Pane_base

Definition at line 527 of file RFC_Window_base.h.

Member Typedef Documentation

typedef COM::Attribute Attribute

Definition at line 531 of file RFC_Window_base.h.

typedef COM::Window Base

Definition at line 530 of file RFC_Window_base.h.

Definition at line 532 of file RFC_Window_base.h.

typedef std::map< int, Pane*> Pane_set

Definition at line 533 of file RFC_Window_base.h.

Definition at line 529 of file RFC_Window_base.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
SDV_BINARY 
SDV_HDF 
SDV_CGNS 

Definition at line 603 of file RFC_Window_base.h.

Constructor & Destructor Documentation

RFC_Window_base ( Base b,
int  c,
MPI_Comm  comm 
)

Construct an object with base b and color c.

See Also
init

Definition at line 247 of file RFC_Window_base.C.

248  : _base(b), _verbose(1), _color(c), _map_comm( b, comm) {}
MAP::Pane_communicator _map_comm
Base * _base
A reference to its base COM::Window object.
~RFC_Window_base ( )
virtual

Default destructor.

Definition at line 249 of file RFC_Window_base.C.

References _pane_set.

249  {
250  while ( !_pane_set.empty()) {
251  delete _pane_set.begin()->second;
252  _pane_set.erase( _pane_set.begin());
253  }
254 }
Pane_set _pane_set
The set of panes contained in the window.
RFC_Window_base ( )
private
RFC_Window_base ( const Self )
private

Member Function Documentation

const Attribute* attribute ( const char *  f) const
inline

Retrieve an attribute object from the base using the attribute name.

Definition at line 580 of file RFC_Window_base.h.

References _base.

Referenced by RFC_Data_const< _Tag >::RFC_Data_const(), and RFC_Window_transfer::set_tags().

581  { return _base->attribute(f); }
Base * _base
A reference to its base COM::Window object.

Here is the caller graph for this function:

const COM::Window* base ( ) const
inline

Get a reference to the base COM::Window object.

Definition at line 557 of file RFC_Window_base.h.

References _base.

Referenced by Overlay::get_rfc_window(), Overlay::write_overlay_off(), and Overlay::write_overlay_tec().

557 { return _base; }
Base * _base
A reference to its base COM::Window object.

Here is the caller graph for this function:

void build_pc_tables ( )

Build the pane connectivity table.

Definition at line 290 of file RFC_Window_base.C.

References _base, _map_comm, _pane_set, RFC_Pane_base::build_v2b_from_b2v(), COM_MESH, COM_PCONN, pane(), and s.

Referenced by RFC_Window_overlay::RFC_Window_overlay().

290  {
291  MAP::Pane_connectivity pc( _base->attribute(COM::COM_MESH),
292  _map_comm.mpi_comm());
293  pc.compute_pconn( _base->attribute(COM::COM_PCONN));
294 
295  // Now copy from b2v into the tables of each pane
296  Pane_set::iterator pane_it, pane_iend=_pane_set.end();
297 
298  for ( pane_it=_pane_set.begin(); pane_it != pane_iend; ++pane_it) {
299  const COM::Attribute *pconn =
300  pane_it->second->_base->attribute(COM::COM_PCONN);
301 
302  int count=pc.pconn_offset(), s = pconn->size_of_real_items();
303  const int *buf= ((const int*)pconn->pointer())+count;
304 
305  while ( count < s) {
306  const int r_pid = *buf;
307  const int r_size = *(buf+1);
308  count += 2; buf += 2;
309 
310  Pane::B2v &b2 = pane_it->second->_b2v_table[ r_pid];
311  b2.clear();
312  b2.insert( b2.end(), buf, buf+r_size);
313 
314  count += r_size;
315  buf += r_size;
316  }
317  }
318 
319  // Construct v2b
320  for ( pane_it=_pane_set.begin(); pane_it != pane_iend; ++pane_it) {
321  Pane &pane = *pane_it->second;
322  pane.build_v2b_from_b2v( this);
323  }
324 }
A Pane object contains a mesh, pane attribute, and field variables.
Definition: Pane.h:43
MAP::Pane_communicator _map_comm
double s
Definition: blastest.C:80
const RFC_Pane_base & pane(const int pid) const
Base * _base
A reference to its base COM::Window object.
Pane_set _pane_set
The set of panes contained in the window.
std::vector< int > B2v
From local boundary ids to node ids.

Here is the call graph for this function:

Here is the caller graph for this function:

int color ( ) const
inline

The color of the window for overlay or for data transfer (BLUE or GREEN).

Definition at line 560 of file RFC_Window_base.h.

References _color.

Referenced by RFC_Window_transfer::init_recv_buffer().

560 { return _color; }

Here is the caller graph for this function:

void export_window ( RFC_Window_base w) const

Definition at line 366 of file RFC_Window_base.C.

References RFC_Pane_base::_b2v_table, _pane_set, RFC_Pane_base::_subface_counterparts, RFC_Pane_base::_subface_offsets, RFC_Pane_base::_subface_parents, RFC_Pane_base::_subfaces, RFC_Pane_base::_subnode_counterparts, RFC_Pane_base::_subnode_nat_coors, RFC_Pane_base::_subnode_parents, RFC_Pane_base::_v2b_table, RFC_Pane_base::comp_nat_coors(), RFC_Pane_base::id(), and pane().

Referenced by Overlay::export_windows().

366  {
367 
368  Pane_set::const_iterator pane_it, pane_iend=_pane_set.end();
369 
370  for ( pane_it=_pane_set.begin(); pane_it != pane_iend; ++pane_it) {
371  Pane &pane = *pane_it->second;
372  Pane &to_pane = *w->_pane_set.find( pane.id())->second;
373 
374  // Copy over the nodes information
375  to_pane._subnode_parents = pane._subnode_parents;
376  to_pane._subnode_counterparts = pane._subnode_counterparts;
377  to_pane._subnode_nat_coors = pane._subnode_nat_coors;
378 
379  // Copy over the face information
380  to_pane._subface_offsets = pane._subface_offsets;
381  to_pane._subface_counterparts = pane._subface_counterparts;
382  to_pane._subface_parents = pane._subface_parents;
383  to_pane._subfaces = pane._subfaces;
384 
385  // Copy over the pane connectivity of the vertices
386  to_pane._b2v_table = pane._b2v_table;
387  to_pane._v2b_table = pane._v2b_table;
388 
389  to_pane.comp_nat_coors();
390  }
391 }
A Pane object contains a mesh, pane attribute, and field variables.
Definition: Pane.h:43
const RFC_Pane_base & pane(const int pid) const
Pane_set _pane_set
The set of panes contained in the window.
int id() const
Get the ID of the pane.
Definition: Pane.h:96

Here is the call graph for this function:

Here is the caller graph for this function:

Bbox_3 get_bounding_box ( ) const

Get the bounding box of the window.

Definition at line 281 of file RFC_Window_base.C.

References _pane_set, and iend.

Referenced by Overlay::overlay().

281  {
282  Bbox_3 b;
283  Pane_set::const_iterator it=_pane_set.begin(), iend=_pane_set.end();
284  for ( ; it != iend; ++it)
285  b += it->second->get_bounding_box();
286  return b;
287 }
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
Pane_set _pane_set
The set of panes contained in the window.

Here is the caller graph for this function:

const char * get_prefix_base ( const char *  prefix)
staticprotected

Definition at line 456 of file RFC_Window_base_IO.C.

Referenced by RFC_Window_transfer::init_recv_buffer(), read_sdv(), and write_sdv().

457 {
458  const char *last_slash = std::strrchr( prefix, '/');
459 
460  if ( last_slash == NULL) return prefix;
461  else return last_slash+1;
462 }

Here is the caller graph for this function:

std::string get_sdv_fname ( const char *  prefix,
int  pane_id,
const int  format = SDV_BINARY 
)
staticprotected

Definition at line 479 of file RFC_Window_base_IO.C.

References COM_assertion_msg, SDV_BINARY, SDV_CGNS, and SDV_HDF.

Referenced by RFC_Window_transfer::init_recv_buffer(), read_sdv(), and write_sdv().

480 {
481  // Define a file name name
482  std::ostringstream fname;
483 
484 
485  switch (format) {
486  case SDV_BINARY: fname << prefix << pane_id << ".sdv"; break;
487  case SDV_HDF: fname << prefix << '_' << pane_id << "_sdv.hdf"; break;
488  case SDV_CGNS: fname << prefix << '_' << pane_id << "_sdv.cgns"; break;
489  default: COM_assertion_msg( false, "Unknown file format");
490  }
491 
492  return fname.str();
493 }
#define COM_assertion_msg(EX, msg)

Here is the caller graph for this function:

int get_sdv_format ( const char *  format)
staticprotected

Definition at line 465 of file RFC_Window_base_IO.C.

References RFC_assertion_msg, SDV_BINARY, SDV_CGNS, and SDV_HDF.

Referenced by read_sdv(), and write_sdv().

466 {
467  if ( !format || std::strcmp( format, "BIN") ==0)
468  return SDV_BINARY;
469  if ( std::strcmp( format, "HDF") ==0)
470  return SDV_HDF;
471  if (std::strcmp( format, "CGNS") ==0)
472  return SDV_CGNS;
473 
474  RFC_assertion_msg( false, (std::string("Unknown format ")+format).c_str());
475  return SDV_BINARY; // Default is SDV_BINARY.
476 }
#define RFC_assertion_msg
Definition: rfc_basic.h:67

Here is the caller graph for this function:

std::string name ( ) const
inline

The name of the window.

Definition at line 542 of file RFC_Window_base.h.

References _base.

Referenced by RFC_Pane_overlay::determine_counterparts(), Overlay::match_features_0(), Transfer_base::minmax(), Overlay::overlay(), and write_sdv().

542 { return _base->name(); }
Base * _base
A reference to its base COM::Window object.

Here is the caller graph for this function:

RFC_BEGIN_NAME_SPACE void new_sdv_attributes ( const std::string &  wname) const

New attributes.

Definition at line 38 of file RFC_Window_base_IO.C.

References COM_FLOAT, COM_INT, and COM_new_attribute().

Referenced by write_sdv().

38  {
39 
40  // New attributes for v2b and b2v.
41  COM_new_attribute( (wname+".v2b").c_str(), 'p', COM_INT, 1, "");
42  COM_new_attribute( (wname+".b2v").c_str(), 'p', COM_INT, 1, "");
43 
44  // New attributes for subnode parents
45  COM_new_attribute( (wname+".sn_parent_fcID").c_str(), 'n', COM_INT, 1, "");
46  COM_new_attribute( (wname+".sn_parent_ncs").c_str(), 'n', COM_FLOAT, 2, "");
47 
48  // New attributes for natural coordinates
49  COM_new_attribute( (wname+".sn_permu_edID").c_str(), 'n', COM_INT, 1, "");
50  COM_new_attribute( (wname+".sn_permu_ncs").c_str(), 'n', COM_FLOAT, 2, "");
51 
52  // New attributes for counterpart of each subnode
53  COM_new_attribute( (wname+".sn_cntpt_pnID").c_str(), 'n', COM_INT, 1, "");
54  COM_new_attribute( (wname+".sn_cntpt_ndID").c_str(), 'n', COM_INT, 1, "");
55 
56  // New attributes for the mapping from node IDs to sub-node IDs.
57  COM_new_attribute( (wname+".sn_subID").c_str(), 'p', COM_INT, 1, "");
58 
59  // New attributes for the parent of each subface
60  COM_new_attribute( (wname+".sf_parent").c_str(), 'e', COM_INT, 1, "");
61 
62  // Register the natural coordinates of subnodes in each subface
63  COM_new_attribute( (wname+".sf_ncs").c_str(), 'e', COM_FLOAT, 6, "");
64 
65  // New attributes for the counterpart in the other mesh of each subface
66  COM_new_attribute( (wname+".sf_cntpt_pnID").c_str(), 'e', COM_INT, 1, "");
67  COM_new_attribute( (wname+".sf_cntpt_fcID").c_str(), 'e', COM_INT, 1, "");
68 
69  // New attributes for the offset of the subface ID for each input facet
70  COM_new_attribute( (wname+".sf_offset").c_str(), 'p', COM_INT, 1, "");
71 }
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
Definition: roccom_c++.h:118

Here is the call graph for this function:

Here is the caller graph for this function:

Self& operator= ( const Self )
private
const RFC_Pane_base& pane ( const int  pid) const
inline

Definition at line 544 of file RFC_Window_base.h.

References _pane_set, and RFC_assertion.

Referenced by build_pc_tables(), RFC_Pane_base::build_v2b_from_b2v(), export_window(), read_sdv(), write_sdv(), write_tec_ascii(), and write_tec_sub().

544  {
545  Pane_set::const_iterator pit = _pane_set.find( pid);
546  RFC_assertion( pit != _pane_set.end());
547  return *pit->second;
548  }
Pane_set _pane_set
The set of panes contained in the window.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

RFC_Pane_base& pane ( const int  pid)
inline

Definition at line 550 of file RFC_Window_base.h.

References _pane_set, and RFC_assertion.

550  {
551  Pane_set::iterator pit = _pane_set.find( pid);
552  RFC_assertion( pit != _pane_set.end());
553  return *pit->second;
554  }
Pane_set _pane_set
The set of panes contained in the window.
#define RFC_assertion
Definition: rfc_basic.h:65
void read_sdv ( const char *  prefix,
const char *  format = NULL 
)

Read in local panes in native binary format or using Rocin.

Read in panes in native or HDF format. In native format, each pane has a separate file with file name {prefix}paneID.sdv. In HDF format, each pane also has a separate file with file name {prefix}_paneID_sdv.hdf.

See Also
write_sdv

Definition at line 304 of file RFC_Window_base_IO.C.

References _bufwin_prefix, _pane_set, COM_call_function(), COM_delete_window(), COM_get_attribute_handle(), COM_get_function_handle(), get_prefix_base(), get_sdv_fname(), get_sdv_format(), iend, MPI_COMM_SELF, pane(), RFC_Pane_base::read_binary(), RFC_assertion, Rocin_load_module(), Rocin_unload_module(), and SDV_BINARY.

304  {
305 
306  // Determine the format
307  int IO_format = get_sdv_format( format);
308 
309  if ( IO_format == SDV_BINARY) {
310  // Read in native format binary format.
311  for ( Pane_set::iterator
312  it=_pane_set.begin(), iend=_pane_set.end();it!=iend; ++it) {
313  std::string fname = get_sdv_fname( prefix, it->first, IO_format);
314 
315  std::ifstream is( fname.c_str());
316  if ( !is) {
317  std::cerr << "Rocface: Could not open input file " << fname
318  << "\nAbortting..." << std::endl;
319  RFC_assertion(is); exit(-1);
320  }
321 
322  RFC_Pane_base &pane = *it->second;
323  pane.read_binary( is);
324  }
325  }
326  else {
327  // Read in using Rocin.
328  Rocin_load_module( "RFC_IN");
329  int hdl_read = COM_get_function_handle( "RFC_IN.read_windows");
330  int hdl_obtain = COM_get_function_handle( "RFC_IN.obtain_attribute");
331 
332  // Define the base-window and sdv-window names
333  std::string base_material = get_prefix_base( prefix);
334  std::string sdv_material = base_material+"_sdv";
335 
336  std::string buf_wname(_bufwin_prefix); buf_wname.append( base_material);
337  std::string sdv_wname=buf_wname+"_sdv";
338  MPI_Comm comm_self = MPI_COMM_SELF;
339 
340  // Loop through the panes to obtain the attributes.
341  for ( Pane_set::iterator
342  it=_pane_set.begin(), iend=_pane_set.end(); it!=iend; ++it) {
343 
344  int pane_id = it->first;
345  std::string fname = get_sdv_fname( prefix, pane_id, IO_format);
346 
347  // Read the pane from the given file. Note that the file contains both
348  // the parent and the subdivided windows. Read only the subdivided one.
349  COM_call_function( hdl_read, fname.c_str(), _bufwin_prefix,
350  sdv_material.c_str(), &comm_self);
351 
352  int hdl_all = COM_get_attribute_handle( (sdv_wname+".all").c_str());
353  COM_call_function( hdl_obtain, &hdl_all, &hdl_all, &pane_id);
354  it->second->read_rocin( sdv_wname);
355 
356  // Delete the window created by Rocin.
357  COM_delete_window( sdv_wname.c_str());
358  }
359 
360  // Unload Rocin
361  Rocin_unload_module( "RFC_IN");
362  }
363 }
void Rocin_load_module(const char *name)
Load the module Rocin into Roccom using the given module name.
Definition: Rocin.C:3063
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_SELF
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
const RFC_Pane_base & pane(const int pid) const
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
static const char * _bufwin_prefix
The base implementation of RFC_Pane.
void read_binary(std::istream &is, std::vector< int > *b2v_all=NULL, COM::Pane *p=NULL)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
Pane_set _pane_set
The set of panes contained in the window.
static const char * get_prefix_base(const char *prefix)
#define RFC_assertion
Definition: rfc_basic.h:65
static std::string get_sdv_fname(const char *prefix, int pane_id, const int format=SDV_BINARY)
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
void Rocin_unload_module(const char *name)
Unload the module Rocin from Roccom.
Definition: Rocin.C:3066
static int get_sdv_format(const char *format)

Here is the call graph for this function:

int size_of_faces ( ) const

Get the total number of faces contained the window.

Definition at line 269 of file RFC_Window_base.C.

References _pane_set, and n.

Referenced by Overlay::overlay().

269  {
270  int n = 0;
271  // Loop through panes
272  Pane_set::const_iterator pit=_pane_set.begin(), piend=_pane_set.end();
273  for ( ; pit != piend; ++pit) {
274  n += pit->second->size_of_faces();
275  }
276 
277  return n;
278 }
const NT & n
Pane_set _pane_set
The set of panes contained in the window.

Here is the caller graph for this function:

int size_of_nodes ( ) const

Get the total number of nodes contained the window.

The coincident nodes are counted more than once.

Definition at line 257 of file RFC_Window_base.C.

References _pane_set, and n.

Referenced by RFC_Window_transfer::init_nodal_buffers(), and Overlay::overlay().

257  {
258  int n = 0;
259  // Loop through panes
260  Pane_set::const_iterator pit=_pane_set.begin(), piend=_pane_set.end();
261  for ( ; pit != piend; ++pit) {
262  n += pit->second->size_of_primary_nodes();
263  }
264 
265  return n;
266 }
const NT & n
Pane_set _pane_set
The set of panes contained in the window.

Here is the caller graph for this function:

int size_of_panes ( ) const
inline

Number of local panes in the window.

Definition at line 577 of file RFC_Window_base.h.

References _pane_set.

577 { return _pane_set.size(); }
Pane_set _pane_set
The set of panes contained in the window.
int size_of_primary_nodes ( ) const

Get the total number of nodes contained the window.

The coincident nodes are counted once.

void write_sdv ( const char *  prefix,
const char *  format = NULL 
) const

Write out panes in native binary format or using Rocout.

Write panes in native format or using Rocout's format. In native format, each pane has a separate file with file name {prefix}paneID.sdv. In Rocout format, each pane also has a separate file with file name {prefix}_paneID_sdv.<suf>.

See Also
read_sdv

Definition at line 375 of file RFC_Window_base_IO.C.

References _bufwin_prefix, _pane_set, COM_call_function(), COM_delete_pane(), COM_delete_window(), COM_get_attribute_handle(), COM_get_function_handle(), COM_new_window(), COM_window_init_done(), get_prefix_base(), get_sdv_fname(), get_sdv_format(), iend, name(), new_sdv_attributes(), pane(), RFC_assertion, Rocout_load_module(), Rocout_unload_module(), SDV_BINARY, and RFC_Pane_base::write_binary().

375  {
376 
377  // Determine the format
378  int IO_format = get_sdv_format( format);
379 
380  if ( IO_format == SDV_BINARY) {
381  // Output using native file format
382  for ( Pane_set::const_iterator
383  it=_pane_set.begin(), iend=_pane_set.end(); it!=iend; ++it) {
384  std::string fname = get_sdv_fname( prefix, it->first, IO_format);
385 
386  std::ofstream os( fname.c_str());
387  if ( !os) {
388  std::cerr << "Rocface: Could not open output file " << fname
389  << "\nAbortting..." << std::endl;
390  RFC_assertion(os); exit(-1);
391  }
392 
393  RFC_Pane_base &pane = *it->second;
394  pane.write_binary( os);
395  }
396  }
397  else {
398  // Output using Rocout's format
399  Rocout_load_module( "RFC_OUT");
400  int hdl_set_option = COM_get_function_handle( "RFC_OUT.set_option");
401  int hdl_write = COM_get_function_handle( "RFC_OUT.write_attribute");
402 
403  COM_call_function( hdl_set_option, "rankwidth", "0");
404  COM_call_function( hdl_set_option, "format", format);
405 
406  int parent_mesh = COM_get_attribute_handle( (name()+".pmesh").c_str());
407 
408  // Define the base-window and sdv-window names
409  std::string base_material = get_prefix_base( prefix);
410  std::string sdv_material = base_material+"_sdv";
411 
412  std::string buf_wname(_bufwin_prefix); buf_wname.append( base_material);
413  std::string sdv_wname=buf_wname+"_sdv";
414 
415  // Create a window for calling Rocout.
416  COM_new_window( sdv_wname.c_str());
417  new_sdv_attributes( sdv_wname);
418  int win_all = COM_get_attribute_handle( (sdv_wname+".all").c_str());
419 
420  const char *time_level = "000";
421  for ( Pane_set::const_iterator
422  it=_pane_set.begin(), iend=_pane_set.end(); it!=iend; ++it) {
423  int pane_id = it->first;
424 
425  // Define a file name name
426  std::string fname = get_sdv_fname( prefix, pane_id, IO_format);
427 
428  // Initialize the attributes for the subdivision pane
429  it->second->register_sdv_attributes( sdv_wname);
430 
431  // write parent mesh of the given pane into the file
432  COM_call_function( hdl_set_option, "mode", "w");
433  COM_call_function( hdl_write, fname.c_str(), &parent_mesh,
434  base_material.c_str(), time_level,
435  NULL, NULL, &pane_id);
436 
437  // append the subdivision pane into the file.
438  COM_call_function( hdl_set_option, "mode", "a");
439  COM_call_function( hdl_write, fname.c_str(), &win_all,
440  sdv_material.c_str(), time_level,
441  NULL, NULL, &pane_id);
442 
443  // remove the subdivision pane after output it.
444  COM_delete_pane( sdv_wname.c_str(), pane_id);
445  COM_window_init_done( sdv_wname.c_str());
446  }
447 
448  // Unload Rocout
449  COM_delete_window( sdv_wname.c_str());
450  Rocout_unload_module( "RFC_OUT");
451  }
452 }
std::string name() const
The name of the window.
void write_binary(std::ostream &os) const
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
const RFC_Pane_base & pane(const int pid) const
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
static const char * _bufwin_prefix
The base implementation of RFC_Pane.
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
void new_sdv_attributes(const std::string &wname) const
New attributes.
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
Definition: roccom_c++.h:86
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
void Rocout_load_module(const char *name)
Load the module Rocout into Roccom using the given module name.
Definition: Rocout.C:934
Pane_set _pane_set
The set of panes contained in the window.
void COM_delete_pane(const char *str, int pid)
Definition: roccom_c++.h:110
static const char * get_prefix_base(const char *prefix)
#define RFC_assertion
Definition: rfc_basic.h:65
static std::string get_sdv_fname(const char *prefix, int pane_id, const int format=SDV_BINARY)
void Rocout_unload_module(const char *name)
Unload the module Rocout from Roccom.
Definition: Rocout.C:937
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
static int get_sdv_format(const char *format)

Here is the call graph for this function:

void write_tec_ascii ( const char *  prefix) const

Ouptut a mesh in Tecplot format.

Parameters
fnameName of the output file.
aAttribute to be writtin out. Default is mesh only.

Definition at line 253 of file RFC_Window_base_IO_tecplot.C.

References _pane_set, iend, RFC_Pane_base::is_master(), pane(), RFC_assertion, and RFC_Pane_base::write_tec_ascii().

253  {
254  std::ofstream os( (std::string( prefix) + ".plt").c_str()); RFC_assertion(os);
255  os.precision(9);
256  os.setf( std::ios::scientific, std::ios::floatfield);
257  for (Pane_set::const_iterator
258  it=_pane_set.begin(), iend=_pane_set.end(); it != iend; ++it) {
259  RFC_Pane_base &pane = *it->second;
260  if ( pane.is_master()) {
261  pane.write_tec_ascii( os, 0);
262  }
263  }
264 }
void write_tec_ascii(std::ostream &os, const COM::Attribute *attr=0) const
const RFC_Pane_base & pane(const int pid) const
bool is_master() const
Is this pane a master copy?
The base implementation of RFC_Pane.
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
Pane_set _pane_set
The set of panes contained in the window.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

void write_tec_sub ( const char *  prefix) const

Ouptut a subdivision of a mesh in Tecplot format.

Parameters
fnameName of the output file.
aAttribute to be writtin out. Default is mesh only.

Definition at line 235 of file RFC_Window_base_IO_tecplot.C.

References _pane_set, iend, RFC_Pane_base::is_master(), pane(), RFC_assertion, and RFC_Pane_base::write_tec_sub().

235  {
236  std::ofstream os( (std::string( prefix) + ".plt").c_str()); RFC_assertion(os);
237  os.precision(9);
238  os.setf( std::ios::scientific, std::ios::floatfield);
239  for (Pane_set::const_iterator
240  it=_pane_set.begin(), iend=_pane_set.end(); it != iend; ++it) {
241  RFC_Pane_base &pane = *it->second;
242  if ( pane.is_master()) {
243  pane.write_tec_sub( os);
244  }
245  }
246 }
const RFC_Pane_base & pane(const int pid) const
void write_tec_sub(std::ostream &) const
bool is_master() const
Is this pane a master copy?
The base implementation of RFC_Pane.
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
Pane_set _pane_set
The set of panes contained in the window.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Member Data Documentation

Base* _base
protected

A reference to its base COM::Window object.

Definition at line 619 of file RFC_Window_base.h.

Referenced by attribute(), base(), build_pc_tables(), name(), and RFC_Window_transfer::RFC_Window_transfer().

const char * _bufwin_prefix = "buf_"
staticprotected

Definition at line 616 of file RFC_Window_base.h.

Referenced by RFC_Window_transfer::init_recv_buffer(), read_sdv(), and write_sdv().

int _color
protected

Definition at line 622 of file RFC_Window_base.h.

Referenced by color().

int _verbose
protected

Definition at line 621 of file RFC_Window_base.h.


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