Changeset 3313
- Timestamp:
- 03/22/10 10:07:43 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/@bamgmesh/bamgmesh.m
r3311 r3313 12 12 bm.Triangles=[]; 13 13 bm.Quadrilaterals=[]; 14 bm. AllEdges=[];14 bm.ElementEdges=[]; 15 15 bm.Segments=[]; 16 16 bm.VerticesOnGeometricVertex=[]; -
issm/trunk/src/mex/Bamg/Bamg.cpp
r3311 r3313 26 26 /*create bamg geometry input*/ 27 27 BamgGeomInit(&bamggeom_in); 28 FetchData(&bamggeom_in.Vertices,&bamggeom_in.NumVertices,NULL,mxGetField(BAMGGEOMETRY,0,"Vertices")); 29 FetchData(&bamggeom_in.Edges,&bamggeom_in.NumEdges,NULL,mxGetField(BAMGGEOMETRY,0,"Edges")); 30 FetchData(&bamggeom_in.Corners,&bamggeom_in.NumCorners,NULL,mxGetField(BAMGGEOMETRY,0,"Corners")); 31 FetchData(&bamggeom_in.RequiredVertices,&bamggeom_in.NumRequiredVertices,NULL,mxGetField(BAMGGEOMETRY,0,"RequiredVertices")); 32 FetchData(&bamggeom_in.RequiredEdges,&bamggeom_in.NumRequiredEdges,NULL,mxGetField(BAMGGEOMETRY,0,"RequiredEdges")); 28 FetchData(&bamggeom_in.Vertices, &bamggeom_in.VerticesSize[0], &bamggeom_in.VerticesSize[1], mxGetField(BAMGGEOMETRY,0,"Vertices")); 29 FetchData(&bamggeom_in.Edges, &bamggeom_in.EdgesSize[0], &bamggeom_in.EdgesSize[1], mxGetField(BAMGGEOMETRY,0,"Edges")); 30 FetchData(&bamggeom_in.Corners, &bamggeom_in.CornersSize[0], &bamggeom_in.CornersSize[1], mxGetField(BAMGGEOMETRY,0,"Corners")); 31 FetchData(&bamggeom_in.RequiredVertices,&bamggeom_in.RequiredVerticesSize[0],&bamggeom_in.RequiredVerticesSize[1],mxGetField(BAMGGEOMETRY,0,"RequiredVertices")); 32 FetchData(&bamggeom_in.RequiredEdges, &bamggeom_in.RequiredEdgesSize[0], &bamggeom_in.RequiredEdgesSize[1], mxGetField(BAMGGEOMETRY,0,"RequiredEdges")); 33 FetchData(&bamggeom_in.CrackedEdges, &bamggeom_in.CrackedEdgesSize[0], &bamggeom_in.CrackedEdgesSize[1], mxGetField(BAMGGEOMETRY,0,"CrackedEdges")); 34 FetchData(&bamggeom_in.SubDomains, &bamggeom_in.SubDomainsSize[0], &bamggeom_in.SubDomainsSize[1], mxGetField(BAMGGEOMETRY,0,"SubDomains")); 33 35 FetchData(&bamggeom_in.hVertices,&lines,&cols,mxGetField(BAMGGEOMETRY,0,"hVertices")); 34 FetchData(&bamggeom_in.CrackedEdges,&bamggeom_in.NumCrackedEdges,NULL,mxGetField(BAMGGEOMETRY,0,"CrackedEdges")); 35 FetchData(&bamggeom_in.SubDomains,&bamggeom_in.NumSubDomains,NULL,mxGetField(BAMGGEOMETRY,0,"SubDomains")); 36 if (bamggeom_in.hVertices && (cols!=1 || lines!=bamggeom_in.NumVertices)){throw ErrorException(__FUNCT__,exprintf("the size of 'hVertices' should be [%i %i]",bamggeom_in.NumVertices,1));} 36 if (bamggeom_in.hVertices && (cols!=1 || lines!=bamggeom_in.VerticesSize[0])){throw ErrorException(__FUNCT__,exprintf("the size of 'hVertices' should be [%i %i]",bamggeom_in.VerticesSize[0],1));} 37 37 38 38 /*create bamg mesh input*/ 39 39 BamgMeshInit(&bamgmesh_in); 40 FetchData(&bamgmesh_in.Vertices,&bamgmesh_in.NumVertices,NULL,mxGetField(BAMGMESH,0,"Vertices")); 41 FetchData(&bamgmesh_in.Triangles,&bamgmesh_in.NumTriangles,NULL,mxGetField(BAMGMESH,0,"Triangles")); 40 FetchData(&bamgmesh_in.Triangles,&bamgmesh_in.TrianglesSize[0],&bamgmesh_in.TrianglesSize[1],mxGetField(BAMGMESH,0,"Triangles")); 41 FetchData(&bamgmesh_in.Vertices, &bamgmesh_in.VerticesSize[0], &bamgmesh_in.VerticesSize[1], mxGetField(BAMGMESH,0,"Vertices")); 42 FetchData(&bamgmesh_in.Edges, &bamgmesh_in.EdgesSize[0], &bamgmesh_in.EdgesSize[1], mxGetField(BAMGMESH,0,"Edges")); 43 FetchData(&bamgmesh_in.Segments, &bamgmesh_in.SegmentsSize[0], &bamgmesh_in.SegmentsSize[1], mxGetField(BAMGMESH,0,"Segments")); 44 FetchData(&bamgmesh_in.CrackedEdges,&bamgmesh_in.CrackedEdgesSize[0],&bamgmesh_in.CrackedEdgesSize[1],mxGetField(BAMGMESH,0,"CrackedEdges")); 45 FetchData(&bamgmesh_in.EdgesOnGeometricEdge,&bamgmesh_in.EdgesOnGeometricEdgeSize[0],&bamgmesh_in.EdgesOnGeometricEdgeSize[1],mxGetField(BAMGMESH,0,"EdgesOnGeometricEdge")); 46 FetchData(&bamgmesh_in.VerticesOnGeometricEdge,&bamgmesh_in.VerticesOnGeometricEdgeSize[0],&bamgmesh_in.VerticesOnGeometricEdgeSize[1],mxGetField(BAMGMESH,0,"VerticesOnGeometricEdge")); 47 FetchData(&bamgmesh_in.VerticesOnGeometricVertex,&bamgmesh_in.VerticesOnGeometricVertexSize[0],&bamgmesh_in.VerticesOnGeometricVertexSize[1],mxGetField(BAMGMESH,0,"VerticesOnGeometricVertex")); 42 48 FetchData(&bamgmesh_in.hVertices,&lines,&cols,mxGetField(BAMGMESH,0,"hVertices")); 43 FetchData(&bamgmesh_in.Segments,&bamgmesh_in.NumSegments,NULL,mxGetField(BAMGMESH,0,"Segments")); 44 FetchData(&bamgmesh_in.CrackedEdges,&bamgmesh_in.NumCrackedEdges,NULL,mxGetField(BAMGMESH,0,"CrackedEdges")); 45 FetchData(&bamgmesh_in.Edges,&bamgmesh_in.NumEdges,NULL,mxGetField(BAMGMESH,0,"Edges")); 46 FetchData(&bamgmesh_in.EdgesOnGeometricEdge,&bamgmesh_in.NumEdgesOnGeometricEdge,NULL,mxGetField(BAMGMESH,0,"EdgesOnGeometricEdge")); 47 FetchData(&bamgmesh_in.VerticesOnGeometricEdge,&bamgmesh_in.NumVerticesOnGeometricEdge,NULL,mxGetField(BAMGMESH,0,"VerticesOnGeometricEdge")); 48 FetchData(&bamgmesh_in.VerticesOnGeometricVertex,&bamgmesh_in.NumVerticesOnGeometricVertex,NULL,mxGetField(BAMGMESH,0,"VerticesOnGeometricVertex")); 49 if (bamgmesh_in.hVertices && (cols!=1 || lines!=bamgmesh_in.NumVertices)){throw ErrorException(__FUNCT__,exprintf("the size of 'hVertices' should be [%i %i]",bamgmesh_in.NumVertices,1));} 49 if (bamgmesh_in.hVertices && (cols!=1 || lines!=bamgmesh_in.VerticesSize[0])){throw ErrorException(__FUNCT__,exprintf("the size of 'hVertices' should be [%i %i]",bamgmesh_in.VerticesSize[0],1));} 50 50 51 51 /*create bamg options input*/ … … 72 72 FetchData(&bamgopts.MaximalAngleOfCorner,mxGetField(BAMGOPTIONS,0,"MaximalAngleOfCorner")); 73 73 FetchData(&bamgopts.hminVertices,&lines,&cols,mxGetField(BAMGOPTIONS,0,"hminVertices")); 74 if (bamgopts.hminVertices && (cols!=1 || lines!=bamgmesh_in. NumVertices)){throw ErrorException(__FUNCT__,exprintf("the size of 'hminVertices' should be [%i %i]",bamgmesh_in.NumVertices,1));}74 if (bamgopts.hminVertices && (cols!=1 || lines!=bamgmesh_in.VerticesSize[0])){throw ErrorException(__FUNCT__,exprintf("the size of 'hminVertices' should be [%i %i]",bamgmesh_in.VerticesSize[0],1));} 75 75 FetchData(&bamgopts.hmaxVertices,&lines,&cols,mxGetField(BAMGOPTIONS,0,"hmaxVertices")); 76 if (bamgopts.hmaxVertices && (cols!=1 || lines!=bamgmesh_in. NumVertices)){throw ErrorException(__FUNCT__,exprintf("the size of 'hmaxVertices' should be [%i %i]",bamgmesh_in.NumVertices,1));}76 if (bamgopts.hmaxVertices && (cols!=1 || lines!=bamgmesh_in.VerticesSize[0])){throw ErrorException(__FUNCT__,exprintf("the size of 'hmaxVertices' should be [%i %i]",bamgmesh_in.VerticesSize[0],1));} 77 77 FetchData(&bamgopts.metric,&lines,&cols,mxGetField(BAMGOPTIONS,0,"metric")); 78 if (bamgopts.metric && (cols!=3 || lines!=bamgmesh_in. NumVertices)){throw ErrorException(__FUNCT__,exprintf("the size of 'metric' should be [%i %i]",bamgmesh_in.NumVertices,3));}78 if (bamgopts.metric && (cols!=3 || lines!=bamgmesh_in.VerticesSize[0])){throw ErrorException(__FUNCT__,exprintf("the size of 'metric' should be [%i %i]",bamgmesh_in.VerticesSize[0],3));} 79 79 FetchData(&bamgopts.field,&lines,&bamgopts.numfields,mxGetField(BAMGOPTIONS,0,"field")); 80 if (bamgopts.field && lines!=bamgmesh_in. NumVertices){throw ErrorException(__FUNCT__,exprintf("the size of 'field' should be [%i %i]",bamgmesh_in.NumVertices,bamgopts.numfields));}80 if (bamgopts.field && lines!=bamgmesh_in.VerticesSize[0]){throw ErrorException(__FUNCT__,exprintf("the size of 'field' should be [%i %i]",bamgmesh_in.VerticesSize[0],bamgopts.numfields));} 81 81 FetchData(&bamgopts.err,NULL,&cols,mxGetField(BAMGOPTIONS,0,"err")); 82 82 if (bamgopts.numfields!=0 && cols!=bamgopts.numfields){throw ErrorException(__FUNCT__,exprintf("the size of 'err' should be the same as 'field'"));}
Note:
See TracChangeset
for help on using the changeset viewer.