MOAB: Mesh Oriented datABase  (version 5.4.1)
laplacian.cpp File Reference
#include "TestUtil.hpp"
#include "Mesquite.hpp"
#include "MeshImpl.hpp"
#include "MsqError.hpp"
#include "PlanarDomain.hpp"
#include "LaplaceWrapper.hpp"
#include <iostream>
#include <cstdlib>
+ Include dependency graph for laplacian.cpp:

Go to the source code of this file.

Functions

int main ()

Function Documentation

int main ( )

Definition at line 63 of file laplacian.cpp.

References mesh, MBMesquite::MeshImpl::read_vtk(), MBMesquite::IQInterface::run_instructions(), and MBMesquite::MeshImpl::write_vtk().

{
    MBMesquite::MeshImpl mesh;
    MsqPrintError err( cout );
    std::string file_name = TestDir + "unittest/mesquite/2D/vtk/quads/untangled/square_quad_2.vtk";
    mesh.read_vtk( file_name.c_str(), err );
    if( err ) return 1;

    // create geometry: plane z=0, normal (0,0,1)
    Vector3D pnt( 0, 0, 5 );
    Vector3D s_norm( 0, 0, 1 );
    MBMesquite::PlanarDomain msq_geom( s_norm, pnt );

    // creates an intruction queue
    LaplaceWrapper laplacian_smoother;

    mesh.write_vtk( "original_mesh.vtk", err );
    if( err ) return 1;

    // launches optimization on mesh_set1
    MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &msq_geom );
    laplacian_smoother.run_instructions( &mesh_and_domain, err );
    if( err ) return 1;

    mesh.write_vtk( "smoothed_mesh.vtk", err );
    if( err ) return 1;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines