MOAB: Mesh Oriented datABase  (version 5.4.1)
domain.hpp File Reference
#include "CLArgs.hpp"
#include "MeshImpl.hpp"
+ Include dependency graph for domain.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void add_domain_args (CLArgs &args)
MBMesquite::MeshDomainprocess_domain_args (MBMesquite::MeshImpl *mesh)

Variables

const char SPHERE_FLAG = 'S'
const char PLANE_FLAG = 'P'
const char CYLINDER_FLAG = 'C'
const char CONE_FLAG = 'N'
const char LINE_FLAG = 'l'
const char CIRCLE_FLAG = 'c'
const char POINT_FLAG = 'v'
const char SKIN_FLAG = 's'

Function Documentation

void add_domain_args ( CLArgs args)

Definition at line 212 of file domain.cpp.

References circle_arg, CIRCLE_FLAG, CONE_FLAG, CONE_VALUES, conic_arg, cylinder_arg, CYLINDER_FLAG, CYLINDER_VALUES, CLArgs::double_list_flag(), CLArgs::limit_list_flag(), line_arg, LINE_FLAG, plane_arg, PLANE_FLAG, point_arg, POINT_FLAG, SKIN_FLAG, skin_mesh, sphere_arg, SPHERE_FLAG, SPHERE_VALUES, and CLArgs::toggle_flag().

Referenced by main().

{
    args.toggle_flag( SKIN_FLAG, "Mark boundary vertices as fixed (default if no domain specified)", &skin_mesh );
    args.double_list_flag( SPHERE_FLAG, "Spherical domain as center and radius", &sphere_arg );
    args.limit_list_flag( SPHERE_FLAG, 4, SPHERE_VALUES );
    args.limit_list_flag( SPHERE_FLAG, 1, SPHERE_VALUES );
    args.double_list_flag( PLANE_FLAG, "Planar domain as normal and point", &plane_arg );
    args.limit_list_flag( PLANE_FLAG, 3, CYLINDER_VALUES + 1 );
    args.limit_list_flag( PLANE_FLAG, 6, CYLINDER_VALUES + 1 );
    args.double_list_flag( CYLINDER_FLAG, "Cylindrical radius, axis, and point", &cylinder_arg );
    args.limit_list_flag( CYLINDER_FLAG, 4, CYLINDER_VALUES );
    args.limit_list_flag( CYLINDER_FLAG, 7, CYLINDER_VALUES );
    args.double_list_flag( CONE_FLAG, "Conic domain as base radius, height, axis, and base center", &conic_arg );
    args.limit_list_flag( CONE_FLAG, 2, CONE_VALUES );
    args.limit_list_flag( CONE_FLAG, 5, CONE_VALUES );
    args.limit_list_flag( CONE_FLAG, 8, CONE_VALUES );
    args.double_list_flag( LINE_FLAG, "Linear domain as direction and point", &line_arg );
    args.limit_list_flag( LINE_FLAG, 3, CYLINDER_VALUES + 1 );
    args.limit_list_flag( LINE_FLAG, 6, CYLINDER_VALUES + 1 );
    args.double_list_flag( CIRCLE_FLAG, "Circular domain as radius, normal, and center", &circle_arg );
    args.limit_list_flag( CIRCLE_FLAG, 4, CYLINDER_VALUES );
    args.limit_list_flag( CIRCLE_FLAG, 7, CYLINDER_VALUES );
    args.double_list_flag( POINT_FLAG, "Point domain", &point_arg );
    args.limit_list_flag( POINT_FLAG, 3, SPHERE_VALUES + 1 );
}

Definition at line 238 of file domain.cpp.

References MBMesquite::arrptr(), MBMesquite::DomainClassifier::classify_geometrically(), MBMesquite::DomainClassifier::classify_skin_geometrically(), domain_dims, domains, MBMesquite::MeshImpl::elements_get_topologies(), MBMesquite::MeshImpl::get_all_elements(), MBMesquite::MeshImpl::mark_skin_fixed(), skin_mesh, and CLArgs::ArgTemplate< T >::value().

Referenced by main().

{
    MsqPrintError err( std::cerr );
    MeshDomain* rval = 0;

    if( !domains.empty() )
    {
        int max_domain_dim = *std::max_element( domain_dims.begin(), domain_dims.end() );
        std::vector< Mesh::ElementHandle > elems;
        mesh->get_all_elements( elems, err );
        std::vector< EntityTopology > types( elems.size() );
        mesh->elements_get_topologies( arrptr( elems ), arrptr( types ), elems.size(), err );
        EntityTopology max_type = *std::max_element( types.begin(), types.end() );
        int max_elem_dim        = TopologyInfo::dimension( max_type );

        if( max_domain_dim == max_elem_dim && domains.size() == 1 )
        {
            rval = domains.front();
        }
        else
        {
            DomainClassifier* result = new DomainClassifier();
            if( max_domain_dim < max_elem_dim )
            {
                DomainClassifier::classify_skin_geometrically( *result, mesh, 1e-4, arrptr( domains ),
                                                               arrptr( domain_dims ), domains.size(), err );
            }
            else
            {
                DomainClassifier::classify_geometrically( *result, mesh, 1e-4, arrptr( domains ), arrptr( domain_dims ),
                                                          domains.size(), err );
            }
            rval = result;
        }
    }
    if( skin_mesh.value() )
    {
        mesh->mark_skin_fixed( err, false );
    }
    if( err )
    {
        std::cerr << err << std::endl;
        exit( 3 );
    }

    return rval;
}

Variable Documentation

const char CIRCLE_FLAG = 'c'

Definition at line 13 of file domain.hpp.

Referenced by add_domain_args().

const char CONE_FLAG = 'N'

Definition at line 11 of file domain.hpp.

Referenced by add_domain_args().

const char CYLINDER_FLAG = 'C'

Definition at line 10 of file domain.hpp.

Referenced by add_domain_args().

const char LINE_FLAG = 'l'

Definition at line 12 of file domain.hpp.

Referenced by add_domain_args().

const char PLANE_FLAG = 'P'

Definition at line 9 of file domain.hpp.

Referenced by add_domain_args().

const char POINT_FLAG = 'v'

Definition at line 14 of file domain.hpp.

Referenced by add_domain_args().

const char SKIN_FLAG = 's'

Definition at line 15 of file domain.hpp.

Referenced by add_domain_args().

const char SPHERE_FLAG = 'S'

Definition at line 8 of file domain.hpp.

Referenced by add_domain_args().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines