Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Private Attributes
SpcDynamic Class Reference

#include <SpcDynamic.h>

Inheritance diagram for SpcDynamic:
Constraint Object

Public Member Functions

 SpcDynamic ()
 
 SpcDynamic (int id_in, int nodeid, int dof, int analysis_type)
 
 ~SpcDynamic ()
 
Objectcopy ()
 
void DeepEcho ()
 
void Echo ()
 
int Id ()
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum ()
 
void ActivatePenaltyMethod (void)
 
void ConstrainNode (Nodes *nodes, Parameters *parameters)
 
void PenaltyDofAndValue (int *dof, IssmDouble *value, Nodes *nodes, Parameters *parameters)
 
void InputUpdateFromVectorDakota (IssmDouble *vector, Nodes *nodes, int name, int type)
 
int GetDof ()
 
int GetNodeId ()
 
IssmDouble GetValue ()
 
void SetDynamicConstraint (Nodes *nodes, IssmDouble *yg_serial)
 
- Public Member Functions inherited from Constraint
virtual ~Constraint ()
 
- Public Member Functions inherited from Object
virtual ~Object ()
 

Private Attributes

int id
 
int nodeid
 
int dof
 
IssmDouble value
 
bool isset
 
int analysis_type
 
bool penalty
 

Detailed Description

Definition at line 13 of file SpcDynamic.h.

Constructor & Destructor Documentation

◆ SpcDynamic() [1/2]

SpcDynamic::SpcDynamic ( )

Definition at line 16 of file SpcDynamic.cpp.

16  {/*{{{*/
17  return;
18 }

◆ SpcDynamic() [2/2]

SpcDynamic::SpcDynamic ( int  id_in,
int  nodeid,
int  dof,
int  analysis_type 
)

Definition at line 20 of file SpcDynamic.cpp.

20  {/*{{{*/
21 
22  id = spc_id;
23  nodeid = spc_nodeid;
24  dof = spc_dof;
25  value = 0;
26  analysis_type = spc_analysis_type;
27  isset = false;
28  penalty = false;
29 
30  return;
31 }

◆ ~SpcDynamic()

SpcDynamic::~SpcDynamic ( )

Definition at line 33 of file SpcDynamic.cpp.

33  {/*{{{*/
34  return;
35 }

Member Function Documentation

◆ copy()

Object * SpcDynamic::copy ( void  )
virtual

Implements Object.

Definition at line 39 of file SpcDynamic.cpp.

39  {/*{{{*/
40 
41  SpcDynamic* spcdyn = new SpcDynamic(*this);
42 
43  spcdyn->id=this->id;
44  spcdyn->nodeid=this->nodeid;
45  spcdyn->dof=this->dof;
46  spcdyn->value=this->value;
47  spcdyn->analysis_type=this->analysis_type;
48  spcdyn->isset=this->isset;
49 
50  return (Object*) spcdyn;
51 }

◆ DeepEcho()

void SpcDynamic::DeepEcho ( void  )
virtual

Implements Object.

Definition at line 53 of file SpcDynamic.cpp.

53  {/*{{{*/
54 
55  this->Echo();
56  return;
57 }

◆ Echo()

void SpcDynamic::Echo ( void  )
virtual

Implements Object.

Definition at line 59 of file SpcDynamic.cpp.

59  {/*{{{*/
60 
61  _printf_("SpcDynamic:\n");
62  _printf_(" id: " << id << "\n");
63  _printf_(" nodeid: " << nodeid << "\n");
64  _printf_(" dof: " << dof << "\n");
65  _printf_(" value: " << value << "\n");
66  _printf_(" isset: " <<(isset?"true":"false") << "\n");
67  _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n");
68  return;
69 }

◆ Id()

int SpcDynamic::Id ( void  )
virtual

Implements Object.

Definition at line 71 of file SpcDynamic.cpp.

71 { return id; }/*{{{*/

◆ Marshall()

void SpcDynamic::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
virtual

Implements Object.

Definition at line 73 of file SpcDynamic.cpp.

73  { /*{{{*/
74 
76 
77  MARSHALLING(id);
84 
85 }

◆ ObjectEnum()

int SpcDynamic::ObjectEnum ( void  )
virtual

Implements Object.

Definition at line 87 of file SpcDynamic.cpp.

87  {/*{{{*/
88 
89  return SpcDynamicEnum;
90 
91 }

◆ ActivatePenaltyMethod()

void SpcDynamic::ActivatePenaltyMethod ( void  )
virtual

Implements Constraint.

Definition at line 95 of file SpcDynamic.cpp.

95  {/*{{{*/
96  this->penalty = true;
97 }

◆ ConstrainNode()

void SpcDynamic::ConstrainNode ( Nodes nodes,
Parameters parameters 
)
virtual

Implements Constraint.

Definition at line 99 of file SpcDynamic.cpp.

