[17802] | 1 | Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h (revision 17000)
|
---|
| 4 | +++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h (revision 17001)
|
---|
| 5 | @@ -61,6 +61,7 @@
|
---|
| 6 | void GetBHOFriction(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
|
---|
| 7 | void InputUpdateFromSolutionHO(IssmDouble* solution,Element* element);
|
---|
| 8 | /*FS*/
|
---|
| 9 | + ElementVector* CreateDVectorFS(Element* element);
|
---|
| 10 | ElementMatrix* CreateJacobianMatrixFS(Element* element);
|
---|
| 11 | ElementMatrix* CreateKMatrixFS(Element* element);
|
---|
| 12 | ElementMatrix* CreateKMatrixFSViscous(Element* element);
|
---|
| 13 | Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
|
---|
| 14 | ===================================================================
|
---|
| 15 | --- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp (revision 17000)
|
---|
| 16 | +++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp (revision 17001)
|
---|
| 17 | @@ -812,8 +812,17 @@
|
---|
| 18 |
|
---|
| 19 | /*Finite Element Analysis*/
|
---|
| 20 | ElementVector* StressbalanceAnalysis::CreateDVector(Element* element){/*{{{*/
|
---|
| 21 | - /*Default, return NULL*/
|
---|
| 22 | +
|
---|
| 23 | + int approximation;
|
---|
| 24 | + element->GetInputValue(&approximation,ApproximationEnum);
|
---|
| 25 | + switch(approximation){
|
---|
| 26 | + case FSApproximationEnum:
|
---|
| 27 | + return CreateDVectorFS(element);
|
---|
| 28 | + default:
|
---|
| 29 | + return NULL; //no need for doftypes outside of FS approximation
|
---|
| 30 | + }
|
---|
| 31 | return NULL;
|
---|
| 32 | +
|
---|
| 33 | }/*}}}*/
|
---|
| 34 | ElementMatrix* StressbalanceAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
|
---|
| 35 |
|
---|
| 36 | @@ -2380,6 +2389,35 @@
|
---|
| 37 | }/*}}}*/
|
---|
| 38 |
|
---|
| 39 | /*FS*/
|
---|
| 40 | +ElementVector* StressbalanceAnalysis::CreateDVectorFS(Element* element){/*{{{*/
|
---|
| 41 | +
|
---|
| 42 | + int meshtype,dim;
|
---|
| 43 | +
|
---|
| 44 | + /*Get problem dimension*/
|
---|
| 45 | + element->FindParam(&meshtype,MeshTypeEnum);
|
---|
| 46 | + switch(meshtype){
|
---|
| 47 | + case Mesh2DverticalEnum: dim = 2; break;
|
---|
| 48 | + case Mesh3DEnum: dim = 3; break;
|
---|
| 49 | + default: _error_("mesh "<<EnumToStringx(meshtype)<<" not supported yet");
|
---|
| 50 | + }
|
---|
| 51 | +
|
---|
| 52 | + /*Fetch number of nodes and dof for this finite element*/
|
---|
| 53 | + int vnumnodes = element->GetNumberOfNodesVelocity();
|
---|
| 54 | + int pnumnodes = element->GetNumberOfNodesPressure();
|
---|
| 55 | +
|
---|
| 56 | + /*Initialize output vector*/
|
---|
| 57 | + ElementVector* de = element->NewElementVector(FSvelocityEnum);
|
---|
| 58 | +
|
---|
| 59 | + for(int i=0;i<vnumnodes;i++){
|
---|
| 60 | + for(int j=0;j<dim;j++) de->values[i*dim+j]=VelocityEnum;
|
---|
| 61 | + }
|
---|
| 62 | + for(int i=0;i<pnumnodes;i++){
|
---|
| 63 | + de->values[vnumnodes*dim+i]=PressureEnum;
|
---|
| 64 | + }
|
---|
| 65 | +
|
---|
| 66 | + return de;
|
---|
| 67 | +
|
---|
| 68 | +}/*}}}*/
|
---|
| 69 | ElementMatrix* StressbalanceAnalysis::CreateJacobianMatrixFS(Element* element){/*{{{*/
|
---|
| 70 |
|
---|
| 71 | /*Intermediaries */
|
---|
| 72 | Index: ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
|
---|
| 73 | ===================================================================
|
---|
| 74 | --- ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp (revision 17000)
|
---|
| 75 | +++ ../trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp (revision 17001)
|
---|
| 76 | @@ -101,9 +101,13 @@
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | /*Create dof vector for stiffness matrix preconditioning*/
|
---|
| 80 | - for (i=0;i<femmodel->elements->Size();i++){
|
---|
| 81 | - element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 82 | - element->CreateDVector(df);
|
---|
| 83 | + if(pdf){
|
---|
| 84 | + for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 85 | + element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 86 | + ElementVector* de=analysis->CreateDVector(element);
|
---|
| 87 | + if(de) de->InsertIntoGlobal(df);
|
---|
| 88 | + delete de;
|
---|
| 89 | + }
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | /*Assemble matrices and vector*/
|
---|
| 93 | Index: ../trunk-jpl/src/c/classes/Elements/Element.h
|
---|
| 94 | ===================================================================
|
---|
| 95 | --- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 17000)
|
---|
| 96 | +++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 17001)
|
---|
| 97 | @@ -103,7 +103,6 @@
|
---|
| 98 | virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
|
---|
| 99 | virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0;
|
---|
| 100 | virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum)=0;
|
---|
| 101 | - virtual void CreateDVector(Vector<IssmDouble>* df)=0;
|
---|
| 102 | virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
|
---|
| 103 | virtual void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure)=0;
|
---|
| 104 | virtual IssmDouble EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure)=0;
|
---|
| 105 | Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
|
---|
| 106 | ===================================================================
|
---|
| 107 | --- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 17000)
|
---|
| 108 | +++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 17001)
|
---|
| 109 | @@ -190,12 +190,6 @@
|
---|
| 110 | return sqrt(2*this->GetArea());
|
---|
| 111 | }
|
---|
| 112 | /*}}}*/
|
---|
| 113 | -/*FUNCTION Tria::CreateDVector {{{*/
|
---|
| 114 | -void Tria::CreateDVector(Vector<IssmDouble>* df){
|
---|
| 115 | -
|
---|
| 116 | - /*Nothing done yet*/
|
---|
| 117 | -}
|
---|
| 118 | -/*}}}*/
|
---|
| 119 | /*FUNCTION Tria::ComputeBasalStress {{{*/
|
---|
| 120 | void Tria::ComputeBasalStress(Vector<IssmDouble>* eps){
|
---|
| 121 | _error_("Not Implemented yet");
|
---|
| 122 | Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
|
---|
| 123 | ===================================================================
|
---|
| 124 | --- ../trunk-jpl/src/c/classes/Elements/Tria.h (revision 17000)
|
---|
| 125 | +++ ../trunk-jpl/src/c/classes/Elements/Tria.h (revision 17001)
|
---|
| 126 | @@ -66,7 +66,6 @@
|
---|
| 127 | void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
|
---|
| 128 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
|
---|
| 129 | void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
|
---|
| 130 | - void CreateDVector(Vector<IssmDouble>* df);
|
---|
| 131 | void Delta18oParameterization(void);
|
---|
| 132 | void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
|
---|
| 133 | void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){_error_("not implemented yet");};
|
---|
| 134 | Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
|
---|
| 135 | ===================================================================
|
---|
| 136 | --- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 17000)
|
---|
| 137 | +++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 17001)
|
---|
| 138 | @@ -378,32 +378,6 @@
|
---|
| 139 | this->inputs->Configure(parameters);
|
---|
| 140 | }
|
---|
| 141 | /*}}}*/
|
---|
| 142 | -/*FUNCTION Penta::CreateDVector {{{*/
|
---|
| 143 | -void Penta::CreateDVector(Vector<IssmDouble>* df){
|
---|
| 144 | -
|
---|
| 145 | - /*retrieve parameters: */
|
---|
| 146 | - ElementVector* De=NULL;
|
---|
| 147 | - int analysis_type;
|
---|
| 148 | - parameters->FindParam(&analysis_type,AnalysisTypeEnum);
|
---|
| 149 | -
|
---|
| 150 | - /*Checks in debugging*/
|
---|
| 151 | - _assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
|
---|
| 152 | -
|
---|
| 153 | - switch(analysis_type){
|
---|
| 154 | - #ifdef _HAVE_STRESSBALANCE_
|
---|
| 155 | - case StressbalanceAnalysisEnum:
|
---|
| 156 | - De=CreateDVectorStressbalanceHoriz();
|
---|
| 157 | - break;
|
---|
| 158 | - #endif
|
---|
| 159 | - }
|
---|
| 160 | -
|
---|
| 161 | - /*Add to global Vector*/
|
---|
| 162 | - if(De){
|
---|
| 163 | - De->InsertIntoGlobal(df);
|
---|
| 164 | - delete De;
|
---|
| 165 | - }
|
---|
| 166 | -}
|
---|
| 167 | -/*}}}*/
|
---|
| 168 | /*FUNCTION Penta::DeepEcho{{{*/
|
---|
| 169 | void Penta::DeepEcho(void){
|
---|
| 170 |
|
---|
| 171 | @@ -4475,52 +4449,6 @@
|
---|
| 172 | /*}}}*/
|
---|
| 173 | #endif
|
---|
| 174 |
|
---|
| 175 | -#ifdef _HAVE_STRESSBALANCE_
|
---|
| 176 | -/*FUNCTION Penta::CreateDVectorStressbalanceHoriz {{{*/
|
---|
| 177 | -ElementVector* Penta::CreateDVectorStressbalanceHoriz(void){
|
---|
| 178 | -
|
---|
| 179 | - int approximation;
|
---|
| 180 | - inputs->GetInputValue(&approximation,ApproximationEnum);
|
---|
| 181 | -
|
---|
| 182 | - switch(approximation){
|
---|
| 183 | - case FSApproximationEnum:
|
---|
| 184 | - return CreateDVectorStressbalanceFS();
|
---|
| 185 | - default:
|
---|
| 186 | - return NULL; //no need for doftypes outside of FS approximation
|
---|
| 187 | - }
|
---|
| 188 | -}
|
---|
| 189 | -/*}}}*/
|
---|
| 190 | -/*FUNCTION Penta::CreateDVectorStressbalanceFS{{{*/
|
---|
| 191 | -ElementVector* Penta::CreateDVectorStressbalanceFS(void){
|
---|
| 192 | -
|
---|
| 193 | - /*output: */
|
---|
| 194 | - ElementVector* De=NULL;
|
---|
| 195 | -
|
---|
| 196 | - /*Initialize Element vector and return if necessary*/
|
---|
| 197 | - int approximation;
|
---|
| 198 | - inputs->GetInputValue(&approximation,ApproximationEnum);
|
---|
| 199 | - if(approximation!=FSApproximationEnum) return NULL;
|
---|
| 200 | -
|
---|
| 201 | - /*Fetch number of nodes and dof for this finite element*/
|
---|
| 202 | - int vnumnodes = this->NumberofNodesVelocity();
|
---|
| 203 | - int pnumnodes = this->NumberofNodesPressure();
|
---|
| 204 | -
|
---|
| 205 | - De=new ElementVector(nodes,vnumnodes+pnumnodes,this->parameters,FSvelocityEnum);
|
---|
| 206 | -
|
---|
| 207 | - for(int i=0;i<vnumnodes;i++){
|
---|
| 208 | - De->values[i*3+0]=VelocityEnum;
|
---|
| 209 | - De->values[i*3+1]=VelocityEnum;
|
---|
| 210 | - De->values[i*3+2]=VelocityEnum;
|
---|
| 211 | - }
|
---|
| 212 | - for(int i=0;i<pnumnodes;i++){
|
---|
| 213 | - De->values[vnumnodes*3+i]=PressureEnum;
|
---|
| 214 | - }
|
---|
| 215 | -
|
---|
| 216 | - return De;
|
---|
| 217 | -}
|
---|
| 218 | -/*}}}*/
|
---|
| 219 | -#endif
|
---|
| 220 | -
|
---|
| 221 | #ifdef _HAVE_HYDROLOGY_
|
---|
| 222 | /*FUNCTION Penta::CreateEPLDomainMassMatrix {{{*/
|
---|
| 223 | ElementMatrix* Penta::CreateEPLDomainMassMatrix(void){
|
---|
| 224 | Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
|
---|
| 225 | ===================================================================
|
---|
| 226 | --- ../trunk-jpl/src/c/classes/Elements/Penta.h (revision 17000)
|
---|
| 227 | +++ ../trunk-jpl/src/c/classes/Elements/Penta.h (revision 17001)
|
---|
| 228 | @@ -70,7 +70,6 @@
|
---|
| 229 | int FiniteElement(void);
|
---|
| 230 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
|
---|
| 231 | void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
|
---|
| 232 | - void CreateDVector(Vector<IssmDouble>* df);
|
---|
| 233 | void Delta18oParameterization(void);
|
---|
| 234 | void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
|
---|
| 235 | Element* GetBasalElement(void);
|
---|
| 236 | @@ -251,11 +250,6 @@
|
---|
| 237 | Tria* SpawnTria(int location);
|
---|
| 238 | IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
|
---|
| 239 |
|
---|
| 240 | - #ifdef _HAVE_STRESSBALANCE_
|
---|
| 241 | - ElementVector* CreateDVectorStressbalanceHoriz(void);
|
---|
| 242 | - ElementVector* CreateDVectorStressbalanceFS(void);
|
---|
| 243 | - #endif
|
---|
| 244 | -
|
---|
| 245 | #ifdef _HAVE_HYDROLOGY_
|
---|
| 246 | ElementMatrix* CreateEPLDomainMassMatrix(void);
|
---|
| 247 | void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode);
|
---|
| 248 | Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
|
---|
| 249 | ===================================================================
|
---|
| 250 | --- ../trunk-jpl/src/c/classes/Elements/Seg.h (revision 17000)
|
---|
| 251 | +++ ../trunk-jpl/src/c/classes/Elements/Seg.h (revision 17001)
|
---|
| 252 | @@ -68,7 +68,6 @@
|
---|
| 253 | void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
|
---|
| 254 | void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
|
---|
| 255 | void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){_error_("not implemented yet");};
|
---|
| 256 | - void CreateDVector(Vector<IssmDouble>* df){_error_("not implemented yet");};
|
---|
| 257 | void Delta18oParameterization(void){_error_("not implemented yet");};
|
---|
| 258 | void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
|
---|
| 259 | void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){_error_("not implemented yet");};
|
---|