Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef PHAL_LANGEVINNOISETERM_HPP
00008 #define PHAL_LANGEVINNOISETERM_HPP
00009
00010 #include "Phalanx_ConfigDefs.hpp"
00011 #include "Phalanx_Evaluator_WithBaseImpl.hpp"
00012 #include "Phalanx_Evaluator_Derived.hpp"
00013 #include "Phalanx_MDField.hpp"
00014
00015 #include "QCAD_EvaluatorTools.hpp"
00016
00017
00018 #include <boost/random.hpp>
00019 #include <boost/random/normal_distribution.hpp>
00020 #include <boost/random/mersenne_twister.hpp>
00021 #include <boost/random/variate_generator.hpp>
00022
00028 namespace PHAL {
00029
00030 template<typename EvalT, typename Traits>
00031 class LangevinNoiseTerm : public PHX::EvaluatorWithBaseImpl<Traits>,
00032 public PHX::EvaluatorDerived<EvalT, Traits>,
00033 public QCAD::EvaluatorTools<EvalT, Traits>
00034 {
00035
00036 public:
00037
00038 typedef typename EvalT::ScalarT ScalarT;
00039
00040 LangevinNoiseTerm(const Teuchos::ParameterList& p);
00041
00042 void postRegistrationSetup(typename Traits::SetupData d,
00043 PHX::FieldManager<Traits>& vm);
00044
00045 void evaluateFields(typename Traits::EvalData d);
00046
00047 ScalarT& getValue(const std::string &n);
00048
00049
00050 private:
00051
00052 typedef typename EvalT::MeshScalarT MeshScalarT;
00053
00054
00055 PHX::MDField<ScalarT,Cell,QuadPoint> rho;
00056
00057
00058 PHX::MDField<ScalarT,Cell,QuadPoint> noiseTerm;
00059
00060 unsigned int numQPs, numDims, numNodes;
00061
00062 ScalarT sd;
00063 Teuchos::Array<int> duration;
00064
00065 boost::mt19937 rng;
00066 Teuchos::RCP<boost::normal_distribution<double> > nd;
00067 Teuchos::RCP<boost::variate_generator<boost::mt19937&, boost::normal_distribution<double> > > var_nor;
00068
00069
00070
00071
00072 long seedgen();
00073
00074 };
00075 }
00076
00077 #endif