[21726] | 1 | Index: ../trunk-jpl/src/m/classes/thermal.py
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/classes/thermal.py (revision 21541)
|
---|
| 4 | +++ ../trunk-jpl/src/m/classes/thermal.py (revision 21542)
|
---|
| 5 | @@ -22,6 +22,7 @@
|
---|
| 6 | self.penalty_factor = 0
|
---|
| 7 | self.isenthalpy = 0
|
---|
| 8 | self.isdynamicbasalspc = 0;
|
---|
| 9 | + self.fe = 'P1';
|
---|
| 10 | self.requested_outputs = []
|
---|
| 11 |
|
---|
| 12 | #set defaults
|
---|
| 13 | @@ -78,8 +79,11 @@
|
---|
| 14 | self.isenthalpy=0
|
---|
| 15 |
|
---|
| 16 | #will basal boundary conditions be set dynamically
|
---|
| 17 | - self.isdynamicbasalspc=0;
|
---|
| 18 | + self.isdynamicbasalspc=0
|
---|
| 19 |
|
---|
| 20 | + #Finite element interpolation
|
---|
| 21 | + self.fe='P1'
|
---|
| 22 | +
|
---|
| 23 | #default output
|
---|
| 24 | self.requested_outputs=['default']
|
---|
| 25 | return self
|
---|
| 26 | @@ -123,6 +127,7 @@
|
---|
| 27 | WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer')
|
---|
| 28 | WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double')
|
---|
| 29 | WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean')
|
---|
| 30 | + WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
|
---|
| 31 | WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean');
|
---|
| 32 |
|
---|
| 33 | #process requested outputs
|
---|
| 34 | Index: ../trunk-jpl/src/m/classes/thermal.m
|
---|
| 35 | ===================================================================
|
---|
| 36 | --- ../trunk-jpl/src/m/classes/thermal.m (revision 21541)
|
---|
| 37 | +++ ../trunk-jpl/src/m/classes/thermal.m (revision 21542)
|
---|
| 38 | @@ -14,6 +14,7 @@
|
---|
| 39 | penalty_factor = 0;
|
---|
| 40 | isenthalpy = 0;
|
---|
| 41 | isdynamicbasalspc = 0;
|
---|
| 42 | + fe = 'P1';
|
---|
| 43 | requested_outputs = {};
|
---|
| 44 | end
|
---|
| 45 | methods
|
---|
| 46 | @@ -65,6 +66,9 @@
|
---|
| 47 | %will basal boundary conditions be set dynamically
|
---|
| 48 | self.isdynamicbasalspc=0;
|
---|
| 49 |
|
---|
| 50 | + %Linear elements by default
|
---|
| 51 | + self.fe='P1';
|
---|
| 52 | +
|
---|
| 53 | %default output
|
---|
| 54 | self.requested_outputs={'default'};
|
---|
| 55 | end % }}}
|
---|
| 56 | @@ -75,6 +79,7 @@
|
---|
| 57 |
|
---|
| 58 | md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2]);
|
---|
| 59 | md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1,'>=',0);
|
---|
| 60 | + md = checkfield(md,'fieldname','thermal.fe','values',{'P1','P1xP2'});
|
---|
| 61 | if (ismember('EnthalpyAnalysis',analyses) & md.thermal.isenthalpy & dimension(md.mesh)==3),
|
---|
| 62 |
|
---|
| 63 | %Make sure the spc are less than melting point
|
---|
| 64 | @@ -109,6 +114,7 @@
|
---|
| 65 | fielddisplay(self,'penalty_factor','scaling exponent (default is 3)');
|
---|
| 66 | fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
|
---|
| 67 | fielddisplay(self,'isdynamicbasalspc',['enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)']);
|
---|
| 68 | + fielddisplay(self,'fe','Finite Element type: ''P1'' (default), ''P1xP2''');
|
---|
| 69 | fielddisplay(self,'requested_outputs','additional outputs requested');
|
---|
| 70 |
|
---|
| 71 | end % }}}
|
---|
| 72 | @@ -121,6 +127,7 @@
|
---|
| 73 | WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer');
|
---|
| 74 | WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
|
---|
| 75 | WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean');
|
---|
| 76 | + WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
|
---|
| 77 | WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean');
|
---|
| 78 |
|
---|
| 79 | %process requested outputs
|
---|
| 80 | Index: ../trunk-jpl/src/c/classes/IoModel.cpp
|
---|
| 81 | ===================================================================
|
---|
| 82 | --- ../trunk-jpl/src/c/classes/IoModel.cpp (revision 21541)
|
---|
| 83 | +++ ../trunk-jpl/src/c/classes/IoModel.cpp (revision 21542)
|
---|
| 84 | @@ -656,6 +656,8 @@
|
---|
| 85 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 86 | } else if(strcmp(record_name,"md.flowequation.fe_FS")==0){
|
---|
| 87 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 88 | + } else if(strcmp(record_name,"md.thermal.fe")==0){
|
---|
| 89 | + this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 90 | } else if(strcmp(record_name,"md.groundingline.migration")==0){
|
---|
| 91 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 92 | } else if(strcmp(record_name,"md.masstransport.hydrostatic_adjustment")==0){
|
---|
| 93 | @@ -796,6 +798,8 @@
|
---|
| 94 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 95 | } else if(strcmp(record_name,"md.flowequation.fe_FS")==0){
|
---|
| 96 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 97 | + } else if(strcmp(record_name,"md.thermal.fe")==0){
|
---|
| 98 | + this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 99 | } else if(strcmp(record_name,"md.groundingline.migration")==0){
|
---|
| 100 | this->AddConstant(new IoConstant(StringToEnumx(string),record_name));
|
---|
| 101 | } else if(strcmp(record_name,"md.masstransport.hydrostatic_adjustment")==0){
|
---|
| 102 | Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
|
---|
| 103 | ===================================================================
|
---|
| 104 | --- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp (revision 21541)
|
---|
| 105 | +++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp (revision 21542)
|
---|
| 106 | @@ -97,8 +97,11 @@
|
---|
| 107 | }/*}}}*/
|
---|
| 108 | void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
|
---|
| 109 |
|
---|
| 110 | + int finiteelement;
|
---|
| 111 | + iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 112 | +
|
---|
| 113 | if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
|
---|
| 114 | - ::CreateNodes(nodes,iomodel,EnthalpyAnalysisEnum,P1Enum);
|
---|
| 115 | + ::CreateNodes(nodes,iomodel,EnthalpyAnalysisEnum,finiteelement);
|
---|
| 116 | iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
|
---|
| 117 | }/*}}}*/
|
---|
| 118 | int EnthalpyAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
|
---|
| 119 | @@ -120,12 +123,16 @@
|
---|
| 120 | /*Fetch data needed: */
|
---|
| 121 | iomodel->FetchData(3,"md.initialization.temperature","md.initialization.waterfraction","md.initialization.pressure");
|
---|
| 122 |
|
---|
| 123 | + /*Finite element type*/
|
---|
| 124 | + int finiteelement;
|
---|
| 125 | + iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 126 | +
|
---|
| 127 | /*Update elements: */
|
---|
| 128 | int counter=0;
|
---|
| 129 | for(int i=0;i<iomodel->numberofelements;i++){
|
---|
| 130 | if(iomodel->my_elements[i]){
|
---|
| 131 | Element* element=(Element*)elements->GetObjectByOffset(counter);
|
---|
| 132 | - element->Update(i,iomodel,analysis_counter,analysis_type,P1Enum);
|
---|
| 133 | + element->Update(i,iomodel,analysis_counter,analysis_type,finiteelement);
|
---|
| 134 | counter++;
|
---|
| 135 | }
|
---|
| 136 | }
|
---|
| 137 | Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
|
---|
| 138 | ===================================================================
|
---|
| 139 | --- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp (revision 21541)
|
---|
| 140 | +++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp (revision 21542)
|
---|
| 141 | @@ -8,7 +8,9 @@
|
---|
| 142 | void ThermalAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
|
---|
| 143 |
|
---|
| 144 | /*Intermediary*/
|
---|
| 145 | - int finiteelement = P1Enum;
|
---|
| 146 | + int finiteelement;
|
---|
| 147 | + iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 148 | + _assert_(finiteelement==P1Enum);
|
---|
| 149 |
|
---|
| 150 | /*Only 3d mesh supported*/
|
---|
| 151 | if(iomodel->domaintype!=Domain3DEnum) _error_("not supported yet");
|
---|
| 152 | @@ -61,7 +63,9 @@
|
---|
| 153 | }/*}}}*/
|
---|
| 154 | void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
|
---|
| 155 |
|
---|
| 156 | - int finiteelement = P1Enum;
|
---|
| 157 | + int finiteelement;
|
---|
| 158 | + iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 159 | + _assert_(finiteelement==P1Enum);
|
---|
| 160 |
|
---|
| 161 | if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
|
---|
| 162 | ::CreateNodes(nodes,iomodel,ThermalAnalysisEnum,finiteelement);
|
---|
| 163 | @@ -78,7 +82,9 @@
|
---|
| 164 | if(iomodel->domaintype==Domain2DhorizontalEnum)return;
|
---|
| 165 |
|
---|
| 166 | /*Update elements: */
|
---|
| 167 | - int finiteelement = P1Enum;
|
---|
| 168 | + int finiteelement;
|
---|
| 169 | + iomodel->FindConstant(&finiteelement,"md.thermal.fe");
|
---|
| 170 | + _assert_(finiteelement==P1Enum);
|
---|
| 171 | int counter=0;
|
---|
| 172 | for(int i=0;i<iomodel->numberofelements;i++){
|
---|
| 173 | if(iomodel->my_elements[i]){
|
---|