Changeset 15071
- Timestamp:
- 05/21/13 23:56:29 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
r14950 r15071 37 37 int numgauss_horiz; 38 38 int numgauss_vert; 39 double *coords1_horiz = NULL;40 double *coords2_horiz = NULL;41 double *coords3_horiz = NULL;42 double *weights_horiz = NULL;39 IssmDouble *coords1_horiz = NULL; 40 IssmDouble *coords2_horiz = NULL; 41 IssmDouble *coords3_horiz = NULL; 42 IssmDouble *weights_horiz = NULL; 43 43 double *coords_vert = NULL; 44 44 double *weights_vert = NULL; … … 51 51 /*Allocate GaussPenta fields*/ 52 52 numgauss=numgauss_horiz*numgauss_vert; 53 coords1=xNew< double>(numgauss);54 coords2=xNew< double>(numgauss);55 coords3=xNew< double>(numgauss);56 coords4=xNew< double>(numgauss);57 weights=xNew< double>(numgauss);53 coords1=xNew<IssmDouble>(numgauss); 54 coords2=xNew<IssmDouble>(numgauss); 55 coords3=xNew<IssmDouble>(numgauss); 56 coords4=xNew<IssmDouble>(numgauss); 57 weights=xNew<IssmDouble>(numgauss); 58 58 59 59 /*Combine Horizontal and vertical points*/ … … 76 76 77 77 /*Clean up*/ 78 xDelete< double>(coords1_horiz);79 xDelete< double>(coords2_horiz);80 xDelete< double>(coords3_horiz);78 xDelete<IssmDouble>(coords1_horiz); 79 xDelete<IssmDouble>(coords2_horiz); 80 xDelete<IssmDouble>(coords3_horiz); 81 81 xDelete<double>(coords_vert); 82 xDelete< double>(weights_horiz);82 xDelete<IssmDouble>(weights_horiz); 83 83 xDelete<double>(weights_vert); 84 84 } … … 97 97 98 98 /*Allocate GaussPenta fields*/ 99 coords1=xNew< double>(numgauss);100 coords2=xNew< double>(numgauss);101 coords3=xNew< double>(numgauss);102 coords4=xNew< double>(numgauss);103 weights=xNew< double>(numgauss);99 coords1=xNew<IssmDouble>(numgauss); 100 coords2=xNew<IssmDouble>(numgauss); 101 coords3=xNew<IssmDouble>(numgauss); 102 coords4=xNew<IssmDouble>(numgauss); 103 weights=xNew<IssmDouble>(numgauss); 104 104 105 105 if(index1==0 && index2==3){ … … 151 151 152 152 /*compute z coordinate*/ 153 coords4=xNew< double>(numgauss);153 coords4=xNew<IssmDouble>(numgauss); 154 154 for(int i=0;i<numgauss;i++) coords4[i]=-1.0; 155 155 } … … 161 161 162 162 /*compute z coordinate*/ 163 coords4=xNew< double>(numgauss);163 coords4=xNew<IssmDouble>(numgauss); 164 164 for(int i=0;i<numgauss;i++) coords4[i]=1.0; 165 165 } … … 186 186 /*Allocate GaussPenta fields*/ 187 187 numgauss=order_horiz*order_vert; 188 coords1=xNew< double>(numgauss);189 coords2=xNew< double>(numgauss);190 coords3=xNew< double>(numgauss);191 coords4=xNew< double>(numgauss);192 weights=xNew< double>(numgauss);188 coords1=xNew<IssmDouble>(numgauss); 189 coords2=xNew<IssmDouble>(numgauss); 190 coords3=xNew<IssmDouble>(numgauss); 191 coords4=xNew<IssmDouble>(numgauss); 192 weights=xNew<IssmDouble>(numgauss); 193 193 194 194 /*Quads: get the gauss points using the product of two line rules */ … … 239 239 /*FUNCTION GaussPenta::~GaussPenta(){{{*/ 240 240 GaussPenta::~GaussPenta(){ 241 xDelete< double>(weights);242 xDelete< double>(coords1);243 xDelete< double>(coords2);244 xDelete< double>(coords3);245 xDelete< double>(coords4);241 xDelete<IssmDouble>(weights); 242 xDelete<IssmDouble>(coords1); 243 xDelete<IssmDouble>(coords2); 244 xDelete<IssmDouble>(coords3); 245 xDelete<IssmDouble>(coords4); 246 246 } 247 247 /*}}}*/ … … 361 361 if(index1==0 && index2==1 && index3==2){ 362 362 GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order); 363 coords4=xNew< double>(numgauss);363 coords4=xNew<IssmDouble>(numgauss); 364 364 for(int i=0;i<numgauss;i++) coords4[i]=-1.0; 365 365 } -
issm/trunk-jpl/src/c/classes/gauss/GaussPenta.h
r14915 r15071 14 14 private: 15 15 int numgauss; 16 double* weights;17 double* coords1;18 double* coords2;19 double* coords3;20 double* coords4;16 IssmDouble* weights; 17 IssmDouble* coords1; 18 IssmDouble* coords2; 19 IssmDouble* coords3; 20 IssmDouble* coords4; 21 21 22 22 public: 23 double weight;24 double coord1;25 double coord2;26 double coord3;27 double coord4;23 IssmDouble weight; 24 IssmDouble coord1; 25 IssmDouble coord2; 26 IssmDouble coord3; 27 IssmDouble coord4; 28 28 29 29 public: -
issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp
r14950 r15071 4 4 5 5 #include "./GaussTria.h" 6 #include "../../shared/io/Print/Print.h" 7 #include "../../shared/Exceptions/exceptions.h" 8 #include "../../shared/MemOps/MemOps.h" 9 #include "../../shared/Numerics/GaussPoints.h" 10 #include "../../shared/Numerics/constants.h" 6 #include "../../shared/shared.h" 11 7 12 8 /*GaussTria constructors and destructors:*/ … … 54 50 55 51 /*Allocate GaussTria fields*/ 56 coords1=xNew<Issm PDouble>(numgauss);57 coords2=xNew<Issm PDouble>(numgauss);58 coords3=xNew<Issm PDouble>(numgauss);59 weights=xNew<Issm PDouble>(numgauss);52 coords1=xNew<IssmDouble>(numgauss); 53 coords2=xNew<IssmDouble>(numgauss); 54 coords3=xNew<IssmDouble>(numgauss); 55 weights=xNew<IssmDouble>(numgauss); 60 56 61 57 /*Reverse index1 and 2 if necessary*/ … … 99 95 /*}}}*/ 100 96 /*FUNCTION GaussTria::GaussTria(int index,double r1,double r2,int order) {{{*/ 101 GaussTria::GaussTria(int index,Issm PDouble r1,IssmPDouble r2,bool mainlyfloating,int order){97 GaussTria::GaussTria(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){ 102 98 103 99 /* … … 117 113 */ 118 114 int ig; 119 Issm PDouble x,y;120 Issm PDouble xy_list[3][2];115 IssmDouble x,y; 116 IssmDouble xy_list[3][2]; 121 117 122 118 if(mainlyfloating){ … … 224 220 225 221 this->numgauss = gauss1->numgauss + gauss2->numgauss; 226 this->coords1=xNew<Issm PDouble>(this->numgauss);227 this->coords2=xNew<Issm PDouble>(this->numgauss);228 this->coords3=xNew<Issm PDouble>(this->numgauss);229 this->weights=xNew<Issm PDouble>(this->numgauss);222 this->coords1=xNew<IssmDouble>(this->numgauss); 223 this->coords2=xNew<IssmDouble>(this->numgauss); 224 this->coords3=xNew<IssmDouble>(this->numgauss); 225 this->weights=xNew<IssmDouble>(this->numgauss); 230 226 231 227 for(ig=0;ig<gauss1->numgauss;ig++){ // Add the first triangle gauss points … … 256 252 /*FUNCTION GaussTria::~GaussTria(){{{*/ 257 253 GaussTria::~GaussTria(){ 258 xDelete<Issm PDouble>(weights);259 xDelete<Issm PDouble>(coords1);260 xDelete<Issm PDouble>(coords2);261 xDelete<Issm PDouble>(coords3);254 xDelete<IssmDouble>(weights); 255 xDelete<IssmDouble>(coords1); 256 xDelete<IssmDouble>(coords2); 257 xDelete<IssmDouble>(coords3); 262 258 } 263 259 /*}}}*/ -
issm/trunk-jpl/src/c/classes/gauss/GaussTria.h
r14915 r15071 13 13 private: 14 14 int numgauss; 15 Issm PDouble* weights;16 Issm PDouble* coords1;17 Issm PDouble* coords2;18 Issm PDouble* coords3;15 IssmDouble* weights; 16 IssmDouble* coords1; 17 IssmDouble* coords2; 18 IssmDouble* coords3; 19 19 20 20 public: 21 Issm PDouble weight;21 IssmDouble weight; 22 22 IssmDouble coord1; 23 23 IssmDouble coord2; … … 30 30 GaussTria(int order); 31 31 GaussTria(int index1,int index2,int order); 32 GaussTria(int index,Issm PDouble r1, IssmPDouble r2,bool maintlyfloating,int order);32 GaussTria(int index,IssmDouble r1, IssmDouble r2,bool maintlyfloating,int order); 33 33 ~GaussTria(); 34 34 -
issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
r14979 r15071 88 88 }/*}}}*/ 89 89 /*FUNCTION GaussLegendreTria{{{*/ 90 void GaussLegendreTria( int* pngaus, Issm PDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pwgt, int iord ) {90 void GaussLegendreTria( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord ) { 91 91 /*Gauss quadrature points for the triangle. 92 92 … … 1149 1149 *pngaus=np[iord-1]; 1150 1150 1151 *pl1 =xNew<Issm PDouble>(*pngaus);1152 *pl2 =xNew<Issm PDouble>(*pngaus);1153 *pl3 =xNew<Issm PDouble>(*pngaus);1154 *pwgt =xNew<Issm PDouble>(*pngaus);1151 *pl1 =xNew<IssmDouble>(*pngaus); 1152 *pl2 =xNew<IssmDouble>(*pngaus); 1153 *pl3 =xNew<IssmDouble>(*pngaus); 1154 *pwgt =xNew<IssmDouble>(*pngaus); 1155 1155 1156 1156 for (i=0; i<*pngaus; i++) { … … 1167 1167 *pngaus=nigaus*nigaus; 1168 1168 1169 *pl1 =xNew<Issm PDouble>(*pngaus);1170 *pl2 =xNew<Issm PDouble>(*pngaus);1171 *pl3 =xNew<Issm PDouble>(*pngaus);1172 *pwgt =xNew<Issm PDouble>(*pngaus);1169 *pl1 =xNew<IssmDouble>(*pngaus); 1170 *pl2 =xNew<IssmDouble>(*pngaus); 1171 *pl3 =xNew<IssmDouble>(*pngaus); 1172 *pwgt =xNew<IssmDouble>(*pngaus); 1173 1173 1174 1174 /* get the gauss points in each direction */ -
issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.h
r14915 r15071 10 10 void GaussLegendreLinear(IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus); 11 11 #define MAX_TRIA_SYM_ORD 20 12 void GaussLegendreTria(int* pngaus, Issm PDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pwgt, int iord);12 void GaussLegendreTria(int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord); 13 13 #define MAX_TETRA_SYM_ORD 6 14 14 void GaussLegendreTetra(int* pngaus, IssmPDouble** pl1, IssmPDouble** pl2, IssmPDouble** pl3, IssmPDouble** pl4, IssmPDouble** pwgt, int iord);
Note:
See TracChangeset
for help on using the changeset viewer.