MOAB: Mesh Oriented datABase  (version 5.2.1)
Randomize.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2004 Sandia Corporation and Argonne National
00005     Laboratory.  Under the terms of Contract DE-AC04-94AL85000
00006     with Sandia Corporation, the U.S. Government retains certain
00007     rights in 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     diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
00024     pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
00025 
00026   ***************************************************************** */
00027 /*!
00028   \file   Randomize.hpp
00029   \brief
00030 
00031   The Randomize Class implements the Randomize Vertex Mover
00032   for a patch with one free vertex.
00033 
00034   \author Michael Brewer
00035   \date   2002-10-27
00036 */
00037 
00038 #ifndef Mesquite_Randomize_hpp
00039 #define Mesquite_Randomize_hpp
00040 
00041 #include "Mesquite.hpp"
00042 #include "VertexMover.hpp"
00043 #include "VertexPatches.hpp"
00044 #include <vector>
00045 
00046 namespace MBMesquite
00047 {
00048 
00049 /*! \class Randomize
00050  \brief Randomly perftubs the (un-culled) vertices.
00051 */
00052 class Randomize : public VertexMover
00053 {
00054   public:
00055     //! Constructor defaulting mPercent to .05.
00056     MESQUITE_EXPORT Randomize();
00057     //! Constructor allowing user to set mPercent
00058     MESQUITE_EXPORT Randomize( double percent );
00059 
00060     MESQUITE_EXPORT virtual ~Randomize();
00061 
00062     MESQUITE_EXPORT virtual std::string get_name() const;
00063 
00064     MESQUITE_EXPORT virtual PatchSet* get_patch_set();
00065 
00066   protected:
00067     virtual void initialize( PatchData& pd, MsqError& err );
00068     virtual void optimize_vertex_positions( PatchData& pd, MsqError& err );
00069     virtual void initialize_mesh_iteration( PatchData& pd, MsqError& err );
00070     virtual void terminate_mesh_iteration( PatchData& pd, MsqError& err );
00071     virtual void cleanup();
00072 
00073   private:
00074     //! \param The percentage of the scale factor each vertex will be moved.
00075     double mPercent;
00076     std::vector< size_t > adjVtxList;
00077     VertexPatches patchSet;
00078 };
00079 
00080 }  // namespace MBMesquite
00081 
00082 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines