1 | /*!\file BoolElementResult.c
|
---|
2 | * \brief: implementation of the BoolElementResult 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 <stdio.h>
|
---|
12 | #include <string.h>
|
---|
13 | #include "./ElementResultLocal.h"
|
---|
14 | #include "../../classes.h"
|
---|
15 | #include "../../../EnumDefinitions/EnumDefinitions.h"
|
---|
16 | #include "../../../shared/shared.h"
|
---|
17 | #include "../../../Container/Container.h"
|
---|
18 | #include "../../../include/include.h"
|
---|
19 |
|
---|
20 | /*BoolElementResult constructors and destructor*/
|
---|
21 | /*FUNCTION BoolElementResult::BoolElementResult(){{{*/
|
---|
22 | BoolElementResult::BoolElementResult(){
|
---|
23 | return;
|
---|
24 | }
|
---|
25 | /*}}}*/
|
---|
26 | /*FUNCTION BoolElementResult::BoolElementResult(int in_enum_type,IssmDouble in_value,int in_step, IssmDouble in_time){{{*/
|
---|
27 | BoolElementResult::BoolElementResult(int in_enum_type,bool in_value,int in_step, IssmDouble in_time){
|
---|
28 |
|
---|
29 | enum_type=in_enum_type;
|
---|
30 | value=in_value;
|
---|
31 | step=in_step;
|
---|
32 | time=in_time;
|
---|
33 | }
|
---|
34 | /*}}}*/
|
---|
35 | /*FUNCTION BoolElementResult::~BoolElementResult(){{{*/
|
---|
36 | BoolElementResult::~BoolElementResult(){
|
---|
37 | return;
|
---|
38 | }
|
---|
39 | /*}}}*/
|
---|
40 |
|
---|
41 | /*Object virtual functions definitions:*/
|
---|
42 | /*FUNCTION BoolElementResult::Echo {{{*/
|
---|
43 | void BoolElementResult::Echo(void){
|
---|
44 | this->DeepEcho();
|
---|
45 | }
|
---|
46 | /*}}}*/
|
---|
47 | /*FUNCTION BoolElementResult::DeepEcho{{{*/
|
---|
48 | void BoolElementResult::DeepEcho(void){
|
---|
49 |
|
---|
50 | _printLine_("BoolElementResult:");
|
---|
51 | _printLine_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
|
---|
52 | _printLine_(" value: "<<(this->value?"true":"false"));
|
---|
53 | _printLine_(" step: " << this->step);
|
---|
54 | _printLine_(" time: " << this->time);
|
---|
55 | }
|
---|
56 | /*}}}*/
|
---|
57 | /*FUNCTION BoolElementResult::Id{{{*/
|
---|
58 | int BoolElementResult::Id(void){ return -1; }
|
---|
59 | /*}}}*/
|
---|
60 | /*FUNCTION BoolElementResult::ObjectEnum{{{*/
|
---|
61 | int BoolElementResult::ObjectEnum(void){
|
---|
62 |
|
---|
63 | return BoolElementResultEnum;
|
---|
64 |
|
---|
65 | }
|
---|
66 | /*}}}*/
|
---|
67 | /*FUNCTION BoolElementResult::copy{{{*/
|
---|
68 | Object* BoolElementResult::copy() {
|
---|
69 |
|
---|
70 | return new BoolElementResult(this->enum_type,this->value,this->step,this->time);
|
---|
71 |
|
---|
72 | }
|
---|
73 | /*}}}*/
|
---|
74 |
|
---|
75 | /*ElementResult management*/
|
---|
76 | /*FUNCTION BoolElementResult::InstanceEnum{{{*/
|
---|
77 | int BoolElementResult::InstanceEnum(void){
|
---|
78 |
|
---|
79 | return this->enum_type;
|
---|
80 |
|
---|
81 | }
|
---|
82 | /*}}}*/
|
---|
83 | /*FUNCTION BoolElementResult::SpawnTriaElementResult{{{*/
|
---|
84 | ElementResult* BoolElementResult::SpawnTriaElementResult(int* indices){
|
---|
85 |
|
---|
86 | /*output*/
|
---|
87 | BoolElementResult* outresult=new BoolElementResult();
|
---|
88 |
|
---|
89 | /*copy fields: */
|
---|
90 | outresult->enum_type=this->enum_type;
|
---|
91 | outresult->value=this->value;
|
---|
92 | outresult->time=this->time;
|
---|
93 | outresult->step=this->step;
|
---|
94 |
|
---|
95 | /*Assign output*/
|
---|
96 | return outresult;
|
---|
97 |
|
---|
98 | }
|
---|
99 | /*}}}*/
|
---|
100 | /*FUNCTION BoolElementResult::ProcessUnits{{{*/
|
---|
101 | void BoolElementResult::ProcessUnits(Parameters* parameters){
|
---|
102 | // no op
|
---|
103 | }
|
---|
104 | /*}}}*/
|
---|
105 | /*FUNCTION BoolElementResult::NumberOfNodalValues{{{*/
|
---|
106 | int BoolElementResult::NumberOfNodalValues(void){
|
---|
107 | return 1;
|
---|
108 | }
|
---|
109 | /*}}}*/
|
---|
110 | /*FUNCTION BoolElementResult::PatchFill{{{*/
|
---|
111 | void BoolElementResult::PatchFill(int row, Patch* patch){
|
---|
112 |
|
---|
113 | /*Here, we fill the result information into the patch object. First, let's remember what is in a row
|
---|
114 | * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
|
---|
115 | * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
|
---|
116 | IssmDouble IssmDoublevalue=this->value?1:0;
|
---|
117 | patch->fillresultinfo(row,this->enum_type,this->step,this->time,P0Enum,&IssmDoublevalue,1);
|
---|
118 |
|
---|
119 | }
|
---|
120 | /*}}}*/
|
---|
121 | /*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
|
---|
122 | void BoolElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
|
---|
123 |
|
---|
124 | _error_("cannot return vector on vertices");
|
---|
125 | } /*}}}*/
|
---|
126 | /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
|
---|
127 | void BoolElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
|
---|
128 |
|
---|
129 | vector->SetValue(dof,value,INS_VAL);
|
---|
130 | } /*}}}*/
|
---|