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

#include <Action.h>

Inheritance diagram for Action:
Collaboration diagram for Action:

Public Member Functions

 Action (void *p=0, char *name=NULL)
 
 Action (int n, const char *at[], int *i=NULL, void *p=0, char *name=NULL)
 
 Action (int n, const std::string at[], int *i=NULL, void *p=0, char *name=NULL)
 
virtual ~Action ()
 
virtual void declare (Scheduler &)
 
virtual void init (double t)
 
virtual void run (double t, double dt, double alpha)
 
virtual void finalize ()
 
virtual char * name ()
 
void set_name (const char *name)
 
virtual void print (FILE *f)
 
virtual void print_toposort (FILE *f)
 
virtual void schedule ()
 

Protected Types

enum  { IN =1, OUT =2, INOUT =3 }
 

Protected Member Functions

int get_attribute_handle (int i)
 
int get_attribute_handle_const (int i)
 
int get_attribute_handle (const std::string str)
 
void set_attr (int n, const std::string at[], int *id=NULL)
 
void set_attr (int n, const char *at[], int *id=NULL)
 
void set_io (int n, const int *io)
 
void set_io (const char *io)
 
int get_io (int i)
 

Protected Attributes

char * action_name
 
char ** attr
 
int * idx
 
int count
 
void * usr_ptr
 
std::vector< int > inout
 

Detailed Description

Definition at line 32 of file Action.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
IN 
OUT 
INOUT 

Definition at line 35 of file Action.h.

35 { IN=1, OUT=2, INOUT=3 };

Constructor & Destructor Documentation

Action ( void *  p = 0,
char *  name = NULL 
)

Definition at line 32 of file Action.C.

32  : action_name(name), attr(NULL),
33  idx(NULL), count(0), usr_ptr(p)
34 {
35 }
virtual char * name()
Definition: Action.h:53
int count
Definition: Action.h:39
char * action_name
Definition: Action.h:36
int * idx
Definition: Action.h:38
char ** attr
Definition: Action.h:37
void * usr_ptr
Definition: Action.h:40
Action ( int  n,
const char *  at[],
int *  i = NULL,
void *  p = 0,
char *  name = NULL 
)

Definition at line 37 of file Action.C.

References action_name, and set_attr().

37  : action_name(name), count(n), usr_ptr(p)
38 {
39  set_attr(n, at, id);
40  if (action_name == NULL) action_name = (char*)typeid(*this).name();
41 }
virtual char * name()
Definition: Action.h:53
int count
Definition: Action.h:39
char * action_name
Definition: Action.h:36
const NT & n
void set_attr(int n, const std::string at[], int *id=NULL)
Definition: Action.C:66
void * usr_ptr
Definition: Action.h:40

Here is the call graph for this function:

Action ( int  n,
const std::string  at[],
int *  i = NULL,
void *  p = 0,
char *  name = NULL 
)

Definition at line 43 of file Action.C.

References action_name, and set_attr().

43  : action_name(name), count(n), usr_ptr(p)
44 {
45  set_attr(n, at, id);
46  if (action_name == NULL) action_name = (char*)typeid(*this).name();
47 }
virtual char * name()
Definition: Action.h:53
int count
Definition: Action.h:39
char * action_name
Definition: Action.h:36
const NT & n
void set_attr(int n, const std::string at[], int *id=NULL)
Definition: Action.C:66
void * usr_ptr
Definition: Action.h:40

Here is the call graph for this function:

~Action ( )
virtual

Definition at line 49 of file Action.C.

References attr, count, i, and idx.

50 {
51  for (int i=0; i<count; i++) free(attr[i]);
52  delete [] attr;
53  delete [] idx;
54 }
int count
Definition: Action.h:39
int * idx
Definition: Action.h:38
char ** attr
Definition: Action.h:37
blockLoc i
Definition: read.cpp:79

Member Function Documentation

void declare ( Scheduler sched)
virtual

Reimplemented in PhysicsAction, SchedulerAction, ActionG, ActionF, ActionE, ActionD, ActionC, ActionB, and ActionA.

Definition at line 77 of file Action.C.

References attr, count, i, idx, IN, inout, OUT, Scheduler::reads(), and Scheduler::writes().

Referenced by Scheduler::add_action().

77  {
78  //CmiAssert(count>0);
79  for ( int i=0; i<count; ++i) {
80  if ( inout[i] & IN)
81  sched.reads(this, attr[i], idx[i]);
82  if ( inout[i] & OUT)
83  sched.writes(this, attr[i], idx[i]);
84  }
85 }
std::vector< int > inout
Definition: Action.h:42
int count
Definition: Action.h:39
void writes(Action *, const char *attr, int idx)
Definition: Scheduler.C:64
int * idx
Definition: Action.h:38
void reads(Action *, const char *attr, int idx)
Definition: Scheduler.C:49
char ** attr
Definition: Action.h:37
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void finalize ( )
inlinevirtual

Reimplemented in UserSchedulerAction, and SchedulerAction.

Definition at line 52 of file Action.h.

Referenced by Scheduler::finalize_actions().

52 { /* printf("Rocstar: Action %s finalized. \n", name()); */ }

Here is the caller graph for this function:

int get_attribute_handle ( int  i)
protected
int get_attribute_handle ( const std::string  str)
protected

Definition at line 102 of file Action.C.

References COM_assertion_msg, and COM_get_attribute_handle().

102  {
103  int hdl = COM_get_attribute_handle( str);
104  COM_assertion_msg ( hdl>0, (std::string("Attribute \"")+str
105  +"\" does not exist").c_str());
106  return hdl;
107 }
#define COM_assertion_msg(EX, msg)
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412

Here is the call graph for this function:

int get_attribute_handle_const ( int  i)
protected

Definition at line 110 of file Action.C.

References attr, COM_assertion_msg, and COM_get_attribute_handle_const().

Referenced by InterpolateBase::init(), LoadTransfer_FSc_ALE::init(), LoadTransferOnly_FSc_ALE::init(), and ComputeFluidLoad_ALE::init().

110  {
112  COM_assertion_msg ( hdl>0, (std::string("Attribute \"")+attr[i]
113  +"\" does not exist").c_str());
114  return hdl;
115 }
#define COM_assertion_msg(EX, msg)
char ** attr
Definition: Action.h:37
blockLoc i
Definition: read.cpp:79
int COM_get_attribute_handle_const(const char *waname)
Definition: roccom_c++.h:420

Here is the call graph for this function:

Here is the caller graph for this function:

int get_io ( int  i)
inlineprotected

Definition at line 74 of file Action.h.

References i, and inout.

Referenced by InterpolateBase::init().

74 { return inout[i]; }
std::vector< int > inout
Definition: Action.h:42
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

virtual char* name ( )
inlinevirtual

Reimplemented in PhysicsAction.

Definition at line 53 of file Action.h.

References action_name.

Referenced by InterpolateBase::init(), print(), SchedulerAction::print(), UserSchedulerAction::print(), print_toposort(), Scheduler::reads(), Scheduler::set_name(), and Scheduler::writes().

53 { return action_name; }
char * action_name
Definition: Action.h:36

Here is the caller graph for this function:

void print ( FILE *  f)
virtual

Reimplemented in PhysicsAction.

Definition at line 87 of file Action.C.

References name().

Referenced by Scheduler::print_helper().

88 {
89  fprintf(f, "node: { title:\"%s\" label:\"%s\"}\n", name(), name());
90 }
virtual char * name()
Definition: Action.h:53

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void print_toposort ( FILE *  f)
inlinevirtual

Reimplemented in UserSchedulerAction, and SchedulerAction.

Definition at line 56 of file Action.h.

References name().

56 { fprintf(f, "%s ", name()); }
virtual char * name()
Definition: Action.h:53

Here is the call graph for this function:

virtual void schedule ( )
inlinevirtual

Reimplemented in UserSchedulerAction, and SchedulerAction.

Definition at line 57 of file Action.h.

57 {} // do nothing
void set_attr ( int  n,
const std::string  at[],
int *  id = NULL 
)
protected

Definition at line 66 of file Action.C.

References attr, count, i, idx, and n.

Referenced by Action(), BCInitInvoker::BCInitInvoker(), BCInvoker::BCInvoker(), ComputeBurnPane::ComputeBurnPane(), ComputeFaceCenters::ComputeFaceCenters(), ComputeFluidLoad_ALE::ComputeFluidLoad_ALE(), ComputeMeshMotion::ComputeMeshMotion(), ComputePconn::ComputePconn(), ComputeRhofvf::ComputeRhofvf(), CopyBflagFromBurn::CopyBflagFromBurn(), CopyBurnFromParentMesh::CopyBurnFromParentMesh(), CopyValue::CopyValue(), DeformationVelTransfer_SF::DeformationVelTransfer_SF(), DummyPrint::DummyPrint(), Extrapolate_Central::Extrapolate_Central(), Extrapolate_Linear::Extrapolate_Linear(), FluidPropagateSurface::FluidPropagateSurface(), GetDeformedMesh::GetDeformedMesh(), GetDeformedMesh_ALE::GetDeformedMesh_ALE(), GMInvoker::GMInvoker(), HeatTransfer_FS::HeatTransfer_FS(), Interpolate_Central::Interpolate_Central(), Interpolate_Constant::Interpolate_Constant(), Interpolate_Linear::Interpolate_Linear(), LoadTransfer_FS::LoadTransfer_FS(), LoadTransfer_FSc_ALE::LoadTransfer_FSc_ALE(), LoadTransferOnly_FSc_ALE::LoadTransferOnly_FSc_ALE(), MassTransfer::MassTransfer(), MassTransfer_SF_ALE::MassTransfer_SF_ALE(), MeshMotionTransfer_SF::MeshMotionTransfer_SF(), MeshMotionTransferISS::MeshMotionTransferISS(), RemeshInit::RemeshInit(), Reset_du_alp::Reset_du_alp(), SolidPropagateSurface_ALE::SolidPropagateSurface_ALE(), TemperatureTransfer_SF::TemperatureTransfer_SF(), TransferBurnRate_FS_ALE::TransferBurnRate_FS_ALE(), TransferSolidDensity::TransferSolidDensity(), and ZoomInterface::ZoomInterface().

67 {
68  int i;
69  count = n;
70  attr = new char *[count];
71  for (i=0; i<count; i++) attr[i] = strdup(at[i].c_str());
72  idx = new int[count];
73  for (i=0; i<count; i++) idx[i] = id?id[i]:0;
74 }
int count
Definition: Action.h:39
int * idx
Definition: Action.h:38
char ** attr
Definition: Action.h:37
blockLoc i
Definition: read.cpp:79
const NT & n

Here is the caller graph for this function:

void set_attr ( int  n,
const char *  at[],
int *  id = NULL 
)
protected

Definition at line 56 of file Action.C.

References attr, count, i, idx, and n.

57 {
58  int i;
59  count = n;
60  attr = new char *[count];
61  for (i=0; i<count; i++) attr[i] = strdup(at[i]);
62  idx = new int[count];
63  for (i=0; i<count; i++) idx[i] = id?id[i]:0;
64 }
int count
Definition: Action.h:39
int * idx
Definition: Action.h:38
char ** attr
Definition: Action.h:37
blockLoc i
Definition: read.cpp:79
const NT & n
void set_io ( int  n,
const int *  io 
)
inlineprotected

Definition at line 70 of file Action.h.

References count, inout, and n.

Referenced by BCInitInvoker::BCInitInvoker(), BCInvoker::BCInvoker(), ComputeBurnPane::ComputeBurnPane(), ComputeFaceCenters::ComputeFaceCenters(), ComputeFluidLoad_ALE::ComputeFluidLoad_ALE(), ComputeMeshMotion::ComputeMeshMotion(), ComputePconn::ComputePconn(), ComputeRhofvf::ComputeRhofvf(), CopyBflagFromBurn::CopyBflagFromBurn(), CopyBurnFromParentMesh::CopyBurnFromParentMesh(), CopyValue::CopyValue(), DeformationVelTransfer_SF::DeformationVelTransfer_SF(), DummyPrint::DummyPrint(), Extrapolate_Central::Extrapolate_Central(), Extrapolate_Linear::Extrapolate_Linear(), FluidPropagateSurface::FluidPropagateSurface(), GetDeformedMesh::GetDeformedMesh(), GetDeformedMesh_ALE::GetDeformedMesh_ALE(), GMInvoker::GMInvoker(), HeatTransfer_FS::HeatTransfer_FS(), Interpolate_Central::Interpolate_Central(), Interpolate_Constant::Interpolate_Constant(), Interpolate_Linear::Interpolate_Linear(), LoadTransfer_FS::LoadTransfer_FS(), LoadTransfer_FSc_ALE::LoadTransfer_FSc_ALE(), LoadTransferOnly_FSc_ALE::LoadTransferOnly_FSc_ALE(), MassTransfer::MassTransfer(), MassTransfer_SF_ALE::MassTransfer_SF_ALE(), MeshMotionTransfer_SF::MeshMotionTransfer_SF(), MeshMotionTransferISS::MeshMotionTransferISS(), RemeshInit::RemeshInit(), Reset_du_alp::Reset_du_alp(), SetValueDouble::SetValueDouble(), SolidPropagateSurface_ALE::SolidPropagateSurface_ALE(), TemperatureTransfer_SF::TemperatureTransfer_SF(), TransferBurnRate_FS_ALE::TransferBurnRate_FS_ALE(), TransferSolidDensity::TransferSolidDensity(), and ZoomInterface::ZoomInterface().

71  { inout.clear(); inout.insert( inout.end(), io, io+n); if (count==0) count=n; }
std::vector< int > inout
Definition: Action.h:42
int count
Definition: Action.h:39
const NT & n

Here is the caller graph for this function:

void set_io ( const char *  io)
protected
void set_name ( const char *  name)
inline

Definition at line 54 of file Action.h.

References action_name.

Referenced by Agent::Agent().

54 { action_name = strdup(name); }
virtual char * name()
Definition: Action.h:53
char * action_name
Definition: Action.h:36

Here is the caller graph for this function:

Member Data Documentation

int count
protected

Definition at line 39 of file Action.h.

Referenced by declare(), set_attr(), set_io(), and ~Action().

int* idx
protected

Definition at line 38 of file Action.h.

Referenced by declare(), set_attr(), and ~Action().

std::vector<int> inout
protected

Definition at line 42 of file Action.h.

Referenced by declare(), get_io(), and set_io().

void* usr_ptr
protected

Definition at line 40 of file Action.h.


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