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

The base implementation of RFC_Pane. More...

#include <RFC_Window_base.h>

Inheritance diagram for RFC_Pane_base:
Collaboration diagram for RFC_Pane_base:

Classes

class  COM_Pane_friend
 
struct  Edge_ID
 A local ID of an edge. More...
 

Public Types

typedef RFC_Pane_base Self
 
typedef COM::Pane Base
 
typedef COM::Attribute Attribute
 
typedef Base::Size Size
 
typedef RFC::Real Real
 
typedef std::pair< int, int > V2b
 Pane id and local boundary id. More...
 
typedef std::map< int, V2bV2b_table
 From node id to its corresponding map. More...
 
typedef std::vector< int > B2v
 From local boundary ids to node ids. More...
 
typedef std::map< int, B2vB2v_table
 From pane id to its corresponding mapping. More...
 

Public Member Functions

 RFC_Pane_base (Base *b, int color)
 A constructor. More...
 
void init ()
 
virtual ~RFC_Pane_base ()
 The default destructor. More...
 
Basebase ()
 The id of its base COM::Pane object. More...
 
const Basebase () const
 
int id () const
 
bool is_master () const
 Is this pane a master copy? More...
 
bool is_replicate () const
 Is this pane not a master copy? More...
 
bool is_quadratic () const
 Does this pane contain quadratic elements? More...
 
bool is_border_node (int i) const
 Is a give node on the boundary of the pane? More...
 
bool is_isolated_node (int i) const
 Is a give node an isolated node not belong to any element? More...
 
bool coincident (int i, int j) const
 Report whether the two given nodes are coincident. More...
 
int size_of_nodes () const
 The total number of nodes in the pane. More...
 
int size_of_faces () const
 The total number of faces in the pane. More...
 
int size_of_isolated_nodes () const
 
int size_of_border_nodes () const
 
Edge_ID get_edge_id (const int face_lid, const int vertex_lid) const
 Get the edge id within a given face. More...
 
int size_of_subnodes () const
 The total number of nodes in the subdivision of the pane. More...
 
int size_of_subfaces () const
 The total number of faces in the subdivision of the pane. More...
 
Realpointer (int i)
 Get the address of a given attribute with id i. More...
 
const Realpointer (int i) const
 
bool is_primary_node (const int vid) const
 Is the node with given local id a primary one? More...
 
int size_of_primary_nodes () const
 Get total number of primary nodes contained in the pane. More...
 
const Point_3get_point (int id) const
 Get the physical coordinates of the node with given local id. More...
 
const Point_3get_point (int id, int) const
 
const Realcoordinates () const
 
Point_3 get_point_of_subnode (int id) const
 
Bbox_3 get_bounding_box () const
 Get the bounding box of the pane. More...
 
int color () const
 The color of the parent window (BLUE or GREEN). More...
 
int parent_type_of_subnode (int) const
 Determine the parent type of a subnode of given tyep. More...
 
int get_parent_node (int) const
 Get the local parent node id of a given subnode. More...
 
int get_parent_face (int id) const
 Get the local parent face id of a given subface. More...
 
template<class Point >
void normalize_nat_coor (int idx, int e, Point &nc) const
 
void get_host_element_of_subnode (int i, Element_node_enumerator &ene, Point_2 &nc) const
 
void get_host_element_of_subface (int i, Element_node_enumerator &ene) const
 
void get_nat_coor_in_element (const int eid, const int lid, Point_2 &nc) const
 Take a subface id and a local subnode id, return the natual coordinates of the subnode within the parent element. More...
 
void get_nat_coor_in_element (const int sn_id, Element_node_enumerator &ene, Point_2 &nc) const
 Take a subnode id and an element, return the natrual coordinates within the element. More...
 
std::pair< const
COM::Connectivity *, int > 
get_element (int face_id) const
 Get the connectivity object and the id within the connectivity object for a given element. More...
 
const Node_IDget_subnode_counterpart (int i) const
 
const Face_IDget_subface_counterpart (int i) const
 
int get_lvid (const Element_node_enumerator &ene, const int v) const
 

Protected Member Functions

void comp_nat_coors ()
 Compute the natural coordinates. More...
 
void build_v2b_from_b2v (const RFC_Window_base *w)
 Build pane connectivity. More...
 
void write_tec_ij (std::ostream &, const COM::Attribute *a=0) const
 
void write_tec_tri (std::ostream &, const COM::Connectivity &, const COM::Attribute *a=0) const
 
void write_tec_mixed (std::ostream &, const std::vector< const COM::Connectivity * > &, const COM::Attribute *a=0) const
 
void write_tec_sub (std::ostream &) const
 
void write_tec_ascii (std::ostream &os, const COM::Attribute *attr=0) const
 
void write_binary (std::ostream &os) const
 
void read_binary (std::istream &is, std::vector< int > *b2v_all=NULL, COM::Pane *p=NULL)
 
void register_sdv_attributes (const std::string &wname) const
 
void read_rocin (const std::string &sdv_wname, const std::string &parent_wname="", COM::Pane *p=NULL)
 Read in using Rocin. More...
 

Protected Attributes

Base_base
 Reference to its base object. More...
 
bool _is_master
 Is the pane a master copy? More...
 
bool _quadratic
 Does it contain quadratic elements? More...
 
std::vector< bool > _is_border
 Is a node on border? More...
 
std::vector< bool > _is_isolated
 Is a node isolated? More...
 
int _n_border
 
int _n_isolated
 
V2b_table _v2b_table
 
B2v_table _b2v_table
 
std::vector< Edge_ID_subnode_parents
 Edge ids of parents. More...
 
std::vector< Point_2S_subnode_nat_coors
 Natual coordinates in the parent face. More...
 
std::vector< Point_2S_subnode_normalized_nc
 Natual coordinates in the parent face. More...
 
std::vector< int > _subnode_subID
 Sub-node ID of nodes in the pane. More...
 
std::vector< Node_ID_subnode_counterparts
 Ids of counterparts of subnodes. More...
 
std::vector< Three_tuple< int > > _subfaces
 
std::vector< int > _subface_parents
 Face ids of the parents of the subfaces. More...
 
std::vector< int > _subface_offsets
 Offsets of first subfaces contained in a face. More...
 
std::vector< Face_ID_subface_counterparts
 Ids of counterparts of faces. More...
 
std::vector< Three_tuple
< Point_2S > > 
_subface_nat_coors
 Element connectivity of the subfaces. More...
 

Private Member Functions

 RFC_Pane_base ()
 
 RFC_Pane_base (const Self &)
 
Selfoperator= (const Self &)
 

Private Attributes

int _color
 Is a node on border? More...
 
std::vector< const
COM::Connectivity * > 
_elem_conns
 
std::vector< int > _elem_offsets
 

Friends

class RFC_Window_base
 
template<class _Pane >
class RFC_Window_derived
 

Detailed Description

The base implementation of RFC_Pane.

RFC_Pane_base is built on top of COM::Pane, which encapsulates the nodal coordinates, element connectivity, and attributes of a pane. RFC_Pane_base contains a reference to a COM::Pane object, and also stores a subdivision of a pane, and the pane connectivities for the nodes in the input mesh. Each node and each face in the subdivision has a counterpart in another window, and RFC_Pane_base also stores the ids of counterparts.

If a node is a border node, it can have multiple instances, and the one with the smallest global id among non-isolated-node instances is the primary copy.

For each pair of adjacent panes, we define a numbering system for their coincident nodes, which are numbered from 0 to the number of coincident nodes minus one. We refer to these ids as boundary ids. The number system in the adjacent pane is said to define the remote boundary ids corresponding to this pane.

We use two data structures to store pane connectivity information: The first one, V2b_table, stores mapping from node ids (within this pane) to the remote boundary ids of their primary copoes. V2b is a mapping from node ids to a pair <pane id, REMOTE boundary id>. The second data structure is B2v_table, which is a mapping from pane ids to B2v objects, where a B2v object is a dynamic array each of whose entries contains a local node id and whose indices correspond to the local boundary ids for these nodes. Therefore, a B2v objects contains a mapping from local boundary ids to local node ids for a specific adjacent pane, and there is a B2v object for every adjacent pane. Note that it is possible that a pane is adjacent to itself in the case where a "branch-cut" exists, and in this case V2b_table can contain an entry for the pane itself.

To find the node id of the primary copy for a local node, one must use the local V2b_table and the remote B2v_table. For example, to locate the node id in pane p for a local node v, one could use pane(v2b_table[v].first).b2v_table[my_pane_id][v2b_table[v].second]. One should, however, check that v2b_table.find(v)!=v2b_table.end() and v2b_table[v].find(p.id())!=v2b_table[v].end().

See Also
RFC_Window_base RFC_Window_derived

Definition at line 153 of file RFC_Window_base.h.

Member Typedef Documentation

typedef COM::Attribute Attribute

Definition at line 157 of file RFC_Window_base.h.

typedef std::vector<int> B2v

From local boundary ids to node ids.

Definition at line 193 of file RFC_Window_base.h.

typedef std::map<int, B2v> B2v_table

From pane id to its corresponding mapping.

Definition at line 195 of file RFC_Window_base.h.

typedef COM::Pane Base

Definition at line 156 of file RFC_Window_base.h.

typedef RFC::Real Real

Definition at line 159 of file RFC_Window_base.h.

Definition at line 155 of file RFC_Window_base.h.

typedef Base::Size Size

Definition at line 158 of file RFC_Window_base.h.

typedef std::pair<int,int> V2b

Pane id and local boundary id.

Definition at line 189 of file RFC_Window_base.h.

typedef std::map<int, V2b> V2b_table

From node id to its corresponding map.

Definition at line 191 of file RFC_Window_base.h.

Constructor & Destructor Documentation

RFC_BEGIN_NAME_SPACE RFC_Pane_base ( Base b,
int  color 
)

A constructor.

