Changeset 3311


Ignore:
Timestamp:
03/22/10 07:58:54 (15 years ago)
Author:
Mathieu Morlighem
Message:

do not keep sizes in final matlab bamg structure

Location:
issm/trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Bamgx/objects/Triangles.cpp

    r3309 r3311  
    706706                if(verbose>5) printf("      writing Segments\n");
    707707                bamgmesh->NumSegments=NumSegments;
    708                 bamgmesh->Segments=(double*)xmalloc(3*NumSegments*sizeof(double));
    709                 bamgmesh->SegmentsMarkers=(double*)xmalloc(1*NumSegments*sizeof(double));
     708                bamgmesh->Segments=(double*)xmalloc(4*NumSegments*sizeof(double));
    710709                num=0;
    711710                for (i=0;i<nbe;i++){
     
    719718                                                if (Number(triangles[(int)j/3][k])==i1){
    720719                                                        if (Number(triangles[(int)j/3][(int)((k+1)%3)])==i2){
    721                                                                 bamgmesh->Segments[num*3+0]=Number(edges[i][0])+1; //back to M indexing
    722                                                                 bamgmesh->Segments[num*3+1]=Number(edges[i][1])+1; //back to M indexing
    723                                                                 bamgmesh->Segments[num*3+2]=(int)j/3+1;            //back to M indexing
    724                                                                 bamgmesh->SegmentsMarkers[num]=edges[i].ref;
     720                                                                bamgmesh->Segments[num*4+0]=Number(edges[i][0])+1; //back to M indexing
     721                                                                bamgmesh->Segments[num*4+1]=Number(edges[i][1])+1; //back to M indexing
     722                                                                bamgmesh->Segments[num*4+2]=(int)j/3+1;            //back to M indexing
     723                                                                bamgmesh->Segments[num*4+3]=edges[i].ref;
    725724                                                                num+=1;
    726725                                                                stop=true;
     
    728727                                                        }
    729728                                                        if (Number(triangles[(int)j/3][(int)((k+2)%3)])==i2){
    730                                                                 bamgmesh->Segments[num*3+0]=Number(edges[i][1])+1; //back to M indexing
    731                                                                 bamgmesh->Segments[num*3+1]=Number(edges[i][0])+1; //back to M indexing
    732                                                                 bamgmesh->Segments[num*3+2]=(int)j/3+1;            //back to M indexing
    733                                                                 bamgmesh->SegmentsMarkers[num]=edges[i].ref;
     729                                                                bamgmesh->Segments[num*4+0]=Number(edges[i][1])+1; //back to M indexing
     730                                                                bamgmesh->Segments[num*4+1]=Number(edges[i][0])+1; //back to M indexing
     731                                                                bamgmesh->Segments[num*4+2]=(int)j/3+1;            //back to M indexing
     732                                                                bamgmesh->Segments[num*4+3]=edges[i].ref;
    734733                                                                num+=1;
    735734                                                                stop=true;
  • issm/trunk/src/c/objects/BamgGeom.cpp

    r3309 r3311  
    3636        mxArray*    pfield=NULL;
    3737        mxArray*    pfield2=NULL;
    38         int         numfields=14;
     38        int         numfields=7;
    3939        const char* fnames[numfields];
    4040        mwSize      ndim=2;
    4141        mwSize      dimensions[2]={1,1};
    4242
    43         fnames[0] = "NumVertices";
    44         fnames[1] = "Vertices";
    45         fnames[2] = "NumEdges";
    46         fnames[3] = "Edges";
    47         fnames[4] = "NumTangentAtEdges";
    48         fnames[5] = "TangentAtEdges";
    49         fnames[6] = "NumRequiredVertices";
    50         fnames[7] = "RequiredVertices";
    51         fnames[8] = "NumRequiredEdges";
    52         fnames[9] = "RequiredEdges";
    53         fnames[10]= "NumCrackedEdges";
    54         fnames[11]= "CrackedEdges";
    55         fnames[12]= "NumSubDomains";
    56         fnames[13]= "SubDomains";
     43        fnames[0] = "Vertices";
     44        fnames[1] = "Edges";
     45        fnames[2] = "TangentAtEdges";
     46        fnames[3] = "RequiredVertices";
     47        fnames[4] = "RequiredEdges";
     48        fnames[5] = "CrackedEdges";
     49        fnames[6] = "SubDomains";
    5750
    5851        bamggeom_mat=mxCreateStructArray(ndim,dimensions,numfields,fnames);
    59 
    60         mxSetField(bamggeom_mat,0,"NumVertices",mxCreateDoubleScalar(bamggeom->NumVertices));
    6152
    6253        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    6758        mxSetField(bamggeom_mat,0,"Vertices",pfield2);
    6859
    69         mxSetField(bamggeom_mat,0,"NumEdges",mxCreateDoubleScalar(bamggeom->NumEdges));
    70 
    7160        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    7261        mxSetM(pfield,3);
     
    7564        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    7665        mxSetField(bamggeom_mat,0,"Edges",pfield2);
    77 
    78         mxSetField(bamggeom_mat,0,"NumTangentAtEdges",mxCreateDoubleScalar(bamggeom->NumTangentAtEdges));
    7966
    8067        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    8572        mxSetField(bamggeom_mat,0,"TangentAtEdges",pfield2);
    8673
    87         mxSetField(bamggeom_mat,0,"NumRequiredVertices",mxCreateDoubleScalar(bamggeom->NumRequiredVertices));
    88 
    8974        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    9075        mxSetM(pfield,1);
     
    9378        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    9479        mxSetField(bamggeom_mat,0,"RequiredVertices",pfield2);
    95 
    96         mxSetField(bamggeom_mat,0,"NumRequiredEdges",mxCreateDoubleScalar(bamggeom->NumRequiredEdges));
    9780
    9881        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    10386        mxSetField(bamggeom_mat,0,"RequiredEdges",pfield2);
    10487
    105         mxSetField(bamggeom_mat,0,"NumCrackedEdges",mxCreateDoubleScalar(bamggeom->NumCrackedEdges));
    106 
    10788        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    10889        mxSetM(pfield,2);
     
    11192        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    11293        mxSetField(bamggeom_mat,0,"CrackedEdges",pfield2);
    113 
    114         mxSetField(bamggeom_mat,0,"NumSubDomains",mxCreateDoubleScalar(bamggeom->NumSubDomains));
    11594
    11695        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
  • issm/trunk/src/c/objects/BamgMesh.cpp

    r3309 r3311  
    4949        mxArray*    pfield=NULL;
    5050        mxArray*    pfield2=NULL;
    51         int         numfields=31;
     51        int         numfields=15;
    5252        const char* fnames[numfields];
    5353        mwSize      ndim=2;
    5454        mwSize      dimensions[2]={1,1};
    5555
    56         fnames[0]  = "NumTriangles";
    57         fnames[1]  = "Triangles";
    58         fnames[2]  = "NumVertices";
    59         fnames[3]  = "Vertices";
    60         fnames[4]  = "NumEdges";
    61         fnames[5]  = "Edges";
    62         fnames[6]  = "NumSegments";
    63         fnames[7]  = "Segments";
    64         fnames[8]  = "NumAllEdges";
    65         fnames[9]  = "AllEdges";
    66         fnames[10] = "SegmentsMarkers";
    67         fnames[11] = "NumCrackedEdges";
    68         fnames[12] = "CrackedEdges";
    69         fnames[13] = "NumQuadrilaterals";
    70         fnames[14] = "Quadrilaterals";
    71         fnames[15] = "NumVerticesOnGeometricVertex";
    72         fnames[16] = "VerticesOnGeometricVertex";
    73         fnames[17] = "NumVerticesOnGeometricEdge";
    74         fnames[18] = "VerticesOnGeometricEdge";
    75         fnames[19] = "NumEdgesOnGeometricEdge";
    76         fnames[20] = "EdgesOnGeometricEdge";
    77         fnames[21] = "NumSubDomains";
    78         fnames[22] = "SubDomains";
    79         fnames[23] = "NumSubDomainsFromGeom";
    80         fnames[24] = "SubDomainsFromGeom";
    81         fnames[25] = "NumElementConnectivity";
    82         fnames[26] = "ElementConnectivity";
    83         fnames[27] = "NumNodalConnectivity";
    84         fnames[28] = "NodalConnectivity";
    85         fnames[29] = "NumNodalElementConnectivity";
    86         fnames[30] = "NodalElementConnectivity";
     56        fnames[0]  = "Triangles";
     57        fnames[1]  = "Vertices";
     58        fnames[2]  = "Edges";
     59        fnames[3]  = "Segments";
     60        fnames[4]  = "AllEdges";
     61        fnames[5] = "CrackedEdges";
     62        fnames[6] = "Quadrilaterals";
     63        fnames[7] = "VerticesOnGeometricVertex";
     64        fnames[8] = "VerticesOnGeometricEdge";
     65        fnames[9] = "EdgesOnGeometricEdge";
     66        fnames[10]= "SubDomains";
     67        fnames[11]= "SubDomainsFromGeom";
     68        fnames[12]= "ElementConnectivity";
     69        fnames[13]= "NodalConnectivity";
     70        fnames[14]= "NodalElementConnectivity";
    8771
    8872        bamgmesh_mat=mxCreateStructArray(ndim,dimensions,numfields,fnames);
     
    9781        mxSetField(bamgmesh_mat,0,"Triangles",pfield2);
    9882
    99         mxSetField(bamgmesh_mat,0,"NumVertices",mxCreateDoubleScalar(bamgmesh->NumVertices));
    100 
    10183        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    10284        mxSetM(pfield,3);
     
    10587        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    10688        mxSetField(bamgmesh_mat,0,"Vertices",pfield2);
    107 
    108         mxSetField(bamgmesh_mat,0,"NumEdges",mxCreateDoubleScalar(bamgmesh->NumEdges));
    10989
    11090        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    11595        mxSetField(bamgmesh_mat,0,"Edges",pfield2);
    11696
    117         mxSetField(bamgmesh_mat,0,"NumSegments",mxCreateDoubleScalar(bamgmesh->NumSegments));
    118 
    11997        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    120         mxSetM(pfield,3);
     98        mxSetM(pfield,4);
    12199        mxSetN(pfield,bamgmesh->NumSegments);
    122100        mxSetPr(pfield,bamgmesh->Segments);
    123101        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    124102        mxSetField(bamgmesh_mat,0,"Segments",pfield2);
    125 
    126         mxSetField(bamgmesh_mat,0,"NumAllEdges",mxCreateDoubleScalar(bamgmesh->NumAllEdges));
    127103
    128104        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    134110
    135111        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    136         mxSetM(pfield,1);
    137         mxSetN(pfield,bamgmesh->NumSegments);
    138         mxSetPr(pfield,bamgmesh->SegmentsMarkers);
    139         mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    140         mxSetField(bamgmesh_mat,0,"SegmentsMarkers",pfield2);
    141 
    142         mxSetField(bamgmesh_mat,0,"NumCrackedEdges",mxCreateDoubleScalar(bamgmesh->NumCrackedEdges));
    143 
    144         pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    145112        mxSetM(pfield,2);
    146113        mxSetN(pfield,bamgmesh->NumCrackedEdges);
     
    148115        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    149116        mxSetField(bamgmesh_mat,0,"CrackedEdges",pfield2);
    150 
    151         mxSetField(bamgmesh_mat,0,"NumQuadrilaterals",mxCreateDoubleScalar(bamgmesh->NumQuadrilaterals));
    152117
    153118        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    158123        mxSetField(bamgmesh_mat,0,"Quadrilaterals",pfield2);
    159124
    160         mxSetField(bamgmesh_mat,0,"NumVerticesOnGeometricVertex",mxCreateDoubleScalar(bamgmesh->NumVerticesOnGeometricVertex));
    161 
    162125        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    163126        mxSetM(pfield,2);
     
    166129        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    167130        mxSetField(bamgmesh_mat,0,"VerticesOnGeometricVertex",pfield2);
    168 
    169         mxSetField(bamgmesh_mat,0,"NumVerticesOnGeometricEdge",mxCreateDoubleScalar(bamgmesh->NumVerticesOnGeometricEdge));
    170131
    171132        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    176137        mxSetField(bamgmesh_mat,0,"VerticesOnGeometricEdge",pfield2);
    177138
    178         mxSetField(bamgmesh_mat,0,"NumEdgesOnGeometricEdge",mxCreateDoubleScalar(bamgmesh->NumEdgesOnGeometricEdge));
    179 
    180139        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    181140        mxSetM(pfield,2);
     
    184143        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    185144        mxSetField(bamgmesh_mat,0,"EdgesOnGeometricEdge",pfield2);
    186 
    187         mxSetField(bamgmesh_mat,0,"NumSubDomains",mxCreateDoubleScalar(bamgmesh->NumSubDomains));
    188145
    189146        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    194151        mxSetField(bamgmesh_mat,0,"SubDomains",pfield2);
    195152
    196         mxSetField(bamgmesh_mat,0,"NumSubDomainsFromGeom",mxCreateDoubleScalar(bamgmesh->NumSubDomainsFromGeom));
    197 
    198153        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    199154        mxSetM(pfield,4);
     
    202157        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    203158        mxSetField(bamgmesh_mat,0,"SubDomainsFromGeom",pfield2);
    204 
    205         mxSetField(bamgmesh_mat,0,"NumElementConnectivity",mxCreateDoubleScalar(bamgmesh->NumElementConnectivity));
    206159
    207160        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
     
    212165        mxSetField(bamgmesh_mat,0,"ElementConnectivity",pfield2);
    213166
    214         mxSetField(bamgmesh_mat,0,"NumNodalConnectivity",mxCreateDoubleScalar(bamgmesh->NumNodalConnectivity));
    215 
    216167        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
    217168        mxSetM(pfield,2);
     
    220171        mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
    221172        mxSetField(bamgmesh_mat,0,"NodalConnectivity",pfield2);
    222 
    223         mxSetField(bamgmesh_mat,0,"NumNodalElementConnectivity",mxCreateDoubleScalar(bamgmesh->NumNodalElementConnectivity));
    224173
    225174        pfield=mxCreateDoubleMatrix(0,0,mxREAL);
  • issm/trunk/src/m/classes/@bamggeom/bamggeom.m

    r3277 r3311  
    88case 0
    99        % if no input arguments, create a default object
    10         bg.NumVertices=0;
    1110        bg.Vertices=[];
    12 
    13         bg.NumEdges=0;
    14         bg.Edges=zeros(0,3);
    15 
    16         bg.NumTangentAtEdges=0;
     11        bg.Edges=[];
    1712        bg.TangentAtEdges=[];
    18 
    19         bg.NumCorners=0;
    2013        bg.Corners=[];
    21 
    22         bg.NumRequiredVertices=0;
    2314        bg.RequiredVertices=[];
    24 
    25         bg.NumRequiredEdges=0;
    2615        bg.RequiredEdges=[];
    27 
    28         bg.NumCrackedEdges=0;
    29         bg.CrackedEdges=zeros(0,3);
    30 
     16        bg.CrackedEdges=[];
    3117        bg.hVertices=[];
    32         bg.MetricVertices=zeros(0,3);
     18        bg.MetricVertices=[];
    3319        bg.h1h2VpVertices=[];
    34 
    35         bg.NumSubDomains=0;
    36         bg.SubDomains=zeros(0,4);
     20        bg.SubDomains=[];
    3721
    3822        bg=class(bg,'bamggeom');
  • issm/trunk/src/m/classes/@bamgmesh/bamgmesh.m

    r3309 r3311  
    88case 0
    99        % if no input arguments, create a default object
    10         bm.NumVertices=0;
    1110        bm.Vertices=[];
    12 
    13         bm.NumEdges=0;
    14         bm.Edges=zeros(0,3);
    15 
    16         bm.NumTriangles=0;
     11        bm.Edges=[];
    1712        bm.Triangles=[];
    18 
    19         bm.NumQuadrilaterals=0;
    2013        bm.Quadrilaterals=[];
    21 
    22         bm.NumAllEdges=0;
    23         bm.AllEdges=zeros(0,2);
    24 
    25         bm.NumSegments=0;
    26         bm.Segments=zeros(0,3);
    27         bm.SegmentsMarkers=[];
    28 
    29         bm.NumVerticesOnGeometricVertex=0;
    30         bm.VerticesOnGeometricVertex=zeros(0,2);
    31 
    32         bm.NumVerticesOnGeometricEdge=0;
    33         bm.VerticesOnGeometricEdge=zeros(0,2);
    34 
    35         bm.NumEdgesOnGeometricEdge=0;
    36         bm.EdgesOnGeometricEdge=zeros(0,2);
    37 
    38         bm.NumCrackedEdges=0;
    39         bm.CrackedEdges=zeros(0,2);
    40 
    41         bm.NumSubDomains=0;
    42         bm.SubDomains=zeros(0,4);
    43 
    44         bm.NumSubDomainsFromGeom=0;
    45         bm.SubDomainsFromGeom=zeros(0,4);
    46 
    47         bm.NumElementConnectivity=0;
    48         bm.ElementConnectivity=zeros(0,3);
    49 
    50         bm.NumNodalConnectivity=0;
    51         bm.NodalConnectivity=zeros(0,2);
    52 
    53         bm.NumNodalElementConnectivity=0;
     14        bm.AllEdges=[];
     15        bm.Segments=[];
     16        bm.VerticesOnGeometricVertex=[];
     17        bm.VerticesOnGeometricEdge=[];
     18        bm.EdgesOnGeometricEdge=[];
     19        bm.CrackedEdges=[];
     20        bm.SubDomains=[];
     21        bm.SubDomainsFromGeom=[];
     22        bm.ElementConnectivity=[];
     23        bm.NodalConnectivity=[];
    5424        bm.NodalElementConnectivity=[];
    55 
    5625        bm.hVertices=[];
    5726
  • issm/trunk/src/m/classes/public/bamg.m

    r3307 r3311  
    216216
    217217end
    218 
    219 %update other fields of bamg_geometry
    220 bamg_geometry.NumVertices=size(bamg_geometry.Vertices,1);
    221 bamg_geometry.NumEdges=size(bamg_geometry.Edges,1);
    222 bamg_geometry.NumSubDomains=size(bamg_geometry.SubDomains,1);
    223218%}}}
    224219
     
    229224                bamg_mesh=bamgmesh(md.bamg.mesh);
    230225        else
    231                 bamg_mesh.NumVertices=md.numberofgrids;
    232226                bamg_mesh.Vertices=[md.x md.y ones(md.numberofgrids,1)];
    233                 bamg_mesh.NumTriangles=md.numberofelements;
    234227                bamg_mesh.Triangles=[md.elements ones(md.numberofelements,1)];
    235228        end
     
    286279md.y=bamgmesh_out.Vertices(:,2);
    287280md.elements=bamgmesh_out.Triangles(:,1:3);
    288 md.segments=bamgmesh_out.Segments;
    289 md.segmentmarkers=bamgmesh_out.SegmentsMarkers;
     281md.segments=bamgmesh_out.Segments(:,1:3);
     282md.segmentmarkers=bamgmesh_out.Segments(:,4);
    290283
    291284%Fill in rest of fields:
  • issm/trunk/src/mex/Bamg/Bamg.cpp

    r3309 r3311  
    2626        /*create bamg geometry input*/
    2727        BamgGeomInit(&bamggeom_in);
    28         FetchData(&bamggeom_in.NumVertices,mxGetField(BAMGGEOMETRY,0,"NumVertices"));
    29         FetchData(&bamggeom_in.Vertices,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"Vertices"));
    30         FetchData(&bamggeom_in.NumEdges,mxGetField(BAMGGEOMETRY,0,"NumEdges"));
    31         FetchData(&bamggeom_in.Edges,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"Edges"));
    32         FetchData(&bamggeom_in.NumCorners,mxGetField(BAMGGEOMETRY,0,"NumCorners"));
    33         FetchData(&bamggeom_in.Corners,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"Corners"));
    34         FetchData(&bamggeom_in.NumRequiredVertices,mxGetField(BAMGGEOMETRY,0,"NumRequiredVertices"));
    35         FetchData(&bamggeom_in.RequiredVertices,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"RequiredVertices"));
    36         FetchData(&bamggeom_in.NumRequiredEdges,mxGetField(BAMGGEOMETRY,0,"NumRequiredEdges"));
    37         FetchData(&bamggeom_in.RequiredEdges,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"RequiredEdges"));
     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"));
    3833        FetchData(&bamggeom_in.hVertices,&lines,&cols,mxGetField(BAMGGEOMETRY,0,"hVertices"));
    39         FetchData(&bamggeom_in.NumCrackedEdges,mxGetField(BAMGGEOMETRY,0,"NumCrackedEdges"));
    40         FetchData(&bamggeom_in.CrackedEdges,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"CrackedEdges"));
    41         FetchData(&bamggeom_in.NumSubDomains,mxGetField(BAMGGEOMETRY,0,"NumSubDomains"));
    42         FetchData(&bamggeom_in.SubDomains,NULL,NULL,mxGetField(BAMGGEOMETRY,0,"SubDomains"));
     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"));
    4336        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));}
    4437
    4538        /*create bamg mesh input*/
    4639        BamgMeshInit(&bamgmesh_in);
    47         FetchData(&bamgmesh_in.NumVertices,mxGetField(BAMGMESH,0,"NumVertices"));
    48         FetchData(&bamgmesh_in.Vertices,NULL,NULL,mxGetField(BAMGMESH,0,"Vertices"));
    49         FetchData(&bamgmesh_in.NumTriangles,mxGetField(BAMGMESH,0,"NumTriangles"));
    50         FetchData(&bamgmesh_in.Triangles,NULL,NULL,mxGetField(BAMGMESH,0,"Triangles"));
     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"));
    5142        FetchData(&bamgmesh_in.hVertices,&lines,&cols,mxGetField(BAMGMESH,0,"hVertices"));
    52         FetchData(&bamgmesh_in.NumSegments,mxGetField(BAMGMESH,0,"NumSegments"));
    53         FetchData(&bamgmesh_in.Segments,NULL,NULL,mxGetField(BAMGMESH,0,"Segments"));
    54         FetchData(&bamgmesh_in.SegmentsMarkers,NULL,NULL,mxGetField(BAMGMESH,0,"SegmentsMarkers"));
    55         FetchData(&bamgmesh_in.NumCrackedEdges,mxGetField(BAMGMESH,0,"NumCrackedEdges"));
    56         FetchData(&bamgmesh_in.CrackedEdges,NULL,NULL,mxGetField(BAMGMESH,0,"CrackedEdges"));
    57         FetchData(&bamgmesh_in.NumEdges,mxGetField(BAMGMESH,0,"NumEdges"));
    58         FetchData(&bamgmesh_in.Edges,NULL,NULL,mxGetField(BAMGMESH,0,"Edges"));
    59         FetchData(&bamgmesh_in.NumEdgesOnGeometricEdge,mxGetField(BAMGMESH,0,"NumEdgesOnGeometricEdge"));
    60         FetchData(&bamgmesh_in.EdgesOnGeometricEdge,NULL,NULL,mxGetField(BAMGMESH,0,"EdgesOnGeometricEdge"));
    61         FetchData(&bamgmesh_in.NumVerticesOnGeometricEdge,mxGetField(BAMGMESH,0,"NumVerticesOnGeometricEdge"));
    62         FetchData(&bamgmesh_in.VerticesOnGeometricEdge,NULL,NULL,mxGetField(BAMGMESH,0,"VerticesOnGeometricEdge"));
    63         FetchData(&bamgmesh_in.NumVerticesOnGeometricVertex,mxGetField(BAMGMESH,0,"NumVerticesOnGeometricVertex"));
    64         FetchData(&bamgmesh_in.VerticesOnGeometricVertex,NULL,NULL,mxGetField(BAMGMESH,0,"VerticesOnGeometricVertex"));
     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"));
    6549        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));}
    6650
Note: See TracChangeset for help on using the changeset viewer.