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

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

CHG: implementation of revised ISSM toolkit.
We now have the following objects in the ISSM toolkit:
IssmMat and IssmVec: these are the wrappers to all our toolkit objects. These are hooked up to the
src/c/objects/matrix/Matrix.h and Vector.h objects.
We need of course enums that go with them, which map into Petsc constructs, such as MpiDenseEnum, DenseEnum,
etc ...
The toolkit now implements a MatDense matrix, and a future MatMpiDense matrix, as well as a SeqVec and
future MpiVec vector.
There is also an abstract class, called IssmAbsMat and IssmAbsVec, from which all our matrix and vector objects,
except for IssmMat and IssmVec, derive.
Updated all the wrappers and modules to use these new objects.
The toolkit options database is derived from the .toolkit file which is read at the beginning of any run. Very similar
to what Petsc does with its options database. Created a static class to hold this options database, in src/c/classes/ToolkitOptions.h
very similar to our static class holding the IssmComm.

File size: 1.6 KB
RevLine 
[1]1/*
[11932]2 * TriMesh: mesh a domain using an .exp file
[1]3 */
4
5#include "./TriMesh.h"
6
[13236]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}/*}}}*/
[11969]16WRAPPER(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}
Note: See TracBrowser for help on using the repository browser.