source: issm/trunk-jpl/src/wrappers/TriMesh/TriMesh.cpp@ 14221

Last change on this file since 14221 was 14221, checked in by Mathieu Morlighem, 12 years ago

CHG: index and segments are now integers

File size: 1.6 KB
Line 
1/*
2 * TriMesh: mesh a domain using an .exp file
3 */
4
5#include "./TriMesh.h"
6
7void 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}/*}}}*/
16WRAPPER(TriMesh){
17
18 /*intermediary: */
19 double area;
20 DataSet *domain = NULL;
21 DataSet *rifts = NULL;
22
23 /* output: */
24 SeqMat<int> *index = NULL;
25 SeqVec<double> *x = NULL;
26 SeqVec<double> *y = NULL;
27 SeqMat<int> *segments = NULL;
28 SeqVec<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}
Note: See TracBrowser for help on using the repository browser.