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 #include "MOR_FullStateReconstructor.hpp" 00007 00008 #include "MOR_ReducedSpace.hpp" 00009 00010 namespace MOR { 00011 00012 FullStateReconstructor::FullStateReconstructor( 00013 const Teuchos::RCP<const ReducedSpace> &reducedSpace, 00014 const Teuchos::RCP<NOX::Epetra::Observer> &decoratedObserver) : 00015 reducedSpace_(reducedSpace), 00016 decoratedObserver_(decoratedObserver), 00017 lastFullSolution_(reducedSpace->basisMap(), false) 00018 { 00019 // Nothing to do 00020 } 00021 00022 void FullStateReconstructor::observeSolution(const Epetra_Vector& solution) 00023 { 00024 computeLastFullSolution(solution); 00025 decoratedObserver_->observeSolution(lastFullSolution_); 00026 } 00027 00028 void FullStateReconstructor::observeSolution(const Epetra_Vector& solution, double time_or_param_val) 00029 { 00030 computeLastFullSolution(solution); 00031 decoratedObserver_->observeSolution(lastFullSolution_, time_or_param_val); 00032 } 00033 00034 void FullStateReconstructor::computeLastFullSolution(const Epetra_Vector& reducedSolution) 00035 { 00036 reducedSpace_->expansion(reducedSolution, lastFullSolution_); 00037 } 00038 00039 } // namespace MOR