Changeset 8303
- Timestamp:
- 05/16/11 15:42:41 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
r3595 r8303 27 27 /*Contour:*/ 28 28 Contour* contouri=NULL; 29 int num grids;29 int numnodes; 30 30 double* xc=NULL; 31 31 double* yc=NULL; … … 63 63 for (i=0;i<numcontours;i++){ 64 64 contouri=*(contours+i); 65 num grids=contouri->nods;65 numnodes=contouri->nods; 66 66 xc=contouri->x; 67 67 yc=contouri->y; 68 IsInPoly(in_nod,xc,yc,num grids,x,y,i0,i1,edgevalue);68 IsInPoly(in_nod,xc,yc,numnodes,x,y,i0,i1,edgevalue); 69 69 } 70 70 -
issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
r3595 r8303 11 11 /*Contour:*/ 12 12 Contour* contouri=NULL; 13 int num grids;13 int numnodes; 14 14 double* xc=NULL; 15 15 double* yc=NULL; … … 24 24 for (i=0;i<numcontours;i++){ 25 25 contouri=*(contours+i); 26 num grids=contouri->nods;26 numnodes=contouri->nods; 27 27 xc=contouri->x; 28 28 yc=contouri->y; 29 IsInPoly(flags,xc,yc,num grids,x,y,0,nods,edgevalue);29 IsInPoly(flags,xc,yc,numnodes,x,y,0,nods,edgevalue); 30 30 } 31 31 -
issm/trunk/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp
r8224 r8303 53 53 GetVectorFromInputsx(&vertex_response,elements,nodes, vertices, loads, materials, parameters, StringToEnumx(root),VertexEnum); 54 54 55 /*Now, average it onto the partition grids: */55 /*Now, average it onto the partition nodes: */ 56 56 AverageOntoPartitionx(&qmu_response,elements,nodes,vertices,loads,materials,parameters,vertex_response); 57 57 -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp
r7340 r8303 12 12 void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){ //{{{1 13 13 14 /*Here, whatever grids inside the ice sheet want to unground, we allow -> instantaneous transmission of water through the bedrock: */14 /*Here, whatever nodes inside the ice sheet want to unground, we allow -> instantaneous transmission of water through the bedrock: */ 15 15 16 16 int i,j; -
issm/trunk/src/c/modules/KMLMeshWritex/KMLMeshWritex.cpp
r8046 r8303 242 242 sprintf(kfold->name ,"ISSM Targets"); 243 243 kfold->visibility=1; 244 // sprintf(kfold->descript ,"Elements=%d, Grids=%d",melem,mncon);244 // sprintf(kfold->descript ,"Elements=%d, Nodes=%d",melem,mncon); 245 245 sprintf(kfold->descript ,"campaign{\n"); 246 246 strcat(kfold->descript ," evaluator ClaspTargetEvaluator;\n"); -
issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
r6412 r8303 1 1 /*!\file: MeshPartition.cpp 2 * \brief partition elements and grids across a cluster of size numprocs.2 * \brief partition elements and nodes across a cluster of size numprocs. 3 3 */ 4 4 … … 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberof grids,double* elements,12 int numberofelements2d,int numberof grids2d,double* elements2d,int numlayers,int elements_width, int dim,int num_procs){11 int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,double* elements, 12 int numberofelements2d,int numberofnodes2d,double* elements2d,int numlayers,int elements_width, int dim,int num_procs){ 13 13 14 14 int noerr=1; … … 32 32 if(dim==2){ 33 33 epart=(int*)xmalloc(numberofelements*sizeof(int)); 34 npart=(int*)xmalloc(numberof grids*sizeof(int));34 npart=(int*)xmalloc(numberofnodes*sizeof(int)); 35 35 index=(int*)xmalloc(elements_width*numberofelements*sizeof(int)); 36 36 for (i=0;i<numberofelements;i++){ … … 42 42 /*Partition using Metis:*/ 43 43 if (num_procs>1){ 44 METIS_PartMeshNodal(&numberofelements,&numberof grids, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);44 METIS_PartMeshNodal(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart); 45 45 } 46 46 else if (num_procs==1){ 47 47 /*METIS does not know how to deal with one cpu only!*/ 48 48 for (i=0;i<numberofelements;i++) epart[i]=0; 49 for (i=0;i<numberof grids;i++) npart[i]=0;49 for (i=0;i<numberofnodes;i++) npart[i]=0; 50 50 } 51 51 else _error_("At least one processor is required"); … … 56 56 /*First build concatenated 2d mesh from 2d_coll and 2d_noncoll: */ 57 57 epart2d=(int*)xmalloc(numberofelements2d*sizeof(int)); 58 npart2d=(int*)xmalloc(numberof grids2d*sizeof(int));58 npart2d=(int*)xmalloc(numberofnodes2d*sizeof(int)); 59 59 index2d=(int*)xmalloc(3*numberofelements2d*sizeof(int)); 60 60 … … 67 67 /*Partition using Metis:*/ 68 68 if (num_procs>1){ 69 METIS_PartMeshNodal(&numberofelements2d,&numberof grids2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);69 METIS_PartMeshNodal(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d); 70 70 } 71 71 else if (num_procs==1){ 72 72 /*METIS does not know how to deal with one cpu only!*/ 73 73 for (i=0;i<numberofelements2d;i++) epart2d[i]=0; 74 for (i=0;i<numberof grids2d;i++) npart2d[i]=0;74 for (i=0;i<numberofnodes2d;i++) npart2d[i]=0; 75 75 } 76 76 else _error_("At least one processor is required"); … … 88 88 89 89 /*Extrude npart2d to npart, using numlayers: */ 90 npart=(int*)xmalloc(numberof grids*sizeof(int));90 npart=(int*)xmalloc(numberofnodes*sizeof(int)); 91 91 92 92 count=0; 93 93 for(i=0;i<(numlayers);i++){ 94 for(j=0;j<numberof grids2d;j++){94 for(j=0;j<numberofnodes2d;j++){ 95 95 npart[count]=npart2d[j]; 96 96 count++; -
issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.h
r4021 r8303 7 7 8 8 /* local prototypes: */ 9 int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberof grids,double* elements,10 int numberofelements2d,int numberof grids2d,double* elements2d,int numlayers,int elements_width, int dim,int numareas);9 int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofnodes,double* elements, 10 int numberofelements2d,int numberofnodes2d,double* elements2d,int numlayers,int elements_width, int dim,int numareas); 11 11 12 12 #endif /* _MESHPARTITIONX_H */ -
issm/trunk/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp
r6412 r8303 4 4 #include "./MeshProfileIntersectionx.h" 5 5 6 void ElementSegment(DataSet* segments_dataset,int el,double* x grids,double* ygrids,double* xsegment,double* ysegment){6 void ElementSegment(DataSet* segments_dataset,int el,double* xnodes,double* ynodes,double* xsegment,double* ysegment){ 7 7 8 /*We have a tria element (x grids,ygrids) and a segment (xsegment,ysegment). Find whether they intersect.8 /*We have a tria element (xnodes,ynodes) and a segment (xsegment,ysegment). Find whether they intersect. 9 9 * If they do, create a Segment object with the intersection, and add to segments_dataset dataset: */ 10 10 … … 23 23 24 24 /*edge 1: */ 25 xel[0]=x grids[0]; yel[0]=ygrids[0]; xel[1]=xgrids[1]; yel[1]=ygrids[1];25 xel[0]=xnodes[0]; yel[0]=ynodes[0]; xel[1]=xnodes[1]; yel[1]=ynodes[1]; 26 26 edge1=SegmentIntersect(&alpha1,&alpha2, xel,yel,xsegment,ysegment); //alpha1: segment coordinate of intersection. alpha2: same thing for second interesection if it exists (colinear edges) 27 27 28 28 /*edge 2: */ 29 xel[0]=x grids[1]; yel[0]=ygrids[1]; xel[1]=xgrids[2]; yel[1]=ygrids[2];29 xel[0]=xnodes[1]; yel[0]=ynodes[1]; xel[1]=xnodes[2]; yel[1]=ynodes[2]; 30 30 edge2=SegmentIntersect(&beta1,&beta2, xel,yel,xsegment,ysegment); 31 31 32 32 /*edge 3: */ 33 xel[0]=x grids[2]; yel[0]=ygrids[2]; xel[1]=xgrids[0]; yel[1]=ygrids[0];33 xel[0]=xnodes[2]; yel[0]=ynodes[2]; xel[1]=xnodes[0]; yel[1]=ynodes[0]; 34 34 edge3=SegmentIntersect(&gamma1,&gamma2, xel,yel,xsegment,ysegment); 35 35 … … 65 65 /*segment intersect only 1 edge. Figure out where the first point in the segment is, inside or outside the element, 66 66 * this will decide the coordinate: */ 67 if (NodeInElement(x grids,ygrids,xsegment[0],ysegment[0])){67 if (NodeInElement(xnodes,ynodes,xsegment[0],ysegment[0])){ 68 68 coord1=0; 69 69 if(edge1==IntersectEnum){coord2=alpha1;} … … 87 87 else{ 88 88 /*No interesections, but the segment might be entirely inside this triangle!: */ 89 if ( (NodeInElement(x grids,ygrids,xsegment[0],ysegment[0])) && (NodeInElement(xgrids,ygrids,xsegment[1],ysegment[1])) ){89 if ( (NodeInElement(xnodes,ynodes,xsegment[0],ysegment[0])) && (NodeInElement(xnodes,ynodes,xsegment[1],ysegment[1])) ){ 90 90 segments_dataset->AddObject(new Segment(el+1,xsegment[0],ysegment[0],xsegment[1],ysegment[1])); 91 91 } -
issm/trunk/src/c/modules/MeshProfileIntersectionx/ElementSegmentsIntersection.cpp
r4785 r8303 4 4 #include "./MeshProfileIntersectionx.h" 5 5 6 void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* x grids,double* ygrids,double* xc,double* yc,int numgrids){6 void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* xnodes,double* ynodes,double* xc,double* yc,int numnodes){ 7 7 8 8 int i; … … 11 11 12 12 /*Loop through contour: */ 13 for(i=0;i<num grids-1;i++){13 for(i=0;i<numnodes-1;i++){ 14 14 15 15 xsegment[0]=xc[i]; … … 18 18 ysegment[1]=yc[i+1]; 19 19 20 ElementSegment(segments_dataset,el, x grids,ygrids,xsegment,ysegment);20 ElementSegment(segments_dataset,el, xnodes,ynodes,xsegment,ysegment); 21 21 22 22 } -
issm/trunk/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp
r4773 r8303 12 12 /*Contour:*/ 13 13 Contour* contouri=NULL; 14 int num grids;14 int numnodes; 15 15 double* xc=NULL; 16 16 double* yc=NULL; … … 36 36 /*retrieve contour info: */ 37 37 contouri=*(contours+i); 38 num grids=contouri->nods;38 numnodes=contouri->nods; 39 39 xc=contouri->x; 40 40 yc=contouri->y; 41 41 42 42 /*determine segmentsi and numsegsi for this contour and the mesh intersection: */ 43 MeshSegmentsIntersection(&segmentsi,&numsegsi,index,x,y,nel,nods,xc,yc,num grids);43 MeshSegmentsIntersection(&segmentsi,&numsegsi,index,x,y,nel,nods,xc,yc,numnodes); 44 44 45 45 /*save segmentsi: */ -
issm/trunk/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h
r4785 r8303 12 12 /* local prototypes: */ 13 13 void MeshProfileIntersectionx( double** psegments, int* pnumseg, int* index, double* x, double* y, int nel, int nods, Contour** contours,int numcontours); 14 void MeshSegmentsIntersection(double** psegments, int* pnumsegs,int* index, double* x, double* y, int nel, int nods, double* xc, double* yc, int num grids);15 void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* x grids,double* ygrids,double* xc,double* yc,int numgrids);16 void ElementSegment(DataSet* segments_dataset,int el,double* x grids,double* ygrids,double* xsegment,double* ysegment);14 void MeshSegmentsIntersection(double** psegments, int* pnumsegs,int* index, double* x, double* y, int nel, int nods, double* xc, double* yc, int numnodes); 15 void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* xnodes,double* ynodes,double* xc,double* yc,int numnodes); 16 void ElementSegment(DataSet* segments_dataset,int el,double* xnodes,double* ynodes,double* xsegment,double* ysegment); 17 17 int SegmentIntersect(double* palpha, double* pbeta, double* x1, double* y1, double* x2, double* y2); 18 bool NodeInElement(double* x grids, double* ygrids, double x, double y);18 bool NodeInElement(double* xnodes, double* ynodes, double x, double y); 19 19 20 20 #endif /* _MESHPROFILEINTERSECTIONX_H */ -
issm/trunk/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp
r4785 r8303 4 4 #include "./MeshProfileIntersectionx.h" 5 5 6 void MeshSegmentsIntersection(double** psegments, int* pnumsegs,int* index, double* x, double* y, int nel, int nods, double* xc, double* yc, int num grids){6 void MeshSegmentsIntersection(double** psegments, int* pnumsegs,int* index, double* x, double* y, int nel, int nods, double* xc, double* yc, int numnodes){ 7 7 8 8 int i,j; … … 15 15 /*intermediary: */ 16 16 DataSet* segments_dataset=NULL; 17 double x grids[3];18 double y grids[3];17 double xnodes[3]; 18 double ynodes[3]; 19 19 20 20 /*We don't know how many segments we are going to get, so have a dynamic container: */ … … 24 24 for(i=0;i<nel;i++){ 25 25 for(j=0;j<3;j++){ 26 x grids[j]=x[*(index+3*i+j)];27 y grids[j]=y[*(index+3*i+j)];26 xnodes[j]=x[*(index+3*i+j)]; 27 ynodes[j]=y[*(index+3*i+j)]; 28 28 } 29 ElementSegmentsIntersection(segments_dataset,i,x grids,ygrids,xc,yc,numgrids);29 ElementSegmentsIntersection(segments_dataset,i,xnodes,ynodes,xc,yc,numnodes); 30 30 } 31 31 -
issm/trunk/src/c/modules/MeshProfileIntersectionx/NodeInElement.cpp
r4785 r8303 4 4 #include "./MeshProfileIntersectionx.h" 5 5 6 bool NodeInElement(double* x grids, double* ygrids, double x, double y){6 bool NodeInElement(double* xnodes, double* ynodes, double x, double y){ 7 7 8 8 double x1,y1; … … 12 12 double det; 13 13 14 x1=x grids[0];15 x2=x grids[1];16 x3=x grids[2];17 y1=y grids[0];18 y2=y grids[1];19 y3=y grids[2];14 x1=xnodes[0]; 15 x2=xnodes[1]; 16 x3=xnodes[2]; 17 y1=ynodes[0]; 18 y2=ynodes[1]; 19 y3=ynodes[2]; 20 20 21 21 -
issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
r8288 r8303 40 40 /*First fetch data: */ 41 41 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 42 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");43 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");44 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");45 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");42 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 43 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 44 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 45 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 46 46 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 47 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");47 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 48 48 49 49 if(continuous_galerkin){ … … 86 86 /*Clean fetched data: */ 87 87 xfree((void**)&iomodel->elements); 88 xfree((void**)&iomodel-> gridonbed);89 xfree((void**)&iomodel-> gridonsurface);90 xfree((void**)&iomodel-> gridonicesheet);91 xfree((void**)&iomodel-> gridonwater);92 xfree((void**)&iomodel-> gridoniceshelf);88 xfree((void**)&iomodel->nodeonbed); 89 xfree((void**)&iomodel->nodeonsurface); 90 xfree((void**)&iomodel->nodeonicesheet); 91 xfree((void**)&iomodel->nodeonwater); 92 xfree((void**)&iomodel->nodeoniceshelf); 93 93 xfree((void**)&iomodel->vertices_type); 94 94 -
issm/trunk/src/c/modules/ModelProcessorx/Balancevelocities/CreateConstraintsBalancevelocities.cpp
r8288 r8303 38 38 if ((int)iomodel->spcvelocity[6*i+0] && (int)iomodel->spcvelocity[6*i+1]){ //spc if vx and vy are constrained 39 39 40 /*This gridneeds to be spc'd: */40 /*This node needs to be spc'd: */ 41 41 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1, 42 42 pow( pow(*(iomodel->spcvelocity+6*i+4),2.0) + pow(*(iomodel->spcvelocity+6*i+5),2.0) ,0.5),BalancevelocitiesAnalysisEnum)); -
issm/trunk/src/c/modules/ModelProcessorx/Balancevelocities/CreateNodesBalancevelocities.cpp
r8288 r8303 32 32 33 33 /*First fetch data: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 for (i=0;i<iomodel->numberofvertices;i++){ 41 41 … … 49 49 50 50 /*Clean fetched data: */ 51 xfree((void**)&iomodel-> gridonbed);52 xfree((void**)&iomodel-> gridonsurface);53 xfree((void**)&iomodel-> gridonicesheet);54 xfree((void**)&iomodel-> gridoniceshelf);55 xfree((void**)&iomodel-> gridonwater);51 xfree((void**)&iomodel->nodeonbed); 52 xfree((void**)&iomodel->nodeonsurface); 53 xfree((void**)&iomodel->nodeonicesheet); 54 xfree((void**)&iomodel->nodeoniceshelf); 55 xfree((void**)&iomodel->nodeonwater); 56 56 xfree((void**)&iomodel->vertices_type); 57 57 -
issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
r7516 r8303 32 32 33 33 /*First fetch data: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 41 41 for (i=0;i<iomodel->numberofvertices;i++){ … … 50 50 51 51 /*Clean fetched data: */ 52 xfree((void**)&iomodel-> gridonbed);53 xfree((void**)&iomodel-> gridonsurface);54 xfree((void**)&iomodel-> gridonicesheet);55 xfree((void**)&iomodel-> gridonwater);56 xfree((void**)&iomodel-> gridoniceshelf);52 xfree((void**)&iomodel->nodeonbed); 53 xfree((void**)&iomodel->nodeonsurface); 54 xfree((void**)&iomodel->nodeonicesheet); 55 xfree((void**)&iomodel->nodeonwater); 56 xfree((void**)&iomodel->nodeoniceshelf); 57 57 xfree((void**)&iomodel->vertices_type); 58 58 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r6715 r8303 33 33 /*Spcs: fetch data: */ 34 34 IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 35 IoModelFetchData(&iomodel-> gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");36 IoModelFetchData(&iomodel-> gridonmacayeal,NULL,NULL,iomodel_handle,"gridonmacayeal");37 if(iomodel->dim==3)IoModelFetchData(&iomodel-> gridonpattyn,NULL,NULL,iomodel_handle,"gridonpattyn");38 if(iomodel->dim==3)IoModelFetchData(&iomodel-> gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");35 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter"); 36 IoModelFetchData(&iomodel->nodeonmacayeal,NULL,NULL,iomodel_handle,"nodeonmacayeal"); 37 if(iomodel->dim==3)IoModelFetchData(&iomodel->nodeonpattyn,NULL,NULL,iomodel_handle,"nodeonpattyn"); 38 if(iomodel->dim==3)IoModelFetchData(&iomodel->nodeonstokes,NULL,NULL,iomodel_handle,"nodeonstokes"); 39 39 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 40 40 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); … … 51 51 if ((int)iomodel->vertices_type[i]==MacAyealPattynApproximationEnum){ 52 52 /*If grionmacayeal, spc pattyn dofs: 3 & 4*/ 53 if ((int)iomodel-> gridonpattyn[i]){53 if ((int)iomodel->nodeonpattyn[i]){ 54 54 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 55 55 count++; … … 66 66 67 67 } 68 else if ((int)iomodel-> gridonmacayeal[i]){68 else if ((int)iomodel->nodeonmacayeal[i]){ 69 69 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 70 70 count++; … … 81 81 82 82 } 83 else _error_("if vertices_type is MacAyealPattyn, you shoud have gridonpattyn or gridonmacayeal");83 else _error_("if vertices_type is MacAyealPattyn, you shoud have nodeonpattyn or nodeonmacayeal"); 84 84 } 85 85 /*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/ 86 86 else if ((int)iomodel->vertices_type[i]==PattynStokesApproximationEnum){ 87 87 /*If grion,pattyn spc stokes dofs: 3 4 & 5*/ 88 if ((int)iomodel-> gridonpattyn[i]){88 if ((int)iomodel->nodeonpattyn[i]){ 89 89 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 90 90 count++; … … 103 103 104 104 } 105 else if ((int)iomodel-> gridonstokes[i]){ //spc pattyn grids: 1 & 2105 else if ((int)iomodel->nodeonstokes[i]){ //spc pattyn nodes: 1 & 2 106 106 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 107 107 count++; … … 121 121 } 122 122 } 123 else _error_("if vertices_type is PattynStokes, you shoud have gridonpattyn or gridonstokes");123 else _error_("if vertices_type is PattynStokes, you shoud have nodeonpattyn or nodeonstokes"); 124 124 } 125 125 /*Also add spcs of coupling: zero at the border pattyn/stokes for the appropriate dofs*/ 126 126 else if ((int)iomodel->vertices_type[i]==MacAyealStokesApproximationEnum){ 127 127 /*If grion,pattyn spc stokes dofs: 3 4 & 5*/ 128 if ((int)iomodel-> gridonmacayeal[i]){128 if ((int)iomodel->nodeonmacayeal[i]){ 129 129 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 130 130 count++; … … 143 143 144 144 } 145 else if ((int)iomodel-> gridonstokes[i]){ //spc macayeal grids: 1 & 2145 else if ((int)iomodel->nodeonstokes[i]){ //spc macayeal nodes: 1 & 2 146 146 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 147 147 count++; … … 161 161 } 162 162 } 163 else _error_("if vertices_type is MacAyealStokes, you shoud have gridonmacayeal or gridonstokes");163 else _error_("if vertices_type is MacAyealStokes, you shoud have nodeonmacayeal or nodeonstokes"); 164 164 } 165 165 /*Now add the regular spcs*/ 166 166 else{ 167 if ((int)iomodel->spcvelocity[6*i+0] || (int)iomodel-> gridonhutter[i]){167 if ((int)iomodel->spcvelocity[6*i+0] || (int)iomodel->nodeonhutter[i]){ 168 168 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcvelocity+6*i+3)/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 169 169 count++; 170 170 } 171 171 172 if ((int)iomodel->spcvelocity[6*i+1] || (int)iomodel-> gridonhutter[i]){172 if ((int)iomodel->spcvelocity[6*i+1] || (int)iomodel->nodeonhutter[i]){ 173 173 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,*(iomodel->spcvelocity+6*i+4)/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy 174 174 count++; … … 188 188 /*Free data: */ 189 189 xfree((void**)&iomodel->spcvelocity); 190 xfree((void**)&iomodel-> gridonhutter);191 xfree((void**)&iomodel-> gridonmacayeal);192 xfree((void**)&iomodel-> gridonpattyn);193 xfree((void**)&iomodel-> gridonstokes);190 xfree((void**)&iomodel->nodeonhutter); 191 xfree((void**)&iomodel->nodeonmacayeal); 192 xfree((void**)&iomodel->nodeonpattyn); 193 xfree((void**)&iomodel->nodeonstokes); 194 194 xfree((void**)&iomodel->vertices_type); 195 195 xfree((void**)&iomodel->surface); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r7152 r8303 35 35 if (!iomodel->ismacayealpattyn & !iomodel->isstokes)goto cleanup_and_return; 36 36 37 /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the grids37 /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the nodes 38 38 * referenced by a certain load must belong to the cluster node): */ 39 39 IoModelFetchData(&iomodel->pressureload,&iomodel->numberofpressureloads,NULL,iomodel_handle,"pressureload"); … … 51 51 if (iomodel->dim==2) segment_width=4; 52 52 else segment_width=6; 53 element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column ( grid1 grid2 ... elem fill)53 element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill) 54 54 55 55 /*Now, if this element is not in the partition, pass: */ … … 102 102 xfree((void**)&iomodel->bed); 103 103 104 /*create penalties for grids on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy */105 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");106 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");107 IoModelFetchData(&iomodel-> gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");104 /*create penalties for nodes on the base of icesheet. We must have wb=ub*db/dx+vb*db/dy */ 105 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 106 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 107 IoModelFetchData(&iomodel->nodeonstokes,NULL,NULL,iomodel_handle,"nodeonstokes"); 108 108 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 109 109 IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); … … 115 115 if(iomodel->my_vertices[i]==1 && iomodel->singlenodetoelementconnectivity[i]!=0){ 116 116 117 //if ((iomodel-> gridonbed[i]) && (iomodel->gridonstokes[i])){118 if ((iomodel-> gridonbed[i]) && (iomodel->gridonicesheet[i]) && (iomodel->gridonstokes[i])){117 //if ((iomodel->nodeonbed[i]) && (iomodel->nodeonstokes[i])){ 118 if ((iomodel->nodeonbed[i]) && (iomodel->nodeonicesheet[i]) && (iomodel->nodeonstokes[i])){ 119 119 120 120 loads->AddObject(new Pengrid(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum)); … … 124 124 } 125 125 126 xfree((void**)&iomodel-> gridonbed);127 xfree((void**)&iomodel-> gridonstokes);128 xfree((void**)&iomodel-> gridonicesheet);126 xfree((void**)&iomodel->nodeonbed); 127 xfree((void**)&iomodel->nodeonstokes); 128 xfree((void**)&iomodel->nodeonicesheet); 129 129 xfree((void**)&iomodel->elements); 130 130 xfree((void**)&iomodel->spcvelocity); … … 160 160 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 161 161 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 162 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");162 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 163 163 164 164 for(i=0;i<iomodel->numrifts;i++){ … … 175 175 xfree((void**)&iomodel->bed); 176 176 xfree((void**)&iomodel->surface); 177 xfree((void**)&iomodel-> gridoniceshelf);177 xfree((void**)&iomodel->nodeoniceshelf); 178 178 179 179 cleanup_and_return: -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r7442 r8303 35 35 36 36 /*Create nodes: */ 37 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");38 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");39 IoModelFetchData(&iomodel-> gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");40 IoModelFetchData(&iomodel-> gridonmacayeal,NULL,NULL,iomodel_handle,"gridonmacayeal");41 IoModelFetchData(&iomodel-> gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");42 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");43 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");44 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");37 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 38 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 39 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter"); 40 IoModelFetchData(&iomodel->nodeonmacayeal,NULL,NULL,iomodel_handle,"nodeonmacayeal"); 41 IoModelFetchData(&iomodel->nodeonstokes,NULL,NULL,iomodel_handle,"nodeonstokes"); 42 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 43 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 44 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 45 45 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 46 IoModelFetchData(&iomodel->diagnostic_ref,NULL,NULL,iomodel_handle,"diagnostic_ref"); 46 47 47 48 for (i=0;i<iomodel->numberofvertices;i++){ … … 55 56 56 57 /*Clean fetched data: */ 57 xfree((void**)&iomodel-> gridonbed);58 xfree((void**)&iomodel-> gridonsurface);59 xfree((void**)&iomodel-> gridonhutter);60 xfree((void**)&iomodel-> gridonmacayeal);61 xfree((void**)&iomodel-> gridonstokes);62 xfree((void**)&iomodel-> gridonicesheet);63 xfree((void**)&iomodel-> gridoniceshelf);64 xfree((void**)&iomodel-> gridonwater);58 xfree((void**)&iomodel->nodeonbed); 59 xfree((void**)&iomodel->nodeonsurface); 60 xfree((void**)&iomodel->nodeonhutter); 61 xfree((void**)&iomodel->nodeonmacayeal); 62 xfree((void**)&iomodel->nodeonstokes); 63 xfree((void**)&iomodel->nodeonicesheet); 64 xfree((void**)&iomodel->nodeoniceshelf); 65 xfree((void**)&iomodel->nodeonwater); 65 66 xfree((void**)&iomodel->vertices_type); 67 xfree((void**)&iomodel->diagnostic_ref); 66 68 67 69 cleanup_and_return: -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
r7310 r8303 47 47 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 48 48 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 49 IoModelFetchData(&iomodel-> gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");49 IoModelFetchData(&iomodel->nodeonstokes,NULL,NULL,iomodel_handle,"nodeonstokes"); 50 50 } 51 51 if(iomodel->control_analysis){ … … 83 83 xfree((void**)&iomodel->accumulation_rate); 84 84 xfree((void**)&iomodel->melting_rate); 85 xfree((void**)&iomodel-> gridonstokes);85 xfree((void**)&iomodel->nodeonstokes); 86 86 xfree((void**)&iomodel->vx); 87 87 xfree((void**)&iomodel->vy); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r5184 r8303 32 32 /*Fetch data: */ 33 33 IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 34 IoModelFetchData(&iomodel-> gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");34 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter"); 35 35 36 36 /*Initialize conunter*/ 37 37 count=0; 38 38 39 /*vx and vy are spc'd if we are not on gridonhutter: */39 /*vx and vy are spc'd if we are not on nodeonhutter: */ 40 40 for (i=0;i<iomodel->numberofvertices;i++){ 41 41 /*keep only this partition's nodes:*/ 42 42 if((iomodel->my_vertices[i])){ 43 if (!(int)iomodel-> gridonhutter[i]){43 if (!(int)iomodel->nodeonhutter[i]){ 44 44 45 45 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticHutterAnalysisEnum)); … … 64 64 65 65 /*Free data: */ 66 xfree((void**)&iomodel-> gridonhutter);66 xfree((void**)&iomodel->nodeonhutter); 67 67 xfree((void**)&iomodel->spcvelocity); 68 68 -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r7516 r8303 35 35 36 36 /*First fetch data: */ 37 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");38 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");39 IoModelFetchData(&iomodel-> gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");40 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");41 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");37 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 38 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 39 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter"); 40 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 41 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 42 42 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 43 43 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 44 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");44 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 45 45 46 46 CreateNumberNodeToElementConnectivity(iomodel); … … 57 57 58 58 /*Clean fetched data: */ 59 xfree((void**)&iomodel-> gridonbed);60 xfree((void**)&iomodel-> gridonsurface);61 xfree((void**)&iomodel-> gridonhutter);62 xfree((void**)&iomodel-> gridonicesheet);63 xfree((void**)&iomodel-> gridoniceshelf);59 xfree((void**)&iomodel->nodeonbed); 60 xfree((void**)&iomodel->nodeonsurface); 61 xfree((void**)&iomodel->nodeonhutter); 62 xfree((void**)&iomodel->nodeonicesheet); 63 xfree((void**)&iomodel->nodeoniceshelf); 64 64 xfree((void**)&iomodel->elements); 65 xfree((void**)&iomodel-> gridonwater);65 xfree((void**)&iomodel->nodeonwater); 66 66 xfree((void**)&iomodel->numbernodetoelementconnectivity); 67 67 xfree((void**)&iomodel->vertices_type); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp
r6972 r8303 24 24 25 25 /*Fetch data needed: */ 26 IoModelFetchData(&iomodel-> gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");26 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter"); 27 27 IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness"); 28 28 IoModelFetchData(&iomodel->thickness_coeff,NULL,NULL,iomodel_handle,"thickness_coeff"); 29 29 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 30 30 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 31 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");32 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");31 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 32 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 33 33 IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient"); 34 34 IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B"); … … 52 52 53 53 /*Free data: */ 54 xfree((void**)&iomodel-> gridonhutter);54 xfree((void**)&iomodel->nodeonhutter); 55 55 xfree((void**)&iomodel->thickness); 56 56 xfree((void**)&iomodel->thickness_coeff); 57 57 xfree((void**)&iomodel->surface); 58 58 xfree((void**)&iomodel->bed); 59 xfree((void**)&iomodel-> gridonsurface);60 xfree((void**)&iomodel-> gridonbed);59 xfree((void**)&iomodel->nodeonsurface); 60 xfree((void**)&iomodel->nodeonbed); 61 61 xfree((void**)&iomodel->drag_coefficient); 62 62 xfree((void**)&iomodel->rheology_B); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r5803 r8303 31 31 /*Fetch data: */ 32 32 IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity"); 33 IoModelFetchData(&iomodel-> gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");33 IoModelFetchData(&iomodel->nodeonstokes,NULL,NULL,iomodel_handle,"nodeonstokes"); 34 34 35 35 /*Initialize counter*/ … … 42 42 if(iomodel->my_vertices[i]){ 43 43 44 if ((int)iomodel-> gridonstokes[i]){44 if ((int)iomodel->nodeonstokes[i]){ 45 45 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,DiagnosticVertAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for Stokes 46 46 count++; … … 57 57 /*Free data: */ 58 58 xfree((void**)&iomodel->spcvelocity); 59 xfree((void**)&iomodel-> gridonstokes);59 xfree((void**)&iomodel->nodeonstokes); 60 60 61 61 cleanup_and_return: -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
r7516 r8303 35 35 36 36 /*First fetch data: */ 37 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");38 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");39 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");40 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");37 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 38 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 39 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 40 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 41 41 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 42 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");42 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 43 43 44 44 for (i=0;i<iomodel->numberofvertices;i++){ … … 53 53 54 54 /*Clean fetched data: */ 55 xfree((void**)&iomodel-> gridonbed);56 xfree((void**)&iomodel-> gridonsurface);57 xfree((void**)&iomodel-> gridonicesheet);58 xfree((void**)&iomodel-> gridoniceshelf);59 xfree((void**)&iomodel-> gridonwater);55 xfree((void**)&iomodel->nodeonbed); 56 xfree((void**)&iomodel->nodeonsurface); 57 xfree((void**)&iomodel->nodeonicesheet); 58 xfree((void**)&iomodel->nodeoniceshelf); 59 xfree((void**)&iomodel->nodeonwater); 60 60 xfree((void**)&iomodel->vertices_type); 61 61 -
issm/trunk/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp
r8287 r8303 1 1 /*!\file: DistributeNumDofs.cpp 2 * \brief: figure out the maximum number of dofs per grid.2 * \brief: figure out the maximum number of dofs per node. 3 3 */ 4 4 -
issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r6235 r8303 70 70 el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing 71 71 el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing 72 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding grids;72 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices; 73 73 } 74 74 -
issm/trunk/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp
r7640 r8303 32 32 33 33 /*Create nodes and vertices: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 41 41 for (i=0;i<iomodel->numberofvertices;i++){ … … 50 50 51 51 /*Clean fetched data: */ 52 xfree((void**)&iomodel-> gridonbed);53 xfree((void**)&iomodel-> gridonsurface);54 xfree((void**)&iomodel-> gridonicesheet);55 xfree((void**)&iomodel-> gridonwater);56 xfree((void**)&iomodel-> gridoniceshelf);52 xfree((void**)&iomodel->nodeonbed); 53 xfree((void**)&iomodel->nodeonsurface); 54 xfree((void**)&iomodel->nodeonicesheet); 55 xfree((void**)&iomodel->nodeonwater); 56 xfree((void**)&iomodel->nodeoniceshelf); 57 57 xfree((void**)&iomodel->vertices_type); 58 58 -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r6412 r8303 28 28 if(!loads) loads = new Loads(LoadsEnum); 29 29 30 //create penalties for grids: no gridcan have a temperature over the melting point31 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");30 //create penalties for nodes: no node can have a temperature over the melting point 31 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 32 32 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 33 33 CreateSingleNodeToElementConnectivity(iomodel); … … 37 37 if((iomodel->my_vertices[i]==1)){ 38 38 39 if (iomodel-> gridonbed[i]){39 if (iomodel->nodeonbed[i]){ 40 40 41 41 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum)); … … 43 43 } 44 44 } 45 xfree((void**)&iomodel-> gridonbed);45 xfree((void**)&iomodel->nodeonbed); 46 46 xfree((void**)&iomodel->elements); 47 47 xfree((void**)&iomodel->singlenodetoelementconnectivity); -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
r7516 r8303 32 32 33 33 /*First fetch data: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 41 41 for (i=0;i<iomodel->numberofvertices;i++){ … … 50 50 51 51 /*Clean fetched data: */ 52 xfree((void**)&iomodel-> gridonbed);53 xfree((void**)&iomodel-> gridonsurface);54 xfree((void**)&iomodel-> gridonicesheet);55 xfree((void**)&iomodel-> gridonwater);56 xfree((void**)&iomodel-> gridoniceshelf);52 xfree((void**)&iomodel->nodeonbed); 53 xfree((void**)&iomodel->nodeonsurface); 54 xfree((void**)&iomodel->nodeonicesheet); 55 xfree((void**)&iomodel->nodeonwater); 56 xfree((void**)&iomodel->nodeoniceshelf); 57 57 xfree((void**)&iomodel->vertices_type); 58 58 -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
r7843 r8303 58 58 /*Create Penpair for penalties: */ 59 59 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 60 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");60 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 61 61 62 62 for(i=0;i<iomodel->numpenalties;i++){ … … 68 68 69 69 /*Skip if one of the two is not on the bed*/ 70 if(!iomodel-> gridonbed[(int)iomodel->penalties[2*i+0]-1] || !iomodel->gridonbed[(int)iomodel->penalties[2*i+1]-1]) continue;70 if(!iomodel->nodeonbed[(int)iomodel->penalties[2*i+0]-1] || !iomodel->nodeonbed[(int)iomodel->penalties[2*i+1]-1]) continue; 71 71 72 72 /*Get node ids*/ … … 85 85 /*free ressources: */ 86 86 xfree((void**)&iomodel->penalties); 87 xfree((void**)&iomodel-> gridonbed);87 xfree((void**)&iomodel->nodeonbed); 88 88 89 89 -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r7516 r8303 40 40 /*First fetch data: */ 41 41 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 42 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");43 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");44 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");45 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");42 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 43 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 44 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 45 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 46 46 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 47 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");47 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 48 48 49 49 if(continuous_galerkin){ … … 85 85 86 86 /*Clean fetched data: */ 87 xfree((void**)&iomodel-> gridonbed);88 xfree((void**)&iomodel-> gridonsurface);89 xfree((void**)&iomodel-> gridonicesheet);90 xfree((void**)&iomodel-> gridoniceshelf);91 xfree((void**)&iomodel-> gridonwater);87 xfree((void**)&iomodel->nodeonbed); 88 xfree((void**)&iomodel->nodeonsurface); 89 xfree((void**)&iomodel->nodeonicesheet); 90 xfree((void**)&iomodel->nodeoniceshelf); 91 xfree((void**)&iomodel->nodeonwater); 92 92 xfree((void**)&iomodel->elements); 93 93 xfree((void**)&iomodel->vertices_type); -
issm/trunk/src/c/modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp
r8224 r8303 144 144 145 145 if (strncmp(variabledescriptors[i],"scaled_",7)==0){ 146 /*Ok, we are dealing with a variable that is distributed over grids. Recover the name of the variable (ex: scaled_Thickness): */146 /*Ok, we are dealing with a variable that is distributed over nodes. Recover the name of the variable (ex: scaled_Thickness): */ 147 147 sscanf(variabledescriptors[i],"scaled_%s",tag); 148 148 -
issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
r7516 r8303 32 32 33 33 /*First fetch data: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 41 41 for (i=0;i<iomodel->numberofvertices;i++){ … … 50 50 51 51 /*Clean fetched data: */ 52 xfree((void**)&iomodel-> gridonbed);53 xfree((void**)&iomodel-> gridonsurface);54 xfree((void**)&iomodel-> gridonicesheet);55 xfree((void**)&iomodel-> gridoniceshelf);56 xfree((void**)&iomodel-> gridonwater);52 xfree((void**)&iomodel->nodeonbed); 53 xfree((void**)&iomodel->nodeonsurface); 54 xfree((void**)&iomodel->nodeonicesheet); 55 xfree((void**)&iomodel->nodeoniceshelf); 56 xfree((void**)&iomodel->nodeonwater); 57 57 xfree((void**)&iomodel->vertices_type); 58 58 -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp
r6237 r8303 48 48 } 49 49 50 } //if((my_ grids[i]==1))50 } //if((my_nodes[i]==1)) 51 51 } 52 52 -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r6412 r8303 29 29 if (iomodel->dim==2) _error_("2d meshes not supported yet"); 30 30 31 //create penalties for grids: no gridcan have a temperature over the melting point31 //create penalties for nodes: no node can have a temperature over the melting point 32 32 IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 33 33 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); … … 39 39 if((iomodel->my_vertices[i]==1)){ 40 40 41 if (!iomodel->spctemperature[2*i]){ //No penalty applied on spc grids!41 if (!iomodel->spctemperature[2*i]){ //No penalty applied on spc nodes! 42 42 43 43 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum)); -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
r7516 r8303 32 32 33 33 /*Create nodes and vertices: */ 34 IoModelFetchData(&iomodel-> gridonbed,NULL,NULL,iomodel_handle,"gridonbed");35 IoModelFetchData(&iomodel-> gridonsurface,NULL,NULL,iomodel_handle,"gridonsurface");36 IoModelFetchData(&iomodel-> gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");37 IoModelFetchData(&iomodel-> gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");34 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed"); 35 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface"); 36 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet"); 37 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf"); 38 38 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type"); 39 IoModelFetchData(&iomodel-> gridonwater,NULL,NULL,iomodel_handle,"gridonwater");39 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater"); 40 40 41 41 for (i=0;i<iomodel->numberofvertices;i++){ … … 50 50 51 51 /*Clean fetched data: */ 52 xfree((void**)&iomodel-> gridonbed);53 xfree((void**)&iomodel-> gridonsurface);54 xfree((void**)&iomodel-> gridonicesheet);55 xfree((void**)&iomodel-> gridonwater);56 xfree((void**)&iomodel-> gridoniceshelf);52 xfree((void**)&iomodel->nodeonbed); 53 xfree((void**)&iomodel->nodeonsurface); 54 xfree((void**)&iomodel->nodeonicesheet); 55 xfree((void**)&iomodel->nodeonwater); 56 xfree((void**)&iomodel->nodeoniceshelf); 57 57 xfree((void**)&iomodel->vertices_type); 58 58 -
issm/trunk/src/c/modules/PenaltyConstraintsx/RiftConstraints.cpp
r6412 r8303 312 312 double penetration; 313 313 314 /*Ok, we are going to find the gridpairs which are not penetrating, even though they314 /*Ok, we are going to find the node pairs which are not penetrating, even though they 315 315 * are penalised. We will release only the one with has least <0 penetration. : */ 316 316 … … 349 349 Riftfront* riftfront=NULL; 350 350 351 /*Ok, we are going to find the gridpairs which are not penetrating, even though they351 /*Ok, we are going to find the node pairs which are not penetrating, even though they 352 352 * are penalised. We will release only the one with has least <0 penetration. : */ 353 353 int unstable=0; -
issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp
r5772 r8303 1 1 /*!\file SpcNodesx 2 * \brief: establish single point constraints on all grids, as well as constraints vector.2 * \brief: establish single point constraints on all nodes, as well as constraints vector. 3 3 */ 4 4 -
issm/trunk/src/c/modules/TriaSearchx/TriaSearchx.cpp
r5391 r8303 13 13 using namespace std; 14 14 15 void TriaSearchx(double** ptria,double* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberof grids){15 void TriaSearchx(double** ptria,double* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberofnodes){ 16 16 17 17 /*Output*/ … … 19 19 20 20 /*allocate: */ 21 tria=(double*)xmalloc(numberof grids*sizeof(double));21 tria=(double*)xmalloc(numberofnodes*sizeof(double)); 22 22 23 23 /*Intermediary*/ … … 36 36 Th.CreateSingleVertexToTriangleConnectivity(); 37 37 38 for(i=0;i<numberof grids;i++){38 for(i=0;i<numberofnodes;i++){ 39 39 40 40 //Get current point coordinates -
issm/trunk/src/c/modules/TriaSearchx/TriaSearchx.h
r5357 r8303 9 9 10 10 /* local prototypes: */ 11 void TriaSearchx(double** ptria,double* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberof grids);11 void TriaSearchx(double** ptria,double* index,int nel, double* x, double* y, int nods,double* x0, double* y0,int numberofnodes); 12 12 13 13 #endif -
issm/trunk/src/c/objects/Contour.cpp
r6412 r8303 17 17 int i; 18 18 19 _printf_(true,"Number of grids in contour: %i\n",contour->nods);20 _printf_(true," Gridcoordinates: \n");19 _printf_(true,"Number of nodes in contour: %i\n",contour->nods); 20 _printf_(true,"Node coordinates: \n"); 21 21 for (i=0;i<contour->nods;i++){ 22 22 _printf_(true,"%lf %lf\n",*(contour->x+i),*(contour->y+i)); -
issm/trunk/src/c/objects/Elements/Penta.cpp
r8287 r8303 593 593 594 594 /*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 595 bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build595 bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 596 596 the stiffness matrix. */ 597 597 if (!IsOnBed()) return NULL; … … 602 602 603 603 /*Spawn Tria element from the base of the Penta: */ 604 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.604 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 605 605 ElementMatrix* Ke=tria->CreateKMatrixBalancethickness(); 606 606 delete tria->matice; delete tria; … … 618 618 619 619 /*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 620 bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build620 bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 621 621 the stiffness matrix. */ 622 622 if (!IsOnBed()) return NULL; … … 627 627 628 628 /*Spawn Tria element from the base of the Penta: */ 629 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.629 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 630 630 ElementMatrix* Ke=tria->CreateKMatrixBalancevelocities(); 631 631 delete tria->matice; delete tria; … … 678 678 /*Find penta on bed as pattyn must be coupled to the dofs on the bed: */ 679 679 Penta* pentabase=GetBasalElement(); 680 Tria* tria=pentabase->SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.680 Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 681 681 682 682 /*Initialize Element matrix*/ … … 738 738 if(IsOnShelf() || !IsOnBed()) return NULL; 739 739 740 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.740 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 741 741 ElementMatrix* Ke=tria->CreateKMatrixCouplingMacAyealPattynFriction(); 742 742 delete tria->matice; delete tria; … … 789 789 /*Find penta on bed as stokes must be coupled to the dofs on the bed: */ 790 790 Penta* pentabase=GetBasalElement(); 791 Tria* tria=pentabase->SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.791 Tria* tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 792 792 793 793 /*Initialize Element matrix and return if necessary*/ … … 1093 1093 1094 1094 /*Figure out if this penta is collapsed. If so, then bailout, except if it is at the 1095 bedrock, in which case we spawn a tria element using the 3 first grids, and use it to build1095 bedrock, in which case we spawn a tria element using the 3 first nodes, and use it to build 1096 1096 the stiffness matrix. */ 1097 1097 if (!IsOnBed()) return NULL; … … 1101 1101 1102 1102 /*Call Tria function*/ 1103 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1103 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1104 1104 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyeal(); 1105 1105 delete tria->matice; delete tria; … … 1151 1151 /*Find penta on bed as this is a macayeal elements: */ 1152 1152 pentabase=GetBasalElement(); 1153 tria=pentabase->SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1153 tria=pentabase->SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1154 1154 1155 1155 /*Initialize Element matrix*/ … … 1217 1217 if(IsOnShelf() || !IsOnBed()) return NULL; 1218 1218 1219 /*Build a tria element using the 3 grids of the base of the penta. Then use1219 /*Build a tria element using the 3 nodes of the base of the penta. Then use 1220 1220 * the tria functionality to build a friction stiffness matrix on these 3 1221 * grids: */1222 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1221 * nodes: */ 1222 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1223 1223 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticMacAyealFriction(); 1224 1224 delete tria->matice; delete tria; … … 1346 1346 if(IsOnShelf() || !IsOnBed()) return NULL; 1347 1347 1348 /*Build a tria element using the 3 grids of the base of the penta. Then use1348 /*Build a tria element using the 3 nodes of the base of the penta. Then use 1349 1349 * the tria functionality to build a friction stiffness matrix on these 3 1350 * grids: */1351 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1350 * nodes: */ 1351 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1352 1352 ElementMatrix* Ke=tria->CreateKMatrixDiagnosticPattynFriction(); 1353 1353 delete tria->matice; delete tria; … … 1639 1639 if (!IsOnBed()) return NULL; 1640 1640 1641 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1641 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1642 1642 ElementMatrix* Ke=tria->CreateKMatrixMelting(); 1643 1643 … … 1655 1655 this->InputDepthAverageAtBase(VyEnum,VyAverageEnum); 1656 1656 1657 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1657 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1658 1658 ElementMatrix* Ke=tria->CreateKMatrixPrognostic(); 1659 1659 delete tria->matice; delete tria; … … 1672 1672 if (!IsOnBed()) return NULL; 1673 1673 1674 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1674 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1675 1675 ElementMatrix* Ke=tria->CreateKMatrixSlope(); 1676 1676 delete tria->matice; delete tria; … … 1957 1957 1958 1958 /*Call Tria function*/ 1959 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1959 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1960 1960 ElementVector* pe=tria->CreatePVectorAdjointHoriz(); 1961 1961 delete tria->matice; delete tria; … … 1971 1971 1972 1972 /*Call Tria function*/ 1973 Tria* tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).1973 Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 1974 1974 ElementVector* pe=tria->CreatePVectorAdjointHoriz(); 1975 1975 delete tria->matice; delete tria; … … 1989 1989 1990 1990 /*Call Tria function*/ 1991 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.1991 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 1992 1992 ElementVector* pe=tria->CreatePVectorBalancethickness(); 1993 1993 delete tria->matice; delete tria; … … 2011 2011 2012 2012 /*Call Tria function*/ 2013 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2013 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2014 2014 ElementVector* pe=tria->CreatePVectorBalancevelocities(); 2015 2015 delete tria->matice; delete tria; … … 2481 2481 2482 2482 /*Call Tria function*/ 2483 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2483 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2484 2484 ElementVector* pe=tria->CreatePVectorDiagnosticMacAyeal(); 2485 2485 delete tria->matice; delete tria; … … 2698 2698 2699 2699 /*Call Tria function*/ 2700 Tria* tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).2700 Tria* tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 2701 2701 ElementVector* pe=tria->CreatePVectorAdjointStokes(); 2702 2702 delete tria->matice; delete tria; … … 2782 2782 2783 2783 /*Call Tria function*/ 2784 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2784 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2785 2785 ElementVector* pe=tria->CreatePVectorDiagnosticBaseVert(); 2786 2786 delete tria->matice; delete tria; … … 2805 2805 2806 2806 /*Call Tria function*/ 2807 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2807 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2808 2808 ElementVector* pe=tria->CreatePVectorPrognostic(); 2809 2809 delete tria->matice; delete tria; … … 2823 2823 2824 2824 /*Call Tria function*/ 2825 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2825 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2826 2826 ElementVector* pe=tria->CreatePVectorSlope(); 2827 2827 delete tria->matice; delete tria; … … 2940 2940 2941 2941 /*Call Tria function*/ 2942 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2942 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2943 2943 ElementVector* pe=tria->CreatePVectorThermalShelf(); 2944 2944 delete tria->matice; delete tria; … … 2955 2955 2956 2956 /*Call Tria function*/ 2957 Tria* tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.2957 Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 2958 2958 ElementVector* pe=tria->CreatePVectorThermalSheet(); 2959 2959 delete tria->matice; delete tria; … … 3050 3050 this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum); 3051 3051 3052 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).3052 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 3053 3053 tria->GradjB(gradient); 3054 3054 delete tria->matice; delete tria; … … 3065 3065 3066 3066 /*B is a 2d field, use MacAyeal(2d) gradient even if it is Stokes or Pattyn*/ 3067 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).3067 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 3068 3068 tria->GradjB(gradient); 3069 3069 delete tria->matice; delete tria; … … 3090 3090 if (approximation==MacAyealApproximationEnum || approximation==PattynApproximationEnum){ 3091 3091 /*MacAyeal or Pattyn*/ 3092 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.3092 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 3093 3093 tria->GradjDrag(gradient); 3094 3094 delete tria->matice; delete tria; … … 3096 3096 else if (approximation==StokesApproximationEnum){ 3097 3097 /*Stokes*/ 3098 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria.3098 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria. 3099 3099 tria->GradjDragStokes(gradient); 3100 3100 delete tria->matice; delete tria; … … 3362 3362 Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input); 3363 3363 3364 /*If the element is a coupling, do nothing: every gridis also on an other elements3364 /*If the element is a coupling, do nothing: every node is also on an other elements 3365 3365 * (as coupling is between MacAyeal and Pattyn) so the other element will take care of it*/ 3366 3366 GetDofList(&doflist,approximation,GsetEnum); … … 5732 5732 this->InputDepthAverageAtBase(RheologyBEnum,RheologyBbarEnum,MaterialsEnum); 5733 5733 5734 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).5734 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 5735 5735 J=tria->RegularizeInversion(); 5736 5736 delete tria->matice; delete tria; … … 5750 5750 this->matice->inputs->AddInput((Input*)B_copy); 5751 5751 5752 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).5752 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 5753 5753 J=tria->RegularizeInversion(); 5754 5754 delete tria->matice; delete tria; … … 5850 5850 /*This element should be collapsed into a tria element at its base. Create this tria element, 5851 5851 * and compute SurfaceArea*/ 5852 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).5852 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 5853 5853 S=tria->SurfaceArea(); 5854 5854 delete tria->matice; delete tria; … … 5857 5857 else{ 5858 5858 5859 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).5859 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 5860 5860 S=tria->SurfaceArea(); 5861 5861 delete tria->matice; delete tria; … … 5887 5887 /*This element should be collapsed into a tria element at its base. Create this tria element, 5888 5888 * and compute SurfaceAverageVelMisfit*/ 5889 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).5889 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 5890 5890 J=tria->SurfaceAverageVelMisfit(process_units); 5891 5891 delete tria->matice; delete tria; … … 5894 5894 else{ 5895 5895 5896 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).5896 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 5897 5897 J=tria->SurfaceAverageVelMisfit(process_units); 5898 5898 delete tria->matice; delete tria; … … 5924 5924 /*This element should be collapsed into a tria element at its base. Create this tria element, 5925 5925 * and compute SurfaceAbsVelMisfit*/ 5926 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).5926 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 5927 5927 J=tria->SurfaceAbsVelMisfit(process_units); 5928 5928 delete tria->matice; delete tria; … … 5931 5931 else{ 5932 5932 5933 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).5933 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 5934 5934 J=tria->SurfaceAbsVelMisfit(process_units); 5935 5935 delete tria->matice; delete tria; … … 5961 5961 /*This element should be collapsed into a tria element at its base. Create this tria element, 5962 5962 * and compute SurfaceLogVelMisfit*/ 5963 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).5963 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 5964 5964 J=tria->SurfaceLogVelMisfit(process_units); 5965 5965 delete tria->matice; delete tria; … … 5968 5968 else{ 5969 5969 5970 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).5970 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 5971 5971 J=tria->SurfaceLogVelMisfit(process_units); 5972 5972 delete tria->matice; delete tria; … … 6000 6000 /*This element should be collapsed into a tria element at its base. Create this tria element, 6001 6001 * and compute SurfaceLogVxVyMisfit*/ 6002 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).6002 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 6003 6003 J=tria->SurfaceLogVxVyMisfit(process_units); 6004 6004 delete tria->matice; delete tria; … … 6007 6007 else{ 6008 6008 6009 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).6009 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 6010 6010 J=tria->SurfaceLogVxVyMisfit(process_units); 6011 6011 delete tria->matice; delete tria; … … 6061 6061 /*This element should be collapsed into a tria element at its base. Create this tria element, 6062 6062 * and compute SurfaceRelVelMisfit*/ 6063 tria=(Tria*)SpawnTria(0,1,2); // grids 0, 1 and 2 make the new tria (lower face).6063 tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face). 6064 6064 J=tria->SurfaceRelVelMisfit(process_units); 6065 6065 delete tria->matice; delete tria; … … 6068 6068 else{ 6069 6069 6070 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).6070 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 6071 6071 J=tria->SurfaceRelVelMisfit(process_units); 6072 6072 delete tria->matice; delete tria; … … 6133 6133 _error_("Not implemented yet"); 6134 6134 6135 tria=(Tria*)SpawnTria(3,4,5); // grids 3, 4 and 5 make the new tria (upper face).6135 tria=(Tria*)SpawnTria(3,4,5); //nodes 3, 4 and 5 make the new tria (upper face). 6136 6136 J=tria->ThicknessAbsMisfit(process_units); 6137 6137 delete tria->matice; delete tria; … … 6221 6221 if(*(iomodel->elements_type+index)==PattynStokesApproximationEnum){ 6222 6222 /*Create VzPattyn and VzStokes Enums*/ 6223 if(iomodel->vz && iomodel-> gridonstokes){6224 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel-> gridonstokes[penta_vertex_ids[i]-1];6223 if(iomodel->vz && iomodel->nodeonstokes){ 6224 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1]; 6225 6225 this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs)); 6226 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel-> gridonstokes[penta_vertex_ids[i]-1]);6226 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]); 6227 6227 this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs)); 6228 6228 } … … 6235 6235 if(*(iomodel->elements_type+index)==MacAyealStokesApproximationEnum){ 6236 6236 /*Create VzMacAyeal and VzStokes Enums*/ 6237 if(iomodel->vz && iomodel-> gridonstokes){6238 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel-> gridonstokes[penta_vertex_ids[i]-1];6237 if(iomodel->vz && iomodel->nodeonstokes){ 6238 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*iomodel->nodeonstokes[penta_vertex_ids[i]-1]; 6239 6239 this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs)); 6240 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel-> gridonstokes[penta_vertex_ids[i]-1]);6240 for(i=0;i<6;i++) nodeinputs[i]=iomodel->vz[penta_vertex_ids[i]-1]/iomodel->yts*(1-iomodel->nodeonstokes[penta_vertex_ids[i]-1]); 6241 6241 this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs)); 6242 6242 } -
issm/trunk/src/c/objects/Elements/PentaRef.cpp
r7070 r8303 60 60 void PentaRef::GetBMacAyealPattyn(double* B, double* xyz_list, GaussPenta* gauss){ 61 61 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 62 * For gridi, Bi can be expressed in the actual coordinate system62 * For node i, Bi can be expressed in the actual coordinate system 63 63 * by: 64 64 * Bi=[ dh/dx 0 ] 65 65 * [ 0 dh/dy ] 66 66 * [ 1/2*dh/dy 1/2*dh/dx ] 67 * where h is the interpolation function for gridi.67 * where h is the interpolation function for node i. 68 68 * 69 69 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1) … … 93 93 void PentaRef::GetBMacAyealStokes(double* B, double* xyz_list, GaussPenta* gauss){ 94 94 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 95 * For gridi, Bi can be expressed in the actual coordinate system95 * For node i, Bi can be expressed in the actual coordinate system 96 96 * by: 97 97 * Bi=[ dh/dx 0 0 0 ] … … 99 99 * [ 1/2*dh/dy 1/2*dh/dx 0 0 ] 100 100 * [ 0 0 0 h ] 101 * where h is the interpolation function for gridi.101 * where h is the interpolation function for node i. 102 102 * 103 103 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1) … … 139 139 void PentaRef::GetBPattyn(double* B, double* xyz_list, GaussPenta* gauss){ 140 140 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 141 * For gridi, Bi can be expressed in the actual coordinate system141 * For node i, Bi can be expressed in the actual coordinate system 142 142 * by: 143 143 * Bi=[ dh/dx 0 ] … … 146 146 * [ 1/2*dh/dz 0 ] 147 147 * [ 0 1/2*dh/dz ] 148 * where h is the interpolation function for gridi.148 * where h is the interpolation function for node i. 149 149 * 150 150 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1) … … 179 179 void PentaRef::GetBprimePattyn(double* B, double* xyz_list, GaussPenta* gauss_coord){ 180 180 /*Compute B prime matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF2. 181 * For gridi, Bi can be expressed in the actual coordinate system181 * For node i, Bi can be expressed in the actual coordinate system 182 182 * by: 183 183 * Bi=[ 2*dh/dx dh/dy ] … … 186 186 * [ dh/dz 0 ] 187 187 * [ 0 dh/dz ] 188 * where h is the interpolation function for gridi.188 * where h is the interpolation function for node i. 189 189 * 190 190 * We assume B has been allocated already, of size: 5x(NDOF2*NUMNODESP1) … … 217 217 void PentaRef::GetBprimeMacAyealStokes(double* Bprime, double* xyz_list, GaussPenta* gauss){ 218 218 /*Compute Bprime matrix. Bprime=[Bprime1 Bprime2 Bprime3 Bprime4 Bprime5 Bprime6] where Bprimei is of size 5*NDOF2. 219 * For gridi, Bprimei can be expressed in the actual coordinate system219 * For node i, Bprimei can be expressed in the actual coordinate system 220 220 * by: 221 221 * Bprimei=[ 2*dh/dx dh/dy 0 0 ] 222 222 * [ dh/dx 2*dh/dy 0 0 ] 223 223 * [ dh/dy dh/dx 0 0 ] 224 * where h is the interpolation function for gridi.224 * where h is the interpolation function for node i. 225 225 * 226 226 * We assume Bprime has been allocated already, of size: 5x(NDOF2*NUMNODESP1) … … 258 258 259 259 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 3*NDOF4. 260 * For gridi, Bi can be expressed in the actual coordinate system260 * For node i, Bi can be expressed in the actual coordinate system 261 261 * by: Bi=[ dh/dx 0 0 0 ] 262 262 * [ 0 dh/dy 0 0 ] … … 267 267 * [ 0 0 0 h ] 268 268 * [ dh/dx dh/dy dh/dz 0 ] 269 * where h is the interpolation function for gridi.269 * where h is the interpolation function for node i. 270 270 * Same thing for Bb except the last column that does not exist. 271 271 */ … … 324 324 void PentaRef::GetBprimeStokes(double* B_prime, double* xyz_list, GaussPenta* gauss){ 325 325 /* Compute B' matrix. B'=[B1' B2' B3' B4' B5' B6' Bb'] where Bi' is of size 3*NDOF2. 326 * For gridi, Bi' can be expressed in the actual coordinate system326 * For node i, Bi' can be expressed in the actual coordinate system 327 327 * by: 328 328 * Bi'=[ dh/dx 0 0 0] … … 334 334 * [ dh/dx dh/dy dh/dz 0] 335 335 * [ 0 0 0 h] 336 * where h is the interpolation function for gridi.336 * where h is the interpolation function for node i. 337 337 * 338 338 * Same thing for the bubble fonction except that there is no fourth column … … 391 391 void PentaRef::GetBArtdiff(double* B_artdiff, double* xyz_list, GaussPenta* gauss){ 392 392 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 393 * For gridi, Bi' can be expressed in the actual coordinate system393 * For node i, Bi' can be expressed in the actual coordinate system 394 394 * by: 395 395 * Bi_artdiff=[ dh/dx ] 396 396 * [ dh/dy ] 397 * where h is the interpolation function for gridi.397 * where h is the interpolation function for node i. 398 398 * 399 399 * We assume B has been allocated already, of size: 2x(NDOF1*NUMNODESP1) … … 416 416 void PentaRef::GetBAdvec(double* B_advec, double* xyz_list, GaussPenta* gauss){ 417 417 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 418 * For gridi, Bi' can be expressed in the actual coordinate system418 * For node i, Bi' can be expressed in the actual coordinate system 419 419 * by: 420 420 * Bi_advec =[ h ] 421 421 * [ h ] 422 422 * [ h ] 423 * where h is the interpolation function for gridi.423 * where h is the interpolation function for node i. 424 424 * 425 425 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1) … … 443 443 void PentaRef::GetBConduct(double* B_conduct, double* xyz_list, GaussPenta* gauss){ 444 444 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 445 * For gridi, Bi' can be expressed in the actual coordinate system445 * For node i, Bi' can be expressed in the actual coordinate system 446 446 * by: 447 447 * Bi_conduct=[ dh/dx ] 448 448 * [ dh/dy ] 449 449 * [ dh/dz ] 450 * where h is the interpolation function for gridi.450 * where h is the interpolation function for node i. 451 451 * 452 452 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1) … … 470 470 void PentaRef::GetBVert(double* B, double* xyz_list, GaussPenta* gauss){ 471 471 /* Compute B matrix. B=[dh1/dz dh2/dz dh3/dz dh4/dz dh5/dz dh6/dz]; 472 where hi is the interpolation function for gridi.*/472 where hi is the interpolation function for node i.*/ 473 473 474 474 int i; … … 488 488 void PentaRef::GetBprimeAdvec(double* Bprime_advec, double* xyz_list, GaussPenta* gauss){ 489 489 /*Compute B matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 490 * For gridi, Bi' can be expressed in the actual coordinate system490 * For node i, Bi' can be expressed in the actual coordinate system 491 491 * by: 492 492 * Biprime_advec=[ dh/dx ] 493 493 * [ dh/dy ] 494 494 * [ dh/dz ] 495 * where h is the interpolation function for gridi.495 * where h is the interpolation function for node i. 496 496 * 497 497 * We assume B has been allocated already, of size: 3x(NDOF1*NUMNODESP1) … … 514 514 /*FUNCTION PentaRef::GetBprimeVert{{{1*/ 515 515 void PentaRef::GetBprimeVert(double* B, double* xyz_list, GaussPenta* gauss){ 516 /* Compute Bprime matrix. Bprime=[L1 L2 L3 L4 L5 L6] where Li is the nodal function for gridi*/516 /* Compute Bprime matrix. Bprime=[L1 L2 L3 L4 L5 L6] where Li is the nodal function for node i*/ 517 517 518 518 GetNodalFunctionsP1(B, gauss); … … 524 524 /* 525 525 * Compute L matrix. L=[L1 L2 L3] where Li is square and of size numdof. 526 * For gridi, Li can be expressed in the actual coordinate system526 * For node i, Li can be expressed in the actual coordinate system 527 527 * by: 528 528 * Li=[ h 0 0 0] … … 540 540 * [ 0 h 0 0] 541 541 * [ 0 0 h 0] 542 * where h is the interpolation function for gridi.542 * where h is the interpolation function for node i. 543 543 */ 544 544 … … 621 621 /* 622 622 * Compute Lprime matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 623 * For gridi, Lpi can be expressed in the actual coordinate system623 * For node i, Lpi can be expressed in the actual coordinate system 624 624 * by: 625 625 * Lpi=[ h 0 0 0] … … 637 637 * [ 0 0 0 h] 638 638 * [ 0 0 0 h] 639 * where h is the interpolation function for gridi.639 * where h is the interpolation function for node i. 640 640 */ 641 641 int i; … … 717 717 /* 718 718 * Compute L matrix. L=[L1 L2 L3] where Li is square and of size numdof. 719 * For gridi, Li can be expressed in the actual coordinate system719 * For node i, Li can be expressed in the actual coordinate system 720 720 * by: 721 721 * Li=[ h 0 ] … … 727 727 * [ h 0 ] 728 728 * [ 0 h ] 729 * where h is the interpolation function for gridi.729 * where h is the interpolation function for node i. 730 730 */ 731 731 … … 768 768 /* 769 769 * Compute Lprime matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 770 * For gridi, Lpi can be expressed in the actual coordinate system770 * For node i, Lpi can be expressed in the actual coordinate system 771 771 * by: 772 772 * Lpi=[ h 0 0 0] … … 778 778 * [ 0 0 0 h] 779 779 * [ 0 0 0 h] 780 * where h is the interpolation function for gridi.780 * where h is the interpolation function for node i. 781 781 */ 782 782 int i; … … 834 834 /* 835 835 * Compute L matrix. L=[L1 L2 L3] where Li is square and of size numdof. 836 * For gridi, Li can be expressed in the actual coordinate system836 * For node i, Li can be expressed in the actual coordinate system 837 837 * by: 838 838 * Li=[ h 0 0 0] … … 840 840 * [ 0 0 h 0] 841 841 * [ 0 0 h 0] 842 * where h is the interpolation function for gridi.842 * where h is the interpolation function for node i. 843 843 */ 844 844 … … 881 881 /* 882 882 * Compute Lprime matrix. Lprime=[Lp1 Lp2 Lp3] where Lpi is square and of size numdof. 883 * For gridi, Lpi can be expressed in the actual coordinate system883 * For node i, Lpi can be expressed in the actual coordinate system 884 884 * by: 885 885 * Lpi=[ h 0 ] … … 887 887 * [ h 0 ] 888 888 * [ 0 h ] 889 * where h is the interpolation function for gridi.889 * where h is the interpolation function for node i. 890 890 */ 891 891 int i; … … 1284 1284 /*FUNCTION PentaRef::GetParameterDerivativeValue{{{1*/ 1285 1285 void PentaRef::GetParameterDerivativeValue(double* p, double* plist,double* xyz_list, GaussPenta* gauss){ 1286 /*From gridvalues of parameter p (p_list[0], p_list[1], p_list[2], p_list[3], p_list[4] and p_list[4]), return parameter derivative value at gaussian point specified by gauss_coord:1286 /*From node values of parameter p (p_list[0], p_list[1], p_list[2], p_list[3], p_list[4] and p_list[4]), return parameter derivative value at gaussian point specified by gauss_coord: 1287 1287 * dp/dx=p_list[0]*dh1/dx+p_list[1]*dh2/dx+p_list[2]*dh3/dx+p_list[3]*dh4/dx+p_list[4]*dh5/dx+p_list[5]*dh6/dx; 1288 1288 * dp/dy=p_list[0]*dh1/dy+p_list[1]*dh2/dy+p_list[2]*dh3/dy+p_list[3]*dh4/dy+p_list[4]*dh5/dy+p_list[5]*dh6/dy; -
issm/trunk/src/c/objects/Elements/TriaRef.cpp
r6987 r8303 59 59 void TriaRef::GetBMacAyeal(double* B, double* xyz_list, GaussTria* gauss){ 60 60 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 61 * For gridi, Bi can be expressed in the actual coordinate system61 * For node i, Bi can be expressed in the actual coordinate system 62 62 * by: 63 63 * Bi=[ dh/dx 0 ] 64 64 * [ 0 dh/dy ] 65 65 * [ 1/2*dh/dy 1/2*dh/dx ] 66 * where h is the interpolation function for gridi.66 * where h is the interpolation function for node i. 67 67 * 68 68 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES) … … 90 90 91 91 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 92 * For gridi, Bi can be expressed in the actual coordinate system92 * For node i, Bi can be expressed in the actual coordinate system 93 93 * by: 94 94 * Bi=[ dh/dx 0 ] 95 95 * [ 0 dh/dy ] 96 96 * [ 1/2*dh/dy 1/2*dh/dx ] 97 * where h is the interpolation function for gridi.97 * where h is the interpolation function for node i. 98 98 * 99 99 * We assume B has been allocated already, of size: 3x(NDOF2*NUMNODES) … … 158 158 void TriaRef::GetBPrognostic(double* B_prog, double* xyz_list, GaussTria* gauss){ 159 159 /*Compute B matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 160 * For gridi, Bi can be expressed in the actual coordinate system160 * For node i, Bi can be expressed in the actual coordinate system 161 161 * by: 162 162 * Bi=[ h ] 163 163 * [ h ] 164 * where h is the interpolation function for gridi.164 * where h is the interpolation function for node i. 165 165 * 166 166 * We assume B_prog has been allocated already, of size: 2x(NDOF1*NUMNODES) … … 183 183 184 184 /*Compute B' matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 185 * For gridi, Bi' can be expressed in the actual coordinate system185 * For node i, Bi' can be expressed in the actual coordinate system 186 186 * by: 187 187 * Bi_prime=[ 2*dh/dx dh/dy ] 188 188 * [ dh/dx 2*dh/dy ] 189 189 * [ dh/dy dh/dx ] 190 * where h is the interpolation function for gridi.190 * where h is the interpolation function for node i. 191 191 * 192 192 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES) … … 214 214 215 215 /*Compute Bprime matrix. Bprime=[Bprime1 Bprime2 Bprime3] where Bprimei is of size 3*NDOF2. 216 * For gridi, Bprimei can be expressed in the actual coordinate system216 * For node i, Bprimei can be expressed in the actual coordinate system 217 217 * by: 218 218 * Bprimei=[ dh/dx 0 ] … … 220 220 * [ dh/dy dh/dx ] 221 221 * [ dh/dx dh/dy ] 222 * where h is the interpolation function for gridi.222 * where h is the interpolation function for node i. 223 223 * 224 224 * We assume Bprime has been allocated already, of size: 3x(NDOF2*NUMNODES) … … 247 247 void TriaRef::GetBprimePrognostic(double* Bprime_prog, double* xyz_list, GaussTria* gauss){ 248 248 /*Compute B' matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 249 * For gridi, Bi' can be expressed in the actual coordinate system249 * For node i, Bi' can be expressed in the actual coordinate system 250 250 * by: 251 251 * Bi_prime=[ dh/dx ] 252 252 * [ dh/dy ] 253 * where h is the interpolation function for gridi.253 * where h is the interpolation function for node i. 254 254 * 255 255 * We assume B' has been allocated already, of size: 3x(NDOF2*NUMNODES) … … 272 272 void TriaRef::GetL(double* L, double* xyz_list,GaussTria* gauss,int numdof){ 273 273 /*Compute L matrix. L=[L1 L2 L3] where Li is square and of size numdof. 274 * For gridi, Li can be expressed in the actual coordinate system274 * For node i, Li can be expressed in the actual coordinate system 275 275 * by: 276 276 * numdof=1: … … 279 279 * Li=[ h 0 ] 280 280 * [ 0 h ] 281 * where h is the interpolation function for gridi.281 * where h is the interpolation function for node i. 282 282 * 283 283 * We assume L has been allocated already, of size: NUMNODES (numdof=1), or numdofx(numdof*NUMNODES) (numdof=2) -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r8224 r8303 195 195 int i,j; 196 196 197 const int num grids=6;197 const int numnodes=6; 198 198 const int DOFVELOCITY=3; 199 199 double B[8][27]; 200 double B_reduced[6][DOFVELOCITY*num grids];201 double velocity[num grids][DOFVELOCITY];200 double B_reduced[6][DOFVELOCITY*numnodes]; 201 double velocity[numnodes][DOFVELOCITY]; 202 202 203 203 /*Get B matrix: */ … … 226 226 227 227 /*Here, we are computing the strain rate of (vx,0,0)*/ 228 for(i=0;i<num grids;i++){228 for(i=0;i<numnodes;i++){ 229 229 velocity[i][0]=this->values[i]; 230 230 velocity[i][1]=0.0; … … 232 232 } 233 233 /*Multiply B by velocity, to get strain rate: */ 234 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*num grids,0,&velocity[0][0],DOFVELOCITY*numgrids,1,0,epsilonvx,0);234 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvx,0); 235 235 236 236 } … … 240 240 int i,j; 241 241 242 const int num grids=6;242 const int numnodes=6; 243 243 const int DOFVELOCITY=3; 244 244 double B[8][27]; 245 double B_reduced[6][DOFVELOCITY*num grids];246 double velocity[num grids][DOFVELOCITY];245 double B_reduced[6][DOFVELOCITY*numnodes]; 246 double velocity[numnodes][DOFVELOCITY]; 247 247 248 248 /*Get B matrix: */ … … 271 271 272 272 /*Here, we are computing the strain rate of (0,vy,0)*/ 273 for(i=0;i<num grids;i++){273 for(i=0;i<numnodes;i++){ 274 274 velocity[i][0]=0.0; 275 275 velocity[i][1]=this->values[i]; … … 277 277 } 278 278 /*Multiply B by velocity, to get strain rate: */ 279 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*num grids,0,&velocity[0][0],DOFVELOCITY*numgrids,1,0,epsilonvy,0);279 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvy,0); 280 280 281 281 } … … 285 285 int i,j; 286 286 287 const int num grids=6;287 const int numnodes=6; 288 288 const int DOFVELOCITY=3; 289 289 double B[8][27]; 290 double B_reduced[6][DOFVELOCITY*num grids];291 double velocity[num grids][DOFVELOCITY];290 double B_reduced[6][DOFVELOCITY*numnodes]; 291 double velocity[numnodes][DOFVELOCITY]; 292 292 293 293 /*Get B matrix: */ … … 316 316 317 317 /*Here, we are computing the strain rate of (0,0,vz)*/ 318 for(i=0;i<num grids;i++){318 for(i=0;i<numnodes;i++){ 319 319 velocity[i][0]=0.0; 320 320 velocity[i][1]=0.0; … … 323 323 324 324 /*Multiply B by velocity, to get strain rate: */ 325 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*num grids,0,&velocity[0][0],DOFVELOCITY*numgrids,1,0,epsilonvz,0);325 MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvz,0); 326 326 327 327 } … … 331 331 332 332 int i; 333 const int num grids=6;334 double B[5][NDOF2*num grids];335 double velocity[num grids][NDOF2];333 const int numnodes=6; 334 double B[5][NDOF2*numnodes]; 335 double velocity[numnodes][NDOF2]; 336 336 337 337 /*Get B matrix: */ … … 339 339 340 340 /*Here, we are computing the strain rate of (vx,0)*/ 341 for(i=0;i<num grids;i++){341 for(i=0;i<numnodes;i++){ 342 342 velocity[i][0]=this->values[i]; 343 343 velocity[i][1]=0.0; … … 345 345 346 346 /*Multiply B by velocity, to get strain rate: */ 347 MatrixMultiply( &B[0][0],5,NDOF2*num grids,0,348 &velocity[0][0],NDOF2*num grids,1,0,347 MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0, 348 &velocity[0][0],NDOF2*numnodes,1,0, 349 349 epsilonvx,0); 350 350 … … 355 355 356 356 int i; 357 const int num grids=6;358 double B[5][NDOF2*num grids];359 double velocity[num grids][NDOF2];357 const int numnodes=6; 358 double B[5][NDOF2*numnodes]; 359 double velocity[numnodes][NDOF2]; 360 360 361 361 /*Get B matrix: */ … … 363 363 364 364 /*Here, we are computing the strain rate of (0,vy)*/ 365 for(i=0;i<num grids;i++){365 for(i=0;i<numnodes;i++){ 366 366 velocity[i][0]=0.0; 367 367 velocity[i][1]=this->values[i]; … … 369 369 370 370 /*Multiply B by velocity, to get strain rate: */ 371 MatrixMultiply( &B[0][0],5,NDOF2*num grids,0,372 &velocity[0][0],NDOF2*num grids,1,0,371 MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0, 372 &velocity[0][0],NDOF2*numnodes,1,0, 373 373 epsilonvy,0); 374 374 … … 414 414 415 415 int i; 416 const int num grids=6;417 418 for(i=0;i<num grids;i++) if (values[i]<minimum) values[i]=minimum;416 const int numnodes=6; 417 418 for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum; 419 419 } 420 420 /*}}}*/ … … 423 423 424 424 /*Output*/ 425 const int num grids=6;425 const int numnodes=6; 426 426 double norm=0; 427 427 428 for(int i=0;i<num grids;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);428 for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]); 429 429 return norm; 430 430 } … … 433 433 double PentaVertexInput::Max(void){ 434 434 435 const int num grids=6;435 const int numnodes=6; 436 436 double max=values[0]; 437 437 438 for(int i=1;i<num grids;i++){438 for(int i=1;i<numnodes;i++){ 439 439 if(values[i]>max) max=values[i]; 440 440 } … … 445 445 double PentaVertexInput::MaxAbs(void){ 446 446 447 const int num grids=6;447 const int numnodes=6; 448 448 double max=fabs(values[0]); 449 449 450 for(int i=1;i<num grids;i++){450 for(int i=1;i<numnodes;i++){ 451 451 if(fabs(values[i])>max) max=fabs(values[i]); 452 452 } … … 457 457 double PentaVertexInput::Min(void){ 458 458 459 const int num grids=6;459 const int numnodes=6; 460 460 double min=values[0]; 461 461 462 for(int i=1;i<num grids;i++){462 for(int i=1;i<numnodes;i++){ 463 463 if(values[i]<min) min=values[i]; 464 464 } … … 469 469 double PentaVertexInput::MinAbs(void){ 470 470 471 const int num grids=6;471 const int numnodes=6; 472 472 double min=fabs(values[0]); 473 473 474 for(int i=1;i<num grids;i++){474 for(int i=1;i<numnodes;i++){ 475 475 if(fabs(values[i])<min) min=fabs(values[i]); 476 476 } … … 482 482 483 483 int i; 484 const int num grids=6;485 486 for(i=0;i<num grids;i++)values[i]=values[i]*scale_factor;484 const int numnodes=6; 485 486 for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor; 487 487 } 488 488 /*}}}*/ … … 491 491 492 492 int i; 493 const int num grids=6;493 const int numnodes=6; 494 494 495 495 /*xinput is of the same type, so cast it: */ … … 500 500 case PentaVertexInputEnum:{ 501 501 PentaVertexInput* cast_input=(PentaVertexInput*)xinput; 502 for(i=0;i<num grids;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}502 for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);} 503 503 return; 504 504 case ControlInputEnum:{ … … 506 506 if(cont_input->values->Enum()!=PentaVertexInputEnum) _error_("not supported yet"); 507 507 PentaVertexInput* cast_input=(PentaVertexInput*)cont_input->values; 508 for(i=0;i<num grids;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}508 for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);} 509 509 return; 510 510 default: … … 518 518 519 519 int i; 520 const int num grids=6;520 const int numnodes=6; 521 521 522 if(!isnan(cm_min)) for(i=0;i<num grids;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;523 if(!isnan(cm_max)) for(i=0;i<num grids;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;522 if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min; 523 if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max; 524 524 525 525 } … … 540 540 /*Intermediaries*/ 541 541 int i; 542 const int num grids = 6;542 const int numnodes = 6; 543 543 int num_thickness_values; 544 544 double *thickness_values = NULL; … … 575 575 PentaVertexInput *xinputB = NULL; 576 576 int B_numvalues; 577 const int num grids = 6;578 double AdotBvalues[num grids];577 const int numnodes = 6; 578 double AdotBvalues[numnodes]; 579 579 580 580 /*Check that inputB is of the same type*/ … … 583 583 584 584 /*Create point wise sum*/ 585 for(i=0;i<num grids;i++){585 for(i=0;i<numnodes;i++){ 586 586 _assert_(xinputB->values[i]!=0); 587 587 AdotBvalues[i]=this->values[i]/xinputB->values[i]; … … 606 606 PentaVertexInput *xinputB = NULL; 607 607 int B_numvalues; 608 const int num grids = 6;609 double minvalues[num grids];608 const int numnodes = 6; 609 double minvalues[numnodes]; 610 610 611 611 /*Check that inputB is of the same type*/ … … 614 614 615 615 /*Create point wise min*/ 616 for(i=0;i<num grids;i++){616 for(i=0;i<numnodes;i++){ 617 617 if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i]; 618 618 else minvalues[i]=this->values[i]; … … 637 637 PentaVertexInput *xinputB = NULL; 638 638 int B_numvalues; 639 const int num grids = 6;640 double maxvalues[num grids];639 const int numnodes = 6; 640 double maxvalues[numnodes]; 641 641 642 642 /*Check that inputB is of the same type*/ … … 645 645 646 646 /*Create point wise max*/ 647 for(i=0;i<num grids;i++){647 for(i=0;i<numnodes;i++){ 648 648 if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i]; 649 649 else maxvalues[i]=this->values[i]; -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r8224 r8303 185 185 /*Intermediary*/ 186 186 int i; 187 const int num grids=3;188 double B[3][NDOF2*num grids];187 const int numnodes=3; 188 double B[3][NDOF2*numnodes]; 189 189 double velocity[3][NDOF2]; 190 190 … … 198 198 } 199 199 /*Get epsilon(vx) = B*velocity*/ 200 MatrixMultiply( &B[0][0],3,NDOF2*num grids,0,201 &velocity[0][0],NDOF2*num grids,1,0,200 MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0, 201 &velocity[0][0],NDOF2*numnodes,1,0, 202 202 epsilonvx,0); 203 203 } … … 208 208 /*Intermediary*/ 209 209 int i; 210 const int num grids=3;211 double B[3][NDOF2*num grids];210 const int numnodes=3; 211 double B[3][NDOF2*numnodes]; 212 212 double velocity[3][NDOF2]; 213 213 … … 221 221 } 222 222 /*Get epsilon(vy) = B*velocity*/ 223 MatrixMultiply( &B[0][0],3,NDOF2*num grids,0,224 &velocity[0][0],NDOF2*num grids,1,0,223 MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0, 224 &velocity[0][0],NDOF2*numnodes,1,0, 225 225 epsilonvy,0); 226 226 } … … 265 265 266 266 int i; 267 const int num grids=3;268 269 for(i=0;i<num grids;i++) if (values[i]<minimum) values[i]=minimum;267 const int numnodes=3; 268 269 for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum; 270 270 } 271 271 /*}}}*/ … … 275 275 /*Output*/ 276 276 double norm=0; 277 const int num grids=3;278 279 for(int i=0;i<num grids;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);277 const int numnodes=3; 278 279 for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]); 280 280 return norm; 281 281 } … … 284 284 double TriaVertexInput::Max(void){ 285 285 286 const int num grids=3;286 const int numnodes=3; 287 287 double max=values[0]; 288 288 289 for(int i=1;i<num grids;i++){289 for(int i=1;i<numnodes;i++){ 290 290 if(values[i]>max) max=values[i]; 291 291 } … … 296 296 double TriaVertexInput::MaxAbs(void){ 297 297 298 const int num grids=3;298 const int numnodes=3; 299 299 double max=fabs(values[0]); 300 300 301 for(int i=1;i<num grids;i++){301 for(int i=1;i<numnodes;i++){ 302 302 if(fabs(values[i])>max) max=fabs(values[i]); 303 303 } … … 308 308 double TriaVertexInput::Min(void){ 309 309 310 const int num grids=3;310 const int numnodes=3; 311 311 double min=values[0]; 312 312 313 for(int i=1;i<num grids;i++){313 for(int i=1;i<numnodes;i++){ 314 314 if(values[i]<min) min=values[i]; 315 315 } … … 320 320 double TriaVertexInput::MinAbs(void){ 321 321 322 const int num grids=3;322 const int numnodes=3; 323 323 double min=fabs(values[0]); 324 324 325 for(int i=1;i<num grids;i++){325 for(int i=1;i<numnodes;i++){ 326 326 if(fabs(values[i])<min) min=fabs(values[i]); 327 327 } … … 333 333 334 334 int i; 335 const int num grids=3;336 337 for(i=0;i<num grids;i++)values[i]=values[i]*scale_factor;335 const int numnodes=3; 336 337 for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor; 338 338 } 339 339 /*}}}*/ … … 342 342 343 343 int i; 344 const int num grids=3;344 const int numnodes=3; 345 345 double noise; 346 346 … … 351 351 noise=min+(max-min)*(double)rand()/RAND_MAX; 352 352 353 for(i=0;i<num grids;i++)values[i]=values[i]+noise;353 for(i=0;i<numnodes;i++)values[i]=values[i]+noise; 354 354 } 355 355 /*}}}*/ … … 358 358 359 359 int i; 360 const int num grids=3;360 const int numnodes=3; 361 361 TriaVertexInput* xtriavertexinput=NULL; 362 362 … … 368 368 369 369 case TriaVertexInputEnum : 370 for(i=0;i<num grids;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];370 for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i]; 371 371 return; 372 372 … … 381 381 382 382 int i; 383 const int num grids=3;383 const int numnodes=3; 384 384 385 if(!isnan(cm_min)) for(i=0;i<num grids;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;386 if(!isnan(cm_max)) for(i=0;i<num grids;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;385 if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min; 386 if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max; 387 387 388 388 } … … 413 413 TriaVertexInput *xinputB = NULL; 414 414 int B_numvalues; 415 const int num grids = 3;416 double minvalues[num grids];415 const int numnodes = 3; 416 double minvalues[numnodes]; 417 417 418 418 /*Check that inputB is of the same type*/ … … 421 421 422 422 /*Create point wise min*/ 423 for(i=0;i<num grids;i++){423 for(i=0;i<numnodes;i++){ 424 424 if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i]; 425 425 else minvalues[i]=this->values[i]; … … 444 444 TriaVertexInput *xinputB = NULL; 445 445 int B_numvalues; 446 const int num grids = 3;447 double maxvalues[num grids];446 const int numnodes = 3; 447 double maxvalues[numnodes]; 448 448 449 449 /*Check that inputB is of the same type*/ … … 452 452 453 453 /*Create point wise max*/ 454 for(i=0;i<num grids;i++){454 for(i=0;i<numnodes;i++){ 455 455 if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i]; 456 456 else maxvalues[i]=this->values[i]; -
issm/trunk/src/c/objects/IoModel.cpp
r8238 r8303 41 41 xfree((void**)&this->elements_type); 42 42 xfree((void**)&this->vertices_type); 43 xfree((void**)&this-> gridonhutter);44 xfree((void**)&this-> gridonmacayeal);43 xfree((void**)&this->nodeonhutter); 44 xfree((void**)&this->nodeonmacayeal); 45 45 if (this->dim==3){ 46 46 xfree((void**)&this->elements2d); 47 47 xfree((void**)&this->upperelements); 48 48 xfree((void**)&this->lowerelements); 49 xfree((void**)&this-> gridonpattyn);49 xfree((void**)&this->nodeonpattyn); 50 50 } 51 51 xfree((void**)&this->elementonbed); 52 52 xfree((void**)&this->elementonsurface); 53 xfree((void**)&this-> gridonbed);54 xfree((void**)&this-> gridonsurface);55 xfree((void**)&this-> gridonstokes);53 xfree((void**)&this->nodeonbed); 54 xfree((void**)&this->nodeonsurface); 55 xfree((void**)&this->nodeonstokes); 56 56 xfree((void**)&this->borderstokes); 57 57 xfree((void**)&this->thickness_obs); … … 74 74 xfree((void**)&this->elementoniceshelf); 75 75 xfree((void**)&this->elementonwater); 76 xfree((void**)&this-> gridonicesheet);77 xfree((void**)&this-> gridoniceshelf);78 xfree((void**)&this-> gridonwater);76 xfree((void**)&this->nodeonicesheet); 77 xfree((void**)&this->nodeoniceshelf); 78 xfree((void**)&this->nodeonwater); 79 79 xfree((void**)&this->pressureload); 80 80 xfree((void**)&this->spcvelocity); … … 136 136 IoModelFetchData(&this->dim,iomodel_handle,"dim"); 137 137 /*!Get numberofelements and numberofvertices: */ 138 IoModelFetchData(&this->numberofvertices,iomodel_handle,"numberof grids");138 IoModelFetchData(&this->numberofvertices,iomodel_handle,"numberofnodes"); 139 139 IoModelFetchData(&this->numberofelements,iomodel_handle,"numberofelements"); 140 140 /*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */ … … 143 143 /*!Deal with 2d mesh: */ 144 144 IoModelFetchData(&this->numberofelements2d,iomodel_handle,"numberofelements2d"); 145 IoModelFetchData(&this->numberofvertices2d,iomodel_handle,"numberof grids2d");145 IoModelFetchData(&this->numberofvertices2d,iomodel_handle,"numberofnodes2d"); 146 146 IoModelFetchData(&this->numlayers,iomodel_handle,"numlayers"); 147 147 } … … 264 264 this->upperelements=NULL; 265 265 this->lowerelements=NULL; 266 this-> gridonhutter=NULL;267 this-> gridonmacayeal=NULL;268 this-> gridonpattyn=NULL;266 this->nodeonhutter=NULL; 267 this->nodeonmacayeal=NULL; 268 this->nodeonpattyn=NULL; 269 269 this->io_gather=1; 270 270 … … 285 285 this->elementonbed=NULL; 286 286 this->elementonsurface=NULL; 287 this-> gridonbed=NULL;288 this-> gridonsurface=NULL;289 this-> gridonstokes=NULL;287 this->nodeonbed=NULL; 288 this->nodeonsurface=NULL; 289 this->nodeonstokes=NULL; 290 290 this->borderstokes=NULL; 291 291 this->thickness_obs=NULL; … … 297 297 this->elementoniceshelf=NULL; 298 298 this->elementonwater=NULL; 299 this-> gridonicesheet=NULL;300 this-> gridoniceshelf=NULL;301 this-> gridonwater=NULL;299 this->nodeonicesheet=NULL; 300 this->nodeoniceshelf=NULL; 301 this->nodeonwater=NULL; 302 302 303 303 this->drag_type=0; … … 422 422 printf("IoModel penalties: \n"); 423 423 printf(" number of penalties: %i\n",this->numpenalties); 424 printf(" grids: \n");424 printf(" nodes: \n"); 425 425 426 426 for(i=0;i<this->numpenalties;i++){ -
issm/trunk/src/c/objects/IoModel.h
r8238 r8303 46 46 int ismacayealpattyn; 47 47 int isstokes; 48 double* gridonhutter;49 double* gridonmacayeal;50 double* gridonpattyn;48 double* nodeonhutter; 49 double* nodeonmacayeal; 50 double* nodeonpattyn; 51 51 52 52 /*results: */ … … 76 76 double* elementonbed; 77 77 double* elementonsurface; 78 double* gridonbed;79 double* gridonsurface;80 double* gridonstokes;78 double* nodeonbed; 79 double* nodeonsurface; 80 double* nodeonstokes; 81 81 double* borderstokes; 82 82 double* thickness; … … 87 87 double* elementoniceshelf; 88 88 double* elementonwater; 89 double* gridonicesheet;90 double* gridoniceshelf;91 double* gridonwater;89 double* nodeonicesheet; 90 double* nodeoniceshelf; 91 double* nodeonwater; 92 92 93 93 /*friction: */ -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r8224 r8303 58 58 segment_width=6; 59 59 } 60 element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column ( grid1 grid2 ... elem fill)60 element=(int)(*(iomodel->pressureload+segment_width*i+segment_width-2)-1); //element is in the penultimate column (node1 node2 ... elem fill) 61 61 62 62 /*Build ids for hook constructors: */ -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r8224 r8303 462 462 463 463 int found=0; 464 const int num grids=1;464 const int numnodes=1; 465 465 double pressure; 466 466 double temperature; -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r8224 r8303 51 51 /*intermediary: */ 52 52 int el1 ,el2; 53 int grid1 ,grid2;54 55 /*Ok, retrieve all the data needed to add a penalty between the two grids: */53 int node1 ,node2; 54 55 /*Ok, retrieve all the data needed to add a penalty between the two nodes: */ 56 56 el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2); 57 57 el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3); 58 58 59 grid1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+0);60 grid2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+1);59 node1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+0); 60 node2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+1); 61 61 62 62 /*id: */ … … 65 65 66 66 /*hooks: */ 67 riftfront_node_ids[0]=iomodel->nodecounter+ grid1;68 riftfront_node_ids[1]=iomodel->nodecounter+ grid2;67 riftfront_node_ids[0]=iomodel->nodecounter+node1; 68 riftfront_node_ids[1]=iomodel->nodecounter+node2; 69 69 riftfront_elem_ids[0]=el1; 70 70 riftfront_elem_ids[1]=el2; … … 96 96 riftfront_friction=*(iomodel->riftinfo+RIFTINFOSIZE*i+8); 97 97 riftfront_fractionincrement=*(iomodel->riftinfo+RIFTINFOSIZE*i+10); 98 riftfront_shelf=(bool)iomodel-> gridoniceshelf[grid1-1];98 riftfront_shelf=(bool)iomodel->nodeoniceshelf[node1-1]; 99 99 100 100 this->inputs->AddInput(new IntInput(TypeEnum,riftfront_type)); … … 623 623 624 624 /*Ok, this rift is opening. We should put loads on both sides of the rift flanks. Because we are dealing with contact mechanics, 625 * and we want to avoid zigzagging of the loads, we want lump the loads onto grids, not onto surfaces between grids.:*/626 627 /*Ok, to compute the pressure, we are going to need material properties, thickness and bed for the two grids. We assume those properties to625 * and we want to avoid zigzagging of the loads, we want lump the loads onto nodes, not onto surfaces between nodes.:*/ 626 627 /*Ok, to compute the pressure, we are going to need material properties, thickness and bed for the two nodes. We assume those properties to 628 628 * be the same across the rift.: */ 629 629 … … 660 660 } 661 661 662 /*Ok, add contribution to first grid, along the normal i==0: */662 /*Ok, add contribution to first node, along the normal i==0: */ 663 663 for (j=0;j<2;j++){ 664 664 pe->values[j]+=pressure*normal[j]*length; 665 665 } 666 666 667 /*Add contribution to second grid, along the opposite normal: i==1 */667 /*Add contribution to second node, along the opposite normal: i==1 */ 668 668 for (j=0;j<2;j++){ 669 669 pe->values[2+j]+= -pressure*normal[j]*length; … … 679 679 int Riftfront::Constrain(int* punstable){ 680 680 681 const int num grids = 2;681 const int numnodes = 2; 682 682 double max_penetration; 683 683 double penetration; … … 802 802 int Riftfront::MaxPenetration(double* ppenetration){ 803 803 804 const int num grids=2;804 const int numnodes=2; 805 805 double max_penetration; 806 806 double penetration=0; … … 831 831 tria2->GetParameterValue(&vy2,nodes[1],VyEnum); 832 832 833 /* Grid 1 faces grid2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */833 /*Node1 faces node2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ 834 834 penetration=(vx2-vx1)*normal[0]+(vy2-vy1)*normal[1]; 835 835 … … 902 902 903 903 904 const int num grids = 2;904 const int numnodes = 2; 905 905 double max_penetration; 906 906 double penetration; … … 953 953 int Riftfront::PreConstrain(int* punstable){ 954 954 955 const int num grids = 2;955 const int numnodes = 2; 956 956 double penetration; 957 957 int unstable; -
issm/trunk/src/c/objects/Node.cpp
r8287 r8303 50 50 //intialize inputs, and add as many inputs per element as requested: 51 51 this->inputs=new Inputs(); 52 if (iomodel-> gridonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->gridonbed[io_index]));53 if (iomodel-> gridonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->gridonsurface[io_index]));54 if (iomodel-> gridoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->gridoniceshelf[io_index]));55 if (iomodel-> gridonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->gridonicesheet[io_index]));52 if (iomodel->nodeonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->nodeonbed[io_index])); 53 if (iomodel->nodeonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->nodeonsurface[io_index])); 54 if (iomodel->nodeoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->nodeoniceshelf[io_index])); 55 if (iomodel->nodeonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->nodeonicesheet[io_index])); 56 56 if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,(IssmInt)iomodel->numbernodetoelementconnectivity[io_index])); 57 57 if (analysis_type==DiagnosticHorizAnalysisEnum) this->inputs->AddInput(new IntInput(ApproximationEnum,(IssmInt)iomodel->vertices_type[io_index])); … … 60 60 61 61 /*spc all nodes on water*/ 62 if (!iomodel-> gridonwater) _error_("iomodel->gridonwater is NULL");63 if (iomodel-> gridonwater[io_index]){62 if (!iomodel->nodeonwater) _error_("iomodel->nodeonwater is NULL"); 63 if (iomodel->nodeonwater[io_index]){ 64 64 for(k=1;k<=gsize;k++){ 65 65 this->FreezeDof(k); … … 70 70 if (analysis_type==DiagnosticHorizAnalysisEnum){ 71 71 if (iomodel->dim==3){ 72 /*We have a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */73 if (!iomodel-> gridonbed) _error_("iomodel->gridonbed is NULL");72 /*We have a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 73 if (!iomodel->nodeonbed) _error_("iomodel->nodeonbed is NULL"); 74 74 if (!iomodel->vertices_type) _error_("iomodel->vertices_type is NULL"); 75 if (iomodel->vertices_type[io_index]==MacAyealApproximationEnum && !iomodel-> gridonbed[io_index]){75 if (iomodel->vertices_type[io_index]==MacAyealApproximationEnum && !iomodel->nodeonbed[io_index]){ 76 76 for(k=1;k<=gsize;k++) this->FreezeDof(k); 77 77 } 78 if (iomodel->vertices_type[io_index]==MacAyealPattynApproximationEnum && iomodel-> gridonmacayeal[io_index]){79 if(!iomodel-> gridonbed[io_index]){78 if (iomodel->vertices_type[io_index]==MacAyealPattynApproximationEnum && iomodel->nodeonmacayeal[io_index]){ 79 if(!iomodel->nodeonbed[io_index]){ 80 80 for(k=1;k<=gsize;k++) this->FreezeDof(k); 81 81 } 82 82 } 83 if (iomodel->vertices_type[io_index]==MacAyealStokesApproximationEnum && iomodel-> gridonmacayeal[io_index]){84 if(!iomodel-> gridonbed[io_index]){83 if (iomodel->vertices_type[io_index]==MacAyealStokesApproximationEnum && iomodel->nodeonmacayeal[io_index]){ 84 if(!iomodel->nodeonbed[io_index]){ 85 85 for(k=1;k<=2;k++) this->FreezeDof(k); 86 86 } … … 88 88 } 89 89 /*spc all nodes on hutter*/ 90 if (!iomodel-> gridonhutter) _error_("iomodel->gridonhutter is NULL");91 if (iomodel-> gridonhutter[io_index]){90 if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL"); 91 if (iomodel->nodeonhutter[io_index]){ 92 92 for(k=1;k<=gsize;k++){ 93 93 this->FreezeDof(k); … … 100 100 if (analysis_type==DiagnosticHutterAnalysisEnum){ 101 101 /*Spc all nodes that are not Hutter*/ 102 if (!iomodel-> gridonhutter) _error_("iomodel->gridonhutter is NULL");103 if (!iomodel-> gridonhutter[io_index]){102 if (!iomodel->nodeonhutter) _error_("iomodel->nodeonhutter is NULL"); 103 if (!iomodel->nodeonhutter[io_index]){ 104 104 for(k=1;k<=gsize;k++){ 105 105 this->FreezeDof(k); … … 118 118 ){ 119 119 if (iomodel->dim==3){ 120 /*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */121 if (!iomodel-> gridonbed) _error_("iomodel->gridonbed is NULL");122 if (!iomodel-> gridonbed[io_index]){120 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 121 if (!iomodel->nodeonbed) _error_("iomodel->nodeonbed is NULL"); 122 if (!iomodel->nodeonbed[io_index]){ 123 123 for(k=1;k<=gsize;k++){ 124 124 this->FreezeDof(k); -
issm/trunk/src/c/objects/Object.h
r4248 r8303 4 4 * \file Object.h 5 5 * This prototype describes the Object class. This is an abstract class, parent 6 * to any other objects (Quad, Tria, Grid, etc ...), that can be included in a6 * to any other objects (Quad, Tria, Node , etc ...), that can be included in a 7 7 * DataSet. 8 8 */ -
issm/trunk/src/c/objects/Segment.cpp
r6412 r8303 51 51 printf("Segment:\n"); 52 52 printf(" eid: %i\n",eid); 53 printf(" grid1: %g|%g\n",this->x1,this->y1);54 printf(" grid2: %g|%g\n",this->x2,this->y2);53 printf(" node 1: %g|%g\n",this->x1,this->y1); 54 printf(" node 2: %g|%g\n",this->x2,this->y2); 55 55 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.