[1] | 1 | /*
|
---|
[11932] | 2 | * TriMesh: mesh a domain using an .exp file
|
---|
[1] | 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./TriMesh.h"
|
---|
| 6 |
|
---|
[13236] | 7 | void TriMeshUsage(void){/*{{{*/
|
---|
[15105] | 8 | _printf_("\n");
|
---|
| 9 | _printf_(" usage: [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,area) \n");
|
---|
| 10 | _printf_(" where: index,x,y defines a triangulation, segments is an array made \n");
|
---|
| 11 | _printf_(" of exterior segments to the mesh domain outline, segmentmarkers is an array flagging each segment, \n");
|
---|
| 12 | _printf_(" outlinefilename an Argus domain outline file, \n");
|
---|
| 13 | _printf_(" area is the maximum area desired for any element of the resulting mesh, \n");
|
---|
| 14 | _printf_("\n");
|
---|
[13236] | 15 | }/*}}}*/
|
---|
[19716] | 16 | WRAPPER(TriMesh){
|
---|
[19702] | 17 |
|
---|
[13355] | 18 | /*intermediary: */
|
---|
[15335] | 19 | double area;
|
---|
| 20 | Contours *domain = NULL;
|
---|
| 21 | Contours *rifts = NULL;
|
---|
[1] | 22 |
|
---|
[11932] | 23 | /* output: */
|
---|
[14673] | 24 | int *index = NULL;
|
---|
| 25 | double *x = NULL;
|
---|
| 26 | double *y = NULL;
|
---|
| 27 | int *segments = NULL;
|
---|
| 28 | int *segmentmarkerlist = NULL;
|
---|
[19702] | 29 | int nel,nods,nsegs;
|
---|
[1] | 30 |
|
---|
[11932] | 31 | /*Boot module: */
|
---|
| 32 | MODULEBOOT();
|
---|
[1] | 33 |
|
---|
[12112] | 34 | /*checks on arguments: */
|
---|
[11932] | 35 | CHECKARGUMENTS(NLHS,NRHS,&TriMeshUsage);
|
---|
[15106] | 36 |
|
---|
[11932] | 37 | /*Fetch data needed for meshing: */
|
---|
[13355] | 38 | FetchData(&domain,DOMAINOUTLINE);
|
---|
| 39 | FetchData(&rifts,RIFTSOUTLINE);
|
---|
[11932] | 40 | FetchData(&area,AREA);
|
---|
[1] | 41 |
|
---|
[11932] | 42 | /*call x core: */
|
---|
[19702] | 43 | TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,&nel,&nods,&nsegs,domain,rifts,area);
|
---|
[12093] | 44 |
|
---|
[11932] | 45 | /*write outputs: */
|
---|
[19702] | 46 | WriteData(INDEX,index,nel,3);
|
---|
[14673] | 47 | WriteData(X,x,nods);
|
---|
| 48 | WriteData(Y,y,nods);
|
---|
| 49 | WriteData(SEGMENTS,segments,nsegs,3);
|
---|
| 50 | WriteData(SEGMENTMARKERLIST,segmentmarkerlist,nsegs);
|
---|
[11882] | 51 |
|
---|
[11932] | 52 | /*free ressources: */
|
---|
| 53 | delete domain;
|
---|
[12093] | 54 | delete rifts;
|
---|
[14956] | 55 | xDelete<int>(index);
|
---|
| 56 | xDelete<double>(x);
|
---|
| 57 | xDelete<double>(y);
|
---|
| 58 | xDelete<int>(segments);
|
---|
| 59 | xDelete<int>(segmentmarkerlist);
|
---|
[11882] | 60 |
|
---|
[11932] | 61 | /*end module: */
|
---|
| 62 | MODULEEND();
|
---|
[1] | 63 | }
|
---|