Parameters
bthe base COM::Pane object.
colorthe color of the parent window (BLUE or GREEN).

Definition at line 39 of file RFC_Window_base.C.

40  : _base(b), _is_master(true), _quadratic(false),
41  _n_border(0), _n_isolated(0), _color(color) {}
Base * _base
Reference to its base object.
bool _quadratic
Does it contain quadratic elements?
int color() const
The color of the parent window (BLUE or GREEN).
bool _is_master
Is the pane a master copy?
int _color
Is a node on border?
virtual ~RFC_Pane_base ( )
inlinevirtual

The default destructor.

Definition at line 203 of file RFC_Window_base.h.

203 {}
RFC_Pane_base ( )
private
RFC_Pane_base ( const Self )
private

Member Function Documentation

Base* base ( )
inline

The id of its base COM::Pane object.

Definition at line 206 of file RFC_Window_base.h.

References _base.

Referenced by comp_nat_coors(), Overlay::convert_nat_coordinates(), Transfer_base::interpolate_fe(), Transfer_base::multiply_mass_mat_and_x(), RFC_Window_transfer::replicate_metadata(), and Vertex_set::Vertex_set().

206 { return _base; }
Base * _base
Reference to its base object.

Here is the caller graph for this function:

const Base* base ( ) const
inline

Definition at line 207 of file RFC_Window_base.h.

References _base.

207 { return _base; }
Base * _base
Reference to its base object.
void build_v2b_from_b2v ( const RFC_Window_base w)
protected

Build pane connectivity.

Definition at line 220 of file RFC_Window_base.C.

References _b2v_table, _v2b_table, i, iend, is_isolated_node(), RFC_Window_base::pane(), and RFC_assertion.

Referenced by RFC_Window_base::build_pc_tables().

220  {
221  //`Loop through the B2v_table
222  for ( B2v_table::iterator
223  it=_b2v_table.begin(), iend=_b2v_table.end(); it != iend; ++it) {
224  for ( int i=0, size=it->second.size(); i<size; ++i) {
225  if ( it->first > id() && !is_isolated_node(it->second[i])) continue;
226 
227  std::pair<int,int> p(it->first, i);
228  if ( it->first==id()) {
229  RFC_assertion( (i&1)==1 && it->second[i-1] < it->second[i] ||
230  (i&1)==0 && it->second[i] < it->second[i+1]);
231  if ( (i&1)==0 || is_isolated_node( it->second[i-1]))
232  continue;
233  --p.second;
234  }
235  else {
236  const RFC_Pane_base &pane = w->pane( it->first);
237  if ( pane.is_isolated_node( pane._b2v_table.find(id())->second[i]))
238  continue;
239  }
240 
241  if ( _v2b_table.find( it->second[i]) == _v2b_table.end())
242  _v2b_table[it->second[i]] = p;
243  }
244  }
245 }
const RFC_Pane_base & pane(const int pid) const
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
blockLoc i
Definition: read.cpp:79
B2v_table _b2v_table
V2b_table _v2b_table
bool is_isolated_node(int i) const
Is a give node an isolated node not belong to any element?
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

bool coincident ( int  i,
int  j 
) const

Report whether the two given nodes are coincident.

Definition at line 71 of file RFC_Window_base.C.

References _b2v_table, _v2b_table, and RFC_assertion.

Referenced by get_lvid().

71  {
72  if ( v1==v2) return true;
73  V2b_table::const_iterator it1 = _v2b_table.find( v1);
74  V2b_table::const_iterator it2 = _v2b_table.find( v2);
75 
76  if ( it1 == _v2b_table.end() && it2 != _v2b_table.end())
77  return it2->second.first == id() &&
78  _b2v_table.find( id())->second[it2->second.second] == v1;
79  else if ( it1 != _v2b_table.end() && it2 == _v2b_table.end())
80  return it1->second.first == id() &&
81  _b2v_table.find( id())->second[it1->second.second] == v2;
82  else if ( it1 != _v2b_table.end() && it2 != _v2b_table.end()) {
83  RFC_assertion( it1->second.first==id() && it2->second.first==id());
84  B2v_table::const_iterator bit=_b2v_table.find( id());
85  return bit->second[it1->second.second]==bit->second[it2->second.second];
86  }
87  else
88  return false;
89 }
B2v_table _b2v_table
V2b_table _v2b_table
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

int color ( ) const
inline

The color of the parent window (BLUE or GREEN).

Definition at line 273 of file RFC_Window_base.h.

References _color.

Referenced by RFC_Pane_overlay::create_overlay_data().

273 { return _color; }
int _color
Is a node on border?

Here is the caller graph for this function:

void comp_nat_coors ( )
protected

Compute the natural coordinates.

Definition at line 327 of file RFC_Window_base.C.

References _base, _subface_nat_coors, _subface_parents, _subfaces, _subnode_normalized_nc, _subnode_parents, _subnode_subID, base(), get_host_element_of_subface(), get_nat_coor_in_element(), i, Element_node_enumerator::id(), j, Element_node_enumerator::next(), Element_node_enumerator::pane(), parent_type_of_subnode(), PARENT_VERTEX, size_of_nodes(), size_of_subfaces(), and size_of_subnodes().

Referenced by RFC_Window_base::export_window(), read_binary(), and read_rocin().

327  {
328  int nsn=size_of_subnodes();
329  _subnode_normalized_nc.resize( nsn);
330  _subnode_subID.resize( size_of_nodes());
331 
332  // Initialize _subnode_normalized_nc.
333  for ( int i=0; i<nsn; ++i) {
334  int f=_subnode_parents[i].face_id;
336 
337  Point_2 p; get_nat_coor_in_element( i+1, ene, p);
338  _subnode_normalized_nc[i] = Point_2S(p[0], p[1]);
339 
340  // Assign sub-node ID for each vertex in input mesh
342  int vid = ene[_subnode_parents[i].edge_id];
343  _subnode_subID[ vid-1] = i+1;
344  }
345  }
346 
347  int nsf=size_of_subfaces();
348  _subface_nat_coors.resize( nsf);
349  // Initialize _subface_nat_coors.
350  Element_node_enumerator ene( base(), 1);
351  for ( int i=0; i<nsf; ++i) {
352  if ( ene.id() != _subface_parents[i]) {
353  ene.next();
354  if ( ene.pane()==NULL || ene.id() != _subface_parents[i])
356  }
357  Point_2 p;
358  for ( int j=0; j<3; ++j) {
359  get_nat_coor_in_element( _subfaces[i][j], ene, p);
360  _subface_nat_coors[i][j] = Point_2S(p[0], p[1]);
361  }
362  }
363 }
An adaptor for enumerating node IDs of an element.
Base * base()
The id of its base COM::Pane object.
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
Base * _base
Reference to its base object.
int parent_type_of_subnode(int) const
Determine the parent type of a subnode of given tyep.
std::vector< Three_tuple< int > > _subfaces
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
std::vector< int > _subnode_subID
Sub-node ID of nodes in the pane.
std::vector< Point_2S > _subnode_normalized_nc
Natual coordinates in the parent face.
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79
void get_nat_coor_in_element(const int eid, const int lid, Point_2 &nc) const
Take a subface id and a local subnode id, return the natual coordinates of the subnode within the par...
int size_of_subfaces() const
The total number of faces in the subdivision of the pane.
std::vector< Three_tuple< Point_2S > > _subface_nat_coors
Element connectivity of the subfaces.
j indices j
Definition: Indexing.h:6
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.

Here is the call graph for this function:

Here is the caller graph for this function:

const Real* coordinates ( ) const
inline

Definition at line 266 of file RFC_Window_base.h.

References _base.

Referenced by RFC_Pane_transfer::coordinates(), and get_point_of_subnode().

266 { return _base->coordinates(); }
Base * _base
Reference to its base object.

Here is the caller graph for this function:

Bbox_3 get_bounding_box ( ) const

Get the bounding box of the pane.

Definition at line 152 of file RFC_Window_base.C.

References get_point(), i, and size_of_nodes().

152  {
153  Bbox_3 b;
154  for ( int i=1, size=size_of_nodes(); i<=size; ++i)
155  b += Bbox_3(get_point( i));
156  return b;
157 }
const Point_3 & get_point(int id) const
Get the physical coordinates of the node with given local id.
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

RFC_Pane_base::Edge_ID get_edge_id ( const int  face_lid,
const int  vertex_lid 
) const

Get the edge id within a given face.

Definition at line 160 of file RFC_Window_base.C.

References _base, _elem_conns, k, and RFC_assertion.

160  {
161  if ( _base->is_structured()) {
162  Element_node_enumerator ene( _base, face_lid, (COM::Connectivity *)NULL);
163  for ( int k=0; k<4; ++k)
164  if ( ene[k] == vertex_lid) return Edge_ID( face_lid, k);
165  RFC_assertion(false); abort();
166  }
167  else {
168  for ( std::vector<const COM::Connectivity*>::const_iterator
169  it = _elem_conns.begin(); it != _elem_conns.end(); ++it) {
170  const int ne = (*it)->size_of_edges_pe();
171  if ( face_lid > int((*it)->index_offset()) &&
172  face_lid <= int((*it)->index_offset()+(*it)->size_of_elements())) {
173  Element_node_enumerator ene(_base, face_lid-(*it)->index_offset(), *it);
174 
175  for ( int k=0; k<ne; ++k)
176  if ( ene[k] == vertex_lid) return Edge_ID(face_lid,k);
177  RFC_assertion(false); abort();
178  }
179  }
180  }
181  return Edge_ID(face_lid,-1);
182 }
An adaptor for enumerating node IDs of an element.
j indices k indices k
Definition: Indexing.h:6
std::vector< const COM::Connectivity * > _elem_conns
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Base * _base
Reference to its base object.
#define RFC_assertion
Definition: rfc_basic.h:65
std::pair< const COM::Connectivity*, int> get_element ( int  face_id) const
inline

Get the connectivity object and the id within the connectivity object for a given element.

Definition at line 342 of file RFC_Window_base.h.

References _elem_conns, and _elem_offsets.

342  {
343  const int* p = std::lower_bound( &*_elem_offsets.begin(),
344  &*_elem_offsets.end(), face_id)-1;
345  return std::make_pair( _elem_conns[p-&_elem_offsets[0]],
346  face_id-_elem_offsets[*p]);
347  }
std::vector< const COM::Connectivity * > _elem_conns
std::vector< int > _elem_offsets
void get_host_element_of_subface ( int  i,
Element_node_enumerator ene 
) const
inline

Definition at line 322 of file RFC_Window_base.h.

References _base, _subface_parents, Element_node_enumerator::id(), and Element_node_enumerator::pane().

Referenced by comp_nat_coors(), Transfer_base::init_load_vector(), and Transfer_base::transfer_2f().

322  {
323  int f=_subface_parents[i-1];
324  if ( ene.pane() != _base || ene.id() != f)
325  ene = Element_node_enumerator( _base, f);
326  }
An adaptor for enumerating node IDs of an element.
Base * _base
Reference to its base object.
int id() const
Get the local id of the element within the pane.
blockLoc i
Definition: read.cpp:79
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
const Pane * pane() const

Here is the call graph for this function:

Here is the caller graph for this function:

void get_host_element_of_subnode ( int  i,
Element_node_enumerator ene,
Point_2 nc 
) const
inline

Definition at line 312 of file RFC_Window_base.h.

References _base, _subnode_normalized_nc, _subnode_parents, Element_node_enumerator::id(), and Element_node_enumerator::pane().

Referenced by Transfer_base::interpolate_fe().

313  {
314  int f=_subnode_parents[i-1].face_id;
315  if ( ene.pane() != _base || ene.id() != f)
316  ene = Element_node_enumerator( _base, f);
317  const Point_2S &p=_subnode_normalized_nc[i-1];
318  nc[0]=p[0]; nc[1]=p[1];
319  }
An adaptor for enumerating node IDs of an element.
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
Base * _base
Reference to its base object.
int id() const
Get the local id of the element within the pane.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
std::vector< Point_2S > _subnode_normalized_nc
Natual coordinates in the parent face.
blockLoc i
Definition: read.cpp:79
const Pane * pane() const

Here is the call graph for this function:

Here is the caller graph for this function:

int get_lvid ( const Element_node_enumerator ene,
const int  v 
) const

Definition at line 185 of file RFC_Window_base.C.

References coincident(), i, j, RFC_assertion, Element_node_enumerator::size_of_nodes(), and Element_node_enumerator::vertex().

Referenced by Overlay::convert_nat_coordinates(), and get_nat_coor_in_element().

186  {
187  int i = ene.vertex( vid);
188  if ( i<0) {
189  // Resort to a more expensive method.
190  for ( int j=ene.size_of_nodes()-1; j>=0; --j) {
191  if ( coincident(vid, ene[j])) { i = j; }
192  }
193  RFC_assertion( i>=0);
194  }
195  return i;
196 }
int vertex(int lvid, bool level=false) const
Get the vertex index of an vertex within the element.
bool coincident(int i, int j) const
Report whether the two given nodes are coincident.
blockLoc i
Definition: read.cpp:79
int size_of_nodes() const
Number of nodes per element.
j indices j
Definition: Indexing.h:6
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

void get_nat_coor_in_element ( const int  eid,
const int  lid,
Point_2 nc 
) const
inline

Take a subface id and a local subnode id, return the natual coordinates of the subnode within the parent element.

Definition at line 330 of file RFC_Window_base.h.

References _subface_nat_coors.

Referenced by comp_nat_coors(), Transfer_base::compute_load_vector_wra(), get_point_of_subnode(), and Transfer_base::integrate_subface().

330  {
331  const Point_2S &p=_subface_nat_coors[eid-1][lid];
332  nc[0] = p[0]; nc[1]=p[1];
333  }
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
std::vector< Three_tuple< Point_2S > > _subface_nat_coors
Element connectivity of the subfaces.

Here is the caller graph for this function:

void get_nat_coor_in_element ( const int  sn_id,
Element_node_enumerator ene,
Point_2 nc 
) const

Take a subnode id and an element, return the natrual coordinates within the element.

Definition at line 92 of file RFC_Window_base.C.

References _base, _subnode_nat_coors, _subnode_parents, RFC_Pane_base::Edge_ID::edge_id, RFC_Pane_base::Edge_ID::face_id, get_lvid(), i, Element_node_enumerator::id(), normalize_nat_coor(), RFC_assertion, and Element_node_enumerator::size_of_edges().

93  {
94  RFC_assertion( sn_id >= 1 && sn_id <= int(_subnode_parents.size()));
95 
96  const Point_2S &p = _subnode_nat_coors[ sn_id-1];
97  const Edge_ID &eid = _subnode_parents[ sn_id-1];
98 
99  if ( eid.face_id == ene.id()) {
100  nc[0]=p[0]; nc[1]=p[1];
101  normalize_nat_coor( eid.edge_id, ene.size_of_edges(), nc);
102  }
103  else {
104  nc[0] = 1.-p[0]; nc[1]=0;
105  int vid = Element_node_enumerator(_base,eid.face_id)[eid.edge_id];
106 
107  int i = get_lvid(ene, vid)-1;
108 
109  int num_edges = ene.size_of_edges();
110  if ( i<0) i=num_edges-1;
111  normalize_nat_coor( i, num_edges, nc);
112  }
113 }
An adaptor for enumerating node IDs of an element.
void normalize_nat_coor(int idx, int e, Point &nc) const
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
Base * _base
Reference to its base object.
int get_lvid(const Element_node_enumerator &ene, const int v) const
int id() const
Get the local id of the element within the pane.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
int size_of_edges() const
Number of edges per element.
blockLoc i
Definition: read.cpp:79
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

int get_parent_face ( int  id) const
inline

Get the local parent face id of a given subface.

Definition at line 282 of file RFC_Window_base.h.

References _subface_parents.

Referenced by Transfer_base::transfer_2f().

282 { return _subface_parents[ id-1]; }
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.

Here is the caller graph for this function:

int get_parent_node ( int  id) const

Get the local parent node id of a given subnode.

Precondition: The parent type is PARENT_VERTEX.

Definition at line 130 of file RFC_Window_base.C.

References _base, _subnode_parents, RFC_Pane_base::Edge_ID::edge_id, and RFC_Pane_base::Edge_ID::face_id.

Referenced by Transfer_base::interpolate_fe().

130  {
131  const Edge_ID &eid=_subnode_parents[ id-1];
132  Element_node_enumerator ene(_base, eid.face_id);
133 
134  return ene[eid.edge_id];
135 }
An adaptor for enumerating node IDs of an element.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Base * _base
Reference to its base object.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.

Here is the caller graph for this function:

const Point_3& get_point ( int  id) const
inline

Get the physical coordinates of the node with given local id.

Definition at line 258 of file RFC_Window_base.h.

References _base, and RFC_assertion.

Referenced by get_bounding_box(), RFC_Pane_overlay::get_point(), and Nodal_coor_const::get_value().

258  {
259  RFC_assertion( sizeof( Point_3) == 3*sizeof( Real));
260  return *reinterpret_cast<const Point_3*>(_base->coordinates()+3*(id-1));
261  }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

const Point_3& get_point ( int  id,
int   
) const
inline

Definition at line 262 of file RFC_Window_base.h.

References _base, id(), and RFC_assertion.

262  {
263  RFC_assertion( sizeof( Point_3) == 3*sizeof( Real));
264  return *reinterpret_cast<const Point_3*>(_base->coordinates()+3*id);
265  }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
int id() const
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Point_3 get_point_of_subnode ( int  id) const

Definition at line 138 of file RFC_Window_base.C.

References _base, _subnode_parents, coordinates(), get_nat_coor_in_element(), Element_node_enumerator::size_of_edges(), and Element_node_enumerator::size_of_nodes().

Referenced by register_sdv_attributes(), and write_tec_sub().

138  {
139  const int fid = _subnode_parents[i-1].face_id;
140  Element_node_enumerator ene( _base, fid);
141  Point_2 nc; get_nat_coor_in_element( i, ene, nc);
142 
143  Nodal_coor_const coors;
145  ps( coors, coordinates(), ene);
146 
147  return SURF::Generic_element_2( ene.size_of_edges(),
148  ene.size_of_nodes()).interpolate(ps, nc);
149 }
An adaptor for enumerating node IDs of an element.
Adpator for element-wise data container.
Base * _base
Reference to its base object.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
blockLoc i
Definition: read.cpp:79
void get_nat_coor_in_element(const int eid, const int lid, Point_2 &nc) const
Take a subface id and a local subnode id, return the natual coordinates of the subnode within the par...
const Real * coordinates() const
An const adaptor for accessing nodal coordinates of a pane.

Here is the call graph for this function:

Here is the caller graph for this function:

const Face_ID& get_subface_counterpart ( int  i) const
inline

Definition at line 352 of file RFC_Window_base.h.

References _subface_counterparts, and RFC_assertion.

352  {
353  RFC_assertion( i>=1 && i<=(int)_subface_counterparts.size());
354  return _subface_counterparts[i-1];
355  }
blockLoc i
Definition: read.cpp:79
#define RFC_assertion
Definition: rfc_basic.h:65
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.
const Node_ID& get_subnode_counterpart ( int  i) const
inline

Definition at line 348 of file RFC_Window_base.h.

References _subnode_counterparts, and RFC_assertion.

Referenced by Transfer_base::interpolate_fe().

348  {
349  RFC_assertion( i>=1 && i<=(int)_subnode_counterparts.size());
350  return _subnode_counterparts[i-1];
351  }
blockLoc i
Definition: read.cpp:79
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

void init ( )

Definition at line 44 of file RFC_Window_base.C.

