Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFC_Window_derived< _Pane > Class Template Reference

Reusable implementation for derived class of RFC_Window_base. More...

#include <RFC_Window_base.h>

Inheritance diagram for RFC_Window_derived< _Pane >:
Collaboration diagram for RFC_Window_derived< _Pane >:

Public Member Functions

const Panepane (const int pid) const
 Get a reference to the pane with give id pid. More...
 
Panepane (const int pid)
 
std::pair< Pane *, int > get_primary (Pane *p, int vid)
 Get a handle to the primary copy of a node contained in the pane p with local id vid. More...
 
std::pair< const Pane *, int > get_primary (const Pane *p, int vid) const
 
void panes (std::vector< Pane * > &ps)
 Get a vector of local panes contained in the window. More...
 
void panes (std::vector< const Pane * > &ps) const
 
- Public Member Functions inherited from RFC_Window_base
 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

typedef RFC_Window_derived< _Pane > Self
 
typedef RFC_Window_base Base
 
typedef _Pane Pane
 
- Protected Types inherited from RFC_Window_base
enum  { SDV_BINARY, SDV_HDF, SDV_CGNS }
 

Protected Member Functions

 RFC_Window_derived (COM::Window *b, int c, MPI_Comm comm)
 A constructor. More...
 
virtual ~RFC_Window_derived ()
 A destructor. More...
 
void init ()
 

Additional Inherited Members

- Public Types inherited from RFC_Window_base
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
 
- Static Protected Member Functions inherited from RFC_Window_base
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 inherited from RFC_Window_base
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 inherited from RFC_Window_base
static const char * _bufwin_prefix = "buf_"
 

Detailed Description

template<class _Pane>
class RFC_Window_derived< _Pane >

Reusable implementation for derived class of RFC_Window_base.

This class provides some template implementation for some useful functions that depends on the specific type of the panes. One usually should derive subclasses of RFC_Window_base by inherit from this class, but it is not required.

Definition at line 108 of file RFC_Window_base.h.

Member Typedef Documentation

typedef RFC_Window_base Base
protected

Definition at line 643 of file RFC_Window_base.h.

typedef _Pane Pane
protected

Definition at line 644 of file RFC_Window_base.h.

typedef RFC_Window_derived<_Pane> Self
protected

Definition at line 642 of file RFC_Window_base.h.

Constructor & Destructor Documentation

RFC_Window_derived ( COM::Window *  b,
int  c,
MPI_Comm  comm 
)
inlineprotected

A constructor.

Definition at line 647 of file RFC_Window_base.h.

647  : Base(b,c, comm)
648  { init(); }
RFC_Window_base Base
~RFC_Window_derived ( )
protectedvirtual

A destructor.

Definition at line 672 of file RFC_Window_base.h.

672 {}

Member Function Documentation

std::pair< _Pane *, int > get_primary ( Pane p,
int  vid 
)

Get a handle to the primary copy of a node contained in the pane p with local id vid.

Definition at line 721 of file RFC_Window_base.h.

References RFC_Pane_base::_b2v_table, RFC_Pane_base::_v2b_table, RFC_Pane_base::id(), RFC_Pane_base::is_border_node(), RFC_Pane_base::is_isolated_node(), Node_ID::node_id, and RFC_assertion.

Referenced by RFC_Pane_overlay::determine_counterparts().

