source: issm/oecreview/Archive/25834-26739/ISSM-26222-26223.diff@ 26740

Last change on this file since 26740 was 26740, checked in by Mathieu Morlighem, 3 years ago

CHG: added 25834-26739

File size: 4.8 KB
RevLine 
[26740]1Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
2===================================================================
3--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp (revision 26222)
4+++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp (revision 26223)
5@@ -808,6 +808,11 @@
6 delete gauss;
7 return Me;
8 }/*}}}*/
9+ElementVector* DamageEvolutionAnalysis::CreateFctPVector(Element* element){/*{{{*/
10+
11+ return this->CreatePVector(element);
12+
13+}/*}}}*/
14 void DamageEvolutionAnalysis::FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel){/*{{{*/
15
16 /*Output*/
17@@ -836,6 +841,26 @@
18 delete Kfs;
19 }
20 }/*}}}*/
21+void DamageEvolutionAnalysis::FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel){/*{{{*/
22+
23+ /*Output*/
24+ Vector<IssmDouble>* pf = NULL;
25+
26+ /*Initialize P vector*/
27+ AllocateSystemMatricesx(NULL,NULL,NULL,&pf,femmodel);
28+
29+ /*Create and assemble matrix*/
30+ for(Object* & object : femmodel->elements->objects){
31+ Element* element = xDynamicCast<Element*>(object);
32+ ElementVector* pe = this->CreateFctPVector(element);
33+ if(pe) pe->AddToGlobal(pf);
34+ delete pe;
35+ }
36+ pf->Assemble();
37+
38+ /*Assign output pointer*/
39+ *ppf=pf;
40+}/*}}}*/
41 void DamageEvolutionAnalysis::MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel){/*{{{*/
42
43 /*Initialize Mass matrix*/
44Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
45===================================================================
46--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h (revision 26222)
47+++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h (revision 26223)
48@@ -38,7 +38,9 @@
49 /*FCT*/
50 ElementMatrix* CreateFctKMatrix(Element* element);
51 ElementMatrix* CreateMassMatrix(Element* element);
52+ ElementVector* CreateFctPVector(Element* element);
53 void FctKMatrix(Matrix<IssmDouble>** pKff,Matrix<IssmDouble>** pKfs,FemModel* femmodel);
54 void MassMatrix(Matrix<IssmDouble>** pMff,FemModel* femmodel);
55+ void FctPVector(Vector<IssmDouble>** ppf,FemModel* femmodel);
56 };
57 #endif
58Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp
59===================================================================
60--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp (revision 26222)
61+++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_fct.cpp (revision 26223)
62@@ -417,6 +417,7 @@
63 danalysis = new DamageEvolutionAnalysis();
64 danalysis->MassMatrix(&Mc,femmodel);
65 danalysis->FctKMatrix(&K,NULL,femmodel);
66+ danalysis->FctPVector(&p,femmodel);
67 break;
68 default: _error_("analysis type " << EnumToStringx(analysis_type) << " not supported for FCT\n");
69 }
70Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
71===================================================================
72--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 26222)
73+++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 26223)
74@@ -1815,7 +1815,7 @@
75 total_weight+=gauss->weight;
76 }
77 //normalize to phi.
78- if(total_weight)for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi;
79+ if(total_weight>0.) for(int i=0;i<NUMVERTICES;i++)weights[i]/=total_weight/phi;
80 else for(int i=0;i<NUMVERTICES;i++)weights[i]=0;
81
82 /*free ressources:*/
83Index: ../trunk-jpl/src/c/classes/SealevelGeometry.cpp
84===================================================================
85--- ../trunk-jpl/src/c/classes/SealevelGeometry.cpp (revision 26222)
86+++ ../trunk-jpl/src/c/classes/SealevelGeometry.cpp (revision 26223)
87@@ -19,7 +19,7 @@
88 SealevelGeometry::SealevelGeometry(int localnelin){ /*{{{*/
89 localnel=localnelin;
90 for(int i=0;i<SLGEOM_NUMLOADS;i++){
91- for (int j=0;j<MAXVERTICES;j++){
92+ for (int j=0;j<SLMAXVERTICES;j++){
93 LoadWeigths[i][j]=xNewZeroInit<IssmDouble>(localnel);
94 }
95 vlatbarycentre[i]=NULL; //we don't know yet
96@@ -42,7 +42,7 @@
97 }; /*}}}*/
98 SealevelGeometry::~SealevelGeometry(){ /*{{{*/
99 for(int i=0;i<SLGEOM_NUMLOADS;i++){
100- for (int j=0;j<MAXVERTICES;j++){
101+ for (int j=0;j<SLMAXVERTICES;j++){
102 xDelete<IssmDouble>(LoadWeigths[i][j]);
103 }
104 xDelete<IssmDouble>(LoadArea[i]);
105Index: ../trunk-jpl/src/c/classes/SealevelGeometry.h
106===================================================================
107--- ../trunk-jpl/src/c/classes/SealevelGeometry.h (revision 26222)
108+++ ../trunk-jpl/src/c/classes/SealevelGeometry.h (revision 26223)
109@@ -10,7 +10,7 @@
110 #define SLGEOM_OCEAN 0
111 #define SLGEOM_ICE 1
112 #define SLGEOM_WATER 2
113-#define MAXVERTICES 3
114+#define SLMAXVERTICES 3
115
116 #include "../toolkits/toolkits.h"
117
118@@ -19,7 +19,7 @@
119 public:
120
121 int localnel;
122- IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][MAXVERTICES];
123+ IssmDouble* LoadWeigths[SLGEOM_NUMLOADS][SLMAXVERTICES];
124 IssmDouble* LoadArea[SLGEOM_NUMLOADS];
125 Vector<IssmDouble>* vlatbarycentre[SLGEOM_NUMLOADS];
126 Vector<IssmDouble>* vlongbarycentre[SLGEOM_NUMLOADS];
Note: See TracBrowser for help on using the repository browser.