References _base, _elem_conns, _elem_offsets, _is_border, _is_isolated, _n_border, _n_isolated, _quadratic, i, and n.

Referenced by RFC_Window_transfer::init_recv_buffer().

44  {
45 
46  // Determine whether the pane has quadratic elements
47  if ( !_base->is_structured()) {
48  _base->elements( _elem_conns);
49  _elem_offsets.reserve( _elem_conns.size());
50 
51  for ( std::vector<const COM::Connectivity*>::const_iterator
52  it = _elem_conns.begin(); it != _elem_conns.end(); ++it) {
53  _elem_offsets.push_back( (*it)->index_offset());
54  const int ne = (*it)->size_of_edges_pe();
55  const int nn = (*it)->size_of_nodes_pe();
56  if ( nn > ne) _quadratic = true;
57  }
58  }
59 
60  MAP::Pane_boundary pb( _base);
61  pb.determine_border_nodes( _is_border, _is_isolated);
62 
63  for ( int i=0, n=_is_border.size(); i<n; ++i)
65 }
std::vector< const COM::Connectivity * > _elem_conns
Base * _base
Reference to its base object.
bool _quadratic
Does it contain quadratic elements?
std::vector< int > _elem_offsets
std::vector< bool > _is_isolated
Is a node isolated?
blockLoc i
Definition: read.cpp:79
std::vector< bool > _is_border
Is a node on border?
const NT & n

Here is the caller graph for this function:

bool is_border_node ( int  i) const
inline

Is a give node on the boundary of the pane?

Definition at line 217 of file RFC_Window_base.h.

References _is_border, RFC_assertion, and size_of_nodes().

Referenced by RFC_Window_derived< _Pane >::get_primary(), and is_primary_node().

218  { RFC_assertion( i>=1 && i<= size_of_nodes()); return _is_border[i-1]; }
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79
std::vector< bool > _is_border
Is a node on border?
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_isolated_node ( int  i) const
inline

Is a give node an isolated node not belong to any element?

Definition at line 220 of file RFC_Window_base.h.

References _is_isolated, RFC_assertion, and size_of_nodes().

Referenced by build_v2b_from_b2v(), RFC_Window_derived< _Pane >::get_primary(), and is_primary_node().

221  { RFC_assertion( i>=1 && i<= size_of_nodes()); return _is_isolated[i-1]; }
std::vector< bool > _is_isolated
Is a node isolated?
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_master ( ) const
inline

Is this pane a master copy?

Definition at line 211 of file RFC_Window_base.h.

References _is_master.

Referenced by RFC_Window_overlay::delete_overlay_data(), RFC_Window_overlay::evaluate_normals(), RFC_Window_base::write_tec_ascii(), and RFC_Window_base::write_tec_sub().

211 { return _is_master; }
bool _is_master
Is the pane a master copy?

Here is the caller graph for this function:

bool is_primary_node ( const int  vid) const

Is the node with given local id a primary one?

Definition at line 202 of file RFC_Window_base.C.

References _v2b_table, is_border_node(), is_isolated_node(), and RFC_assertion.

Referenced by size_of_primary_nodes().

202  {
203  if ( !is_border_node(vid) && !is_isolated_node(vid)) return true;
204  V2b_table::const_iterator it = _v2b_table.find( vid);
205  RFC_assertion( it != _v2b_table.end() || !is_isolated_node( vid));
206  return ( it == _v2b_table.end());
207 }
bool is_border_node(int i) const
Is a give node on the boundary of the pane?
V2b_table _v2b_table
bool is_isolated_node(int i) const
Is a give node an isolated node not belong to any element?
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_quadratic ( ) const
inline

Does this pane contain quadratic elements?

Definition at line 215 of file RFC_Window_base.h.

References _quadratic.

Referenced by Transfer_base::interpolate_fe(), and RFC_Window_overlay::print_features().

215 { return _quadratic; }
bool _quadratic
Does it contain quadratic elements?

Here is the caller graph for this function:

bool is_replicate ( ) const
inline

Is this pane not a master copy?

Definition at line 213 of file RFC_Window_base.h.

References _is_master.

213 { return !_is_master; }
bool _is_master
Is the pane a master copy?
void normalize_nat_coor ( int  idx,
int  e,
Point &  nc 
) const
inline

Normailize the natural coordinates.

Parameters
idxthe index of an edge of an element.
ethe number of edges fo an element
ncthe natural of a point in the element which where the edge idx is its first edge.

Definition at line 291 of file RFC_Window_base.h.

References RFC_assertion.

Referenced by Overlay::convert_nat_coordinates(), and get_nat_coor_in_element().

291  {
292  if( e == 3) {
293  switch( idx) {
294  case 0: return;
295  case 1: nc = Point( 1.-nc[0]-nc[1], nc[0]); return;
296  case 2: nc = Point( nc[1], 1.-nc[0]-nc[1]); return;
297  default: RFC_assertion( false);
298  }
299  }
300  else {
301  switch( idx) {
302  case 0: return;
303  case 1: nc = Point( 1-nc[1], nc[0]); return;
304  case 2: nc = Point( 1-nc[0], 1-nc[1]); return;
305  case 3: nc = Point( nc[1], 1-nc[0]); return;
306  default: RFC_assertion( false);
307  }
308  }
309  }
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the caller graph for this function:

Self& operator= ( const Self )
private
int parent_type_of_subnode ( int  id) const

Determine the parent type of a subnode of given tyep.

Parameters
idthe local id of the subnode (starting from 1).

Definition at line 118 of file RFC_Window_base.C.

References _subnode_nat_coors, PARENT_EDGE, PARENT_FACE, and PARENT_VERTEX.

Referenced by comp_nat_coors(), and Transfer_base::interpolate_fe().

118  {
119  const Point_2S &nc = _subnode_nat_coors[ id-1];
120  if ( nc[0]==0 && nc[1]==0)
121  return PARENT_VERTEX;
122  if ( nc[1]==0)
123  return PARENT_EDGE;
124  return PARENT_FACE;
125 }
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.

Here is the caller graph for this function:

Real* pointer ( int  i)
inline

Get the address of a given attribute with id i.

Definition at line 245 of file RFC_Window_base.h.

References _base.

Referenced by RFC_Pane_transfer::pointer().

246  { return (Real*)_base->attribute(i)->pointer(); }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

const Real* pointer ( int  i) const
inline

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 248 of file RFC_Window_base.h.

References _base.

249  { return (Real*)_base->attribute(i)->pointer(); }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
blockLoc i
Definition: read.cpp:79
void read_binary ( std::istream &  is,
std::vector< int > *  b2v_all = NULL,
COM::Pane *  p = NULL 
)
protected

Definition at line 163 of file RFC_Window_base_IO_binary.C.

References _b2v_table, _base, _subface_counterparts, _subface_offsets, _subface_parents, _subfaces, _subnode_counterparts, _subnode_nat_coors, _subnode_parents, _v2b_table, COM_NC, comp_nat_coors(), i, j, n, read(), RFC_assertion, RFC_assertion_code, size_of_faces(), size_of_nodes(), and swap_endian().

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

