MOAB: Mesh Oriented datABase  (version 5.4.1)
SlaveBoundaryVertices.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2007 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     (2009) [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 /** \file SlaveBoundaryVertices.hpp
00028  *  \brief
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_SLAVE_BOUNDARY_VERTICES_HPP
00033 #define MSQ_SLAVE_BOUNDARY_VERTICES_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include "VertexSlaver.hpp"
00037 
00038 namespace MBMesquite
00039 {
00040 
00041 /**\brief Utility to set slaved vs. non-slaved vertices.
00042  *
00043  * This class can be inserted in the instruction queue before any
00044  * optimization to determine which higher-order nodes are slaved
00045  * as a function of their distance from the bounary of the mesh.
00046  *
00047  * This implementation assumes that the boundary of the mesh can
00048  * be identified either by dimension of the associated geometric
00049  * domain or by fixed vertices.
00050  */
00051 class MESQUITE_EXPORT SlaveBoundaryVertices : public VertexSlaver
00052 {
00053   public:
00054     /**\brief Define defintion of boundary as either the distance
00055      *        from a fixed vertex or the distance from the domain
00056      *        of the boundary vertices.
00057      *
00058      * If the second parameter is not specified, the boundary will
00059      * be assumed to be indicated by fixed vertices.  If it is specified,
00060      * the boundary will be assumed to be those vertices constrained to
00061      * a domain less than or equal to the specified dimension (I.e.
00062      * vertices constrained such that the number of degrees of freedom
00063      * in their motion is less than or equal to the specified number.)
00064      *
00065      *\param depth The number of elements inwards from the boundary for
00066      *             which all contained higher-order nodes will be free
00067      *             variables in the optimization.  Any vertex for further
00068      *             from the boundary will be slaved.  Specifying zero
00069      *             will result in all higher-order nodes being slaved
00070      *             except free nodes on the boundary.
00071      *\param max_boundary_domain_dimension  Specify the definition
00072      *             of "boundary".  If greater than or equal to 4, then
00073      *             the the set of all fixed vertices is assumed to be
00074      *             the boundary.  If less than four, then all vertices
00075      *             constrained to a domain with the specified number of
00076      *             fewer degrees of freedom (constrained to a geometric
00077      *             entity with an equal or smaller topological dimension)
00078      *             will be considered to be the boundary.
00079      */
00080     SlaveBoundaryVertices( unsigned depth, unsigned max_boundary_domain_dimension = 4 );
00081 
00082     virtual double loop_over_mesh( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err );
00083 
00084     virtual std::string get_name() const;
00085 
00086     virtual void initialize_queue( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err );
00087 
00088     unsigned get_num_boundary_layers() const
00089     {
00090         return elemDepth;
00091     }
00092     bool boundary_is_fixed_vertices() const
00093     {
00094         return domainDoF >= 4;
00095     }
00096     bool boundary_is_mesh_domain() const
00097     {
00098         return domainDoF < 4;
00099     }
00100     unsigned boundary_mesh_domain_dimension() const
00101     {
00102         return domainDoF;
00103     }
00104 
00105   private:
00106     unsigned elemDepth;
00107     unsigned domainDoF;
00108 };
00109 
00110 }  // namespace MBMesquite
00111 
00112 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines