Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFC_Window_base.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: RFC_Window_base.h,v 1.30 2008/12/06 08:43:26 mtcampbe Exp $
24 
25 //===============================================================
26 // This file defines RFC_Window_base and RFC_Pane_base. The class
27 // RFC_Window_overlay, RFC_Pane_overlay, RFC_Window_transfer,
28 // and RFC_Pane_transfer are implemented based on these two.
29 // Author: Xiangmin Jiao
30 // Date: 06/14/2001
31 //===============================================================
32 
33 #ifndef RFC_WINDOW_BASE_H
34 #define RFC_WINDOW_BASE_H
35 
36 #include "rfc_basic.h"
37 #include "roccom_devel.h"
38 #include "Tuple.h"
39 #include "Vector_n.h"
40 #include <set>
41 #include <map>
42 #include <fstream>
43 #include "../Rocmap/include/Pane_communicator.h"
44 #include "Element_accessors.h"
45 
47 
49 
54 struct Node_ID {
56  Node_ID() {}
58 
62  Node_ID( int p, int v) : pane_id( p), node_id( v) {}
63  int pane_id;
64  int node_id;
65 
67  bool operator==( const Node_ID &v) const
68  { return pane_id == v.pane_id && node_id == v.node_id; }
70  bool operator<( const Node_ID &v) const {
71  return (pane_id < v.pane_id ||
72  pane_id == v.pane_id && node_id < v.node_id);
73  }
74 };
75 
77 
82 struct Face_ID {
84  Face_ID() {}
86 
90  Face_ID( int p, int f) : pane_id( p), face_id( f) {}
91 
92  int pane_id;
93  int face_id;
94 
96  bool operator==( const Face_ID &v) const
97  { return pane_id == v.pane_id && face_id == v.face_id; }
99  bool operator<( const Face_ID &v) const {
100  return (pane_id < v.pane_id ||
101  pane_id == v.pane_id && face_id < v.face_id);
102  }
103 };
104 
105 class RFC_Window_base;
106 using MAP::Element_node_enumerator;
107 
108 template < class _Pane> class RFC_Window_derived;
110 
154 public:
156  typedef COM::Pane Base;
157  typedef COM::Attribute Attribute;
158  typedef Base::Size Size;
159  typedef RFC::Real Real;
160 
161  friend class RFC_Window_base;
162  template <class _Pane> friend class RFC_Window_derived;
163 
165 
168  struct Edge_ID {
170  Edge_ID() {}
172 
176  Edge_ID( int f, int e) : face_id( f), edge_id(e) {}
177 
178  int face_id;
179  int edge_id;
180 
182  bool operator<( const Edge_ID &v) const {
183  return (face_id < v.face_id ||
184  face_id == v.face_id && edge_id < v.edge_id);
185  }
186  };
187 
188  // Pane connectivity informaiton.
189  typedef std::pair<int,int> V2b;
191  typedef std::map<int, V2b> V2b_table;
193  typedef std::vector<int> B2v;
195  typedef std::map<int, B2v> B2v_table;
197 
199  RFC_Pane_base( Base *b, int color);
200  void init();
201 
203  virtual ~RFC_Pane_base() {}
204 
206  Base *base() { return _base; }
207  const Base *base() const { return _base; }
208  int id() const { return _base->id(); }
209 
211  bool is_master() const { return _is_master; }
213  bool is_replicate() const { return !_is_master; }
215  bool is_quadratic() const { return _quadratic; }
217  bool is_border_node( int i) const
218  { RFC_assertion( i>=1 && i<= size_of_nodes()); return _is_border[i-1]; }
220  bool is_isolated_node( int i) const
221  { RFC_assertion( i>=1 && i<= size_of_nodes()); return _is_isolated[i-1]; }
222 
224  bool coincident( int i, int j) const;
225 
227  int size_of_nodes() const { return _base->size_of_nodes(); }
229  int size_of_faces() const { return _base->size_of_elements(); }
230 
231  // ! Obtain the number of isolated nodes in the pane
232  int size_of_isolated_nodes() const { return _n_isolated; }
233  // ! Obtain the number of border nodes in the pane
234  int size_of_border_nodes() const { return _n_border; }
235 
237  Edge_ID get_edge_id( const int face_lid, const int vertex_lid) const;
238 
240  int size_of_subnodes() const { return _subnode_parents.size(); }
242  int size_of_subfaces() const { return _subfaces.size(); }
243 
245  Real *pointer( int i)
246  { return (Real*)_base->attribute(i)->pointer(); }
248  const Real *pointer( int i) const
249  { return (Real*)_base->attribute(i)->pointer(); }
250 
252  bool is_primary_node( const int vid) const;
253 
255  int size_of_primary_nodes() const;
256 
258  const Point_3 &get_point( int id) const {
259  RFC_assertion( sizeof( Point_3) == 3*sizeof( Real));
260  return *reinterpret_cast<const Point_3*>(_base->coordinates()+3*(id-1));
261  }
262  const Point_3 &get_point( int id, int) const {
263  RFC_assertion( sizeof( Point_3) == 3*sizeof( Real));
264  return *reinterpret_cast<const Point_3*>(_base->coordinates()+3*id);
265  }
266  const Real *coordinates() const { return _base->coordinates(); }
267  Point_3 get_point_of_subnode( int id) const;
268 
270  Bbox_3 get_bounding_box() const;
271 
273  int color() const { return _color; }
274 
276  int parent_type_of_subnode( int) const;
277 
279  int get_parent_node( int) const;
280 
282  int get_parent_face( int id) const { return _subface_parents[ id-1]; }
283 
290  template <class Point>
291  void normalize_nat_coor( int idx, int e, Point &nc) const {
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  }
310 
311  void
313  Point_2 &nc) const {
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  }
320 
321  void
323  int f=_subface_parents[i-1];
324  if ( ene.pane() != _base || ene.id() != f)
325  ene = Element_node_enumerator( _base, f);
326  }
327 
330  void get_nat_coor_in_element( const int eid, const int lid, Point_2 &nc) const {
331  const Point_2S &p=_subface_nat_coors[eid-1][lid];
332  nc[0] = p[0]; nc[1]=p[1];
333  }
334 
337  void get_nat_coor_in_element( const int sn_id,
338  Element_node_enumerator &ene, Point_2 &nc) const;
339 
342  std::pair< const COM::Connectivity*, int> get_element( int face_id) const {
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  }
348  const Node_ID &get_subnode_counterpart( int i) const {
349  RFC_assertion( i>=1 && i<=(int)_subnode_counterparts.size());
350  return _subnode_counterparts[i-1];
351  }
352  const Face_ID &get_subface_counterpart( int i) const {
353  RFC_assertion( i>=1 && i<=(int)_subface_counterparts.size());
354  return _subface_counterparts[i-1];
355  }
356 
357  int get_lvid( const Element_node_enumerator &ene,
358  const int v) const;
359 
360 protected:
362  void comp_nat_coors();
363 
365  void build_v2b_from_b2v( const RFC_Window_base *w);
366 
367 protected:
368  // Used by read_binary and read_rocin to create a pane
369  class COM_Pane_friend : protected COM::Pane {
370  protected:
371  COM_Pane_friend();
372  public:
373  using COM::Pane::attribute;
374  using COM::Pane::connectivity;
375  using COM::Pane::set_size;
376  using COM::Pane::reinit_conn;
377  };
378 
379  //=========== IO Functions
380  void write_tec_ij( std::ostream &, const COM::Attribute *a=0) const;
381  void write_tec_tri( std::ostream &, const COM::Connectivity &,
382  const COM::Attribute *a=0) const;
383  void write_tec_mixed( std::ostream&,
384  const std::vector< const COM::Connectivity*>&,
385  const COM::Attribute *a=0) const;
386  void write_tec_sub( std::ostream &) const;
387  void write_tec_ascii( std::ostream &os, const COM::Attribute *attr=0) const;
388 
389  // Write in native binary format
390  void write_binary( std::ostream &os) const;
391 
392  // Read in native binary format.
393  void read_binary( std::istream &is,
394  std::vector <int> *b2v_all=NULL, COM::Pane *p=NULL);
395 
396  // Register the attributes for the pane for output using Rocout.
397  void register_sdv_attributes( const std::string &wname) const;
398 
403  void read_rocin( const std::string &sdv_wname,
404  const std::string &parent_wname="",
405  COM::Pane *p=NULL);
406 
407 protected:
408  // Data members
410  bool _is_master;
411  bool _quadratic;
412 
413  std::vector< bool> _is_border;
414  std::vector< bool> _is_isolated;
416 
419 
420  // Information about the subnodes contained in the pane
421  std::vector< Edge_ID> _subnode_parents;
423  std::vector< Point_2S> _subnode_nat_coors;
425  std::vector< Point_2S > _subnode_normalized_nc;
427  std::vector< int> _subnode_subID;
429 
430  std::vector< Node_ID> _subnode_counterparts;
432 
433  // Information about the subfaces contained in the pane
434  std::vector< Three_tuple<int> > _subfaces;
435 
436  std::vector< int > _subface_parents;
438  std::vector< int> _subface_offsets;
440  std::vector< Face_ID> _subface_counterparts;
442 
443  // Natural coordiates of the subnodes of a subface in its parent face
444  std::vector< Three_tuple<Point_2S> > _subface_nat_coors;
446 private:
447  int _color;
448 
449  std::vector< const COM::Connectivity*> _elem_conns;
450  std::vector< int> _elem_offsets;
451 
452 private:
453  // Disable the following functions.
454  RFC_Pane_base();
455  RFC_Pane_base( const Self&);
456  Self &operator=( const Self&);
457 };
458 
459 //================ Filed data access operators ===================
461 
463 public:
464  typedef Point_3 Value;
466  typedef const Point_3 Value_const;
467  typedef unsigned int Size;
468 
470  Value_const& get_value( const RFC_Pane_base *p, int i) const {
471  return p->get_point(i);
472  }
474  Value_const& get_value( const Real *p, int i) const {
475  return *reinterpret_cast<Value_const*>(p+3*(i-1));
476  }
477 };
478 
479 
480 // Adpator for element-wise data container.
481 // This wrapper provides an interface to access data through the
482 // element-wise local indices.
483 template < class _Cont, class _Enum>
484 class Field {
485 public:
486  typedef typename _Cont::Value Value;
487  typedef typename _Cont::Value_nonconst Value_nonconst;
488  typedef typename _Cont::Value_const Value_const;
489  typedef unsigned int Size;
490 private:
491  _Cont &_cont;
493  const _Enum &_enum;
494 public:
495  Field( _Cont & cont, Real *p, const _Enum &ids)
496  : _cont(cont), _p(p), _enum(ids) {}
497  Size dimension() const { return _cont.dimension(); }
499  { return _cont.get_value(_p, _enum[i]); }
501  { return _cont.get_value(_p, _enum[i]); }
502 };
503 
504 template < class _Cont, class _Enum>
505 class Field< const _Cont, _Enum> {
506 public:
507  typedef typename _Cont::Value Value;
508  typedef typename _Cont::Value_nonconst Value_nonconst;
509  typedef typename _Cont::Value_const Value_const;
510  typedef unsigned int Size;
511 private:
512  const _Cont &_cont;
513  const Real *_p;
514  const _Enum &_enum;
515 public:
516  Field( const _Cont & cont, const Real *p, const _Enum &ids)
517  : _cont(cont), _p(p), _enum(ids) {}
518  Size dimension() const { return _cont.dimension(); }
520  { return _cont.get_value(_p, _enum[i]); }
521 };
522 
524 
528 public:
530  typedef COM::Window Base;
531  typedef COM::Attribute Attribute;
533  typedef std::map< int, Pane*> Pane_set;
534 
536  RFC_Window_base( Base *b, int c, MPI_Comm);
537 
539  virtual ~RFC_Window_base();
540 
542  std::string name() const { return _base->name(); }
543 
544  const RFC_Pane_base & pane( const int pid) const {
545  Pane_set::const_iterator pit = _pane_set.find( pid);
546  RFC_assertion( pit != _pane_set.end());
547  return *pit->second;
548  }
549 
550  RFC_Pane_base &pane( const int pid) {
551  Pane_set::iterator pit = _pane_set.find( pid);
552  RFC_assertion( pit != _pane_set.end());
553  return *pit->second;
554  }
555 
557  const COM::Window *base() const { return _base; }
558 
560  int color() const { return _color; }
561 
564  int size_of_nodes() const;
565 
567  int size_of_faces() const;
568 
571  int size_of_primary_nodes() const;
572 
574  Bbox_3 get_bounding_box() const;
575 
577  int size_of_panes() const { return _pane_set.size(); }
578 
580  const Attribute *attribute( const char *f) const
581  { return _base->attribute(f); }
582 
583  void export_window( RFC_Window_base *) const;
584 
586  void write_tec_ascii( const char *prefix) const;
588  void write_tec_sub( const char *prefix) const;
589 
591  void new_sdv_attributes( const std::string &wname) const;
592 
594  void read_sdv( const char *prefix, const char *format=NULL);
595 
597  void write_sdv( const char* prefix, const char *format=NULL) const;
598 
600  void build_pc_tables();
601 
602 protected:
604 
605  // Obtain the file name for a specific pane.
606  static std::string get_sdv_fname( const char *prefix, int pane_id,
607  const int format=SDV_BINARY);
608 
609  // Get the basename of the prefix without the directory part and suffix.
610  static const char *get_prefix_base( const char *prefix);
611 
612  // Convert from string into the code.
613  static int get_sdv_format( const char *format);
614 
615  // Prefix to be added in front of buffer windows.
616  static const char *_bufwin_prefix;
617 
618 protected: // Data members
621  int _verbose;
622  int _color;
623 
624  MAP::Pane_communicator _map_comm;
625 
626 private:
627  // Disable the following functions.
628  RFC_Window_base();
629  RFC_Window_base(const Self&);
630  Self &operator=( const Self&);
631 };
632 
634 
639 template <class _Pane>
640 class RFC_Window_derived : public RFC_Window_base {
641 protected:
644  typedef _Pane Pane;
645 
647  RFC_Window_derived( COM::Window *b, int c, MPI_Comm comm) : Base(b,c, comm)
648  { init(); }
650  virtual ~RFC_Window_derived();
651  void init();
652 
653 public:
655  const Pane &pane( const int pid) const;
657  Pane &pane( const int pid);
658 
660  std::pair< Pane*, int> get_primary( Pane *p, int vid);
661 
663  std::pair< const Pane*, int> get_primary( const Pane *p, int vid) const;
664 
666  void panes( std::vector<Pane*> &ps);
668  void panes( std::vector<const Pane*> &ps) const;
669 };
670 
671 template < class _Pane>
673 
674 template < class _Pane>
675 void
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 }
686 
687 template < class _Pane>
688 const _Pane &
689 RFC_Window_derived<_Pane>::pane( const int pid) const {
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 }
694 
695 template < class _Pane>
696 _Pane &
698  Pane_set::iterator pit = _pane_set.find( pid);
699  RFC_assertion( pit != _pane_set.end());
700  return reinterpret_cast<_Pane&>(*pit->second);
701 }
702 
703 template < class _Pane>
704 void
705 RFC_Window_derived<_Pane>::panes( std::vector<Pane*> &ps) {
706  const_cast<Self*>(this)->panes( (std::vector<const Pane*>&)ps);
707 }
708 
709 template < class _Pane>
710 void
711 RFC_Window_derived<_Pane>::panes( std::vector<const Pane*> &ps) const {
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 }
718 
719 template < class _Pane>
720 std::pair< _Pane*, int>
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));
738  return std::make_pair( &p2, v2.node_id);
739 }
740 
741 template < class _Pane>
742 std::pair< const _Pane*, int>
743 RFC_Window_derived<_Pane>::get_primary( const Pane *p, int vid) const {
744  return const_cast<Self*>(this)->get_primary( const_cast<Pane*>(p), vid);
745 }
746 
748 
749 #endif
750 
751 
752 
753 
754 
755 
std::string name() const
The name of the window.
std::pair< int, int > Node_ID
int face_id
local face id.
Node_ID()
A dummy constructor.
bool operator<(const Edge_ID &v) const
Less-than operator.
int node_id
the local id within the pane starting from 1.
A Pane object contains a mesh, pane attribute, and field variables.
Definition: Pane.h:43
RFC_Window_derived(COM::Window *b, int c, MPI_Comm comm)
A constructor.
virtual ~RFC_Window_derived()
A destructor.
MAP::Pane_communicator _map_comm
Value_const operator[](int i) const
int size_of_border_nodes() const
bool operator<(const Node_ID &v) const
Less-than operator.
An adaptor for enumerating node IDs of an element.
const Pane & pane(const int pid) const
Get a reference to the pane with give id pid.
int face_id
the local id within the pane starting from 1.
void write_binary(std::ostream &os) const
std::pair< int, int > V2b
Pane id and local boundary id.
const _Enum & _enum
void build_pc_tables()
Build the pane connectivity table.
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Edge_ID()
A dummy constructor.
void write_tec_ascii(std::ostream &os, const COM::Attribute *attr=0) const
void comp_nat_coors()
Compute the natural coordinates.
std::map< int, V2b > V2b_table
From node id to its corresponding map.
std::vector< const COM::Connectivity * > _elem_conns
Field(const _Cont &cont, const Real *p, const _Enum &ids)
int size_of_primary_nodes() const
Get the total number of nodes contained the window.
void normalize_nat_coor(int idx, int e, Point &nc) const
Base * base()
The id of its base COM::Pane object.
Value_const operator[](int i) const
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::map< int, Pane * > Pane_set
Adpator for element-wise data container.
SURF::Point_2< float > Point_2S
Definition: rfc_basic.h:45
const Point_3 & get_point(int id) const
Get the physical coordinates of the node with given local id.
Self & operator=(const Self &)
const Attribute * attribute(const char *f) const
Retrieve an attribute object from the base using the attribute name.
int pane_id
the id of the owner pane.
_Cont::Value_nonconst Value_nonconst
RFC_Window_derived< _Pane > Self
double Real
Definition: mapbasic.h:322
std::map< int, B2v > B2v_table
From pane id to its corresponding mapping.
virtual ~RFC_Pane_base()
The default destructor.
const Node_ID & get_subnode_counterpart(int i) const
const Face_ID & get_subface_counterpart(int i) const
Base * _base
Reference to its base object.
bool coincident(int i, int j) const
Report whether the two given nodes are coincident.
const RFC_Pane_base & pane(const int pid) const
unsigned int Size
Node_ID(int p, int v)
Constructor from two integers.
void write_tec_sub(std::ostream &) const
int parent_type_of_subnode(int) const
Determine the parent type of a subnode of given tyep.
int color() const
The color of the window for overlay or for data transfer (BLUE or GREEN).
Field(_Cont &cont, Real *p, const _Enum &ids)
int size_of_faces() const
The total number of faces in the pane.
std::vector< Three_tuple< int > > _subfaces
void write_tec_ascii(const char *prefix) const
Ouptut a mesh in Tecplot format.
int get_lvid(const Element_node_enumerator &ene, const int v) const
bool _quadratic
Does it contain quadratic elements?
int size_of_isolated_nodes() const
Size dimension() const
int id() const
Get the local id of the element within the pane.
bool is_master() const
Is this pane a master copy?
int size_of_subnodes() const
The total number of nodes in the subdivision of the pane.
RFC_Window_base Base
void panes(std::vector< Pane * > &ps)
Get a vector of local panes contained in the window.
static const char * _bufwin_prefix
std::vector< Edge_ID > _subnode_parents
Edge ids of parents.
Base * _base
A reference to its base COM::Window object.
void build_v2b_from_b2v(const RFC_Window_base *w)
Build pane connectivity.
int color() const
The color of the parent window (BLUE or GREEN).
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
Real * pointer(int i)
Get the address of a given attribute with id i.
std::vector< int > _elem_offsets
The base implementation of RFC_Pane.
std::vector< int > _subnode_subID
Sub-node ID of nodes in the pane.
#define RFC_END_NAME_SPACE
Definition: rfc_basic.h:29
int pane_id
the id of the owner pane.
int get_parent_node(int) const
Get the local parent node id of a given subnode.
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...
void write_sdv(const char *prefix, const char *format=NULL) const
Write out panes in native binary format or using Rocout.
void write_tec_tri(std::ostream &, const COM::Connectivity &, const COM::Attribute *a=0) const
void read_binary(std::istream &is, std::vector< int > *b2v_all=NULL, COM::Pane *p=NULL)
std::vector< bool > _is_isolated
Is a node isolated?
int size_of_faces() const
Get the total number of faces contained the window.
int get_parent_face(int id) const
Get the local parent face id of a given subface.
Value_const & get_value(const RFC_Pane_base *p, int i) const
Get the coordinates of a point in p with local id .
bool is_replicate() const
Is this pane not a master copy?
const Element_node_enumerator & _enum
_Cont::Value Value
RFC_Window_base Self
bool operator==(const Node_ID &v) const
Equal operator.
std::vector< Point_2S > _subnode_normalized_nc
Natual coordinates in the parent face.
void get_host_element_of_subnode(int i, Element_node_enumerator &ene, Point_2 &nc) const
int size_of_nodes() const
The total number of nodes in the pane.
unsigned int Size
A window is a collection of panes.
A local ID of an edge.
void new_sdv_attributes(const std::string &wname) const
New attributes.
const COM::Window * base() const
Get a reference to the base COM::Window object.
Bbox_3 get_bounding_box() const
Get the bounding box of the pane.
int edge_id
edge id within the face.
blockLoc i
Definition: read.cpp:79
#define RFC_BEGIN_NAME_SPACE
Definition: rfc_basic.h:28
Point_3 get_point_of_subnode(int id) const
std::vector< bool > _is_border
Is a node on border?
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 Point_3 Value_const
const Real * pointer(int i) const
Face_ID(int p, int f)
Constructor from two integers.
void write_tec_ij(std::ostream &, const COM::Attribute *a=0) const
Value_const & get_value(const Real *p, int i) const
Get the coordinates of a point in p with local id .
B2v_table _b2v_table
RFC_Pane_base Pane
const Base * base() const
int size_of_subfaces() const
The total number of faces in the subdivision of the pane.
void write_tec_sub(const char *prefix) const
Ouptut a subdivision of a mesh in Tecplot format.
bool _is_master
Is the pane a master copy?
Edge_ID get_edge_id(const int face_lid, const int vertex_lid) const
Get the edge id within a given face.
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.
Face_ID()
A dummy constructor.
void register_sdv_attributes(const std::string &wname) const
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.
int size_of_nodes() const
Get the total number of nodes contained the window.
Base::Size Size
Value_nonconst operator[](int i)
COM::Window Base
Pane_set _pane_set
The set of panes contained in the window.
bool operator<(const Face_ID &v) const
Less-than operator.
COM::Attribute Attribute
j indices j
Definition: Indexing.h:6
static const char * get_prefix_base(const char *prefix)
Real * _p
const Real * coordinates() const
_Cont::Value_nonconst Value_nonconst
Reusable implementation for derived class of RFC_Window_base.
void get_host_element_of_subface(int i, Element_node_enumerator &ene) const
bool is_border_node(int i) const
Is a give node on the boundary of the pane?
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.
Self & operator=(const Self &)
V2b_table _v2b_table
An const adaptor for accessing nodal coordinates of a pane.
const Point_3 & get_point(int id, int) const
bool is_quadratic() const
Does this pane contain quadratic elements?
void read_rocin(const std::string &sdv_wname, const std::string &parent_wname="", COM::Pane *p=NULL)
Read in using Rocin.
bool is_isolated_node(int i) const
Is a give node an isolated node not belong to any element?
void export_window(RFC_Window_base *) const
A global ID of a node.
int size_of_primary_nodes() const
Get total number of primary nodes contained in the pane.
Bbox_3 get_bounding_box() const
Get the bounding box of the window.
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.
RFC_Pane_base Self
_Cont::Value_const Value_const
int size_of_panes() const
Number of local panes in the window.
void read_sdv(const char *prefix, const char *format=NULL)
Read in local panes in native binary format or using Rocin.
#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 write_tec_mixed(std::ostream &, const std::vector< const COM::Connectivity * > &, const COM::Attribute *a=0) const
bool operator==(const Face_ID &v) const
Equal operator.
COM::Attribute Attribute
Edge_ID(int f, int e)
Constructor from two integers.
std::vector< Face_ID > _subface_counterparts
Ids of counterparts of faces.
RFC_Pane_base & pane(const int pid)
const Pane * pane() const
A global ID of a face.
_Cont::Value_const Value_const
virtual ~RFC_Window_base()
Default destructor.
bool is_primary_node(const int vid) const
Is the node with given local id a primary one?
static int get_sdv_format(const char *format)