MOAB: Mesh Oriented datABase  (version 5.3.0)
voshell.cpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2010 Sandia National Laboratories.  Developed at the
00005     University of Wisconsin--Madison under SNL contract number
00006     624796.  The U.S. Government and the University of Wisconsin
00007     retain certain rights to this software.
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Lesser General Public
00011     License as published by the Free Software Foundation; either
00012     version 2.1 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     (lgpl.txt) along with this library; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023     (2011) kraftche@cae.wisc.edu
00024 
00025   ***************************************************************** */
00026 
00027 /** \file voshell.cpp
00028  *  \brief Implement some of the examples from N. Voshell.
00029  *  \author Jason Kraftcheck
00030  *  \author Nick Voshell
00031  */
00032 
00033 #include "TestUtil.hpp"
00034 #include "ShapeImprover.hpp"
00035 #include "UntangleWrapper.hpp"
00036 #include "MeshImpl.hpp"
00037 #include "MsqError.hpp"
00038 #include "QualityAssessor.hpp"
00039 
00040 #include "PlanarDomain.hpp"
00041 #include "CylinderDomain.hpp"
00042 #include "SphericalDomain.hpp"
00043 #include "MeshDomain1D.hpp"
00044 #include "DomainClassifier.hpp"
00045 
00046 #include "HexLagrangeShape.hpp"
00047 #include "TestUtil.hpp"
00048 
00049 #include <iostream>
00050 #include <string>
00051 #include <cstdlib>
00052 
00053 using namespace MBMesquite;
00054 
00055 std::string get_homogenious_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00056 
00057 std::string get_part_example_tri( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00058 
00059 std::string get_part_example_quad( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00060 
00061 std::string get_sphere_cube_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00062 
00063 std::string get_cut_cube_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00064 
00065 std::string get_sphere_cylinder_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00066 
00067 std::string get_hex_3d_part_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00068 
00069 typedef std::string ( *example_setup_t )( DomainClassifier& geom, MeshImpl& mesh, MsqError& err );
00070 struct Example
00071 {
00072     char flag;
00073     example_setup_t func;
00074     const char* desc;
00075 };
00076 
00077 int run_example( const Example& e, bool write_output_file );
00078 
00079 const Example examples[] = { { 'H', &get_homogenious_example, "homogenous mesh (curvey surface) example" },
00080                              { 't', &get_part_example_tri, "part mesh with triangles" },
00081                              { 'q', &get_part_example_quad, "part mesh with quads" },
00082                              { 'c', &get_sphere_cube_example, "cube with subtracted hemisphere" },
00083                              { 'l', &get_cut_cube_example, "cube with slot removed" },
00084                              { 's', &get_sphere_cylinder_example, "cylinder with subtracted sphere" },
00085                              { 'x', &get_hex_3d_part_example, "rectangular prism with two cylindrical slots" } };
00086 const int num_examples   = sizeof( examples ) / sizeof( examples[0] );
00087 
00088 void usage( const char* argv0, bool help = false )
00089 {
00090     std::cerr << "Usage: " << argv0 << "[-w] ";
00091     for( int i = 0; i < num_examples; ++i )
00092         std::cerr << " [-" << examples[i].flag << "]";
00093     std::cerr << std::endl;
00094 
00095     if( !help )
00096     {
00097         std::cerr << "       " << argv0 << " -h" << std::endl;
00098         std::exit( 1 );
00099     }
00100     std::cerr << "  -w : Write final meshes to VTK file" << std::endl;
00101     std::cerr << "NOTE: If no options are specified, all examples will be run" << std::endl;
00102     for( int i = 0; i < num_examples; ++i )
00103         std::cerr << "  -" << examples[i].flag << " : Run " << examples[i].desc << std::endl;
00104     std::cerr << std::endl;
00105     std::exit( 0 );
00106 }
00107 
00108 int main( int argc, char* argv[] )
00109 {
00110     bool write_final_meshes = false;
00111     std::vector< Example > list;
00112     for( int i = 1; i < argc; ++i )
00113     {
00114         if( argv[i][0] != '-' )
00115         {
00116             std::cerr << "Invalid argument: \"" << argv[i] << '"' << std::endl;
00117             usage( argv[0] );
00118         }
00119         for( int j = 1; argv[i][j]; ++j )
00120         {
00121             if( argv[i][j] == 'w' ) { write_final_meshes = true; }
00122             else
00123             {
00124                 int idx;
00125                 for( idx = 0; idx < num_examples; ++idx )
00126                     if( examples[idx].flag == argv[i][j] ) break;
00127                 if( idx == num_examples )
00128                 {
00129                     if( argv[i][j] == 'h' )
00130                         usage( argv[0], true );
00131                     else
00132                     {
00133                         std::cerr << "Invalid flag: '" << argv[i][j] << "'" << std::endl;
00134                         usage( argv[0] );
00135                     }
00136                 }
00137                 list.push_back( examples[idx] );
00138             }
00139         }
00140     }
00141 
00142     const Example* exlist;
00143     int exlistlen;
00144     if( list.empty() )
00145     {
00146         exlist    = examples;
00147         exlistlen = num_examples;
00148     }
00149     else
00150     {
00151         exlist    = &list[0];
00152         exlistlen = list.size();
00153     }
00154 
00155     int result = 0;
00156     for( int i = 0; i < exlistlen; ++i )
00157         result += run_example( exlist[i], write_final_meshes );
00158 
00159     return result;
00160 }
00161 
00162 int run_example( const Example& e, bool write_output_file )
00163 {
00164     MsqPrintError err( std::cerr );
00165     MeshImpl mesh;
00166     DomainClassifier domain;
00167     HexLagrangeShape hex27;
00168 
00169     std::cout << std::endl
00170               << "--------------------------------------------------------------------" << std::endl
00171               << e.desc << std::endl
00172               << "--------------------------------------------------------------------" << std::endl;
00173 
00174     std::string name = e.func( domain, mesh, err );
00175     if( MSQ_CHKERR( err ) ) return 2;
00176     std::cout << "Loaded mesh from: " << name << std::endl;
00177 
00178     UntangleWrapper untangler;
00179     untangler.set_slaved_ho_node_mode( Settings::SLAVE_NONE );
00180     untangler.set_mapping_function( &hex27 );
00181     MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &domain, false, true );
00182     untangler.run_instructions( &mesh_and_domain, err );
00183     if( MSQ_CHKERR( err ) ) return 1;
00184     ShapeImprover smoother;
00185     smoother.set_slaved_ho_node_mode( Settings::SLAVE_NONE );
00186     smoother.set_mapping_function( &hex27 );
00187     smoother.set_vertex_movement_limit_factor( 0.05 );
00188     smoother.run_instructions( &mesh_and_domain, err );
00189     if( MSQ_CHKERR( err ) ) return 1;
00190 
00191     if( write_output_file )
00192     {
00193         size_t idx = name.find( ".vtk" );
00194         if( idx != std::string::npos )
00195         {
00196             std::string newname( name.substr( 0, idx ) );
00197             newname += ".out";
00198             newname += name.substr( idx );
00199             name.swap( newname );
00200         }
00201         else
00202         {
00203             name += ".out";
00204         }
00205 
00206         mesh.write_vtk( name.c_str(), err );MSQ_CHKERR( err );
00207         std::cout << "Write mesh to file: " << name << std::endl;
00208     }
00209 
00210     return smoother.quality_assessor().invalid_elements();
00211 }
00212 
00213 void get_planar_example( const char* filename, DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00214 {
00215     static PlanarDomain z( PlanarDomain::XY );
00216     mesh.read_vtk( filename, err );MSQ_ERRRTN( err );
00217     mesh.mark_skin_fixed( err );MSQ_ERRRTN( err );
00218     DomainClassifier::DomainSet set( &z );
00219     mesh.get_all_vertices( set.vertices, err );MSQ_ERRRTN( err );
00220     mesh.get_all_elements( set.elements, err );MSQ_ERRRTN( err );
00221     DomainClassifier::classify_by_handle( geom, &mesh, &set, 1, err );MSQ_ERRRTN( err );
00222 }
00223 
00224 std::string get_homogenious_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00225 {
00226     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/homogeneousPart.vtk";
00227     get_planar_example( filename.c_str(), geom, mesh, err );MSQ_CHKERR( err );
00228     return filename;
00229 }
00230 
00231 std::string get_part_example_tri( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00232 {
00233     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/triPart.vtk";
00234     get_planar_example( filename.c_str(), geom, mesh, err );MSQ_CHKERR( err );
00235     return filename;
00236 }
00237 
00238 std::string get_part_example_quad( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00239 {
00240     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/quadPart.vtk";
00241     get_planar_example( filename.c_str(), geom, mesh, err );MSQ_CHKERR( err );
00242     return filename;
00243 }
00244 
00245 std::string get_sphere_cube_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00246 {
00247     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/sphereCube.vtk";
00248 
00249     const Vector3D vec_i( 5, 0, 0 ), vec_ni( -5, 0, 0 );
00250     const Vector3D vec_j( 0, 5, 0 ), vec_nj( 0, -5, 0 );
00251     const Vector3D vec_k( 0, 0, 5 ), vec_nk( 0, 0, -5 );
00252 
00253     const Vector3D vec_tfl( 5, -5, 5 ), vec_tfr( 5, 5, 5 );
00254     const Vector3D vec_tbl( -5, -5, 5 ), vec_tbr( -5, 5, 5 );
00255     const Vector3D vec_bfl( 5, -5, -5 ), vec_bfr( 5, 5, -5 );
00256     const Vector3D vec_bbl( -5, -5, -5 ), vec_bbr( -5, 5, -5 );
00257 
00258     const Vector3D vec_ts( 5, 0, 2 ), vec_bs( 5, 0, -2 );
00259 
00260     //++ 0D domains ++
00261 
00262     static PointDomain pt_tfl( vec_tfl ), pt_tfr( vec_tfr );
00263     static PointDomain pt_tbl( vec_tbl ), pt_tbr( vec_tbr );
00264     static PointDomain pt_bfl( vec_bfl ), pt_bfr( vec_bfr );
00265     static PointDomain pt_bbl( vec_bbl ), pt_bbr( vec_bbr );
00266 
00267     //++ 1D domains ++
00268 
00269     // top square
00270     static LineDomain ln_tf( vec_tfl, vec_j ), lin_tb( vec_tbr, vec_nj );
00271     static LineDomain ln_tl( vec_tfl, vec_ni ), lin_tr( vec_tbr, vec_i );
00272     // bottom square
00273     static LineDomain ln_bf( vec_bfl, vec_j ), lin_bb( vec_bbr, vec_nj );
00274     static LineDomain ln_bl( vec_bfl, vec_ni ), lin_br( vec_bbr, vec_i );
00275     // sides
00276     static LineDomain ln_lf( vec_bfl, vec_k ), lin_rf( vec_bfr, vec_k );
00277     static LineDomain ln_lb( vec_bbl, vec_k ), lin_rb( vec_bbr, vec_k );
00278 
00279     // top sphere
00280     // CircleDomain cr_tf(vec_ts,vec_i,1.0), cr_tn(vec_ts,vec_k,1.0);
00281     // bottom sphere
00282     // CircleDomain cr_bf(vec_bs,vec_i,1.0), cr_bn(vec_bs,vec_k,1.0);
00283     static CircleDomain cr_ct( vec_k, vec_k, 1.0 );
00284 
00285     //++ 2D domains ++
00286 
00287     // cube
00288     static PlanarDomain sf_i( vec_i, vec_i ), sf_ni( vec_ni, vec_ni );
00289     static PlanarDomain sf_j( vec_j, vec_j ), sf_nj( vec_nj, vec_nj );
00290     static PlanarDomain sf_k( vec_k, vec_k ), sf_nk( vec_nk, vec_nk );
00291     // cut
00292     // CylinderDomain cy(1.0,vec_k,vec_bs);
00293     static SphericalDomain sp_t( vec_k, 1.0 );  //, sp_b(vec_bs,1.0);
00294 
00295     MeshDomain* base_domains[] = {
00296         &pt_tfl, &pt_tfr, &pt_tbl, &pt_tbr, &pt_bfl, &pt_bfr, &pt_bbl, &pt_bbr,
00297 
00298         &ln_tf, &lin_tb, &ln_tl, &lin_tr, &ln_bf, &lin_bb, &ln_bl, &lin_br, &ln_lf, &lin_rf, &ln_lb, &lin_rb,
00299 
00300         //  &cr_tf, &cr_tn,
00301         //  &cr_bf, &cr_bn,
00302         &cr_ct,
00303 
00304         &sf_i, &sf_ni, &sf_j, &sf_nj, &sf_k, &sf_nk,
00305         //&cy,
00306         &sp_t  //, &sp_b
00307     };
00308     const int NDOM = sizeof( base_domains ) / sizeof( base_domains[0] );
00309 
00310     int dim_array[NDOM] = {
00311         0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 1,1,1,
00312         2, 2, 2, 2, 2, 2, 2                                             //,2,2
00313     };
00314 
00315     //++ MESH & DOMAIN ++
00316 
00317     mesh.read_vtk( filename.c_str(), err );
00318     MSQ_ERRZERO( err );
00319     DomainClassifier::classify_skin_geometrically( geom, &mesh, 0.1, base_domains, dim_array, NDOM, err );
00320     MSQ_ERRZERO( err );
00321     mesh.set_skin_flags( false, false, true, err );
00322     MSQ_ERRZERO( err );
00323 
00324     return filename;
00325 }
00326 
00327 std::string get_cut_cube_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00328 {
00329     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/cutCube.vtk";
00330 
00331     const Vector3D vec_i( 5, 0, 0 ), vec_ni( -5, 0, 0 );
00332     const Vector3D vec_j( 0, 5, 0 ), vec_nj( 0, -5, 0 );
00333     const Vector3D vec_k( 0, 0, 5 ), vec_nk( 0, 0, -5 );
00334 
00335     const Vector3D vec_tfl( 5, -5, 5 ), vec_tfr( 5, 5, 5 );
00336     const Vector3D vec_tbl( -5, -5, 5 ), vec_tbr( -5, 5, 5 );
00337     const Vector3D vec_bfl( 5, -5, -5 ), vec_bfr( 5, 5, -5 );
00338     const Vector3D vec_bbl( -5, -5, -5 ), vec_bbr( -5, 5, -5 );
00339 
00340     const Vector3D vec_ts( 5, 0, 2 ), vec_bs( 5, 0, -2 );
00341 
00342     //++ 0D domains ++
00343 
00344     static PointDomain pt_tfl( vec_tfl ), pt_tfr( vec_tfr );
00345     static PointDomain pt_tbl( vec_tbl ), pt_tbr( vec_tbr );
00346     static PointDomain pt_bfl( vec_bfl ), pt_bfr( vec_bfr );
00347     static PointDomain pt_bbl( vec_bbl ), pt_bbr( vec_bbr );
00348 
00349     //++ 1D domains ++
00350 
00351     // top square
00352     static LineDomain ln_tf( vec_tfl, vec_j ), lin_tb( vec_tbr, vec_nj );
00353     static LineDomain ln_tl( vec_tfl, vec_ni ), lin_tr( vec_tbr, vec_i );
00354     // bottom square
00355     static LineDomain ln_bf( vec_bfl, vec_j ), lin_bb( vec_bbr, vec_nj );
00356     static LineDomain ln_bl( vec_bfl, vec_ni ), lin_br( vec_bbr, vec_i );
00357     // sides
00358     static LineDomain ln_lf( vec_bfl, vec_k ), lin_rf( vec_bfr, vec_k );
00359     static LineDomain ln_lb( vec_bbl, vec_k ), lin_rb( vec_bbr, vec_k );
00360 
00361     // top sphere
00362     static CircleDomain cr_tf( vec_ts, vec_i, 1.0 ), cr_tn( vec_ts, vec_k, 1.0 );
00363     // bottom sphere
00364     static CircleDomain cr_bf( vec_bs, vec_i, 1.0 ), cr_bn( vec_bs, vec_k, 1.0 );
00365 
00366     //++ 2D domains ++
00367 
00368     // cube
00369     static PlanarDomain sf_i( vec_i, vec_i ), sf_ni( vec_ni, vec_ni );
00370     static PlanarDomain sf_j( vec_j, vec_j ), sf_nj( vec_nj, vec_nj );
00371     static PlanarDomain sf_k( vec_k, vec_k ), sf_nk( vec_nk, vec_nk );
00372     // cut
00373     static CylinderDomain cy( 1.0, vec_k, vec_bs );
00374     static SphericalDomain sp_t( vec_ts, 1.0 ), sp_b( vec_bs, 1.0 );
00375 
00376     MeshDomain* base_domains[] = { &pt_tfl, &pt_tfr, &pt_tbl, &pt_tbr, &pt_bfl, &pt_bfr, &pt_bbl, &pt_bbr,
00377 
00378                                    &ln_tf,  &lin_tb, &ln_tl,  &lin_tr, &ln_bf,  &lin_bb, &ln_bl,  &lin_br, &ln_lf,
00379                                    &lin_rf, &ln_lb,  &lin_rb, &cr_tf,  &cr_tn,  &cr_bf,  &cr_bn,
00380 
00381                                    &sf_i,   &sf_ni,  &sf_j,   &sf_nj,  &sf_k,   &sf_nk,  &cy,     &sp_t,   &sp_b };
00382     const int NDOM             = sizeof( base_domains ) / sizeof( base_domains[0] );
00383 
00384     int dim_array[NDOM] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00385                             1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
00386 
00387     //++ MESH & DOMAIN ++
00388 
00389     mesh.read_vtk( filename.c_str(), err );
00390     MSQ_ERRZERO( err );
00391     DomainClassifier::classify_skin_geometrically( geom, &mesh, 0.1, base_domains, dim_array, NDOM, err );
00392     MSQ_ERRZERO( err );
00393     mesh.set_skin_flags( false, false, true, err );
00394     MSQ_ERRZERO( err );
00395 
00396     return filename;
00397 }
00398 
00399 std::string get_sphere_cylinder_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00400 {
00401     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/sphereCylinder_1194_inv.vtk";
00402 
00403     const Vector3D vec_k( 0, 0, 8 ), vec_nk( 0, 0, -8 );
00404     const Vector3D vec_c( 0, 0, 5 );
00405 
00406     //++ 0D domains ++
00407 
00408     //++ 1D domains ++
00409 
00410     // top circle
00411     static CircleDomain cr_to( vec_k, vec_k, 8.0 ), cr_ti( vec_k, vec_k, 4.0 );
00412     // bottom circle
00413     static CircleDomain cr_bo( vec_nk, vec_nk, 8.0 );
00414 
00415     //++ 2D domains ++
00416 
00417     static PlanarDomain sf_t( vec_k, vec_k ), sf_b( vec_nk, vec_nk );
00418     static CylinderDomain cy( 8.0, vec_k, vec_k );
00419     static SphericalDomain sp( vec_c, 5.0 );
00420 
00421     MeshDomain* base_domains[] = { &cr_to, &cr_ti, &cr_bo, &sf_t, &sf_b, &cy, &sp };
00422     const int NDOM             = sizeof( base_domains ) / sizeof( base_domains[0] );
00423 
00424     int dim_array[NDOM] = { 1, 1, 1, 2, 2, 2, 2 };
00425 
00426     //++ MESH & DOMAIN ++
00427 
00428     mesh.read_vtk( filename.c_str(), err );
00429     MSQ_ERRZERO( err );
00430     DomainClassifier::classify_skin_geometrically( geom, &mesh, 0.001, base_domains, dim_array, NDOM, err );
00431     MSQ_ERRZERO( err );
00432     mesh.set_skin_flags( false, false, true, err );
00433     MSQ_ERRZERO( err );
00434 
00435     return filename;
00436 }
00437 
00438 std::string get_hex_3d_part_example( DomainClassifier& geom, MeshImpl& mesh, MsqError& err )
00439 {
00440     std::string filename = std::string( STRINGIFY( SRCDIR ) ) + "/hex3Dpart.vtk";
00441 
00442     // 2D domains
00443 
00444     const Vector3D vec_i( 1, 0, 0 ), vec_j( 0, 1, 0 ), vec_k( 0, 0, 1 );
00445     const Vector3D vec_ni( -1, 0, 0 ), vec_nj( 0, -1, 0 ), vec_nk( 0, 0, -1 );
00446 
00447     const Vector3D vec_left( -11.5, 0, 0 ), vec_right( 11.5, 0, 0 );
00448     const Vector3D vec_top( 0, 5, 0 ), vec_bottom( 0, -5, 0 );
00449     const Vector3D vec_front( 0, 0, 5 ), vec_back( 0, 0, -5 );
00450 
00451     // 1D domains
00452 
00453     const Vector3D pt_top_front( 0, 5, 5 ), pt_top_back( 0, 5, -5 );
00454     const Vector3D pt_bottom_front( 0, -5, 5 ), pt_bottom_back( 0, -5, -5 );
00455 
00456     const Vector3D pt_top_left( -11.5, 5, 0 ), pt_top_right( 11.5, 5, 0 );
00457     const Vector3D pt_bottom_left( -11.5, -5, 0 ), pt_bottom_right( 11.5, -5, 0 );
00458 
00459     const Vector3D pt_left_front( -11.5, 0, 5 ), pt_left_back( -11.5, 0, -5 );
00460     const Vector3D pt_right_front( 11.5, 0, 5 ), pt_right_back( 11.5, 0, -5 );
00461 
00462     const Vector3D cpt_top_left( -1.5, 5, 0 ), cpt_top_right( 1.5, 5, 0 );
00463     const Vector3D cpt_bottom_left( -1.5, -5, 0 ), cpt_bottom_right( 1.5, -5, 0 );
00464 
00465     // 0D domains
00466 
00467     const Vector3D pt_tlf( -11.5, 5, 5 ), pt_tlb( -11.5, 5, -5 );
00468     const Vector3D pt_trf( 11.5, 5, 5 ), pt_trb( 11.5, 5, -5 );
00469     const Vector3D pt_blf( -11.5, -5, 5 ), pt_blb( -11.5, -5, -5 );
00470     const Vector3D pt_brf( 11.5, -5, 5 ), pt_brb( 11.5, -5, -5 );
00471 
00472     const Vector3D pt_c_tlf( -1.5, 5, 5 ), pt_c_tlb( -1.5, 5, -5 );
00473     const Vector3D pt_c_trf( 1.5, 5, 5 ), pt_c_trb( 1.5, 5, -5 );
00474     const Vector3D pt_c_blf( -1.5, -5, 5 ), pt_c_blb( -1.5, -5, -5 );
00475     const Vector3D pt_c_brf( 1.5, -5, 5 ), pt_c_brb( 1.5, -5, -5 );
00476 
00477     static PointDomain p00( pt_tlf );
00478     static PointDomain p01( pt_tlb );
00479     static PointDomain p02( pt_trf );
00480     static PointDomain p03( pt_trb );
00481     static PointDomain p04( pt_blf );
00482     static PointDomain p05( pt_blb );
00483     static PointDomain p06( pt_brf );
00484     static PointDomain p07( pt_brb );
00485 
00486     static PointDomain p08( pt_c_tlf );
00487     static PointDomain p09( pt_c_tlb );
00488     static PointDomain p10( pt_c_trf );
00489     static PointDomain p11( pt_c_trb );
00490     static PointDomain p12( pt_c_blf );
00491     static PointDomain p13( pt_c_blb );
00492     static PointDomain p14( pt_c_brf );
00493     static PointDomain p15( pt_c_brb );
00494 
00495     static CircleDomain c00( pt_top_front, vec_k, 1.5 );
00496     static CircleDomain c01( pt_top_back, vec_k, 1.5 );
00497     static CircleDomain c02( pt_bottom_front, vec_k, 1.5 );
00498     static CircleDomain c03( pt_bottom_back, vec_k, 1.5 );
00499 
00500     static LineDomain l00( cpt_top_left, vec_k );
00501     static LineDomain l01( cpt_top_right, vec_k );
00502     static LineDomain l02( cpt_bottom_left, vec_k );
00503     static LineDomain l03( cpt_bottom_right, vec_k );
00504 
00505     static LineDomain l04( pt_top_front, vec_i );
00506     static LineDomain l05( pt_top_back, vec_i );
00507     static LineDomain l06( pt_bottom_front, vec_i );
00508     static LineDomain l07( pt_bottom_back, vec_i );
00509     static LineDomain l08( pt_top_left, vec_k );
00510     static LineDomain l09( pt_top_right, vec_k );
00511     static LineDomain l10( pt_bottom_left, vec_k );
00512     static LineDomain l11( pt_bottom_right, vec_k );
00513     static LineDomain l12( pt_left_front, vec_j );
00514     static LineDomain l13( pt_left_back, vec_j );
00515     static LineDomain l14( pt_right_front, vec_j );
00516     static LineDomain l15( pt_right_back, vec_j );
00517 
00518     static CylinderDomain C00( 1.5, vec_k, vec_top, false );
00519     static CylinderDomain C01( 1.5, vec_k, vec_bottom, false );
00520     static PlanarDomain P00( vec_ni, vec_left );
00521     static PlanarDomain P01( vec_i, vec_right );
00522     static PlanarDomain P02( vec_j, vec_top );
00523     static PlanarDomain P03( vec_nj, vec_bottom );
00524     static PlanarDomain P04( vec_k, vec_front );
00525     static PlanarDomain P05( vec_nk, vec_back );
00526 
00527     const int NDOM                 = 44;
00528     MeshDomain* base_domains[NDOM] = { &p00, &p01, &p02, &p03, &p04, &p05, &p06, &p07,
00529 
00530                                        &p08, &p09, &p10, &p11, &p12, &p13, &p14, &p15,
00531 
00532                                        &c00, &c01, &c02, &c03,
00533 
00534                                        &l00, &l01, &l02, &l03,
00535 
00536                                        &l04, &l05, &l06, &l07, &l08, &l09, &l10, &l11, &l12, &l13, &l14, &l15,
00537 
00538                                        &C00, &C01, &P00, &P01, &P02, &P03, &P04, &P05 };
00539 
00540     int dim_array[NDOM] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
00541                             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2 };
00542 
00543     //++ MESH & DOMAIN ++
00544 
00545     mesh.read_vtk( filename.c_str(), err );
00546     MSQ_ERRZERO( err );
00547     DomainClassifier::classify_skin_geometrically( geom, &mesh, 0.1, base_domains, dim_array, NDOM, err );
00548     MSQ_ERRZERO( err );
00549     mesh.set_skin_flags( false, false, true, err );
00550     MSQ_ERRZERO( err );
00551 
00552     return filename;
00553 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines