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 #include "AAdapt_UnifRefSizeField.hpp" 00008 #include "AlbPUMI_FMDBMeshStruct.hpp" 00009 #include "Epetra_Import.h" 00010 00011 #include "Albany_Utils.hpp" 00012 00013 #include <boost/mpi/collectives.hpp> 00014 #include <boost/mpi/collectives/all_reduce.hpp> 00015 00016 00017 00018 const double dist(double* p1, double* p2) { 00019 00020 return std::sqrt(p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2]); 00021 00022 } 00023 00024 AAdapt::UnifRefSizeField::UnifRefSizeField(const Teuchos::RCP<AlbPUMI::AbstractPUMIDiscretization>& disc) : 00025 mesh(disc->getFMDBMeshStruct()->apfMesh), 00026 comm(disc->getComm()) { 00027 initialAverageEdgeLength = ma::getAverageEdgeLength(mesh); 00028 } 00029 00030 AAdapt::UnifRefSizeField:: 00031 ~UnifRefSizeField() { 00032 } 00033 00034 void 00035 AAdapt::UnifRefSizeField::computeError() { 00036 } 00037 00038 void 00039 AAdapt::UnifRefSizeField::setParams(const Epetra_Vector* sol, const Epetra_Vector* ovlp_sol, 00040 double element_size, double err_bound, 00041 const std::string state_var_name) { 00042 00043 solution = sol; 00044 ovlp_solution = ovlp_sol; 00045 elem_size = element_size; 00046 00047 } 00048 00049 double AAdapt::UnifRefSizeField::getValue(ma::Entity* v) { 00050 return 0.5 * initialAverageEdgeLength; 00051 } 00052