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

An Attribute object is a data member of a window. More...

#include <Attribute.h>

Inheritance diagram for Attribute:
Collaboration diagram for Attribute:

Public Types

enum  Copy_dir { COPY_IN, COPY_OUT }
 
typedef unsigned char Shorter_size
 One byte unsighed int. More...
 
typedef unsigned int Size
 Unsighed int. More...
 

Public Member Functions

void set_size (int nitems, int ngitems=0) throw (COM_exception)
 Set the size of items and ghost items. More...
 
void * allocate (int strd, int cap, bool force) throw (COM_exception)
 Allocate memory for the attribute. More...
 
int deallocate () throw (COM_exception)
 Deallocate memory if it was allocated by allocate(). More...
 
void copy_array (void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN) throw (COM_exception)
 
void append_array (const void *from, int strd, int nitem) throw (COM_exception)
 
Identity
const std::string & name () const
 Obtain the name of the attribute. More...
 
std::string fullname () const
 Obtain the full name of the attribute including window name suitable for printing out error messages. More...
 
int id () const
 Obtain the id (or index) of the attribute. More...
 
Attributeparent ()
 Parent attribute used by this object. More...
 
const Attributeparent () const
 
Attributeroot ()
 Root of use-inheritance. More...
 
const Attributeroot () const
 
Physical address
const void * pointer () const
 Obtain a constant pointer to the physical address. More...
 
void * pointer () throw (COM_exception)
 Obtain a modifiable pointer to the physical address. More...
 
const void * get_addr (int i, int j=0) const throw (COM_exception)
 Obtain the address of the jth component of the ith item, where 0<=i<size_of_items. More...
 
void * get_addr (int i, int j=0) throw (COM_exception)
 

Protected Types

enum  {
  STATUS_NOT_INITIALIZED =0, STATUS_SET =1, STATUS_SET_CONST =2, STATUS_USE =3,
  STATUS_ALLOCATED =4
}
 

Protected Member Functions

void set_pointer (void *p, int strd, int cap, int offset, bool is_const) throw (COM_exception)
 Set the physical address of the attribute values. More...
 
void inherit (Attribute *a, bool clone, bool withghost, int depth=0) throw (COM_exception)
 Inherit from parent. If depth>0, then the procedure is for the subcomponents. More...
 

Protected Attributes

Pane_pane
 Pointer to its owner pane. More...
 
Attribute_parent
 Parent attribute being used. More...
 
std::string _name
 Name of the attribute. More...
 
int _id
 Id field data. More...
 
Shorter_size _loc
 Location. More...
 
int _ncomp
 Number of components. More...
 
COM_Type _type
 Base data type of the attribute. More...
 
std::string _unit
 Unit of the attribute. More...
 
int _nitems
 Size of total items. Default value is -1. More...
 
int _ngitems
 Size of ghost items. More...
 
int _gap
 Gap between the IDs of real and ghost items. More...
 
Shorter_size _status
 Indicating whether it has been initialized. More...
 
void * _ptr
 Physical address of the attribute. More...
 
int _strd
 Stride. More...
 
int _nbytes_strd
 Number of bytes of the stride. More...
 
int _cap
 Capacity. More...
 

Static Protected Attributes

Keywords
static const char * _keywords [COM_NUM_KEYWORDS]
 List of keywords. More...
 
static const char _keylocs [COM_NUM_KEYWORDS]
 Default locations. More...
 
static const COM_Type _keytypes [COM_NUM_KEYWORDS]
 Default data types. More...
 
static const int _keysizes [COM_NUM_KEYWORDS]
 Default sizes. More...
 

Private Member Functions

 Attribute (const Attribute &a)
 Disable copy constructor and copy operator. More...
 
Attributeoperator= (const Attribute &)
 

Constructors and destructors

 Attribute ()
 Default constructor. More...
 
 Attribute (Pane *pane, const std::string &name, int id, Shorter_size loc, int type, const int ncomp, const std::string &unit)
 Create an attribute with name n in window w. More...
 
 Attribute (Pane *pane, Attribute *parent, const std::string &name, int id)
 Inherit an attribute from another. More...
 
 ~Attribute ()
 Destructors. More...
 
 Attribute (Pane *pane, int i)
 Constructor for keywords. The default nitems for keywords is 0. More...
 

Access methods

const Panepane () const
 Obtain a constant pointer to the owner pane of the attribute. More...
 
Panepane ()
 Obtain a modifiable pointer to the owner pane of the attribute. More...
 
const Windowwindow () const
 Obtain a constant pointer to the parent window of the attribute. More...
 
Windowwindow ()
 Obtain a modifiable pointer to the parent window of the attribute. More...
 
Shorter_size location () const
 Obtain the location of the attribute. More...
 
bool is_windowed () const
 Checks whether the attribute is associated with the window. More...
 
bool is_panel () const
 Checks whether the attribute is associated with a pane. More...
 
bool is_elemental () const
 Checks whether the attribute is associated with an element. More...
 
bool is_nodal () const
 Checks whether the attribute is associated with a node. More...
 
COM_Type data_type () const
 Obtain the data type of each component of the attribute. More...
 
const std::string & unit () const
 Obtain the unit of the attribute. More...
 
int size_of_components () const
 Obtain the number of components in the attribute. More...
 
int size_of_items () const
 Obtain the number of items in the attribute. More...
 
int maxsize_of_items () const
 Obtain the maximum allowed number of items in the attribute. More...
 
int size_of_ghost_items () const
 Obtain the number of ghost items in the attribute. More...
 
int maxsize_of_ghost_items () const
 Obtain the maximum allowed number of items in the attribute. More...
 
int size_of_real_items () const
 Obtain the number of real items in the attribute. More...
 
int maxsize_of_real_items () const
 Obtain the maximum allowed number of real items in the attribute. More...
 
bool empty () const
 Check whether the number of items of the attribute is zero. More...
 
int capacity () const
 Obtain the capacity of the array. More...
 
int stride () const
 Obtain the stride of the attribute in base datatype. More...
 
int stride_in_bytes () const
 Obtain the stride of the attribute in bytes. More...
 
int status () const
 Obtain the status of the attribute. More...
 
bool initialized () const
 Returns whether the array for the attribute has been set or allocated. More...
 
bool size_set () const
 Returns whether the size for the attribute has been set. More...
 
bool allocated () const
 Returns whether the array for the attribute has been set or allocated. More...
 
bool is_const () const
 Returns whether the array is set to be read-only. More...
 
bool is_staggered () const
 Check how the attribute values are organized. More...
 
static int get_sizeof (COM_Type type, int count=1)
 
static bool compatible_types (COM_Type t1, COM_Type t2)
 
static bool is_digit (char c)
 

Detailed Description

An Attribute object is a data member of a window.

It can be associated with a window, a pane, nodes, or elements. An attribute can be a vector of length size_of_items() with size_of_components() components.

Definition at line 51 of file Attribute.h.

Member Typedef Documentation

typedef unsigned char Shorter_size

One byte unsighed int.

Definition at line 53 of file Attribute.h.

typedef unsigned int Size

Unsighed int.

Definition at line 54 of file Attribute.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
STATUS_NOT_INITIALIZED 
STATUS_SET 
STATUS_SET_CONST 
STATUS_USE 
STATUS_ALLOCATED 

Definition at line 316 of file Attribute.h.

enum Copy_dir
Enumerator
COPY_IN 
COPY_OUT 

Definition at line 280 of file Attribute.h.

Constructor & Destructor Documentation

Attribute ( )
inline

Default constructor.

Definition at line 60 of file Attribute.h.

Referenced by Attribute().

61  : _pane(NULL), _parent(NULL), _id(-1), _loc(0), _ncomp(0), _type(0),
63  _ptr(NULL), _strd(0), _nbytes_strd(0), _cap(0) {}
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _gap
Gap between the IDs of real and ghost items.
Definition: Attribute.h:314
int _id
Id field data.
Definition: Attribute.h:302
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int _cap
Capacity.
Definition: Attribute.h:323

Here is the caller graph for this function:

Attribute ( Pane pane,
int  i 
)
inlineprotected

Constructor for keywords. The default nitems for keywords is 0.

Definition at line 67 of file Attribute.h.

68  : _pane(pane), _parent(NULL), _name( _keywords[i]), _id(i),
70  _unit( i<=COM_NC3?"m":""), _nitems(0), _ngitems(0), _gap(0),
72  _nbytes_strd(0), _cap(0) {}
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
static const int _keysizes[COM_NUM_KEYWORDS]
Default sizes.
Definition: Attribute.h:328
static const COM_Type _keytypes[COM_NUM_KEYWORDS]
Default data types.
Definition: Attribute.h:327
std::string _unit
Unit of the attribute.
Definition: Attribute.h:310
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
Shorter_size _loc
Location.
Definition: Attribute.h:303
blockLoc i
Definition: read.cpp:79
int _gap
Gap between the IDs of real and ghost items.
Definition: Attribute.h:314
std::string _name
Name of the attribute.
Definition: Attribute.h:301
int _id
Id field data.
Definition: Attribute.h:302
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
static const char _keylocs[COM_NUM_KEYWORDS]
Default locations.
Definition: Attribute.h:326
static const char * _keywords[COM_NUM_KEYWORDS]
List of keywords.
Definition: Attribute.h:325
int _cap
Capacity.
Definition: Attribute.h:323
Attribute ( Pane pane,
const std::string &  name,
int  id,
Shorter_size  loc,
int  type,
const int  ncomp,
const std::string &  unit 
)
inline

