NSF Postdoctoral Research
A set of C++ code developed by Andrew E. Slaughter
test_mymesh.cpp

A test function for testing the MyMesh class.

This is the source code for a simple test function that tests the functionality of the MyMessh class associated with my custom fem library. To run this example simply execute the test_mymesh executable from within the /bin directory.

// LibMesh related includes
#include <iostream>
#include "libmesh.h"
#include "mesh.h"
#include "mesh_generation.h"
#include "boundary_info.h"

// My custom fem library includes
#include "fem/include.h"
using namespace SlaughterFEM;

using namespace libMesh;


int main(int argc, char** argv)
{   
    LibMeshInit init (argc, argv);

    MyMesh mesh;
    MeshTools::Generation::build_square(mesh, 3, 3); 
    mesh.find_neighbors();
    
   printf("\n\nBoundary id's generated by libMesh:\n");
    mesh.boundary_info->print_info();
   
   printf("\n\nBoundary id's generated by MyMesh class (+10):\n"); 
    mesh.boundary_info->clear();
    mesh.add_boundary_id(10,"y",0.); // bottom
    mesh.add_boundary_id(11,"x",1.); // right-side
    mesh.add_boundary_id(12,"y",1.); // top
    mesh.add_boundary_id(13,"x",0.); // left
    mesh.boundary_info->print_info();
   
}
 All Classes Namespaces Files Functions Variables Typedefs