Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "SundanceWatchFlag.hpp"
00032 #include "SundanceOut.hpp"
00033
00034 using namespace Sundance;
00035
00036
00037 WatchFlag::WatchFlag(const std::string& name,
00038 const ParameterList& params)
00039 : name_(name), params_(rcp(new ParameterList(params)))
00040 {
00041 if (name_.size() > 0) isActiveMap().put(name, true);
00042 else isActiveMap().put(name, false);
00043 }
00044
00045 void WatchFlag::activate()
00046 {
00047 isActiveMap()[name()] = true;
00048 }
00049
00050 void WatchFlag::deactivate()
00051 {
00052 isActiveMap()[name()] = false;
00053 }
00054
00055 bool WatchFlag::isActive() const
00056 {
00057 return isActiveMap().get(name());
00058 }
00059
00060 XMLObject WatchFlag::toXML() const
00061 {
00062 XMLObject xml("WatchFlag");
00063 xml.addAttribute("name", name());
00064 return xml;
00065 }
00066
00067 int WatchFlag::param(const std::string& name) const
00068 {
00069 return params_->get<int>(name);
00070 }
00071
00072
00073 void WatchFlag::setParam(const std::string& name, int val)
00074 {
00075 params_->set<int>(name, val);
00076 }
00077
00078
00079
00080
00081 RCP<ParameterList> WatchFlag::defaultParams()
00082 {
00083 static RCP<ParameterList> rtn=rcp(new ParameterList());
00084 static bool first=true;
00085 if (first)
00086 {
00087 rtn->set<int>("evaluation", 0);
00088 rtn->set<int>("discrete function evaluation", 0);
00089 rtn->set<int>("symbolic preprocessing", 0);
00090 rtn->set<int>("equation set setup", 0);
00091 rtn->set<int>("assembler setup", 0);
00092 rtn->set<int>("assembly loop", 0);
00093 rtn->set<int>("dof map setup", 0);
00094 rtn->set<int>("dof map access", 0);
00095 rtn->set<int>("eval mediator", 0);
00096 rtn->set<int>("integration setup", 0);
00097 rtn->set<int>("integration", 0);
00098 rtn->set<int>("integral transformation", 0);
00099 rtn->set<int>("fill", 0);
00100 rtn->set<int>("matrix config", 0);
00101 rtn->set<int>("vector config", 0);
00102 rtn->set<int>("solve control", 0);
00103 first = false;
00104 }
00105 return rtn;
00106 }