Create an attribute with name n in window w.

Parameters
panepointer to its owner pane object.
nameattribute name.
idattribute index.
loclocation ('w', 'p', 'n', or 'e').
typebase data type.
ncompnumber of components.
unitunit of the attribute.

Definition at line 83 of file Attribute.h.

86  : _pane(pane), _parent(NULL), _name( name), _id(id), _loc(loc),
87  _ncomp(ncomp), _type(type), _unit(unit), _nitems(-1), _ngitems(0),
89  _nbytes_strd(0), _cap(0) {}
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
const std::string & unit() const
Obtain the unit of the attribute.
Definition: Attribute.h:200
std::string _unit
Unit of the attribute.
Definition: Attribute.h:310
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
Shorter_size _loc
Location.
Definition: Attribute.h:303
const std::string & name() const
Obtain the name of the attribute.
Definition: Attribute.h:113
int _gap
Gap between the IDs of real and ghost items.
Definition: Attribute.h:314
std::string _name
Name of the attribute.
Definition: Attribute.h:301
int _id
Id field data.
Definition: Attribute.h:302
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int _cap
Capacity.
Definition: Attribute.h:323
Attribute ( Pane pane,
Attribute parent,
const std::string &  name,
int  id 
)

Inherit an attribute from another.

Parameters
panepointer to its owner pane object.
parentparent attribute (for supporting inheritance).
nameattribute name.
idattribute index.

Definition at line 63 of file Attribute.C.

References _cap, _loc, _name, _nbytes_strd, _ncomp, _ngitems, _nitems, _parent, _status, _strd, _type, _unit, append_frame, Attribute(), COM_ERR_ATTRIBUTE_NOTEXIST, fullname(), name(), root(), and STATUS_NOT_INITIALIZED.

65  : _pane( pane), _id(id), _gap(0), _status(0)
66 {
67  if ( !parent)
70  _name = name.size()?name:parent->name();
71 
73  Attribute *root = parent->root();
74  _loc=root->_loc; _ncomp=root->_ncomp; _type=root->_type;
75  _cap = root->_cap; _strd = root->_strd; _nbytes_strd = root->_nbytes_strd;
76  _unit=root->_unit; _nitems = root->_nitems; _ngitems = root->_ngitems;
77 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Encapsulates the states of an exception.
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
Attribute()
Default constructor.
Definition: Attribute.h:60
std::string _unit
Unit of the attribute.
Definition: Attribute.h:310
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
const std::string & name() const
Obtain the name of the attribute.
Definition: Attribute.h:113
int _gap
Gap between the IDs of real and ghost items.
Definition: Attribute.h:314
std::string _name
Name of the attribute.
Definition: Attribute.h:301
int _id
Id field data.
Definition: Attribute.h:302
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int _cap
Capacity.
Definition: Attribute.h:323
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82

Here is the call graph for this function:

~Attribute ( )
inline

Destructors.

Definition at line 101 of file Attribute.h.

References _cap, _id, _loc, _nbytes_strd, _ncomp, _ngitems, _nitems, _pane, _parent, _ptr, _status, _strd, _type, deallocate(), and STATUS_NOT_INITIALIZED.

101  {
102  if (!_parent) deallocate();
103  _pane=NULL; _parent=NULL; _id=-1; _loc=0; _ncomp=0; _type=0;
105  _strd=0; _nbytes_strd=0; _cap=0;
106  }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
int deallocate()
Deallocate memory if it was allocated by allocate().
Definition: Attribute.C:473
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int _cap
Capacity.
Definition: Attribute.h:323

Here is the call graph for this function:

Attribute ( const Attribute a)
private

Disable copy constructor and copy operator.

Member Function Documentation

void * allocate ( int  strd,
int  cap,
bool  force 
)
throw (COM_exception
)

Allocate memory for the attribute.

The attribute must be a root if the attribute is to be allocated. If from is not NULL, copy its value to the newly allocated array.

Definition at line 345 of file Attribute.C.

References _cap, _ptr, _status, _strd, append_frame, CATCHBADALLOC_APPEND, CATCHEXP_APPEND, COM_ERR_INVALID_CAPACITY, COM_ERR_INVALID_STRIDE, COM_ERR_OUT_OF_MEMORY, COM_ERR_RESIZE, copy_array(), get_sizeof(), i, max(), min(), and set_pointer().

Referenced by Connectivity::allocate(), inherit(), Pane::reinit_attr(), and Connectivity::set_pointer().

346 {
347  int nitems=size_of_items(), ncomp=size_of_components();
348 
349  if ( strd!=1 && strd<ncomp)
352  if ( cap<nitems)
355 
356  if ( !force && (_parent || _status==STATUS_SET || _status==STATUS_SET_CONST))
359 
360  try {
361  int type = data_type();
362  // Go ahead to allocate for the attribute if it was not initialized
363  // and not inherited or it is forced to overwrite previously set address.
364  int nold, old_cap;
365  if ( _status == STATUS_NOT_INITIALIZED || force)
366  { nold = -1; old_cap = 0; }
367  else {
368  old_cap = _cap;
369  nold = old_cap*get_sizeof(type, std::max(_strd,ncomp));
370  }
371 
372  int nnew = cap*get_sizeof(type, std::max(strd,ncomp));
373 
374  // if the capacity is not big enough or the stride is changed.
375  if ( nold < nnew || strd != _strd) {
376  // Deallocate the old array and copy values to the new one
377  char *old_ptr = (char*)_ptr;
378  int old_strd = _strd;
379 
380  if ( nnew) {
381  _ptr = new char[nnew];
382  std::fill_n( (char*)_ptr, nnew, 0);
383  if (_ptr==NULL)
386  }
387  else _ptr = NULL;
388  _cap = cap; _strd = strd; _nbytes_strd = get_sizeof( data_type(), strd);
389 
390  // Copy data from old array to the new.
391  if ( old_cap && _ptr) {
392  if ( _ncomp ==1 || _id<0) // Copy for connectivity and for scalars
393  copy_array( old_ptr, old_strd, std::min(old_cap,_cap));
394  else { // loop through individual components
395  for ( int i=1; i<=ncomp; ++i) {
396  Attribute *ai = this+i;
397  char *old_ptr_i = (char*)ai->_ptr; old_strd=ai->_strd;
398  old_cap = ai->_cap;
399  ai->set_pointer( _ptr, _strd, _cap, i-1, false);
400  ai->copy_array( old_ptr_i, old_strd, std::min(old_cap,_cap));
401 
402  // Delete the individual components
403  if ( ai->_status == STATUS_ALLOCATED && old_ptr_i)
404  delete [] old_ptr_i;
405  }
406  }
407  }
408  else {
409  if ( _ncomp >1 && _id>=0) for ( int i=1; i<=ncomp; ++i) {
410  this[i].set_pointer( _ptr, _strd, _cap, i-1, false);
411  }
412  }
413 
414  // Delete the old array for all components
415  if ( _status == STATUS_ALLOCATED && old_ptr) delete [] old_ptr;
416 
418  if ( _parent) _parent=NULL; // Break inheritance.
419  }
420  }
422  return _ptr;
423 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
void set_pointer(void *p, int strd, int cap, int offset, bool is_const)
Set the physical address of the attribute values.
Definition: Attribute.C:208
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
Encapsulates the states of an exception.
#define CATCHBADALLOC_APPEND(frame)
Macro for catching an deallocation exception and append the information to the current frame...
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
blockLoc i
Definition: read.cpp:79
int _id
Id field data.
Definition: Attribute.h:302
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
int _ncomp
Number of components.
Definition: Attribute.h:308
void * allocate(int strd, int cap, bool force)
Allocate memory for the attribute.
Definition: Attribute.C:345
void copy_array(void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN)
Definition: Attribute.C:249
#define CATCHEXP_APPEND(frame)
Macro for catching an exception and append the information to the current frame.
COM_Type data_type() const
Obtain the data type of each component of the attribute.
Definition: Attribute.h:197
int _cap
Capacity.
Definition: Attribute.h:323
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82
static int get_sizeof(COM_Type type, int count=1)
Definition: Attribute.C:488
int size_of_components() const
Obtain the number of components in the attribute.
Definition: Attribute.h:203

Here is the call graph for this function:

Here is the caller graph for this function:

bool allocated ( ) const
inline

Returns whether the array for the attribute has been set or allocated.

Definition at line 250 of file Attribute.h.

References _status, and STATUS_ALLOCATED.

250 { return _status==STATUS_ALLOCATED; }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
void append_array ( const void *  from,
int  strd,
int  nitem 
)
throw (COM_exception
)

Definition at line 334 of file Attribute.C.

References append_frame, COM_ERR_APPEND_ARRAY, and offset().

Referenced by Window::append_array().

335 {
336  if ( !is_panel() && !is_windowed() || size_of_ghost_items())
339 
340  int offset = size_of_items();
341  copy_array( const_cast<void*>(from), strd, nitem, offset);
342  set_size( offset+nitem);
343 }
bool is_windowed() const
Checks whether the attribute is associated with the window.
Definition: Attribute.h:188
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
Encapsulates the states of an exception.
int size_of_ghost_items() const
Obtain the number of ghost items in the attribute.
Definition: Attribute.C:139
void set_size(int nitems, int ngitems=0)
Set the size of items and ghost items.
Definition: Attribute.C:191
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
bool is_panel() const
Checks whether the attribute is associated with a pane.
Definition: Attribute.h:190
void copy_array(void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN)
Definition: Attribute.C:249
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82
void append_array(const void *from, int strd, int nitem)
Definition: Attribute.C:334

Here is the call graph for this function:

Here is the caller graph for this function:

int capacity ( ) const
inline

Obtain the capacity of the array.

Definition at line 230 of file Attribute.h.

References _cap, _status, and root().

Referenced by Pane::init_done(), maxsize_of_items(), and Pane::reinit_attr().

230 { return _status?_cap:root()->_cap; }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
int _cap
Capacity.
Definition: Attribute.h:323

Here is the call graph for this function:

Here is the caller graph for this function:

bool compatible_types ( COM_Type  t1,
COM_Type  t2 
)
static

Definition at line 531 of file Attribute.C.

References COM_BYTE, COM_CHAR, COM_CHARACTER, COM_DOUBLE, COM_DOUBLE_PRECISION, COM_FLOAT, COM_INT, COM_INTEGER, COM_LONG, COM_REAL, COM_SHORT, COM_UNSIGNED, COM_UNSIGNED_CHAR, COM_UNSIGNED_LONG, COM_UNSIGNED_SHORT, and get_sizeof().

Referenced by Pane::inherit().

531  {
532  if (t1 == t2) return true;
533  if ( Attribute::get_sizeof( t1, 1) != Attribute::get_sizeof( t2, 1))
534  return false;
535 
536  switch( t1) {
537  case COM_CHAR:
538  case COM_CHARACTER:
539  case COM_UNSIGNED_CHAR:
540  case COM_BYTE:
541  case COM_SHORT:
542  case COM_UNSIGNED_SHORT:
543  return true; // size matching
544  case COM_INT:
545  case COM_INTEGER:
546  case COM_UNSIGNED:
547  case COM_LONG:
548  case COM_UNSIGNED_LONG:
549  return t2 == COM_INT || t2 == COM_INTEGER || t2 == COM_UNSIGNED ||
550  t2 == COM_UNSIGNED_LONG || t2 == COM_LONG;
551  case COM_FLOAT:
552  case COM_REAL:
553  return t2 == COM_FLOAT || t2 == COM_REAL;
554  case COM_DOUBLE:
556  return t2 == COM_DOUBLE_PRECISION || t2 == COM_DOUBLE;
557  default:
558  return false;
559  }
560 }
C/C++ Data types.
Definition: roccom_basic.h:129
Fortran Data types.
Definition: roccom_basic.h:133
static int get_sizeof(COM_Type type, int count=1)
Definition: Attribute.C:488

Here is the call graph for this function:

Here is the caller graph for this function:

void copy_array ( void *  buf,
int  strd,
int  nitem,
int  offset = 0,
int  direction = COPY_IN 
)
throw (COM_exception
)

Definition at line 249 of file Attribute.C.

References append_frame, COM_ERR_ATTRIBUTE_CONST, COM_ERR_INVALID_SIZE, COM_ERR_INVALID_STRIDE, COM_ERR_NULL_POINTER, get_sizeof(), i, j, min(), n, ni, and offset().

Referenced by allocate(), and Pane::inherit().

251 {
252  if (direction==COPY_IN) {
253  if ( is_const())
256 
259  }
260 
261  int nitems=size_of_items(), ncomp=size_of_components();
262 
263  if ( n ==0) { if ( direction==COPY_IN) return; else n = nitems; }
264  if ( strd==0) strd=ncomp;
265 
266  if ( !buf && n)
269 
270  // strd must be either 1 or at least as large as _strd
271  if ( strd!=1 && strd<ncomp)
274 
275  if ( offset<0 || n+offset>_cap)
278 
279  int basesize = get_sizeof( data_type());
280 
281  char *ptr0 = (char*)pointer();
282  if (offset) ptr0 += offset*ncomp*basesize;
283 
284  if ( _strd == strd && (_strd == ncomp || n==_cap && strd==1) ) {
285  // two arrays have the same layout
286  if ( direction == COPY_IN)
287  std::memcpy( ptr0, buf, n*ncomp*basesize);
288  else
289  std::memcpy( buf, ptr0, n*ncomp*basesize);
290  }
291  else if ( _strd>1 && strd>1) {
292  // the components are stored contiguously in both arrays
293  char *p_buf=(char*)buf;
294  char *p_att = ptr0;
295  int strd_att_in_bytes = _nbytes_strd;
296  int strd_buf_in_bytes = strd*basesize;
297  int vecsize = ncomp*basesize;
298 
299  for ( int i=0, ni=std::min(n, nitems); i<ni; ++i) {
300  if ( direction == COPY_IN)
301  std::memcpy( p_att, p_buf, vecsize);
302  else
303  std::memcpy( p_buf, p_att, vecsize);
304  p_buf += strd_buf_in_bytes;
305  p_att += strd_att_in_bytes;
306  }
307  }
308  else {
309  // layouts of two arrays are very different from each
310  char *p_buf=(char*)buf;
311  char *p_att = ptr0;
312 
313  int strd_att_in_bytes = _nbytes_strd;
314  int strd_buf_in_bytes = strd*basesize;
315  int step_att_in_bytes= (_strd==1?_cap:1)*basesize;
316  int step_buf_in_bytes = (strd==1?n:1)*basesize;
317  for ( int i=0, ni=std::min(n, nitems); i<ni; ++i) {
318  for ( int j=0, offset_buf=0, offset_att=0; j<ncomp; ++j) {
319  if ( direction == COPY_IN)
320  std::memcpy( p_att+offset_att, p_buf+offset_buf, basesize);
321  else
322  std::memcpy( p_buf+offset_buf, p_att+offset_att, basesize);
323  offset_buf += step_buf_in_bytes;
324  offset_att += step_att_in_bytes;
325  }
326  p_buf += strd_buf_in_bytes;
327  p_att += strd_att_in_bytes;
328  }
329  }
330 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
Encapsulates the states of an exception.
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
const void * pointer() const
Obtain a constant pointer to the physical address.
Definition: Attribute.h:150
blockLoc i
Definition: read.cpp:79
const NT & n
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
j indices j
Definition: Indexing.h:6
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
void copy_array(void *buf, int strd, int nitem, int offset=0, int direction=COPY_IN)
Definition: Attribute.C:249
COM_Type data_type() const
Obtain the data type of each component of the attribute.
Definition: Attribute.h:197
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Attribute.h:253
int _cap
Capacity.
Definition: Attribute.h:323
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82
static int get_sizeof(COM_Type type, int count=1)
Definition: Attribute.C:488
int size_of_components() const
Obtain the number of components in the attribute.
Definition: Attribute.h:203

Here is the call graph for this function:

Here is the caller graph for this function:

int deallocate ( )
throw (COM_exception
)

Deallocate memory if it was allocated by allocate().

Return 0 if deallocation is successful.

Definition at line 473 of file Attribute.C.

References _id, _ncomp, _ptr, _status, CATCHEXP_APPEND, i, STATUS_ALLOCATED, and STATUS_NOT_INITIALIZED.

Referenced by Pane::reinit_attr(), and ~Attribute().

473  {
474  try {
475  // Deallocate attribute and set individual components to not initialized.
476  if ( _status != STATUS_ALLOCATED) return -1; // failed
478  if ( _ptr) { delete [] (char*)_ptr; _ptr = NULL; }
479 
480  if ( _ncomp>1 && _id>=0)
481  for ( int i=1; i<=_ncomp; ++i)
482  { this[i]._ptr = NULL; this[i]._status = STATUS_NOT_INITIALIZED; }
483  }
485  return 0;
486 }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
int deallocate()
Deallocate memory if it was allocated by allocate().
Definition: Attribute.C:473
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
blockLoc i
Definition: read.cpp:79
int _id
Id field data.
Definition: Attribute.h:302
int _ncomp
Number of components.
Definition: Attribute.h:308
#define CATCHEXP_APPEND(frame)
Macro for catching an exception and append the information to the current frame.

Here is the caller graph for this function:

bool empty ( ) const
inline

Check whether the number of items of the attribute is zero.

Definition at line 227 of file Attribute.h.

References _nitems, and root().

Referenced by Roccom_base::clone_attribute(), Roccom_base::copy_attribute(), and Roccom_base::use_attribute().

227 { return root()->_nitems<= 0; }
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312

Here is the call graph for this function:

Here is the caller graph for this function:

std::string fullname ( ) const

Obtain the full name of the attribute including window name suitable for printing out error messages.

Definition at line 82 of file Attribute.C.

References Window::name(), name(), and window().

Referenced by Rocblas::acos(), Rocblas::add(), Attribute(), Rocblas::axpy(), Rocblas::axpy_gen(), Rocblas::calc(), Rocblas::calcDot(), Rocblas::copy(), Rocblas::div(), Rocblas::dot_MPI(), Rocblas::gen2arg(), Pane::inherit(), Pane::init_done(), Rocblas::limit1(), Rocblas::mul(), Rocblas::neg(), Rocblas::rand(), Rocblas::reduce_MPI(), Rocblas::reduce_scalar_MPI(), Pane::reinit_attr(), Rocblas::sqrt(), and Rocblas::sub().

83 { return window()->name()+"."+name(); }
const std::string & name() const
Obtain the window&#39;s name.
Definition: Window.h:92
const Window * window() const
Obtain a constant pointer to the parent window of the attribute.
Definition: Attribute.C:80
const std::string & name() const
Obtain the name of the attribute.
Definition: Attribute.h:113

Here is the call graph for this function:

Here is the caller graph for this function:

const void * get_addr ( int  i,
int  j = 0 
) const
throw (COM_exception
)

Obtain the address of the jth component of the ith item, where 0<=i<size_of_items.

This function is recursive and relatively expensive, and hence should be used only for performance-insenstive tasks.

Definition at line 85 of file Attribute.C.

References append_frame, COM_ERR_INDEX_OUT_OF_BOUNDS, COM_ERR_INVALID_DIMENSION, i, and j.

Referenced by Connectivity::get_addr().

85  {
86  if ( _parent) return root()->get_addr( i,j);
87 
89 
90  if ( _ncomp>1) return this[j+1].get_addr( i);
91 
92  // Check that i is between 0 and size_of_items-1.
93  if ( i<0 || i>=size_of_items())
96  return ((char*)_ptr)+i*_nbytes_strd;
97 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
const void * get_addr(int i, int j=0) const
Obtain the address of the jth component of the ith item, where 0&lt;=i&lt;size_of_items.
Definition: Attribute.C:85
Encapsulates the states of an exception.
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
blockLoc i
Definition: read.cpp:79
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
j indices j
Definition: Indexing.h:6
int _ncomp
Number of components.
Definition: Attribute.h:308
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82

Here is the caller graph for this function:

void* get_addr ( int  i,
int  j = 0 
)
throw (COM_exception
)
inline

Definition at line 162 of file Attribute.h.

References COM_ERR_ATTRIBUTE_CONST, is_const(), and j.

162  {
164  return (void*)(((const Attribute*)this)->get_addr(i,j));
165  }
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Encapsulates the states of an exception.
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Attribute.h:253

Here is the call graph for this function:

int get_sizeof ( COM_Type  type,
int  count = 1 
)
static

Definition at line 488 of file Attribute.C.

References COM_assertion, COM_BOOL, COM_BYTE, COM_CHAR, COM_CHARACTER, COM_COMPLEX, COM_DOUBLE, COM_DOUBLE_COMPLEX, COM_DOUBLE_PRECISION, COM_F90POINTER, COM_FLOAT, COM_INT, COM_INTEGER, COM_LOGICAL, COM_LONG, COM_LONG_DOUBLE, COM_METADATA, COM_MPI_COMMC, COM_MPI_COMMF, COM_OBJECT, COM_REAL, COM_SHORT, COM_STRING, COM_UNSIGNED, COM_UNSIGNED_CHAR, COM_UNSIGNED_LONG, COM_UNSIGNED_SHORT, and COM_VOID.

Referenced by compatible_types(), Roccom_base::get_f90pntoffsets(), and Roccom_base::get_sizeof().

488  {
489  switch (type) {
490  case COM_CHAR:
491  case COM_UNSIGNED_CHAR:
492  case COM_BYTE:
493  case COM_BOOL:
494  case COM_CHARACTER: return count;
495 
496  case COM_UNSIGNED_SHORT:
497  case COM_SHORT: return count*sizeof(short);
498 
499  case COM_INT:
500  case COM_INTEGER:
501  case COM_LOGICAL:
502  case COM_UNSIGNED: return count*sizeof(int);
503 
504  case COM_UNSIGNED_LONG:
505  case COM_LONG: return count*sizeof(long int);
506 
507  case COM_FLOAT:
508  case COM_REAL: return count*sizeof(float);
509 
511  case COM_DOUBLE: return count*sizeof(double);
512 
513  case COM_LONG_DOUBLE: return count*sizeof(long double);
514 
515  case COM_COMPLEX: return count*2*sizeof(float);
516  case COM_DOUBLE_COMPLEX: return count*2*sizeof(double);
517 
518  case COM_MPI_COMMC: return count*sizeof(MPI_Comm);
519  case COM_MPI_COMMF: return count*sizeof(int);
520 
521  case COM_F90POINTER: return count*64;
522  case COM_METADATA:
523  case COM_VOID: return sizeof(void*)*count;
524  case COM_OBJECT: return sizeof(COM_Object*)*count;
525  case COM_STRING: return count;
526 
527  default: COM_assertion(false); return -1;
528  }
529 }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
C/C++ Data types.
Definition: roccom_basic.h:129
Fortran Data types.
Definition: roccom_basic.h:133

Here is the caller graph for this function:

int id ( ) const
inline
void inherit ( Attribute a,
bool  clone,
bool  withghost,
int  depth = 0 
)
throw (COM_exception
)
protected

Inherit from parent. If depth>0, then the procedure is for the subcomponents.

Definition at line 426 of file Attribute.C.

References _cap, _loc, _ncomp, _strd, _type, _unit, allocate(), CATCHBADALLOC_APPEND, CATCHEXP_APPEND, get_sizeof(), i, and root().

Referenced by Connectivity::inherit(), Window::inherit(), Pane::inherit(), and MarkerParticles_3::multiply_nodal_normals().

427 {
428  Attribute *root = parent->root();
429  _loc=root->_loc; _ncomp=root->_ncomp; _type=root->_type;
430  _cap = root->_cap; _strd = root->_strd;
432 
433  if ( !clone) {
434  _parent = parent;
435 
436  // Inherit individual components
437  if ( _ncomp>1 && _id>=0) try {
438  for ( int i=1; i<=_ncomp; ++i) {
439  this[i].inherit( parent+i, clone, withghost, 1);
440  }
442  }
443  else {
444  _parent = NULL;
445  // Set size
446  if ( withghost) {
449  }
450  else {
452  _ngitems = 0;
453  }
454  if ( depth>0) return;
455 
456  // Allocate and copy from parent if parent was initialized.
457  try {
458  if (parent->initialized()) allocate( _ncomp, _cap, true);
459  else deallocate();
461 
462  // Set pointer for individual components if allocated.
463  if ( _ncomp>1 && _id>=0) try {
464  for ( int i=1; i<=_ncomp; ++i) {
465  this[i].inherit( parent+i, clone, withghost, 1);
466  if (allocated())
467  this[i].set_pointer( _ptr, _strd, _cap, i-1, false);
468  }
470  }
471 }
void inherit(Attribute *a, bool clone, bool withghost, int depth=0)
Inherit from parent. If depth&gt;0, then the procedure is for the subcomponents.
Definition: Attribute.C:426
if(dy > dx)
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
bool initialized() const
Returns whether the array for the attribute has been set or allocated.
Definition: Attribute.h:244
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
An Attribute object is a data member of a window.
Definition: Attribute.h:51
Attribute * parent()
Parent attribute used by this object.
Definition: Attribute.h:125
int deallocate()
Deallocate memory if it was allocated by allocate().
Definition: Attribute.C:473
#define CATCHBADALLOC_APPEND(frame)
Macro for catching an deallocation exception and append the information to the current frame...
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
std::string _unit
Unit of the attribute.
Definition: Attribute.h:310
int size_of_ghost_items() const
Obtain the number of ghost items in the attribute.
Definition: Attribute.C:139
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
Shorter_size _loc
Location.
Definition: Attribute.h:303
blockLoc i
Definition: read.cpp:79
bool allocated() const
Returns whether the array for the attribute has been set or allocated.
Definition: Attribute.h:250
int _id
Id field data.
Definition: Attribute.h:302
int size_of_real_items() const
Obtain the number of real items in the attribute.
Definition: Attribute.C:167
COM_Type _type
Base data type of the attribute.
Definition: Attribute.h:309
int _ncomp
Number of components.
Definition: Attribute.h:308
void * allocate(int strd, int cap, bool force)
Allocate memory for the attribute.
Definition: Attribute.C:345
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
#define CATCHEXP_APPEND(frame)
Macro for catching an exception and append the information to the current frame.
int _cap
Capacity.
Definition: Attribute.h:323
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
static int get_sizeof(COM_Type type, int count=1)
Definition: Attribute.C:488

Here is the call graph for this function:

Here is the caller graph for this function:

bool initialized ( ) const
inline

Returns whether the array for the attribute has been set or allocated.

Definition at line 244 of file Attribute.h.

References _status, and root().

Referenced by Pane::init_done().

244 { return _status||root()->_status; }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_const ( ) const
inline

Returns whether the array is set to be read-only.

Definition at line 253 of file Attribute.h.

References _status, root(), and STATUS_SET_CONST.

Referenced by Roccom_base::call_function(), get_addr(), Connectivity::is_const(), and pointer().

253 { return root()->_status==STATUS_SET_CONST; }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134

Here is the call graph for this function:

Here is the caller graph for this function:

static bool is_digit ( char  c)
inlinestatic

Definition at line 264 of file Attribute.h.

Referenced by Window::attribute(), Window::delete_attribute(), Window::new_attribute(), Pane::reinit_attr(), and Window::Window().

264 { return c>='0' && c<='9'; }

Here is the caller graph for this function:

bool is_elemental ( ) const
inline

Checks whether the attribute is associated with an element.

Definition at line 192 of file Attribute.h.

References _loc.

Referenced by FaceOffset_3::obtain_face_offset(), and Element_vectors_k_const< Value >::set().

192 { return _loc == 'e'; }
Shorter_size _loc
Location.
Definition: Attribute.h:303

Here is the caller graph for this function:

bool is_nodal ( ) const
inline

Checks whether the attribute is associated with a node.

Definition at line 194 of file Attribute.h.

References _loc.

Referenced by FaceOffset_3::obtain_face_offset(), and Element_node_vectors_k_const< Value >::set().

194 { return _loc == 'n'; }
Shorter_size _loc
Location.
Definition: Attribute.h:303

Here is the caller graph for this function:

bool is_panel ( ) const
inline

Checks whether the attribute is associated with a pane.

Definition at line 190 of file Attribute.h.

References _loc.

190 { return _loc == 'p'; }
Shorter_size _loc
Location.
Definition: Attribute.h:303
bool is_staggered ( ) const
inline

Check how the attribute values are organized.

It returns true if the components of the attribute associated with

Definition at line 258 of file Attribute.h.

References size_of_components(), and stride().

258 { return stride()!=size_of_components(); }
int stride() const
Obtain the stride of the attribute in base datatype.
Definition: Attribute.h:233
int size_of_components() const
Obtain the number of components in the attribute.
Definition: Attribute.h:203

Here is the call graph for this function:

bool is_windowed ( ) const
inline

Checks whether the attribute is associated with the window.

Definition at line 188 of file Attribute.h.

References _loc.

Referenced by Rocblas::acos(), Rocblas::axpy(), Rocblas::axpy_gen(), Rocblas::calc(), Rocblas::calcChoose(), Rocblas::calcDot(), Rocblas::copy_helper(), Rocblas::dot_MPI(), Rocblas::gen2arg(), Pane::inherit(), Rocblas::neg(), Pane::Pane(), Rocblas::rand(), Rocblas::reduce_MPI(), Pane::reinit_attr(), Window::set_size(), and Rocblas::sqrt().

188 { return _loc == 'w'; }
Shorter_size _loc
Location.
Definition: Attribute.h:303

Here is the caller graph for this function:

Shorter_size location ( ) const
inline

Obtain the location of the attribute.

It is encoded as follows: 'w' for windowed attribute, 'p' for panal attribute, 'n' for nodal attribute, and 'e' for elemental attribute.

Definition at line 186 of file Attribute.h.

References _loc.

Referenced by Window::get_attribute(), Roccom_base::get_f90pointer(), Pane::inherit(), Roccom_base::set_f90pointer(), and write_attr_CGNS().

186 { return _loc; }
Shorter_size _loc
Location.
Definition: Attribute.h:303

Here is the caller graph for this function:

int maxsize_of_ghost_items ( ) const

Obtain the maximum allowed number of items in the attribute.

Reserved for Roccom3.1

Definition at line 153 of file Attribute.C.

References _cap, _id, _loc, _ngitems, _nitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, Pane::ignore_ghost(), and maxsize_of_ghost_items().

Referenced by maxsize_of_ghost_items().

154 {
155  if ( _pane->ignore_ghost())
156  return 0;
157  else if ( _loc == 'n' && _id != COM_NC)
159  else if ( _loc == 'e' && _id != COM_CONN)
161  else if ( _parent)
163  else
164  return _nitems<=0 ? 0 :_ngitems + (_cap-_nitems);
165 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302
int maxsize_of_ghost_items() const
Obtain the maximum allowed number of items in the attribute.
Definition: Attribute.C:153
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int _cap
Capacity.
Definition: Attribute.h:323

Here is the call graph for this function:

Here is the caller graph for this function:

int maxsize_of_items ( ) const

Obtain the maximum allowed number of items in the attribute.

Reserved for Roccom3.1

Definition at line 125 of file Attribute.C.

References _id, _loc, _pane, _parent, Pane::attribute(), capacity(), COM_CONN, COM_NC, Pane::ignore_ghost(), maxsize_of_items(), and maxsize_of_real_items().

Referenced by maxsize_of_items().

126 {
127  if (_pane->ignore_ghost())
128  return maxsize_of_real_items();
129  if ( _loc == 'n' && _id != COM_NC)
131  else if ( _loc == 'e' && _id != COM_CONN)
133  else if ( _parent)
134  return _parent->maxsize_of_items();
135  else
136  return capacity();
137 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int maxsize_of_real_items() const
Obtain the maximum allowed number of real items in the attribute.
Definition: Attribute.C:179
int maxsize_of_items() const
Obtain the maximum allowed number of items in the attribute.
Definition: Attribute.C:125
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
int capacity() const
Obtain the capacity of the array.
Definition: Attribute.h:230
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302

Here is the call graph for this function:

Here is the caller graph for this function:

int maxsize_of_real_items ( ) const

Obtain the maximum allowed number of real items in the attribute.

Reserved for Roccom3.1

Definition at line 179 of file Attribute.C.

References _id, _loc, _ngitems, _nitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, and maxsize_of_real_items().

Referenced by maxsize_of_items(), and maxsize_of_real_items().

180 {
181  if ( _loc == 'n' && _id != COM_NC)
183  else if ( _loc == 'e' && _id != COM_CONN)
185  else if ( _parent)
186  return _parent->maxsize_of_real_items();
187  else
188  return _nitems<=0 ? 0 : _nitems - _ngitems;
189 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
int maxsize_of_real_items() const
Obtain the maximum allowed number of real items in the attribute.
Definition: Attribute.C:179
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& name ( ) const
inline

Obtain the name of the attribute.

Definition at line 113 of file Attribute.h.

Referenced by Attribute(), Roccom_base::call_function(), Roccom_base::copy_attribute(), Window::delete_attribute(), fullname(), inrt_setmaterial(), io_pane_attribute(), Pane::new_attribute(), Pane::reinit_attr(), and Window::Window().

113 { return _name; }
std::string _name
Name of the attribute.
Definition: Attribute.h:301

Here is the caller graph for this function:

Attribute& operator= ( const Attribute )
private
const Pane* pane ( ) const
inline

Obtain a constant pointer to the owner pane of the attribute.

Definition at line 172 of file Attribute.h.

Referenced by Pane::attributes(), Pane::delete_attribute(), Rocblas::gen2arg(), Pane::inherit(), Pane::init_done(), Pane::Pane(), Pane::reinit_attr(), rocfracsubinterface::rocfracinterfaceinitial(), Element_node_vectors_k_const< Value >::set(), and Element_vectors_k_const< Value >::set().

172 { return _pane; }
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298

Here is the caller graph for this function:

Pane* pane ( )
inline

Obtain a modifiable pointer to the owner pane of the attribute.

Definition at line 174 of file Attribute.h.

References _pane.

174 { return _pane; }
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Attribute* parent ( )
inline

Parent attribute used by this object.

It determines the the meta-data of the attribute. If the array of this attribute is not set, then this attribute also uses the pointer of its parant.

Definition at line 125 of file Attribute.h.

References _parent.

125 { return _parent; }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
const Attribute* parent ( ) const
inline

Definition at line 126 of file Attribute.h.

References _parent.

126 { return _parent; }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
const void* pointer ( ) const
inline
void* pointer ( )
throw (COM_exception
)
inline

Obtain a modifiable pointer to the physical address.

Definition at line 152 of file Attribute.h.

References _ptr, _status, COM_ERR_ATTRIBUTE_CONST, is_const(), and root().

152  {
154  return _status?_ptr:root()->_ptr;
155  }
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Encapsulates the states of an exception.
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Attribute.h:253

Here is the call graph for this function:

Attribute* root ( )
inline

Root of use-inheritance.

The basic properties of the attribute (location, data type, number of components, and unit) are copied from the root during inheritance and hence later changes in the root (by renewing the root) will not be reflected in sub-attribute. Other types of information (sizes, pointer, stride, and capacity) always use those of the root attribute.

Definition at line 134 of file Attribute.h.

References _parent.

Referenced by Attribute(), capacity(), empty(), inherit(), initialized(), is_const(), pointer(), Connectivity::root(), stride(), and stride_in_bytes().

134  {
135  Attribute *a=this;
136  while ( a->_parent) a=a->_parent;
137  return a;
138  }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
An Attribute object is a data member of a window.
Definition: Attribute.h:51

Here is the caller graph for this function:

const Attribute* root ( ) const
inline

Definition at line 139 of file Attribute.h.

References _parent.

139  {
140  const Attribute *a=this;
141  while ( a->_parent) a=a->_parent;
142  return a;
143  }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
An Attribute object is a data member of a window.
Definition: Attribute.h:51
void set_pointer ( void *  p,
int  strd,
int  cap,
int  offset,
bool  is_const 
)
throw (COM_exception
)
protected

Set the physical address of the attribute values.

Definition at line 208 of file Attribute.C.

References append_frame, COM_ERR_INVALID_CAPACITY, COM_ERR_INVALID_STRIDE, get_sizeof(), i, and offset().

Referenced by allocate(), and Connectivity::set_pointer().

210 {
211  int nitems=size_of_items(), ncomp=size_of_components();
212 
213  // Check whether received a local variable
214  // const long int stackSize = 2097152; // 2MB
215  // long int dist = std::abs(((long int)p) - (long int)(&nitems));
216  // if ( p && dist <= stackSize)
217  // throw COM_exception( COM_ERR_INVALID_ADDR,
218  // append_frame( fullname(), Attribute::set_pointer));
219 
220  if ( p && strd!=1 && strd<ncomp)
223  if ( p && cap<nitems)
226 
227  _cap = cap;
228  _strd = strd;
229  int basesize = get_sizeof( data_type(), 1);
230  _nbytes_strd = basesize*strd;
231 
233  if ( p && offset) {
234  if ( strd==1)
235  _ptr = ((char*)p) + (offset*cap)*_nbytes_strd;
236  else // Staggerred
237  _ptr = ((char*)p) + offset*basesize;
238  }
239  else
240  _ptr = p;
242 
243  if ( ncomp >1 && _id>=0) for ( int i=1; i<=ncomp; ++i) {
244  this[i].set_pointer( _ptr, _strd, _cap, i-1, is_const);
245  }
246 }
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
int _strd
Stride.
Definition: Attribute.h:321
void set_pointer(void *p, int strd, int cap, int offset, bool is_const)
Set the physical address of the attribute values.
Definition: Attribute.C:208
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
Encapsulates the states of an exception.
int deallocate()
Deallocate memory if it was allocated by allocate().
Definition: Attribute.C:473
void * _ptr
Physical address of the attribute.
Definition: Attribute.h:320
blockLoc i
Definition: read.cpp:79
int _id
Id field data.
Definition: Attribute.h:302
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
COM_Type data_type() const
Obtain the data type of each component of the attribute.
Definition: Attribute.h:197
bool is_const() const
Returns whether the array is set to be read-only.
Definition: Attribute.h:253
int _cap
Capacity.
Definition: Attribute.h:323
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82
static int get_sizeof(COM_Type type, int count=1)
Definition: Attribute.C:488
int size_of_components() const
Obtain the number of components in the attribute.
Definition: Attribute.h:203

Here is the call graph for this function:

Here is the caller graph for this function:

void set_size ( int  nitems,
int  ngitems = 0 
)
throw (COM_exception
)

Set the size of items and ghost items.

Can be changed only if the attribute is a root.

Definition at line 191 of file Attribute.C.

References append_frame, COM_assertion, COM_CONN, COM_ERR_CHANGE_INHERITED, COM_NC, and i.

Referenced by Window::append_array(), Pane::reinit_attr(), and Connectivity::set_pointer().

192 {
193  if ( _parent)
196 
197  COM_assertion( (_loc!='n'||_id==COM_NC) && (_loc!='e'||_id==COM_CONN));
198  _nitems = nitems; _ngitems = ngitems;
199 
200  if ( _ncomp>1) {
201  // Set sizes for each individial component
202  for ( int i=1; i<=_ncomp; ++i) {
203  this[i]._nitems = nitems; this[i]._ngitems = ngitems;
204  }
205  }
206 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
Encapsulates the states of an exception.
Shorter_size _loc
Location.
Definition: Attribute.h:303
blockLoc i
Definition: read.cpp:79
int _id
Id field data.
Definition: Attribute.h:302
void set_size(int nitems, int ngitems=0)
Set the size of items and ghost items.
Definition: Attribute.C:191
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.
int _ncomp
Number of components.
Definition: Attribute.h:308
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
std::string fullname() const
Obtain the full name of the attribute including window name suitable for printing out error messages...
Definition: Attribute.C:82

Here is the caller graph for this function:

int size_of_ghost_items ( ) const

Obtain the number of ghost items in the attribute.

Definition at line 139 of file Attribute.C.

References _id, _loc, _ngitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, Pane::ignore_ghost(), and size_of_ghost_items().

Referenced by Connectivity::size_of_ghost_elements(), size_of_ghost_items(), and write_attr_CGNS().

140 {
141  if ( _pane->ignore_ghost())
142  return 0;
143  else if ( _loc == 'n' && _id != COM_NC)
145  else if ( _loc == 'e' && _id != COM_CONN)
147  else if ( _parent)
148  return _parent->size_of_ghost_items();
149  else
150  return _ngitems;
151 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
int size_of_ghost_items() const
Obtain the number of ghost items in the attribute.
Definition: Attribute.C:139
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302

Here is the call graph for this function:

Here is the caller graph for this function:

int size_of_items ( ) const

Obtain the number of items in the attribute.

Definition at line 111 of file Attribute.C.

References _id, _loc, _nitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, Pane::ignore_ghost(), size_of_items(), and size_of_real_items().

Referenced by Window::append_array(), Rocblas::axpy_gen(), Rocblas::calc(), Rocblas::calcDot(), Rocblas::gen2arg(), Rocblas::get_stride(), Pane::inherit(), Pane::init_done(), Pane::reinit_attr(), Connectivity::size_of_elements(), size_of_items(), and write_attr_CGNS().

112 {
113  if ( _pane->ignore_ghost())
114  return size_of_real_items();
115  else if ( _loc == 'n' && _id != COM_NC)
116  return _pane->attribute(COM_NC)->size_of_items();
117  else if ( _loc == 'e' && _id != COM_CONN)
119  else if ( _parent)
120  return _parent->size_of_items();
121  else
122  return _nitems<=0 ? 0 : _nitems;
123 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
bool ignore_ghost() const
Definition: Pane.h:202
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302
int size_of_real_items() const
Obtain the number of real items in the attribute.
Definition: Attribute.C:167
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312
int size_of_items() const
Obtain the number of items in the attribute.
Definition: Attribute.C:111

Here is the call graph for this function:

Here is the caller graph for this function:

int size_of_real_items ( ) const

Obtain the number of real items in the attribute.

Definition at line 167 of file Attribute.C.

References _gap, _id, _loc, _ngitems, _nitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, and size_of_real_items().

Referenced by Pane_ghost_connectivity::finalize_pconn(), Pane_ghost_connectivity::get_cpanes(), Pane_ghost_connectivity::get_ents_to_send(), Pane::inherit(), size_of_items(), Connectivity::size_of_real_elements(), size_of_real_items(), and write_attr_CGNS().

168 {
169  if ( _loc == 'n' && _id != COM_NC)
171  else if ( _loc == 'e' && _id != COM_CONN)
173  else if ( _parent)
174  return _parent->size_of_real_items();
175  else
176  return _nitems<=0 ? 0:_nitems - _ngitems - _gap;
177 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
int _ngitems
Size of ghost items.
Definition: Attribute.h:313
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _gap
Gap between the IDs of real and ghost items.
Definition: Attribute.h:314
int _id
Id field data.
Definition: Attribute.h:302
int size_of_real_items() const
Obtain the number of real items in the attribute.
Definition: Attribute.C:167
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312

Here is the call graph for this function:

Here is the caller graph for this function:

bool size_set ( ) const

Returns whether the size for the attribute has been set.

Definition at line 99 of file Attribute.C.

References _id, _loc, _nitems, _pane, _parent, Pane::attribute(), COM_CONN, COM_NC, and size_set().

Referenced by Window::append_array(), Pane::reinit_attr(), and size_set().

100 {
101  if ( _loc == 'n' && _id != COM_NC)
102  return _pane->attribute(COM_NC)->size_set();
103  else if ( _loc == 'e' && _id != COM_CONN)
104  return _pane->attribute(COM_CONN)->size_set();
105  else if ( _parent)
106  return _parent->size_set();
107  else
108  return _nitems>=0;
109 }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
bool size_set() const
Returns whether the size for the attribute has been set.
Definition: Attribute.C:99
Attribute * attribute(const std::string &a)
Obtain the attribute from given name.
Definition: Pane.C:148
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298
Shorter_size _loc
Location.
Definition: Attribute.h:303
int _id
Id field data.
Definition: Attribute.h:302
int _nitems
Size of total items. Default value is -1.
Definition: Attribute.h:312

Here is the call graph for this function:

Here is the caller graph for this function:

int status ( ) const
inline

Obtain the status of the attribute.

Definition at line 240 of file Attribute.h.

References _parent, _status, and STATUS_USE.

Referenced by apn_input_0d(), prep_modbcdistribution::bcdistributionfiles(), feminp(), genxwriterocinout(), Window::get_status(), inrt_readinputfile(), inrt_readmaterialinput(), peri_readinputfile(), peul_clearsendrequests(), peul_readbcinputfile(), peul_readinputfile(), peul_readsolution(), peul_readsolutionregion(), peul_receivecorneredgecells(), peul_receivedummyvals(), peul_writesolution(), plag_binsortnozzleinlet(), plag_binsortspatialdist(), plag_modsurfstats::plag_opensurfstatsascii(), plag_modsurfstats::plag_opensurfstatsbinary(), plag_processeulerfield(), plag_readinputfile(), plag_readpdffromfile(), plag_readsolution(), plag_readsolutionfilepost(), plag_readstatpost(), plag_rflo_modstats::plag_rflo_clearreqstatbuff(), plag_rflo_clearsendrequests(), plag_rflo_modstats::plag_rflo_readstat(), plag_rflo_recvmetrics(), plag_rflo_modstats::plag_rflo_recvstatbuff(), plag_rflo_modstats::plag_rflo_writestat(), plag_rflu_modcomm::plag_rflu_clearrequest(), plag_moddimensions::plag_rflu_readdimensions(), plag_rflu_readsolutionascii(), plag_rflu_readsolutionbinary(), plag_rflu_modcomm::plag_rflu_recvcounters(), plag_rflu_modcomm::plag_rflu_recvdata(), plag_moddimensions::plag_rflu_writedimensions(), plag_rflu_writesolutionascii(), plag_rflu_writesolutionbinary(), plag_writesolution(), plag_writestattecascii(), plag_writetecplotascii(), radi_floflimrecvcornedgecells(), radi_floflimrecvdummyvals(), radi_rflo_flimclearsendrequests(), radi_rflo_readsolution(), radi_rflo_writesolution(), read_files(), read_frac(), read_io_files(), read_msh(), setup_py::read_properties(), readbcinputfile(), readinp(), readinputfile(), setup_py::readtable(), rflo_clearsendrequests(), rflo_exchangednoderecv(), rflo_exchangegeometryprepare(), rflo_exchangegeometryrecv(), rflo_initflowsolver(), rflo_openconverfile(), rflo_modforcesmoments::rflo_openforcemomcofile(), rflo_openprobefile(), rflo_modrestartinfo::rflo_openrestartinfo(), rflo_openthrustfile(), rflo_readbcfromfile(), rflo_readbcinputfile(), rflo_readgrid(), rflo_readgridregion(), rflo_modpatchaerocoeffs::rflo_readpatchaerocoeffs(), rflo_modpatchaerocoeffs::rflo_readpatchaerocoeffsreg(), rflo_readrandomstate(), rflo_readregionmapsection(), rflo_readregiontopology(), rflo_readsolution(), rflo_readsolutionregion(), rflo_readstat(), rflo_readstatregion(), rflo_readtbcinputfile(), rflo_receivecorneredgecells(), rflo_receivedummyvals(), rflo_moddegeneratecornedge::rflo_writedegeneratec(), rflo_writegrid(), rflo_writegridregion(), rflo_modforcesmoments::rflo_writeintegralforcemomco(), rflo_modpatchaerocoeffs::rflo_writepatchaerocoeffs(), rflo_modforcesmoments::rflo_writepatchcoeffsinfo(), rflo_writerandomstate(), rflo_writeregiontopology(), rflo_writesolution(), rflo_writesolutionregion(), rflo_writestat(), rflu_modboundxvutils::rflu_bxv_readvarsascii(), rflu_modboundxvutils::rflu_bxv_readvarsbinary(), rflu_modboundxvutils::rflu_bxv_writevarsascii(), rflu_modboundxvutils::rflu_bxv_writevarsbinary(), rflu_modcoloring::rflu_col_readcoloring(), rflu_modcoloring::rflu_col_writecoloring(), rflu_modcommlists::rflu_comm_readcommlists(), rflu_modcommlists::rflu_comm_writecommlists(), rflu_computeexactflowprobeerror(), rflu_modcobalt::rflu_convcobalt2rocflu(), rflu_modgambit::rflu_convgambit2rocflu(), rflu_modmesh3d::rflu_convmesh3d2rocflu(), rflu_modtetmesh::rflu_convtetmesh2rocflu(), rflu_modvgridns::rflu_convvgridns2rocflu(), rflu_modensight::rflu_ens_openfilegeometry(), rflu_modensight::rflu_ens_openfilescalarvector(), rflu_modensight::rflu_ens_writefilecase(), rflu_modextractflowdata::rflu_extractflowdatablasius(), rflu_modextractflowdata::rflu_extractflowdatalinefarf(), rflu_modextractflowdata::rflu_extractflowdatanscbc(), rflu_modextractflowdata::rflu_extractflowdataproudman(), rflu_modextractflowdata::rflu_extractflowdataskews(), rflu_modextractflowdata::rflu_extractflowdatasod(), rflu_modextractflowdata::rflu_extractflowdatasommspi(), rflu_modextractflowdata::rflu_extractflowdatastg1d(), rflu_modextractflowdata::rflu_extractflowdatastg2d(), rflu_modrocstario::rflu_genx_openrocinctrlfiles(), rflu_modrocstaradmin::rflu_genx_readctrlfile(), rflu_modmpi::rflu_mpi_clearrequest(), rflu_modmpi::rflu_mpi_recvcelldata(), rflu_openconverfile(), rflu_modpatchcoeffs::rflu_openpatchcoeffsascii(), rflu_modpatchcoeffs::rflu_openpatchcoeffsbinary(), rflu_openpostinfo(), rflu_modprobes::rflu_openprobefiles(), rflu_modregionmapping::rflu_openregionmappingfile(), rflu_openrestartinfo(), rflu_openstatsfileoles(), rflu_opentotalmassfile(), rflu_modreadwritebcdatafile::rflu_readbcdatafile(), rflu_modreadbcinputfile::rflu_readbcinputfile(), rflu_moddimensions::rflu_readdimensions(), rflu_modreadwriteflow::rflu_readflowascii(), rflu_modreadwriteflow::rflu_readflowbinary(), rflu_modreadwritegrid::rflu_readgridascii(), rflu_modreadwritegrid::rflu_readgridbinary(), rflu_modcentaur::rflu_readgridcentaurascii(), rflu_modcentaur::rflu_readgridcentaurbinary(), rflu_modcobalt::rflu_readgridcobalt(), rflu_modgambit::rflu_readgridgambitneutral(), rflu_modmesh3d::rflu_readgridmesh3d(), rflu_modreadwritegridspeeds::rflu_readgridspeedsascii(), rflu_modreadwritegridspeeds::rflu_readgridspeedsbinary(), rflu_modtetmesh::rflu_readgridtetmesh(), rflu_modvgridns::rflu_readgridvgridns(), rflu_readintegrals1245oles(), rflu_modcellmapping::rflu_readloc2globcellmapping(), rflu_readstat(), rflu_readtbcinputfile(), rflu_modrenumberings::rflu_rnmb_readpxx2sxxmaps(), rflu_modrenumberings::rflu_rnmb_readsc2rmap(), rflu_modrenumberings::rflu_rnmb_writepxx2sxxmaps(), rflu_modrenumberings::rflu_rnmb_writesc2rmap(), rflu_modstl::rflu_stl_writesurfgridascii(), rflu_modsymmetryperiodic::rflu_sype_readtransforms(), rflu_modsymmetryperiodic::rflu_sype_setsypepatchesflag(), rflu_modsymmetryperiodic::rflu_sype_writetransforms(), rflu_modtecplot::rflu_tec_openfilepnt(), rflu_modthrustspecimpulse::rflu_tsi_openglobalvals(), rflu_modreadwritebcdatafile::rflu_writebcdatafile(), rflu_moddimensions::rflu_writedimensions(), rflu_moddimensions::rflu_writedimensionsborders(), rflu_modreadwriteflow::rflu_writeflowascii(), rflu_modreadwriteflow::rflu_writeflowbinary(), rflu_modforcesmoments::rflu_writeglobalforcesmoments(), rflu_modreadwritegrid::rflu_writegridascii(), rflu_modreadwritegrid::rflu_writegridbinary(), rflu_modreadwritegridspeeds::rflu_writegridspeedsascii(), rflu_modreadwritegridspeeds::rflu_writegridspeedsbinary(), rflu_writeintegrals1245oles(), rflu_modcellmapping::rflu_writeloc2globcellmapping(), rflu_modextractflowdata::rflu_writemeshbump(), rflu_writestat(), rflu_modtetmesh::rflu_writesurfgridtetmesh(), rflu_writeversionstring(), rocflo_2dto3d(), rocflo_surf(), rocfracprep(), rvav_blasiussolution(), rvav_computeanalyticalsolution(), rvav_readfilestream2analyt(), rvav_readfilestream2experm(), rvav_readinputfile(), scale_mesh(), select_bbx(), spec_readinputfile(), spec_rflu_readbcinputfile(), spec_rflu_modreadwritevars::spec_rflu_readcvascii(), spec_rflu_modreadwritevars::spec_rflu_readcvbinary(), spec_rflu_modreadwritevars::spec_rflu_readeevascii(), spec_rflu_modreadwritevars::spec_rflu_readeevbinary(), spec_rflu_modreadwritevars::spec_rflu_writecvascii(), spec_rflu_modreadwritevars::spec_rflu_writecvbinary(), spec_rflu_modreadwritevars::spec_rflu_writeeevascii(), spec_rflu_modreadwritevars::spec_rflu_writeeevbinary(), turb_coranswalldistov(), turb_floransrecvcornedgecells(), turb_floransrecvdummyvals(), turb_readbcinputfile(), turb_readinputfile(), turb_rflo_ransclearsendrequests(), turb_rflo_readsolution(), turb_rflo_readsolutionregion(), turb_rflo_writesolution(), turb_rflu_readsolutionascii(), turb_rflu_readsolutionbinary(), turb_rflu_writesolutionascii(), turb_rflu_writesolutionbinary(), write_grda(), write_grdb(), write_output(), write_output_2(), prep_modbcdistribution::writebctofile(), writeflucellmap(), writefludimens(), writeflugrid(), writegeneric(), writeprobe(), writetecplotascii(), writethrust(), and zn_input_0d().

241  { if ( _parent) return STATUS_USE; else return _status; }
Attribute * _parent
Parent attribute being used.
Definition: Attribute.h:299
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
int stride ( ) const
inline

Obtain the stride of the attribute in base datatype.

Definition at line 233 of file Attribute.h.

References _status, _strd, and root().

Referenced by Window::append_array(), Rocblas::calcDot(), Rocblas::get_stride(), Pane::inherit(), io_pane_attribute(), is_staggered(), Pane::reinit_attr(), Element_node_vectors_k_const< Value >::set(), Element_vectors_k_const< Value >::set(), and write_attr_CGNS().

233 { return _status?_strd:root()->_strd; }
int _strd
Stride.
Definition: Attribute.h:321
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134

Here is the call graph for this function:

Here is the caller graph for this function:

int stride_in_bytes ( ) const
inline

Obtain the stride of the attribute in bytes.

Definition at line 236 of file Attribute.h.

References _nbytes_strd, _status, and root().

237  { return _status?_nbytes_strd:root()->_nbytes_strd; }
int _nbytes_strd
Number of bytes of the stride.
Definition: Attribute.h:322
Shorter_size _status
Indicating whether it has been initialized.
Definition: Attribute.h:318
Attribute * root()
Root of use-inheritance.
Definition: Attribute.h:134

Here is the call graph for this function:

const std::string& unit ( ) const
inline

Obtain the unit of the attribute.

Definition at line 200 of file Attribute.h.

References _unit.

Referenced by __scalegrd.f90__(), apn_input_0d(), Window::get_attribute(), read_files(), read_frac(), read_io_files(), setup_py::read_properties(), scale_mesh(), write_attr_CGNS(), and zn_input_0d().

200 { return _unit; }
std::string _unit
Unit of the attribute.
Definition: Attribute.h:310

Here is the caller graph for this function:

const Window * window ( ) const

Obtain a constant pointer to the parent window of the attribute.

Definition at line 80 of file Attribute.C.

References _pane, and Pane::window().

Referenced by Rocblas::axpy_gen(), Rocblas::calc(), Rocblas::calcDot(), Roccom_base::call_function(), Rocblas::copy(), Roccom_base::copy_attribute(), fullname(), Rocblas::gen2arg(), Window::inherit(), Rocblas::rand(), Rocblas::swap(), and Rocout::write_attr_internal().

80 { return _pane->window(); }
const Window * window() const
Obtain a constant pointer to its owner window object.
Definition: Pane.h:91
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298

Here is the call graph for this function:

Here is the caller graph for this function:

Window * window ( )

Obtain a modifiable pointer to the parent window of the attribute.

Definition at line 79 of file Attribute.C.

References _pane, and Pane::window().

79 { return _pane->window(); }
const Window * window() const
Obtain a constant pointer to its owner window object.
Definition: Pane.h:91
Pane * _pane
Pointer to its owner pane.
Definition: Attribute.h:298

Here is the call graph for this function:

Member Data Documentation

int _cap
protected

Capacity.

Definition at line 323 of file Attribute.h.

Referenced by allocate(), Attribute(), capacity(), inherit(), maxsize_of_ghost_items(), and ~Attribute().

int _gap
protected

Gap between the IDs of real and ghost items.

Definition at line 314 of file Attribute.h.

Referenced by size_of_real_items().

const char _keylocs
staticprotected
Initial value:
=
{ 'n', 'n', 'n', 'n', 'e', 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p'}

Default locations.

The locations of keywords.

Definition at line 326 of file Attribute.h.

const COM_Type _keysizes
staticprotected
Initial value:
=
{ 3, 1, 1, 1, 0, 0, 1, 2, 1, 1, 0, 0, 0 }

Default sizes.

The sizes of keywords.

Definition at line 328 of file Attribute.h.

const COM_Type _keytypes
staticprotected
Initial value:

Default data types.

The datatypes of keywords.

Definition at line 327 of file Attribute.h.

const char * _keywords
staticprotected
Initial value:
=
{ "nc", "1-nc", "2-nc", "3-nc", "conn", "mesh",
"pconn", "ridges", "1-ridges", "2-ridges", "pmesh", "atts", "all" }

List of keywords.

The names of the keywords.

Definition at line 325 of file Attribute.h.

Shorter_size _loc
protected

Location.

'w' for windowed attribute, 'p' for panal attribute, 'n' for nodal attribute, 'e' for elemental attribute

Definition at line 303 of file Attribute.h.

Referenced by Attribute(), inherit(), is_elemental(), is_nodal(), is_panel(), is_windowed(), location(), maxsize_of_ghost_items(), maxsize_of_items(), maxsize_of_real_items(), size_of_ghost_items(), size_of_items(), size_of_real_items(), size_set(), and ~Attribute().

std::string _name
protected

Name of the attribute.

Definition at line 301 of file Attribute.h.

Referenced by Attribute().

int _nbytes_strd
protected

Number of bytes of the stride.

Definition at line 322 of file Attribute.h.

Referenced by Attribute(), stride_in_bytes(), and ~Attribute().

int _ncomp
protected

Number of components.

Definition at line 308 of file Attribute.h.

Referenced by Attribute(), deallocate(), inherit(), size_of_components(), and ~Attribute().

int _nitems
protected

Size of total items. Default value is -1.

Definition at line 312 of file Attribute.h.

Referenced by Attribute(), empty(), maxsize_of_ghost_items(), maxsize_of_real_items(), size_of_items(), size_of_real_items(), size_set(), and ~Attribute().

void* _ptr
protected

Physical address of the attribute.

Definition at line 320 of file Attribute.h.

Referenced by allocate(), deallocate(), pointer(), and ~Attribute().

Shorter_size _status
protected

Indicating whether it has been initialized.

Definition at line 318 of file Attribute.h.

Referenced by allocate(), allocated(), Attribute(), capacity(), deallocate(), initialized(), is_const(), pointer(), status(), stride(), stride_in_bytes(), and ~Attribute().

int _strd
protected

Stride.

Definition at line 321 of file Attribute.h.

Referenced by allocate(), Attribute(), inherit(), stride(), and ~Attribute().

COM_Type _type
protected

Base data type of the attribute.

Definition at line 309 of file Attribute.h.

Referenced by Attribute(), data_type(), inherit(), and ~Attribute().

std::string _unit
protected

Unit of the attribute.

Definition at line 310 of file Attribute.h.

Referenced by Attribute(), inherit(), and unit().


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