Changeset 15396 for issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
- Timestamp:
- 07/02/13 09:24:16 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:ignore
-
old new 1 par 2 ad 3 proj-* 1 4 projects 2 5 autom4te.cache
-
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 14311,14313,14316-14506,14508-15387,15390-15392
- Property svn:ignore
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
r13975 r15396 3 3 */ 4 4 #include "./Bamgx.h" 5 #include "../../ classes/bamg/bamgobjects.h"5 #include "../../bamg/bamgobjects.h" 6 6 #include "../../shared/shared.h" 7 #include "../../include/include.h"8 7 #include "../../toolkits/toolkits.h" 9 8 … … 41 40 42 41 //Step1: generate geometry Gh 43 if (verbosity>0) _print Line_("Construction of a mesh from a given geometry");44 if (verbosity>1) _print Line_(" Processing geometry...");42 if (verbosity>0) _printf_("Construction of a mesh from a given geometry\n"); 43 if (verbosity>1) _printf_(" Processing geometry...\n"); 45 44 Geometry Gh(bamggeom_in,bamgopts); 46 45 … … 50 49 51 50 //build metric using geometry 52 if (verbosity>1) _print Line_(" Generating Metric...");51 if (verbosity>1) _printf_(" Generating Metric...\n"); 53 52 for(i=0;i<Gh.nbv;i++){ 54 53 Metric M=Gh[i]; … … 60 59 61 60 //generate mesh 62 if (verbosity>1) _print Line_(" Generating Mesh...");61 if (verbosity>1) _printf_(" Generating Mesh...\n"); 63 62 Mesh Th(maxnbv,Gh,bamgopts); 64 63 … … 73 72 74 73 //Build output 75 if (verbosity>1) _print Line_(" Write Mesh...");74 if (verbosity>1) _printf_(" Write Mesh...\n"); 76 75 Th.WriteMesh(bamgmesh_out,bamgopts); 77 if (verbosity>1) _print Line_(" Write Geometry...");76 if (verbosity>1) _printf_(" Write Geometry...\n"); 78 77 Gh.WriteGeometry(bamggeom_out,bamgopts); 79 78 … … 87 86 88 87 // read background mesh 89 if (verbosity>0) _print Line_("Anisotropic mesh adaptation");90 if (verbosity>1) _print Line_(" Processing initial mesh and geometry...");88 if (verbosity>0) _printf_("Anisotropic mesh adaptation\n"); 89 if (verbosity>1) _printf_(" Processing initial mesh and geometry...\n"); 91 90 Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts); 92 91 … … 100 99 //Generate initial metric 101 100 if (bamgopts->metric){ 102 if (verbosity>1) _print Line_(" Processing Metric...");101 if (verbosity>1) _printf_(" Processing Metric...\n"); 103 102 BTh.ReadMetric(bamgopts); 104 103 } 105 104 else { 106 if (verbosity>1) _print Line_(" Generating initial Metric...");105 if (verbosity>1) _printf_(" Generating initial Metric...\n"); 107 106 Metric Mhmax(bamgopts->hmax); 108 107 for (int iv=0;iv<BTh.nbv;iv++) BTh[iv].m = Mhmax; … … 111 110 //use present fields to generate metric if present 112 111 if (bamgopts->field){ 113 if (verbosity>1) _print Line_(" Merge metric with field provided...");112 if (verbosity>1) _printf_(" Merge metric with field provided...\n"); 114 113 BTh.AddMetric(bamgopts); 115 114 } … … 117 116 // change using hVertices if provided 118 117 if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==BTh.nbv){ 119 if (verbosity>1) _print Line_(" Merging Metric with hVertices...");118 if (verbosity>1) _printf_(" Merging Metric with hVertices...\n"); 120 119 for (i=0;i<BTh.nbv;i++){ 121 120 if (!xIsNan<IssmPDouble>(bamgopts->hVertices[i])){ … … 127 126 // change using hminVertices if provided 128 127 if (bamgopts->hminVertices){ 129 if (verbosity>1) _print Line_(" Merging Metric with hminVertices...");128 if (verbosity>1) _printf_(" Merging Metric with hminVertices...\n"); 130 129 for (i=0;i<BTh.nbv;i++){ 131 130 if (!xIsNan<IssmPDouble>(bamgopts->hminVertices[i])){ … … 140 139 // change using hmaxVertices if provided 141 140 if (bamgopts->hmaxVertices){ 142 if (verbosity>1) _print Line_(" Merging Metric with hmaxVertices...");141 if (verbosity>1) _printf_(" Merging Metric with hmaxVertices...\n"); 143 142 for (i=0;i<BTh.nbv;i++){ 144 143 if (!xIsNan<IssmPDouble>(bamgopts->hmaxVertices[i])){ … … 164 163 165 164 //Build new mesh 166 if (verbosity>1) _print Line_(" Generating Mesh...");165 if (verbosity>1) _printf_(" Generating Mesh...\n"); 167 166 Thr=&BTh,Thb=0; 168 167 Mesh & Th( *(0 ? new Mesh(*Thr,&Thr->Gh,Thb,maxnbv) : new Mesh(maxnbv,BTh,bamgopts,bamgopts->KeepVertices))); … … 185 184 if(verbosity>0) { 186 185 if (Th.nbt-Th.nbtout-Th.nbq*2){ 187 _print Line_(" new number of triangles = " << (Th.nbt-Th.nbtout-Th.nbq*2));186 _printf_(" new number of triangles = " << (Th.nbt-Th.nbtout-Th.nbq*2) << "\n"); 188 187 } 189 188 if (Th.nbq ){ 190 _print Line_(" new number of quads = " << Th.nbq);189 _printf_(" new number of quads = " << Th.nbq << "\n"); 191 190 } 192 191 } 193 192 194 193 //Build output 195 if (verbosity>1) _print Line_(" Write Mesh...");194 if (verbosity>1) _printf_(" Write Mesh...\n"); 196 195 Th.WriteMesh(bamgmesh_out,bamgopts); 197 if (verbosity>1) _print Line_(" Write Geometry...");196 if (verbosity>1) _printf_(" Write Geometry...\n"); 198 197 Th.Gh.WriteGeometry(bamggeom_out,bamgopts); 199 if (verbosity>1) _print Line_(" Write Metric...");198 if (verbosity>1) _printf_(" Write Metric...\n"); 200 199 BTh.WriteMetric(bamgopts); 201 200 … … 207 206 208 207 /*No error return*/ 209 if (verbosity>1) _print Line_(" Exiting Bamg.");208 if (verbosity>1) _printf_(" Exiting Bamg.\n"); 210 209 return noerr; 211 210
Note:
See TracChangeset
for help on using the changeset viewer.