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