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

#include <Agent.h>

Inheritance diagram for NewAttribute:
Collaboration diagram for NewAttribute:

Public Member Functions

 NewAttribute (Agent *ag, std::string target_window_, std::string attr_, char loc_, int type_, int ncomp_, const char *unit_)
 
void create (std::string bufname)
 
- Public Member Functions inherited from AttributeBase
 AttributeBase (Agent *ag, std::string target_window_, std::string attr_)
 
virtual ~AttributeBase ()
 
virtual void assign (std::string bufname)
 

Protected Attributes

char loc
 
int type
 
int ncomp
 
const char * unit
 

Additional Inherited Members

- Public Attributes inherited from AttributeBase
Agentagent
 
std::string target_window
 
std::string attr
 

Detailed Description

Definition at line 58 of file Agent.h.

Constructor & Destructor Documentation

NewAttribute ( Agent ag,
std::string  target_window_,
std::string  attr_,
char  loc_,
int  type_,
int  ncomp_,
const char *  unit_ 
)

Definition at line 102 of file Agent.C.

102  :
103  AttributeBase(ag, target_window_, attr_),
104  loc(loc_), type(type_), ncomp(ncomp_), unit(unit_)
105 {
106 }
const char * unit
Definition: Agent.h:64
char loc
Definition: Agent.h:61
int ncomp
Definition: Agent.h:63
AttributeBase(Agent *ag, std::string target_window_, std::string attr_)
Definition: Agent.h:51
int type
Definition: Agent.h:62

Member Function Documentation

void create ( std::string  bufname)
virtual

Reimplemented from AttributeBase.

Definition at line 108 of file Agent.C.

References AttributeBase::attr, COM_get_attribute(), COM_get_attribute_handle(), COM_new_attribute(), COM_resize_array(), loc, MAN_DEBUG, MPI_COMM_WORLD, ncomp, type, and unit.

109 {
110  // test if already created
111  if (COM_get_attribute_handle( bufname+attr) > 0) {
112  char loc_;
113  int type_;
114  int ncomp_;
115  std::string unit_;
116  COM_get_attribute( bufname+attr, &loc_, &type_, &ncomp_, &unit_);
117  if (loc_ != loc || type_ != type || ncomp_ != ncomp || unit_ != unit) {
118  std::cerr << "Rocstar Error: NewAttribute::create(): Could not create " << bufname+attr << " in two different ways " << std::endl;
119  MPI_Abort(MPI_COMM_WORLD, -1);
120  }
121  else
122  return;
123  }
124  MAN_DEBUG(3, ("NewAttribute::create: %s%s.\n", bufname.c_str(), attr.c_str()));
125  COM_new_attribute( bufname+attr, loc, type, ncomp, unit);
126  COM_resize_array( bufname+attr);
127 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
Definition: roccom_c++.h:269
const char * unit
Definition: Agent.h:64
char loc
Definition: Agent.h:61
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
int ncomp
Definition: Agent.h:63
int type
Definition: Agent.h:62
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
Definition: roccom_c++.h:118
std::string attr
Definition: Agent.h:49
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
Definition: roccom_c++.h:200

Here is the call graph for this function:

Member Data Documentation

char loc
protected

Definition at line 61 of file Agent.h.

Referenced by create().

int ncomp
protected

Definition at line 63 of file Agent.h.

Referenced by create().

int type
protected

Definition at line 62 of file Agent.h.

Referenced by create().

const char* unit
protected

Definition at line 64 of file Agent.h.

Referenced by create().


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