LCOV - code coverage report
Current view: top level - src/mesquite/Control - SlaveBoundaryVertices.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 1 1 100.0 %
Date: 2020-07-18 00:09:26 Functions: 1 1 100.0 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* *****************************************************************
       2                 :            :     MESQUITE -- The Mesh Quality Improvement Toolkit
       3                 :            : 
       4                 :            :     Copyright 2007 Sandia National Laboratories.  Developed at the
       5                 :            :     University of Wisconsin--Madison under SNL contract number
       6                 :            :     624796.  The U.S. Government and the University of Wisconsin
       7                 :            :     retain certain rights to this software.
       8                 :            : 
       9                 :            :     This library is free software; you can redistribute it and/or
      10                 :            :     modify it under the terms of the GNU Lesser General Public
      11                 :            :     License as published by the Free Software Foundation; either
      12                 :            :     version 2.1 of the License, or (at your option) any later version.
      13                 :            : 
      14                 :            :     This library is distributed in the hope that it will be useful,
      15                 :            :     but WITHOUT ANY WARRANTY; without even the implied warranty of
      16                 :            :     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17                 :            :     Lesser General Public License for more details.
      18                 :            : 
      19                 :            :     You should have received a copy of the GNU Lesser General Public License
      20                 :            :     (lgpl.txt) along with this library; if not, write to the Free Software
      21                 :            :     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      22                 :            : 
      23                 :            :     (2009) [email protected]
      24                 :            : 
      25                 :            :   ***************************************************************** */
      26                 :            : 
      27                 :            : /** \file SlaveBoundaryVertices.hpp
      28                 :            :  *  \brief
      29                 :            :  *  \author Jason Kraftcheck
      30                 :            :  */
      31                 :            : 
      32                 :            : #ifndef MSQ_SLAVE_BOUNDARY_VERTICES_HPP
      33                 :            : #define MSQ_SLAVE_BOUNDARY_VERTICES_HPP
      34                 :            : 
      35                 :            : #include "Mesquite.hpp"
      36                 :            : #include "VertexSlaver.hpp"
      37                 :            : 
      38                 :            : namespace MBMesquite
      39                 :            : {
      40                 :            : 
      41                 :            : /**\brief Utility to set slaved vs. non-slaved vertices.
      42                 :            :  *
      43                 :            :  * This class can be inserted in the instruction queue before any
      44                 :            :  * optimization to determine which higher-order nodes are slaved
      45                 :            :  * as a function of their distance from the bounary of the mesh.
      46                 :            :  *
      47                 :            :  * This implementation assumes that the boundary of the mesh can
      48                 :            :  * be identified either by dimension of the associated geometric
      49                 :            :  * domain or by fixed vertices.
      50                 :            :  */
      51         [ -  + ]:          2 : class MESQUITE_EXPORT SlaveBoundaryVertices : public VertexSlaver
      52                 :            : {
      53                 :            :   public:
      54                 :            :     /**\brief Define defintion of boundary as either the distance
      55                 :            :      *        from a fixed vertex or the distance from the domain
      56                 :            :      *        of the boundary vertices.
      57                 :            :      *
      58                 :            :      * If the second parameter is not specified, the boundary will
      59                 :            :      * be assumed to be indicated by fixed vertices.  If it is specified,
      60                 :            :      * the boundary will be assumed to be those vertices constrained to
      61                 :            :      * a domain less than or equal to the specified dimension (I.e.
      62                 :            :      * vertices constrained such that the number of degrees of freedom
      63                 :            :      * in their motion is less than or equal to the specified number.)
      64                 :            :      *
      65                 :            :      *\param depth The number of elements inwards from the boundary for
      66                 :            :      *             which all contained higher-order nodes will be free
      67                 :            :      *             variables in the optimization.  Any vertex for further
      68                 :            :      *             from the boundary will be slaved.  Specifying zero
      69                 :            :      *             will result in all higher-order nodes being slaved
      70                 :            :      *             except free nodes on the boundary.
      71                 :            :      *\param max_boundary_domain_dimension  Specify the definition
      72                 :            :      *             of "boundary".  If greater than or equal to 4, then
      73                 :            :      *             the the set of all fixed vertices is assumed to be
      74                 :            :      *             the boundary.  If less than four, then all vertices
      75                 :            :      *             constrained to a domain with the specified number of
      76                 :            :      *             fewer degrees of freedom (constrained to a geometric
      77                 :            :      *             entity with an equal or smaller topological dimension)
      78                 :            :      *             will be considered to be the boundary.
      79                 :            :      */
      80                 :            :     SlaveBoundaryVertices( unsigned depth, unsigned max_boundary_domain_dimension = 4 );
      81                 :            : 
      82                 :            :     virtual double loop_over_mesh( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err );
      83                 :            : 
      84                 :            :     virtual std::string get_name() const;
      85                 :            : 
      86                 :            :     virtual void initialize_queue( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err );
      87                 :            : 
      88                 :            :     unsigned get_num_boundary_layers() const
      89                 :            :     {
      90                 :            :         return elemDepth;
      91                 :            :     }
      92                 :            :     bool boundary_is_fixed_vertices() const
      93                 :            :     {
      94                 :            :         return domainDoF >= 4;
      95                 :            :     }
      96                 :            :     bool boundary_is_mesh_domain() const
      97                 :            :     {
      98                 :            :         return domainDoF < 4;
      99                 :            :     }
     100                 :            :     unsigned boundary_mesh_domain_dimension() const
     101                 :            :     {
     102                 :            :         return domainDoF;
     103                 :            :     }
     104                 :            : 
     105                 :            :   private:
     106                 :            :     unsigned elemDepth;
     107                 :            :     unsigned domainDoF;
     108                 :            : };
     109                 :            : 
     110                 :            : }  // namespace MBMesquite
     111                 :            : 
     112                 :            : #endif

Generated by: LCOV version 1.11