00001 //*****************************************************************// 00002 // Albany 2.0: Copyright 2012 Sandia Corporation // 00003 // This Software is released under the BSD license detailed // 00004 // in the file "license.txt" in the top-level Albany directory // 00005 //*****************************************************************// 00006 00007 #ifndef AADAPT_SPRSIZEFIELD_HPP 00008 #define AADAPT_SPRSIZEFIELD_HPP 00009 00010 #include "AlbPUMI_FMDBDiscretization.hpp" 00011 #include "Epetra_Vector.h" 00012 #include <ma.h> 00013 #include "Albany_StateManager.hpp" 00014 00015 namespace AAdapt { 00016 00017 class SPRSizeField : public ma::IsotropicFunction { 00018 00019 public: 00020 SPRSizeField(const Teuchos::RCP<AlbPUMI::AbstractPUMIDiscretization>& disc); 00021 00022 ~SPRSizeField(); 00023 00024 double getValue(ma::Entity* v); 00025 00026 int getCubatureDegree(int num_qp); 00027 00028 void setParams(const Epetra_Vector* sol, const Epetra_Vector* ovlp_sol, 00029 double element_size, double err_bound, 00030 const std::string state_var_name); 00031 00032 void computeError(); 00033 00034 00035 private: 00036 00037 apf::Mesh2* mesh; 00038 apf::Field* field; 00039 Albany::StateArrayVec& esa; 00040 Albany::WsLIDList& elemGIDws; 00041 00042 Teuchos::RCP<const Epetra_Comm> comm; 00043 const Epetra_Vector* solution; 00044 const Epetra_Vector* ovlp_solution; 00045 00046 std::string sv_name; 00047 double rel_err; 00048 00049 int num_qp; 00050 int cub_degree; 00051 00052 void getFieldFromStateVariable(apf::Field* eps); 00053 void computeErrorFromRecoveredGradients(); 00054 void computeErrorFromStateVariable(); 00055 00056 }; 00057 00058 } 00059 00060 #endif 00061