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

Last change on this file since 19716 was 19716, checked in by Eric.Larour, 9 years ago

CHG: new ElementConnectivity javascript module. Simplified the WRAPPER macro, back to what it
was before javascript modifications. The header file for the wrapper now defines WRAPPER.

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