721  {
722  RFC_Pane_base::V2b_table::iterator it;
723 
724  // points to a border halfedge.
725  if ( !p->is_border_node( vid) ||
726  (it = p->_v2b_table.find( vid))==p->_v2b_table.end()) {
727  RFC_assertion( !p->is_isolated_node( vid));
728  return std::make_pair(p, vid);
729  }
730 
731  RFC_Pane_base::V2b &v2b = it->second;
732 
733  Pane &p2 = pane( v2b.first);
734  Node_ID v2( v2b.first, p2._b2v_table.find(p->id())->second[v2b.second]);
735 
736  RFC_assertion( v2 < Node_ID( p->id(), vid) || p->is_isolated_node(vid));
737  RFC_assertion( !p2.is_isolated_node( v2.node_id));
738  return std::make_pair( &p2, v2.node_id);
739 }
std::pair< int, int > Node_ID
A Pane object contains a mesh, pane attribute, and field variables.
Definition: Pane.h:43
const Pane & pane(const int pid) const
Get a reference to the pane with give id pid.
std::pair< int, int > V2b
Pane id and local boundary id.
A global ID of a node.
#define RFC_assertion
Definition: rfc_basic.h:65
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:

std::pair< const _Pane *, int > get_primary ( const Pane p,
int  vid 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 743 of file RFC_Window_base.h.

743  {
744  return const_cast<Self*>(this)->get_primary( const_cast<Pane*>(p), vid);
745 }
RFC_Window_derived< _Pane > Self
std::pair< Pane *, int > get_primary(Pane *p, int vid)
Get a handle to the primary copy of a node contained in the pane p with local id vid.
void init ( )
protected

Definition at line 676 of file RFC_Window_base.h.

Referenced by RFC_Window_derived< RFC_Pane_transfer >::RFC_Window_derived().

676  {
677  std::vector< COM::Pane*> ps;
678  _base->panes( ps);
679 
680  for (std::vector< COM::Pane*>::const_iterator
681  it=ps.begin(); it!=ps.end(); ++it) {
682  // Insert a pane with given id
683  (_pane_set[(*it)->id()] = new Pane(*it, color()))->init();
684  }
685 }
int color() const
The color of the window for overlay or for data transfer (BLUE or GREEN).
Base * _base
A reference to its base COM::Window object.
Pane_set _pane_set
The set of panes contained in the window.

Here is the caller graph for this function:

const _Pane & pane ( const int  pid) const

Get a reference to the pane with give id pid.

Definition at line 689 of file RFC_Window_base.h.

References RFC_assertion.

Referenced by RFC_Pane_overlay::determine_counterparts().

689  {
690  Pane_set::const_iterator pit = _pane_set.find( pid);
691  RFC_assertion( pit != _pane_set.end());
692  return reinterpret_cast<const _Pane&>(*pit->second);
693 }
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:

_Pane & pane ( const int  pid)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 697 of file RFC_Window_base.h.

References RFC_assertion.

697  {
698  Pane_set::iterator pit = _pane_set.find( pid);
699  RFC_assertion( pit != _pane_set.end());
700  return reinterpret_cast<_Pane&>(*pit->second);
701 }
Pane_set _pane_set
The set of panes contained in the window.
#define RFC_assertion
Definition: rfc_basic.h:65
void panes ( std::vector< Pane * > &  ps)

Get a vector of local panes contained in the window.

Definition at line 705 of file RFC_Window_base.h.

Referenced by Overlay::associate_green_vertices(), Overlay::get_green_parent(), Transfer_base::integrate(), Transfer_base::minmax(), Overlay::number_subfaces(), Overlay::number_subnodes(), Overlay::sort_on_green_edges(), Transfer_base::Transfer_base(), Overlay::write_overlay_off(), and Overlay::write_overlay_tec().

705  {
706  const_cast<Self*>(this)->panes( (std::vector<const Pane*>&)ps);
707 }
RFC_Window_derived< _Pane > Self
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.

Here is the caller graph for this function:

void panes ( std::vector< const Pane * > &  ps) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 711 of file RFC_Window_base.h.

711  {
712  ps.resize(0);
713  ps.reserve( _pane_set.size());
714  Pane_set::const_iterator it=_pane_set.begin();
715  for ( ; it != _pane_set.end(); ++it)
716  ps.push_back( reinterpret_cast<const Pane*>(it->second));
717 }
Pane_set _pane_set
The set of panes contained in the window.

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