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

Last change on this file since 15100 was 15100, checked in by Eric.Larour, 12 years ago

CHG: changed the names of _printString_ and _pprintString_
to _printf_ and _printf0_

File size: 2.7 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*/
16/*FUNCTION SpcStatic::SpcStatic(){{{*/
17SpcStatic::SpcStatic(){
18 return;
19}
20/*}}}*/
21/*FUNCTION SpcStatic::SpcStatic(int spc_sid,int spc_nodeid,...){{{*/
22SpcStatic::SpcStatic(int spc_sid,int spc_nodeid, int spc_dof,IssmDouble spc_value,int spc_analysis_type){
23
24 sid=spc_sid;
25 nodeid=spc_nodeid;
26 dof=spc_dof;
27 value=spc_value;
28 analysis_type=spc_analysis_type;
29
30 return;
31}
32/*}}}*/
33/*FUNCTION SpcStatic::~SpcStatic{{{*/
34SpcStatic::~SpcStatic(){
35 return;
36}
37/*}}}*/
38
39/*Object virtual functions definitions:*/
40/*FUNCTION SpcStatic::Echo {{{*/
41void SpcStatic::Echo(void){
42
43 _printf_("SpcStatic:" << "\n");
44 _printf_(" sid: " << sid << "\n");
45 _printf_(" nodeid: " << nodeid << "\n");
46 _printf_(" dof: " << dof << "\n");
47 _printf_(" value: " << value << "\n");
48 _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n");
49 return;
50}
51/*}}}*/
52/*FUNCTION SpcStatic::DeepEcho {{{*/
53void SpcStatic::DeepEcho(void){
54
55 _printf_("SpcStatic:" << "\n");
56 _printf_(" sid: " << sid << "\n");
57 _printf_(" nodeid: " << nodeid << "\n");
58 _printf_(" dof: " << dof << "\n");
59 _printf_(" value: " << value << "\n");
60 _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n");
61 return;
62}
63/*}}}*/
64/*FUNCTION SpcStatic::Id {{{*/
65int SpcStatic::Id(void){ return sid; }
66/*}}}*/
67/*FUNCTION SpcStatic::ObjectEnum{{{*/
68int SpcStatic::ObjectEnum(void){
69
70 return SpcStaticEnum;
71
72}
73/*}}}*/
74/*FUNCTION SpcStatic::copy {{{*/
75Object* SpcStatic::copy() {
76 return new SpcStatic(*this);
77}
78/*}}}*/
79
80/*Constraint virtual functions definitions: */
81/*FUNCTION SpcStatic::InAnalysis{{{*/
82bool SpcStatic::InAnalysis(int in_analysis_type){
83 if (in_analysis_type==this->analysis_type) return true;
84 else return false;
85}
86/*}}}*/
87/*FUNCTION SpcStatic::ConstrainNode{{{*/
88void SpcStatic::ConstrainNode(Nodes* nodes,Parameters* parameters){
89
90 Node* node=NULL;
91
92 /*Chase through nodes and find the node to which this SpcStatic applys: */
93 node=(Node*)nodes->GetObjectById(NULL,nodeid);
94
95 /*Apply constraint: */
96 if(node){ //in case the spc is dealing with a node on another cpu
97 node->ApplyConstraint(dof,value);
98 }
99}
100/*}}}*/
101
102/*SpcStatic functions*/
103/*FUNCTION SpcStatic::GetDof {{{*/
104int SpcStatic::GetDof(){
105 return dof;
106}
107/*}}}*/
108/*FUNCTION SpcStatic::GetNodeId {{{*/
109int SpcStatic::GetNodeId(){
110
111 return nodeid;
112}
113/*}}}*/
114/*FUNCTION SpcStatic::GetValue {{{*/
115IssmDouble SpcStatic::GetValue(){
116 _assert_(!xIsNan<IssmDouble>(value));
117 return value;
118}
119/*}}}*/
Note: See TracBrowser for help on using the repository browser.