NSF Postdoctoral Research
A set of C++ code developed by Andrew E. Slaughter
SlaughterFEM::MyMesh Class Reference

Adds additional boundary identification behavior to libMesh::Mesh class. More...

#include <fem/my_mesh/my_mesh.h>

List of all members.

Public Member Functions

void add_boundary_id (short int id, int dir_idx, Real value)
 A function for identifing a boundary based on the nodal position of the sides.
void add_boundary_id (short int id, const char *dir, Real value)
 An alternative form of add_boundary_id, that allows a text input of the coordinate dimension.
void add_boundary_id (short int id)
 An alternative form of add_boundary_id, that adds the specified ID to all boundaries without an ID.

Detailed Description

Adds additional boundary identification behavior to libMesh::Mesh class.

add_boundary_id: This function searches every element for sides that are not shared, if they are not shared then they must lie on a boundary. These boundary sides are then tested to see if all of the nodes have the specified value for the desired coordinate. If so, then the boundary ID is added to the side object.

There are three ways to use this feature, example code for each is included in the member function documentation.

Examples:
fem/examples/example1.cpp, fem/examples/example2.cpp, fem/examples/example5.cpp, and test_mymesh.cpp.

Member Function Documentation

void MyMesh::add_boundary_id ( short int  id,
int  dir_idx,
Real  value 
)

A function for identifing a boundary based on the nodal position of the sides.

Parameters:
idan integer ID to identify the boundary
dir_idxA integer that represents the space dimension to test: 0, 1, and 2 for x, y, and z directions respectively
valueA libmesh Real number to test the nodal coordinate against

This example first finds the elements with neighbors and then clears any existing boundary IDs. Then all boundary sides that lie completely on x = 0.0 are given the boundary ID of 1.

        mesh.find_neighbors();
        mesh.boundary_info->clear();
        mesh.add_boundary_id(1, 0, 0.0);

Specifing dir_idx = -1 is a special case that inserts the boundary ID to all unset boundaries. In this case, value is not used.

Examples:
fem/examples/example1.cpp, fem/examples/example2.cpp, and test_mymesh.cpp.
void MyMesh::add_boundary_id ( short int  id,
const char *  dir,
Real  value 
)

An alternative form of add_boundary_id, that allows a text input of the coordinate dimension.

Parameters:
idan integer ID to identify the boundary
dirA char that represents the space dimension to test: x, y, or z
valueA libmesh Real number to test the nodal coordinate against

Example code:

        mesh.find_neighbors();
        mesh.boundary_info->clear();
        mesh.add_boundary_id(1, "x", 0.0);
void MyMesh::add_boundary_id ( short int  id)

An alternative form of add_boundary_id, that adds the specified ID to all boundaries without an ID.

This version essentially acts to redifine all boundaries with a value of invalid_id to the specified value.

Parameters:
idan integer ID to identify the boundary
        mesh.find_neighbors();
        mesh.boundary_info->clear();
        mesh.add_boundary_id(1);

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs