Changeset dfed1c for src/commands/com_check_residual.cpp
- Timestamp:
- Nov 22, 2011, 9:22:10 PM (14 years ago)
- Children:
- facba0
- Parents:
- 66f24d
- File:
-
- 1 edited
-
src/commands/com_check_residual.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/commands/com_check_residual.cpp
r66f24d rdfed1c 14 14 15 15 #include <cmath> 16 #include <cstdio>17 16 18 17 #include "base/command.hpp" … … 30 29 Request Run(Command::argument_vector arguments) 31 30 { 32 const vmg_float res = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs()); 33 const vmg_float& precision = MG::GetFactory().GetObject("PRECISION")->Cast< ObjectStorage<vmg_float> >()->Val(); 31 MPE_EVENT_BEGIN() 34 32 35 #ifdef DEBUG 36 if (MG::GetComm()->Rank() == 0) 37 printf("Multigrid: Residual: %e\n", res); 38 #endif 33 const vmg_float& res = MG::GetFactory().GetObjectStorageVal<vmg_float>(arguments[0]); 34 const vmg_float& precision = MG::GetFactory().Get("PRECISION")->Cast< ObjectStorage<vmg_float> >()->Val(); 39 35 40 if (fabs(res) < precision) 36 MPE_EVENT_END() 37 38 if (std::fabs(res) < precision) 41 39 return StopCycleLater; 42 40 else … … 45 43 46 44 static const char* Name() {return "CheckResidual";} 47 static int Arguments() {return 0;}45 static int Arguments() {return 1;} 48 46 }; 49 47 50 CREATE_INITIALIZER(VMGCommandCheckResidual) ;48 CREATE_INITIALIZER(VMGCommandCheckResidual) 51 49
Note:
See TracChangeset
for help on using the changeset viewer.