163  {
164 
165  COM_Pane_friend *pn = (COM_Pane_friend*)pn_in;
166  RFC_assertion( sizeof(int)==4);
167  RFC_assertion( sizeof(Real)==8);
168 
169  int t1, t2;
170 
171  read( is, t1); // For detecting big or small endian
172  bool need_swap = (t1 != 1);
173  if ( need_swap) swap_endian( t1);
174  RFC_assertion( t1 == 1);
175  Real version;
176  is.read( (char*)&version, sizeof(Real));
177  if ( need_swap) swap_endian( version);
178  RFC_assertion( version == 3.);
179 
180  // Read in the color and the id of the pane.
181  read( is, t1); read( is, t2);
182  if ( need_swap) { swap_endian( t1); swap_endian( t2); }
183 
184  // #nodes and #faces
185  read( is, t1); read( is, t2);
186  if ( need_swap) { swap_endian( t1); swap_endian( t2); }
187  if ( pn != NULL) pn->set_size( pn->attribute(COM::COM_NC), t1, 0);
188  else
189  RFC_assertion( t1 == size_of_nodes() && t2 == size_of_faces());
190  _subface_offsets.resize( t2);
191 
192  // Nodal coordinates of the pane
193  {
194  int n=3*_base->size_of_nodes();
195  std::vector< Real> buf( n);
196  is.read( (char*)&buf.front(), n*sizeof(Real));
197  }
198 
199  // Read in number of element types.
200  int ntypes, is_structured=false;
201  read( is, ntypes); if ( need_swap) { swap_endian( ntypes); }
202  for ( int i=0; i<ntypes; ++i) {
203  read( is, t1); read( is, t2);
204  if ( need_swap) { swap_endian( t1); swap_endian( t2); }
205 
206  if ( t1 == 2) { // Structured mesh
207  is_structured=true;
208  RFC_assertion( t2==1);
209  int dims[2];
210  read( is, dims[0]); read( is, dims[1]);
211  if ( need_swap) { swap_endian( dims[0]); swap_endian( dims[1]); }
212  if ( pn != NULL) {
213  int *t = &dims[0];
214  COM::Connectivity *conn = pn->connectivity( ":st2:");
215  pn->reinit_conn( conn, COM::Pane::OP_SET, &t, 0, 0);
216  }
217  }
218  else { // Unstructured mesh
219  int n=t1*t2;
220  if ( pn) {
221  int *buf=NULL;
222  std::string elem;
223  // Create a new Connectivity object in the Pane
224  switch (t1) {
225  case 3: elem=":t3:"; break;
226  case 4: elem=":q4:"; break;
227  case 6: elem=":t6:"; break;
228  case 8: elem=":q8:"; break;
229  case 9: elem=":q9:"; break;
230  default: RFC_assertion(false);
231  }
232  // Insert a connectivity
233  COM::Connectivity *conn=pn->connectivity( elem);
234  pn->set_size( conn, t2, 0);
235  pn->reinit_conn( conn, COM::Pane::OP_RESIZE, &buf, 0, 0);
236 
237  is.read( (char*)buf, n*sizeof(int));
238  if ( need_swap) for ( int j=0; j<n; ++j) swap_endian( buf[j]);
239  }
240  else {
241  int t;
242  for ( int i=0; i<n; ++i) is.read( (char*)&t, sizeof(int));
243  }
244  }
245  }
246 
247  // Pane connectivity of input mesh
248  read( is, t1); t2 = size_of_nodes();
249  if ( need_swap) { swap_endian( t1); }
250  if ( b2v_all) b2v_all->reserve(t1);
251  for ( int i=0; i<t1; ++i) {
252  int pane_id, n;
253  read( is, pane_id); read( is, n);
254  if ( need_swap) { swap_endian( pane_id); swap_endian( n); }
255  B2v &b2v = _b2v_table[pane_id];
256  b2v.resize( n);
257  is.read( (char*)&b2v[0], n*sizeof(b2v[0]));
258  if ( need_swap) for ( int j=0; j<n; ++j) swap_endian( b2v[j]);
259  RFC_assertion_code( for ( int j=0; j<n; ++j)
260  RFC_assertion( b2v[j]>=1 && b2v[j]<=t2));
261  if ( b2v_all) {
262  b2v_all->push_back( pane_id); b2v_all->push_back( n);
263  b2v_all->insert( b2v_all->end(), b2v.begin(), b2v.end());
264  }
265  }
266 
267  read( is, t1); if ( need_swap) { swap_endian( t1); }
268  for ( int i=0; i<t1; ++i) {
269  int n1,n2,n3;
270  read( is, n1); if ( need_swap) { swap_endian( n1); }
271  read( is, n2); if ( need_swap) { swap_endian( n2); }
272  read( is, n3); if ( need_swap) { swap_endian( n3); }
273 
274  _v2b_table[n1] = std::make_pair( n2, n3);
275  }
276 
277  read( is, t1); read( is, t2);
278  if ( need_swap) { swap_endian( t1); swap_endian( t2); }
279  _subnode_parents.resize( t1);
280  _subnode_nat_coors.resize( t1);
281  _subnode_counterparts.resize( t1);
282  _subfaces.resize( t2);
283  _subface_parents.resize( t2);
284  _subface_counterparts.resize( t2);
285 
286  // Read in the subnodes.
287  int n=_subnode_parents.size();
288  RFC_assertion( sizeof(_subnode_parents[0])==8);
289  is.read( (char*)&_subnode_parents[0], n*sizeof(_subnode_parents[0]));
290  if ( need_swap)
291  for ( int j=0; j<n; ++j) {
292  swap_endian( _subnode_parents[j].face_id);
293  swap_endian( _subnode_parents[j].edge_id);
294  }
295 
296  is.read( (char*)&_subnode_nat_coors[0],
297  n*sizeof(_subnode_nat_coors[0]));
298  if ( need_swap)
299  for ( int j=0; j<n; ++j) {
302  }
303 
304  is.read( (char*)&_subnode_counterparts[0],
305  n*sizeof(_subnode_counterparts[0]));
306  if ( need_swap)
307  for ( int j=0; j<n; ++j) {
308  swap_endian( _subnode_counterparts[j].pane_id);
309  swap_endian( _subnode_counterparts[j].node_id);
310  }
311 
312  n = t2;
313  // Read in the subfaces.
314  is.read( (char*)&_subfaces[0], n*sizeof(_subfaces[0]));
315  if ( need_swap)
316  for ( int j=0; j<n; ++j) {
317  swap_endian( _subfaces[j][0]);
318  swap_endian( _subfaces[j][1]);
319  swap_endian( _subfaces[j][2]);
320  }
321  is.read( (char*)&_subface_parents[0], n*sizeof(_subface_parents[0]));
322  if ( need_swap)
323  for ( int j=0; j<n; ++j) {
325  }
326  is.read( (char*)&_subface_counterparts[0],
327  t2*sizeof(_subface_counterparts[0]));
328  if ( need_swap)
329  for ( int j=0; j<n; ++j) {
330  swap_endian( _subface_counterparts[j].pane_id);
331  swap_endian( _subface_counterparts[j].face_id);
332  }
333 
334  // Read in the offset of sub-faces.
335  _subface_offsets.resize( size_of_faces()+1);
336  n = _subface_offsets.size();
337  is.read( (char*)&_subface_offsets[0], sizeof(int)*n);
338  if ( need_swap) for ( int j=0; j<n; ++j) swap_endian( _subface_offsets[j]);
339 
341  int(_subfaces.size()));
342 
343  read( is, t1);
344  if ( need_swap) { swap_endian( t1); }
345  RFC_assertion( t1 ==int(_subnode_parents.size()+_subfaces.size())); // Checksum
346 
347  comp_nat_coors();
348 }
void comp_nat_coors()
Compute the natural coordinates.
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79
const NT & n
B2v_table _b2v_table
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
#define RFC_assertion_code
Definition: rfc_basic.h:68
j indices j
Definition: Indexing.h:6
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
std::vector< int > _subface_offsets
Offsets of first subfaces contained in a face.
void read(std::istream &is, T &t, const io_Read_write &)
Definition: io.h:132
V2b_table _v2b_table
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
void swap_endian(short int &t)
std::vector< int > B2v
From local boundary ids to node ids.
#define RFC_assertion
Definition: rfc_basic.h:65
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.

Here is the call graph for this function:

Here is the caller graph for this function:

void read_rocin ( const std::string &  sdv_wname,
const std::string &  parent_wname = "",
COM::Pane *  p = NULL 
)
protected

Read in using Rocin.

Parameters
sdv_wnamesubdivision window name
parent_wnameparent window name
pparent pane ID base

Definition at line 169 of file RFC_Window_base_IO.C.

References _subface_counterparts, _subface_nat_coors, _subface_offsets, _subface_parents, _subfaces, _subnode_counterparts, _subnode_nat_coors, _subnode_normalized_nc, _subnode_parents, _subnode_subID, _v2b_table, COM_copy_array(), COM_get_attribute_handle(), COM_get_roccom(), COM_get_size(), COM_PMESH, comp_nat_coors(), i, id(), size_of_faces(), and size_of_nodes().

Referenced by RFC_Window_transfer::init_recv_buffer().

171  {
172 
173  const int pid = id();
174 
175  // If pn_base is not NULL, then inherit from parent pane.
176  if ( pn_base) {
177  // Obtain the mesh object in the corresponding pane in the parent window
178  COM::Roccom_base *rcom = COM_get_roccom();
179  int win_handle = rcom->get_window_handle( parent_wname.c_str());
180  COM::Window *parent_win = rcom->get_window_object(win_handle);
181 
182  COM::Attribute *mesh = parent_win->pane(pid).attribute( COM::COM_PMESH);
183 
184  // Clone the mesh from parent pane onto pn_base.
185  ((Pane_friend*)pn_base)->inherit( mesh, "", COM::Pane::INHERIT_CLONE, 0);
186  }
187 
188  // Obtain v2b_table
189  int nv2b; const int *v2b_ptr;
190  COM_get_size( (sdv_wname+".v2b").c_str(), pid, &nv2b);
191  COM_get_array_const( (sdv_wname+".v2b").c_str(), pid, &v2b_ptr);
192 
193  for ( int i=0; i<nv2b; i+=3)
194  _v2b_table[ v2b_ptr[i]] = std::make_pair( v2b_ptr[i+1], v2b_ptr[i+2]);
195 
196  // Obtain b2v mapping
197  int nb2v; const int *b2v_ptr;
198  COM_get_size( (sdv_wname+".b2v").c_str(), pid, &nb2v);
199 
200  COM_get_array_const( (sdv_wname+".b2v").c_str(), pid, &b2v_ptr);
201 
202  int nsubn, nsubf;
203  COM_get_size( (sdv_wname+".nc").c_str(), pid, &nsubn);
204  COM_get_size( (sdv_wname+".:t3").c_str(), pid, &nsubf);
205 
206  _subfaces.resize( nsubf);
207  COM_copy_array( (sdv_wname+".:t3").c_str(), pid, &_subfaces[0]);
208 
209  if ( COM_get_attribute_handle((sdv_wname+".sn_parent_fcID").c_str())>0) {
210  // This is the new HDF file format!
211 
212  // Obtain subnode_parents, subnode_natcoor, and subnode_counterparts
213  _subnode_parents.resize( nsubn);
214  COM_copy_array( (sdv_wname+".sn_parent_fcID").c_str(),
215  pid, &_subnode_parents[0].face_id, 2);
216  _subnode_normalized_nc.resize( nsubn);
217  COM_copy_array( (sdv_wname+".sn_parent_ncs").c_str(),
218  pid, &_subnode_normalized_nc[0], 2);
219  _subnode_subID.resize( size_of_nodes());
220  COM_copy_array( (sdv_wname+".sn_subID").c_str(),
221  pid, &_subnode_subID[0], 1);
222 
223  COM_copy_array( (sdv_wname+".sn_permu_edID").c_str(),
224  pid, &_subnode_parents[0].edge_id, 2);
225  _subnode_nat_coors.resize( nsubn);
226  COM_copy_array( (sdv_wname+".sn_permu_ncs").c_str(),
227  pid, &_subnode_nat_coors[0][0], 2);
228 
229  _subnode_counterparts.resize( nsubn);
230  COM_copy_array( (sdv_wname+".sn_cntpt_pnID").c_str(),
231  pid, &_subnode_counterparts[0].pane_id, 2);
232  COM_copy_array( (sdv_wname+".sn_cntpt_ndID").c_str(),
233  pid, &_subnode_counterparts[0].node_id, 2);
234 
235  _subface_parents.resize( nsubf);
236  COM_copy_array( (sdv_wname+".sf_parent").c_str(), pid,
237  &_subface_parents[0]);
238 
239  _subface_counterparts.resize( nsubf);
240  COM_copy_array( (sdv_wname+".sf_cntpt_pnID").c_str(), pid,
241  &_subface_counterparts[0].pane_id, 2);
242  COM_copy_array( (sdv_wname+".sf_cntpt_fcID").c_str(), pid,
243  &_subface_counterparts[0].face_id, 2);
244 
245  _subface_nat_coors.resize( nsubf);
246  COM_copy_array( (sdv_wname+".sf_ncs").c_str(), pid,
247  &_subface_nat_coors[0], 6);
248 
249  // Obtain subface_offsets
250  _subface_offsets.resize( size_of_faces()+1);
251  COM_copy_array( (sdv_wname+".sf_offset").c_str(), pid,
252  &_subface_offsets[0]);
253  _subface_offsets[size_of_faces()] = nsubf;
254  }
255  else { // This is old file format
256  // Obtain subnode_parents, subnode_natcoor, and subnode_counterparts
257  _subnode_parents.resize( nsubn);
258  COM_copy_array( (sdv_wname+".sn_parents_fcID").c_str(),
259  pid, &_subnode_parents[0].face_id, 2);
260  COM_copy_array( (sdv_wname+".sn_parents_edID").c_str(),
261  pid, &_subnode_parents[0].edge_id, 2);
262 
263  _subnode_nat_coors.resize( nsubn);
264  COM_copy_array( (sdv_wname+".sn_xi").c_str(),
265  pid, &_subnode_nat_coors[0][0], 2);
266  COM_copy_array( (sdv_wname+".sn_eta").c_str(),
267  pid, &_subnode_nat_coors[0][1], 2);
268 
269  _subnode_counterparts.resize( nsubn);
270  COM_copy_array( (sdv_wname+".sn_cntpt_pnID").c_str(),
271  pid, &_subnode_counterparts[0].pane_id, 2);
272  COM_copy_array( (sdv_wname+".sn_cntpt_ndID").c_str(),
273  pid, &_subnode_counterparts[0].node_id, 2);
274 
275  _subface_parents.resize( nsubf);
276  COM_copy_array( (sdv_wname+".sf_parents").c_str(), pid,
277  &_subface_parents[0]);
278 
279  _subface_counterparts.resize( nsubf);
280  COM_copy_array( (sdv_wname+".sf_cntpt_pnID").c_str(), pid,
281  &_subface_counterparts[0].pane_id, 2);
282  COM_copy_array( (sdv_wname+".sf_cntpt_fcID").c_str(), pid,
283  &_subface_counterparts[0].face_id, 2);
284 
285  // Obtain subface_offsets
286  _subface_offsets.resize( size_of_faces()+1);
287  COM_copy_array( (sdv_wname+".sf_offsets").c_str(), pid, &_subface_offsets[0]);
288 
289  // Compute the natural coordinates.
290  comp_nat_coors();
291  }
292 }
void comp_nat_coors()
Compute the natural coordinates.
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
void COM_copy_array(const char *wa_str, int pane_id, void *val, int v_strd=0, int v_size=0, int offset=0)
Copy an array from an attribute on a specific pane into a given buffer.
Definition: roccom_c++.h:311
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
std::vector< int > _subnode_subID
Sub-node ID of nodes in the pane.
std::vector< Point_2S > _subnode_normalized_nc
Natual coordinates in the parent face.
int size_of_nodes() const
The total number of nodes in the pane.
blockLoc i
Definition: read.cpp:79
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
Definition: roccom_c++.h:274
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
std::vector< Three_tuple< Point_2S > > _subface_nat_coors
Element connectivity of the subfaces.
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
std::vector< int > _subface_offsets
Offsets of first subfaces contained in a face.
V2b_table _v2b_table
COM_END_NAME_SPACE COM::Roccom_base * COM_get_roccom()
Definition: Roccom_base.h:537
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
int id() const
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.

Here is the call graph for this function:

Here is the caller graph for this function:

void register_sdv_attributes ( const std::string &  wname) const
protected

Definition at line 75 of file RFC_Window_base_IO.C.

References _b2v_table, _subface_counterparts, _subface_nat_coors, _subface_offsets, _subface_parents, _subfaces, _subnode_counterparts, _subnode_nat_coors, _subnode_normalized_nc, _subnode_parents, _subnode_subID, _v2b_table, COM_allocate_array(), COM_append_array(), COM_set_array_const(), COM_set_size(), COM_window_init_done(), get_point_of_subnode(), i, id(), iend, n, size_of_faces(), and size_of_subnodes().

75  {
76  // Register the mesh
77  const int pid = id();
78 
79  // Pack coordinates into double precision buffers
80  int nnodes = size_of_subnodes();
81  COM_set_size( (wname+".nc").c_str(), pid, nnodes);
82 
83  Point_3 *coor;
84  COM_allocate_array( (wname+".nc").c_str(), pid, &(void*&)coor);
85  for ( int i=0; i<nnodes; ++i)
86  coor[i] = get_point_of_subnode( i+1);
87 
88  // Register subface connectivity, parents, and counterparts
89  COM_set_size( (wname+".:t3").c_str(), pid, _subfaces.size());
90  COM_set_array_const( (wname+".:t3").c_str(), pid, &_subfaces[0]);
91 
92  // Pack pane connectivity v2b of the pane into integer buffers
93  // allocated in Roccom.
94  int *v2b_buf;
95  COM_set_size( (wname+".v2b").c_str(), pid, _v2b_table.size()*3);
96  COM_allocate_array( (wname+".v2b").c_str(), pid, &(void*&)v2b_buf);
97 
98  for ( V2b_table::const_iterator
99  it = _v2b_table.begin(), iend=_v2b_table.end(); it!=iend; ++it) {
100  *(v2b_buf++) = it->first;
101  *(v2b_buf++) = it->second.first;
102  *(v2b_buf++) = it->second.second;
103  }
104 
105  // Pack b2v into an integer buffer.
106  std::string b2v_name=wname+".b2v";
107  for ( B2v_table::const_iterator
108  it=_b2v_table.begin(), iend=_b2v_table.end(); it != iend; ++it) {
109  const B2v &b2v = it->second;
110  int n=b2v.size();
111 
112  COM_append_array( b2v_name.c_str(), pid, &it->first, 0, 1);
113  COM_append_array( b2v_name.c_str(), pid, &n, 0, 1);
114  COM_append_array( b2v_name.c_str(), pid, &b2v[0], 0, b2v.size());
115  }
116 
117  COM_set_array_const( (wname+".sn_parent_fcID").c_str(),
118  pid, &_subnode_parents[0].face_id, 2);
119  COM_set_array_const( (wname+".sn_parent_ncs").c_str(),
120  pid, &_subnode_normalized_nc[0], 2);
121 
122  // Permuted local coordinates within parent face
123  COM_set_array_const( (wname+".sn_permu_edID").c_str(),
124  pid, &_subnode_parents[0].edge_id, 2);
125  COM_set_array_const( (wname+".sn_permu_ncs").c_str(),
126  pid, &_subnode_nat_coors[0][0], 2);
127 
128  // Register the counterpart of each subnode
129  COM_set_array_const( (wname+".sn_cntpt_pnID").c_str(),
130  pid, &_subnode_counterparts[0].pane_id, 2);
131  COM_set_array_const( (wname+".sn_cntpt_ndID").c_str(),
132  pid, &_subnode_counterparts[0].node_id, 2);
133 
134  // Register the parent of each subface
135  COM_set_array_const( (wname+".sf_parent").c_str(),
136  pid, &_subface_parents[0]);
137 
138  // Register the natural coordinates of subnodes in each subface
139  COM_set_array_const( (wname+".sf_ncs").c_str(),
140  pid, &_subface_nat_coors[0]);
141 
142  // Register the counterpart in the other mesh of each subface
143  COM_set_array_const( (wname+".sf_cntpt_pnID").c_str(),
144  pid, &_subface_counterparts[0].pane_id, 2);
145  COM_set_array_const( (wname+".sf_cntpt_fcID").c_str(),
146  pid, &_subface_counterparts[0].face_id, 2);
147 
148  // Register the offset of the subface ID for each input facet
149  COM_set_size( (wname+".sn_subID").c_str(), pid, _subnode_subID.size());
150  COM_set_array_const( (wname+".sn_subID").c_str(),
151  pid, &_subnode_subID[0]);
152 
153  // Register the offset of the subface ID for each input facet
154  COM_set_size( (wname+".sf_offset").c_str(), pid, size_of_faces());
155  COM_set_array_const( (wname+".sf_offset").c_str(),
156  pid, &_subface_offsets[0]);
157 
158  COM_window_init_done( wname.c_str());
159 }
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
Definition: roccom_c++.h:136
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
std::vector< int > _subnode_subID
Sub-node ID of nodes in the 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
std::vector< Point_2S > _subnode_normalized_nc
Natual coordinates in the parent face.
blockLoc i
Definition: read.cpp:79
Point_3 get_point_of_subnode(int id) const
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
const NT & n
B2v_table _b2v_table
void COM_set_array_const(const char *wa_str, int pane_id, const void *addr, int strd=0, int cap=0)
Definition: roccom_c++.h:160
void COM_allocate_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=0, int cap=0)
Allocate space for an attribute on a specific pane and return the address by setting addr...
Definition: roccom_c++.h:196
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
std::vector< Three_tuple< Point_2S > > _subface_nat_coors
Element connectivity of the subfaces.
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
std::vector< int > _subface_offsets
Offsets of first subfaces contained in a face.
V2b_table _v2b_table
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
int id() const
std::vector< int > B2v
From local boundary ids to node ids.
void COM_append_array(const char *wa_str, int pane_id, const void *val, int v_strd, int v_size)
Append an array to the end of the attribute on a specific pane and return the new address by setting ...
Definition: roccom_c++.h:214
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.

Here is the call graph for this function:

int size_of_border_nodes ( ) const
inline

Definition at line 234 of file RFC_Window_base.h.

References _n_border.

234 { return _n_border; }
int size_of_faces ( ) const
inline
int size_of_isolated_nodes ( ) const
inline

Definition at line 232 of file RFC_Window_base.h.

References _n_isolated.

Referenced by Transfer_base::interpolate_fe().

232 { return _n_isolated; }

Here is the caller graph for this function:

int size_of_nodes ( ) const
inline

The total number of nodes in the pane.

Definition at line 227 of file RFC_Window_base.h.

References _base.

Referenced by RFC_Pane_overlay::build_hds(), comp_nat_coors(), get_bounding_box(), Transfer_base::interpolate_fe(), is_border_node(), is_isolated_node(), RFC_Window_overlay::print_features(), read_binary(), read_rocin(), RFC_Window_overlay::reduce_coordinates_to_all(), RFC_Window_transfer::replicate_data(), size_of_primary_nodes(), and write_binary().

227 { return _base->size_of_nodes(); }
Base * _base
Reference to its base object.

Here is the caller graph for this function:

int size_of_primary_nodes ( ) const

Get total number of primary nodes contained in the pane.

Definition at line 210 of file RFC_Window_base.C.

References _v2b_table, iend, is_primary_node(), n, and size_of_nodes().

210  {
211  int n = size_of_nodes();
212  for ( V2b_table::const_iterator it=_v2b_table.begin(), iend=_v2b_table.end();
213  it != iend; ++it) {
214  if ( !is_primary_node( it->first)) --n;
215  }
216  return n;
217 }
**********************************************************************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
int size_of_nodes() const
The total number of nodes in the pane.
const NT & n
V2b_table _v2b_table
bool is_primary_node(const int vid) const
Is the node with given local id a primary one?

Here is the call graph for this function:

int size_of_subfaces ( ) const
inline

The total number of faces in the subdivision of the pane.

Definition at line 242 of file RFC_Window_base.h.

References _subfaces.

Referenced by comp_nat_coors(), RFC_Window_transfer::incident_faces(), RFC_Window_transfer::replicate_metadata(), and write_tec_sub().

242 { return _subfaces.size(); }
std::vector< Three_tuple< int > > _subfaces

Here is the caller graph for this function:

int size_of_subnodes ( ) const
inline

The total number of nodes in the subdivision of the pane.

Definition at line 240 of file RFC_Window_base.h.

References _subnode_parents.

Referenced by comp_nat_coors(), Transfer_base::interpolate_fe(), register_sdv_attributes(), and write_tec_sub().

240 { return _subnode_parents.size(); }
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.

Here is the caller graph for this function:

void write_binary ( std::ostream &  os) const
protected

Definition at line 71 of file RFC_Window_base_IO_binary.C.

References _b2v_table, _base, _color, _subface_counterparts, _subface_offsets, _subface_parents, _subfaces, _subnode_counterparts, _subnode_nat_coors, _subnode_parents, _v2b_table, iend, n, RFC_assertion, size_of_faces(), size_of_nodes(), and write().

Referenced by RFC_Window_base::write_sdv().

71  {
72  RFC_assertion( sizeof(int)==4);
73  RFC_assertion( sizeof(Real)==8);
74 
75  write( os, int(1)); // For detecting big or small endian
76  Real three = 3.; // Version number (New version changed on 04/11/04)
77  os.write( (char *)&three, sizeof(Real));
78 
79  // Write out color and the id of the pane.
80  write( os, _color); write( os, id());
81 
82  // #nodes and #faces
83  write( os, size_of_nodes()); write( os, size_of_faces());
84 
85  // Nodal coordinates of the pane
86  const Real *p = _base->coordinates();
87  os.write( (const char*)p, 3*_base->size_of_nodes()*sizeof(Real));
88 
89  if ( _base->is_structured()) {
90  write( os, 1);
91  write( os, 2); write( os, 1);
92  write( os, _base->size_i()); write( os, _base->size_j());
93  }
94  else {
95  std::vector< const COM::Connectivity*> elems;
96  _base->elements( elems);
97  write( os, elems.size());
98  // Output sizes of the faces
99  for ( std::vector<const COM::Connectivity*>::const_iterator
100  it = elems.begin(); it != elems.end(); ++it) {
101  write( os, (*it)->size_of_nodes_pe());
102  write( os, (*it)->size_of_elements());
103 
104  const int *e = (*it)->pointer();
105  const int nn = (*it)->size_of_nodes_pe();
106  os.write( (const char*)e, (*it)->size_of_elements()*nn*sizeof(int));
107  }
108  }
109 
110  // Pane connectivity of input mesh
111  write( os, _b2v_table.size());
112  for ( B2v_table::const_iterator
113  it=_b2v_table.begin(), iend=_b2v_table.end(); it != iend; ++it) {
114  const B2v &b2v = it->second;
115 
116  int n=b2v.size();
117  write( os, it->first); write( os, n);
118  os.write( (const char*)&b2v[0], n*sizeof(b2v[0]));
119  }
120  write ( os, _v2b_table.size());
121  for ( V2b_table::const_iterator
122  it = _v2b_table.begin(), iend=_v2b_table.end(); it!=iend; ++it) {
123  write( os, it->first);
124  write( os, it->second.first);
125  write( os, it->second.second);
126  }
127 
128  write(os, _subnode_parents.size()); write(os, _subfaces.size());
129 
130  // Output subnodes.
131  {
132  int n=_subnode_parents.size();
133  RFC_assertion( sizeof(_subnode_parents[0])==8);
134  os.write( (const char*)&_subnode_parents[0],
135  n*sizeof(_subnode_parents[0]));
136  os.write( (const char*)&_subnode_nat_coors[0],
137  n*sizeof(_subnode_nat_coors[0]));
138  os.write( (const char*)&_subnode_counterparts[0],
139  n*sizeof(_subnode_counterparts[0]));
140  }
141 
142  // Output subfaces.
143  {
144  int n = _subfaces.size();
145  os.write( (const char*)&_subfaces[0],
146  n*sizeof(_subfaces[0]));
147  os.write( (const char*)&_subface_parents[0],
148  n*sizeof(_subface_parents[0]));
149  os.write( (const char*)&_subface_counterparts[0],
150  n*sizeof(_subface_counterparts[0]));
151  }
152 
153  // Offsets of sub-faces.
154  RFC_assertion( int(_subface_offsets.size()) == int(size_of_faces())+1);
155  os.write( (const char*)&_subface_offsets[0],
156  sizeof(int)*_subface_offsets.size());
157 
158  write( os, _subnode_parents.size()+_subfaces.size()); // Checksum
159 }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
**********************************************************************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 write(std::ostream &os, const T &t, const io_Read_write &)
Definition: io.h:96
int size_of_nodes() const
The total number of nodes in the pane.
const NT & n
B2v_table _b2v_table
std::vector< Node_ID > _subnode_counterparts
Ids of counterparts of subnodes.
int _color
Is a node on border?
std::vector< int > _subface_parents
Face ids of the parents of the subfaces.
std::vector< int > _subface_offsets
Offsets of first subfaces contained in a face.
V2b_table _v2b_table
std::vector< Point_2S > _subnode_nat_coors
Natual coordinates in the parent face.
std::vector< int > B2v
From local boundary ids to node ids.
#define RFC_assertion
Definition: rfc_basic.h:65
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.

Here is the call graph for this function:

Here is the caller graph for this function:

RFC_BEGIN_NAME_SPACE void write_tec_ascii ( std::ostream &  os,
const COM::Attribute *  attr = 0 
) const
protected

Definition at line 36 of file RFC_Window_base_IO_tecplot.C.

References _base, set_ascii_mode(), write_tec_ij(), write_tec_mixed(), and write_tec_tri().

Referenced by RFC_Window_base::write_tec_ascii().

36  {
37  if ( _base->size_of_nodes()==0) return;
38 
39  set_ascii_mode(os);
40  if ( _base->is_structured())
41  write_tec_ij( os, attr); // Structured mesh
42  else { // Unstructured mesh
43  std::vector< const COM::Connectivity*> elems;
44  _base->elements( elems);
45 
46  if ( elems.size() == 1 && elems[0]->size_of_edges_pe() == 3)
47  // Triangular finite element mesh
48  write_tec_tri( os, *elems[0], attr);
49  else
50  // Quadrilateral/mixed finite element mesh
51  write_tec_mixed( os, elems, attr);
52  }
53 }
Base * _base
Reference to its base object.
void write_tec_tri(std::ostream &, const COM::Connectivity &, const COM::Attribute *a=0) const
void write_tec_ij(std::ostream &, const COM::Attribute *a=0) const
IO::Mode set_ascii_mode(std::ios &i)
Definition: io.C:70
void write_tec_mixed(std::ostream &, const std::vector< const COM::Connectivity * > &, const COM::Attribute *a=0) const

Here is the call graph for this function:

Here is the caller graph for this function:

void write_tec_ij ( std::ostream &  os,
const COM::Attribute *  a = 0 
) const
protected

Definition at line 83 of file RFC_Window_base_IO_tecplot.C.

References _base, i, n, RFC_assertion, and write_attr().

Referenced by write_tec_ascii().

83  {
84  RFC_assertion( _base != NULL);
85 
86  // Write out the head
87  if ( attr)
88  os << "TITLE = \"" << attr->name() << "\" \n";
89  else
90  os << "TITLE = \"Structured mesh\" \n";
91  os << "VARIABLES = \"X\", \"Y\", \"Z\"";
92  if ( attr) {
93  const int MAXDIM=4, dim=attr->size_of_components();
94  const char vname[MAXDIM+1]="UVWT";
95  RFC_assertion( dim<=MAXDIM);
96  for ( int i=0; i<dim; ++i)
97  os << ", \"" << vname[i] << "\"";
98  }
99  os << "\nZONE I=" << _base->size_i()
100  << ", J=" << _base->size_j() << ", F=POINT\n";
101 
102  // Write out the coordinates
103  const Real *p = _base->coordinates();
104  for ( int i=0, n=_base->size_of_nodes(); i<n; ++i) {
105  os << p[3*i] << ' ' << p[3*i+1] << ' ' << p[3*i+2];
106  if ( attr) write_attr( os, attr, i);
107  os << std::endl;
108  }
109  os << std::endl;
110 }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
static void write_attr(std::ostream &os, const COM::Attribute *attr, int i)
blockLoc i
Definition: read.cpp:79
const NT & n
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

void write_tec_mixed ( std::ostream &  os,
const std::vector< const COM::Connectivity * > &  elems,
const COM::Attribute *  a = 0 
) const
protected

Definition at line 151 of file RFC_Window_base_IO_tecplot.C.

References _base, i, n, RFC_assertion, and write_attr().

Referenced by write_tec_ascii().

153  {
154  RFC_assertion( _base != NULL);
155 
156  if ( attr)
157  os << "TITLE = \"" << attr->name() << "\" \n";
158  else
159  os << "TITLE = \"Triangular finite element mesh\" \n";
160  os << "VARIABLES = \"X\", \"Y\", \"Z\"";
161  if ( attr) {
162  const int MAXDIM=4, dim=attr->size_of_components();
163  const char vname[MAXDIM+1]="UVWT";
164  RFC_assertion( dim<=MAXDIM);
165  for ( int i=0; i<dim; ++i)
166  os << ", \"" << vname[i] << "\"";
167  }
168  os << "\nZONE N=" << _base->size_of_nodes() << ", E="
169  << _base->size_of_elements() << ", F=FEPOINT, ET=QUADRILATERAL\n";
170 
171  // Write out the coordinates
172  const Real *p = _base->coordinates();
173  for ( int i=0, n=_base->size_of_nodes(); i<n; ++i) {
174  os << p[3*i] << ' ' << p[3*i+1] << ' ' << p[3*i+2];
175  if ( attr) write_attr( os, attr, i);
176  os << std::endl;
177  }
178  os << std::endl;
179 
180  // Write out the elements
181  for ( std::vector<const COM::Connectivity*>::const_iterator
182  it = elems.begin(); it != elems.end(); ++it) {
183  const int *e = (*it)->pointer();
184  int nn = (*it)->size_of_nodes_pe();
185  switch ( (*it)->size_of_edges_pe()) {
186  case 3:
187  for ( int i=0,n=(*it)->size_of_elements(); i<n; ++i)
188  { os << e[nn*i] << ' ' << e[nn*i+1] << ' '
189  << e[nn*i+2] << ' ' << e[nn*i+2] << std::endl; }
190  break;
191  case 4:
192  for ( int i=0, n=(*it)->size_of_elements(); i<n; ++i)
193  { os << e[nn*i] << ' ' << e[nn*i+1] << ' '
194  << e[nn*i+2] << ' ' << e[nn*i+3] << std::endl; }
195  break;
196  default:
197  RFC_assertion( false);
198  }
199  }
200 }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
static void write_attr(std::ostream &os, const COM::Attribute *attr, int i)
blockLoc i
Definition: read.cpp:79
const NT & n
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

void write_tec_sub ( std::ostream &  os) const
protected

Definition at line 205 of file RFC_Window_base_IO_tecplot.C.

References _base, _subfaces, get_point_of_subnode(), i, RFC_assertion, size_of_subfaces(), size_of_subnodes(), Point_3< T >::x(), Point_3< T >::y(), and Point_3< T >::z().

Referenced by RFC_Window_base::write_tec_sub().

205  {
206  RFC_assertion( _base != NULL);
207  if ( size_of_subnodes() == 0) return;
208 
209  os << "TITLE = \"Triangular subdivision mesh\" \n";
210  os << "VARIABLES = \"X\", \"Y\", \"Z\"";
211  os << "\nZONE N=" << size_of_subnodes() << ", E="
212  << size_of_subfaces() << ", F=FEPOINT, ET=TRIANGLE\n";
213 
214  // Write out the coordinates, and the node ids start from 1.
215  for ( int i=1, size=size_of_subnodes(); i<=size; ++i) {
217 
218  os << p.x() << ' ' << p.y() << ' ' << p.z() << std::endl;
219  }
220  os << std::endl;
221 
222  // Write out the elements. We directly access the connectivity table
223  // and their indices start from 0.
224  for ( int i=0, size=size_of_subfaces(); i<size; ++i) {
225  os << _subfaces[i][0] << ' ' << _subfaces[i][1]
226  << ' ' << _subfaces[i][2] << std::endl;
227  }
228 }
Base * _base
Reference to its base object.
std::vector< Three_tuple< int > > _subfaces
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
blockLoc i
Definition: read.cpp:79
Point_3 get_point_of_subnode(int id) const
int size_of_subfaces() const
The total number of faces in the subdivision of the pane.
FT x() const
Definition: Point_3.h:129
FT y() const
Definition: Point_3.h:132
#define RFC_assertion
Definition: rfc_basic.h:65
FT z() const
Definition: Point_3.h:135

Here is the call graph for this function:

Here is the caller graph for this function:

void write_tec_tri ( std::ostream &  os,
const COM::Connectivity &  ec,
const COM::Attribute *  a = 0 
) const
protected

Definition at line 114 of file RFC_Window_base_IO_tecplot.C.

References _base, i, n, RFC_assertion, and write_attr().

Referenced by write_tec_ascii().

115  {
116  RFC_assertion( _base != NULL);
117 
118  if ( attr)
119  os << "TITLE = \"" << attr->name() << "\" \n";
120  else
121  os << "TITLE = \"Triangular finite element mesh\" \n";
122  os << "VARIABLES = \"X\", \"Y\", \"Z\"";
123  if ( attr) {
124  const int MAXDIM=4, dim=attr->size_of_components();
125  const char vname[MAXDIM+1]="UVWT";
126  RFC_assertion( dim<=MAXDIM);
127  for ( int i=0; i<dim; ++i)
128  os << ", \"" << vname[i] << "\"";
129  }
130  os << "\nZONE N=" << _base->size_of_nodes() << ", E="
131  << _base->size_of_elements() << ", F=FEPOINT, ET=TRIANGLE\n";
132 
133  // Write out the coordinates
134  const Real *p = _base->coordinates();
135  for ( int i=0, n=_base->size_of_nodes(); i<n; ++i) {
136  os << p[3*i] << ' ' << p[3*i+1] << ' ' << p[3*i+2];
137  if ( attr) write_attr( os, attr, i);
138  os << std::endl;
139  }
140  os << std::endl;
141 
142  // Write out the elements
143  const int *e = ec.pointer();
144  int nn = ec.size_of_nodes_pe();
145  for ( unsigned int i=0, n=_base->size_of_elements(); i<n; ++i)
146  { os << e[nn*i] << ' ' << e[nn*i+1] << ' ' << e[nn*i+2] << std::endl; }
147 }
double Real
Definition: mapbasic.h:322
Base * _base
Reference to its base object.
static void write_attr(std::ostream &os, const COM::Attribute *attr, int i)
blockLoc i
Definition: read.cpp:79
const NT & n
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class RFC_Window_base
friend

Definition at line 161 of file RFC_Window_base.h.

friend class RFC_Window_derived
friend

Definition at line 162 of file RFC_Window_base.h.

Member Data Documentation

int _color
private

Is a node on border?

Definition at line 447 of file RFC_Window_base.h.

Referenced by color(), and write_binary().

std::vector< const COM::Connectivity*> _elem_conns
private

Definition at line 449 of file RFC_Window_base.h.

Referenced by get_edge_id(), get_element(), and init().

std::vector< int> _elem_offsets
private

Definition at line 450 of file RFC_Window_base.h.

Referenced by get_element(), and init().

std::vector< bool> _is_border
protected

Is a node on border?

Definition at line 413 of file RFC_Window_base.h.

Referenced by init(), and is_border_node().

std::vector< bool> _is_isolated
protected

Is a node isolated?

Definition at line 414 of file RFC_Window_base.h.

Referenced by init(), and is_isolated_node().

bool _is_master
protected

Is the pane a master copy?

Definition at line 410 of file RFC_Window_base.h.

Referenced by is_master(), and is_replicate().

int _n_border
protected

Definition at line 415 of file RFC_Window_base.h.

Referenced by init(), and size_of_border_nodes().

int _n_isolated
protected

Definition at line 415 of file RFC_Window_base.h.

Referenced by init(), and size_of_isolated_nodes().

bool _quadratic
protected

Does it contain quadratic elements?

Definition at line 411 of file RFC_Window_base.h.

Referenced by RFC_Pane_overlay::build_hds(), init(), and is_quadratic().

std::vector< Three_tuple<Point_2S> > _subface_nat_coors
protected

Element connectivity of the subfaces.

Definition at line 444 of file RFC_Window_base.h.

Referenced by comp_nat_coors(), get_nat_coor_in_element(), read_rocin(), and register_sdv_attributes().

std::vector< int> _subface_offsets
protected

Offsets of first subfaces contained in a face.

Definition at line 438 of file RFC_Window_base.h.

Referenced by RFC_Pane_overlay::allocate_subfaces(), RFC_Window_base::export_window(), read_binary(), read_rocin(), register_sdv_attributes(), and write_binary().

std::vector< Point_2S > _subnode_normalized_nc
protected

Natual coordinates in the parent face.

Definition at line 425 of file RFC_Window_base.h.

Referenced by comp_nat_coors(), get_host_element_of_subnode(), read_rocin(), and register_sdv_attributes().

std::vector< int> _subnode_subID
protected

Sub-node ID of nodes in the pane.

Definition at line 427 of file RFC_Window_base.h.

Referenced by comp_nat_coors(), read_rocin(), and register_sdv_attributes().


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