99  {/*{{{*/
100 
101  Node* node=NULL;
102 
103  /*Chase through nodes and find the node to which this SpcDynamic applys: */
104  node=(Node*)nodes->GetObjectById(NULL,nodeid);
105 
106  /*Apply constraint: */
107  if(node){ //in case the spc is dealing with a node on another cpu
108 
109  /*We should first check that the value has been set... (test306)*/
110  node->ApplyConstraint(dof,value);
111  }
112 }

◆ PenaltyDofAndValue()

void SpcDynamic::PenaltyDofAndValue ( int *  dof,
IssmDouble value,
Nodes nodes,
Parameters parameters 
)
inlinevirtual

Implements Constraint.

Definition at line 42 of file SpcDynamic.h.

42 {_error_("not implemented yet");};

◆ InputUpdateFromVectorDakota()

void SpcDynamic::InputUpdateFromVectorDakota ( IssmDouble vector,
Nodes nodes,
int  name,
int  type 
)
inlinevirtual

Implements Constraint.

Definition at line 43 of file SpcDynamic.h.

43 {_error_("not implemented yet");};

◆ GetDof()

int SpcDynamic::GetDof ( )

Definition at line 116 of file SpcDynamic.cpp.

116  {/*{{{*/
117  return dof;
118 }

◆ GetNodeId()

int SpcDynamic::GetNodeId ( )

Definition at line 120 of file SpcDynamic.cpp.

120  {/*{{{*/
121 
122  return nodeid;
123 }

◆ GetValue()

IssmDouble SpcDynamic::GetValue ( )

Definition at line 125 of file SpcDynamic.cpp.

125  {/*{{{*/
126  _assert_(this->isset);
127  _assert_(!xIsNan<IssmDouble>(value));
128  return value;
129 }

◆ SetDynamicConstraint()

void SpcDynamic::SetDynamicConstraint ( Nodes nodes,
IssmDouble yg_serial 
)

Definition at line 131 of file SpcDynamic.cpp.

131  {/*{{{*/
132 
133  int pos;
134 
135  Node* node=(Node*)nodes->GetObjectById(NULL,nodeid);
136  pos=node->GetDof(dof,GsetEnum);
137 
138  this->value=yg_serial[pos];
139  this->isset=true;
140 }

Field Documentation

◆ id

int SpcDynamic::id
private

Definition at line 16 of file SpcDynamic.h.

◆ nodeid

int SpcDynamic::nodeid
private

id, to track it

Definition at line 17 of file SpcDynamic.h.

◆ dof

int SpcDynamic::dof
private

node id

Definition at line 18 of file SpcDynamic.h.

◆ value

IssmDouble SpcDynamic::value
private

component

Definition at line 19 of file SpcDynamic.h.

◆ isset

bool SpcDynamic::isset
private

Definition at line 20 of file SpcDynamic.h.

◆ analysis_type

int SpcDynamic::analysis_type
private

Definition at line 21 of file SpcDynamic.h.

◆ penalty

bool SpcDynamic::penalty
private

Definition at line 22 of file SpcDynamic.h.


The documentation for this class was generated from the following files:
SpcDynamic::nodeid
int nodeid
Definition: SpcDynamic.h:17
_assert_
#define _assert_(ignore)
Definition: exceptions.h:37
DataSet::GetObjectById
Object * GetObjectById(int *poffset, int eid)
Definition: DataSet.cpp:345
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
MARSHALLING_ENUM
#define MARSHALLING_ENUM(EN)
Definition: Marshalling.h:14
SpcDynamic::value
IssmDouble value
Definition: SpcDynamic.h:19
Object
Definition: Object.h:13
SpcDynamic::dof
int dof
Definition: SpcDynamic.h:18
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
SpcDynamic::Echo
void Echo()
Definition: SpcDynamic.cpp:59
GsetEnum
@ GsetEnum
Definition: EnumDefinitions.h:1093
SpcDynamicEnum
@ SpcDynamicEnum
Definition: EnumDefinitions.h:1279
MARSHALLING
#define MARSHALLING(FIELD)
Definition: Marshalling.h:29
SpcDynamic
Definition: SpcDynamic.h:13
SpcDynamic::SpcDynamic
SpcDynamic()
Definition: SpcDynamic.cpp:16
Node
Definition: Node.h:23
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
Node::ApplyConstraint
void ApplyConstraint(int dof, IssmDouble value)
Definition: Node.cpp:646
SpcDynamic::penalty
bool penalty
Definition: SpcDynamic.h:22
SpcDynamic::isset
bool isset
Definition: SpcDynamic.h:20
SpcDynamic::analysis_type
int analysis_type
Definition: SpcDynamic.h:21
SpcDynamic::id
int id
Definition: SpcDynamic.h:16
Node::GetDof
int GetDof(int dofindex, int setenum)
Definition: Node.cpp:374