| 1 | /*
|
|---|
| 2 | * TriMesh: mesh a domain using an .exp file
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | #include "./TriMesh.h"
|
|---|
| 6 |
|
|---|
| 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 | }/*}}}*/
|
|---|
| 16 | WRAPPER(TriMesh){
|
|---|
| 17 |
|
|---|
| 18 | /*intermediary: */
|
|---|
| 19 | double area;
|
|---|
| 20 | DataSet *domain = NULL;
|
|---|
| 21 | DataSet *rifts = NULL;
|
|---|
| 22 |
|
|---|
| 23 | /* output: */
|
|---|
| 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;
|
|---|
| 29 |
|
|---|
| 30 | /*Boot module: */
|
|---|
| 31 | MODULEBOOT();
|
|---|
| 32 |
|
|---|
| 33 | /*checks on arguments: */
|
|---|
| 34 | CHECKARGUMENTS(NLHS,NRHS,&TriMeshUsage);
|
|---|
| 35 |
|
|---|
| 36 | /*Fetch data needed for meshing: */
|
|---|
| 37 | FetchData(&domain,DOMAINOUTLINE);
|
|---|
| 38 | FetchData(&rifts,RIFTSOUTLINE);
|
|---|
| 39 | FetchData(&area,AREA);
|
|---|
| 40 |
|
|---|
| 41 | /*call x core: */
|
|---|
| 42 | TriMeshx(&index,&x,&y,&segments,&segmentmarkerlist,domain,rifts,area);
|
|---|
| 43 |
|
|---|
| 44 | /*write outputs: */
|
|---|
| 45 | WriteData(INDEX,index);
|
|---|
| 46 | WriteData(X,x);
|
|---|
| 47 | WriteData(Y,y);
|
|---|
| 48 | WriteData(SEGMENTS,segments);
|
|---|
| 49 | WriteData(SEGMENTMARKERLIST,segmentmarkerlist);
|
|---|
| 50 |
|
|---|
| 51 | /*free ressources: */
|
|---|
| 52 | delete domain;
|
|---|
| 53 | delete rifts;
|
|---|
| 54 | delete index;
|
|---|
| 55 | delete x;
|
|---|
| 56 | delete y;
|
|---|
| 57 | delete segments;
|
|---|
| 58 | delete segmentmarkerlist;
|
|---|
| 59 |
|
|---|
| 60 | /*end module: */
|
|---|
| 61 | MODULEEND();
|
|---|
| 62 | }
|
|---|