$search
00001 /* 00002 James R. Diebel 00003 Stanford University 00004 00005 Started: 10 January 2005 00006 00007 smoothmsh.cc - Utility to smooth a MSH file 00008 00009 Depends on: 00010 - Mesh class (mesh.hh) 00011 -- Vec3d class (vec3d.hh) 00012 -- Vert class (vert.hh) 00013 -- Edge class (edge.hh) 00014 -- Face class (face.hh) 00015 - Timer class (timer.hh) 00016 - TriMesh class (trimesh.h) 00017 */ 00018 00019 00020 #include <iostream> 00021 #include "bmtk/mesh.hh" 00022 #include "bmtk/timer.hh" 00023 #include <trimesh/trimesh.h> 00024 00025 using namespace std; 00026 using namespace bmtk; 00027 00028 int main (int argc, char *argv[]) { 00029 // if bad command line args, give usage instructions and exit 00030 if (argc < 2) { 00031 cout << endl 00032 << "Usage: smoothmsh infile.msh" << endl 00033 << " infile.msh must be an msh file" << endl; 00034 exit(1); 00035 } 00036 00037 // read Mesh from file 00038 Mesh m; 00039 m.readMesh(argv[1]); 00040 00041 // find mesh properties that are independent of options 00042 m.findMeshProps(); 00043 //m.normalize(); 00044 m.findRegionProps(); 00045 00046 // find mesh properties that depend on options 00047 m.readOptions("mrf_options.dat"); 00048 m.findMeshPotential(); 00049 m.findLocalEdgePotentials(); 00050 m.findVertGradients(); 00051 m.findSearchDirs(true); 00052 00053 // Run the optimization 00054 m.runCG(); 00055 00056 // Save the mesh to file 00057 m.writeMesh(m.filename); 00058 00059 return 0; 00060 }