MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 // -*- Mode : c++; tab-width: 3; c-tab-always-indent: t; indent-tabs-mode: nil; c-basic-offset: 3 00028 // -*- 00029 00030 /*! \file CompositeOFScalarAdd.hpp 00031 00032 Header file for the MBMesquite:: CompositeOFScalarAdd class 00033 00034 \author Michael Brewer 00035 \date 2002-06-24 00036 */ 00037 00038 #ifndef CompositeOFScalarAdd_hpp 00039 #define CompositeOFScalarAdd_hpp 00040 00041 #include "Mesquite.hpp" 00042 #include "ObjectiveFunction.hpp" 00043 00044 namespace MBMesquite 00045 { 00046 /*! \class CompositeOFScalarAdd. 00047 \brief Adds a scalar to a given ObjectiveFunction. 00048 */ 00049 class MsqMeshEntity; 00050 class PatchData; 00051 class MsqError; 00052 00053 class MESQUITE_EXPORT CompositeOFScalarAdd : public ObjectiveFunction 00054 { 00055 public: 00056 CompositeOFScalarAdd( double, ObjectiveFunction*, bool delete_OF = false ); 00057 virtual ~CompositeOFScalarAdd(); 00058 00059 //!\brief Called at start of instruction queue processing 00060 //! 00061 //! Do any preliminary global initialization, consistency checking, 00062 //! etc. 00063 virtual void initialize_queue( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err ); 00064 00065 virtual bool initialize_block_coordinate_descent( MeshDomainAssoc* mesh_and_domain, 00066 const Settings* settings, 00067 PatchSet* user_set, 00068 MsqError& err ); 00069 00070 virtual bool evaluate( EvalType type, PatchData& pd, double& value_out, bool free, MsqError& err ); 00071 00072 virtual bool evaluate_with_gradient( EvalType type, 00073 PatchData& pd, 00074 double& value_out, 00075 std::vector< Vector3D >& grad_out, 00076 MsqError& err ); 00077 00078 virtual bool evaluate_with_Hessian_diagonal( EvalType type, 00079 PatchData& pd, 00080 double& value_out, 00081 std::vector< Vector3D >& grad_out, 00082 std::vector< SymMatrix3D >& hess_diag_out, 00083 MsqError& err ); 00084 00085 virtual bool evaluate_with_Hessian( EvalType type, 00086 PatchData& pd, 00087 double& value_out, 00088 std::vector< Vector3D >& grad_out, 00089 MsqHessian& Hessian_out, 00090 MsqError& err ); 00091 00092 virtual ObjectiveFunction* clone() const; 00093 00094 virtual void clear(); 00095 00096 virtual int min_patch_layers() const; 00097 00098 private: 00099 double mAlpha; 00100 ObjectiveFunction* objFunc; 00101 bool deleteObjFunc; 00102 }; 00103 } // namespace MBMesquite 00104 #endif // CompositeOFScalarAdd_hpp