source: issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp@ 18064

Last change on this file since 18064 was 18064, checked in by Mathieu Morlighem, 11 years ago

DEL: removed all FUNCTIONs

File size: 2.3 KB
Line 
1/*!\file SpcStatic.c
2 * \brief: implementation of the SpcStatic object
3 */
4
5#ifdef HAVE_CONFIG_H
6 #include <config.h>
7#else
8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9#endif
10
11#include "../classes.h"
12#include "./Constraint.h"
13#include "../../shared/shared.h"
14
15/*SpcStatic constructors and destructor*/
16SpcStatic::SpcStatic(){/*{{{*/
17 return;
18}
19/*}}}*/
20SpcStatic::SpcStatic(int spc_sid,int spc_nodeid, int spc_dof,IssmDouble spc_value,int spc_analysis_type){/*{{{*/
21
22 sid = spc_sid;
23 nodeid = spc_nodeid;
24 dof = spc_dof;
25 value = spc_value;
26 analysis_type = spc_analysis_type;
27
28 return;
29}
30/*}}}*/
31SpcStatic::~SpcStatic(){/*{{{*/
32 return;
33}
34/*}}}*/
35
36/*Object virtual functions definitions:*/
37void SpcStatic::Echo(void){/*{{{*/
38
39 _printf_("SpcStatic:\n");
40 _printf_(" sid: " << sid << "\n");
41 _printf_(" nodeid: " << nodeid << "\n");
42 _printf_(" dof: " << dof << "\n");
43 _printf_(" value: " << value << "\n");
44 _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n");
45 return;
46}
47/*}}}*/
48void SpcStatic::DeepEcho(void){/*{{{*/
49
50 _printf_("SpcStatic:\n");
51 _printf_(" sid: " << sid << "\n");
52 _printf_(" nodeid: " << nodeid << "\n");
53 _printf_(" dof: " << dof << "\n");
54 _printf_(" value: " << value << "\n");
55 _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n");
56 return;
57}
58/*}}}*/
59int SpcStatic::Id(void){ return sid; }/*{{{*/
60/*}}}*/
61int SpcStatic::ObjectEnum(void){/*{{{*/
62
63 return SpcStaticEnum;
64
65}
66/*}}}*/
67Object* SpcStatic::copy() {/*{{{*/
68 return new SpcStatic(*this);
69}
70/*}}}*/
71
72/*Constraint virtual functions definitions: */
73bool SpcStatic::InAnalysis(int in_analysis_type){/*{{{*/
74 if (in_analysis_type==this->analysis_type) return true;
75 else return false;
76}
77/*}}}*/
78void SpcStatic::ConstrainNode(Nodes* nodes,Parameters* parameters){/*{{{*/
79
80 Node* node=NULL;
81
82 /*Chase through nodes and find the node to which this SpcStatic applys: */
83 node=(Node*)nodes->GetObjectById(NULL,nodeid);
84
85 /*Apply constraint: */
86 if(node){ //in case the spc is dealing with a node on another cpu
87 node->ApplyConstraint(dof,value);
88 }
89}
90/*}}}*/
91
92/*SpcStatic functions*/
93int SpcStatic::GetDof(){/*{{{*/
94 return dof;
95}
96/*}}}*/
97int SpcStatic::GetNodeId(){/*{{{*/
98
99 return nodeid;
100}
101/*}}}*/
102IssmDouble SpcStatic::GetValue(){/*{{{*/
103 _assert_(!xIsNan<IssmDouble>(value));
104 return value;
105}
106/*}}}*/
Note: See TracBrowser for help on using the repository browser.