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 #ifndef SUNDANCE_FUNCTIONAL_H
00032 #define SUNDANCE_FUNCTIONAL_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceLinearProblem.hpp"
00036 #include "SundanceVectorCalculus.hpp"
00037 #include "SundanceNonlinearProblem.hpp"
00038 #include "SundanceFunctionalEvaluator.hpp"
00039 #include "PlayaNonlinearOperator.hpp"
00040 #include "PlayaLinearSolverDecl.hpp"
00041 #include "PlayaVectorDecl.hpp"
00042 #include "PlayaVectorType.hpp"
00043 
00044 namespace Sundance
00045 {
00046 using namespace Sundance;
00047 using namespace Teuchos;
00048 
00049 
00050 
00051 
00052 class Functional
00053 {
00054 public:
00055 
00056   Functional(){;}
00057 
00058 
00059   Functional(
00060     const Mesh& mesh, 
00061     const Expr& integral, 
00062     const Playa::VectorType<double>& vecType);
00063 
00064 
00065   Functional(
00066     const Mesh& mesh, 
00067     const Expr& integral, 
00068     const Expr& essentialBC,
00069     const Playa::VectorType<double>& vecType);
00070 
00071 
00072   LinearProblem linearVariationalProb(const Expr& var,
00073     const Expr& varEvalPts,
00074     const Expr& unk,
00075     const Expr& fixed,
00076     const Expr& fixedEvalPts) const ;
00077 
00078     
00079 
00080   NonlinearProblem
00081   nonlinearVariationalProb(const Expr& var,
00082     const Expr& varEvalPts,
00083     const Expr& unk,
00084     const Expr& unkEvalPts,
00085     const Expr& fixed,
00086     const Expr& fixedEvalPts) const ;
00087 
00088 
00089 
00090   FunctionalEvaluator evaluator(const Expr& var,
00091     const Expr& varEvalPts,
00092     const Expr& fixed,
00093     const Expr& fixedEvalPts) const ;
00094 
00095 
00096 
00097   FunctionalEvaluator evaluator(const Expr& var,
00098     const Expr& varEvalPts) const ;
00099 
00100 
00101   const Mesh& mesh() const {return mesh_;}
00102     
00103 
00104 private:
00105   Mesh mesh_;
00106 
00107   Expr integral_;
00108 
00109   Expr bc_;
00110 
00111   Playa::VectorType<double> vecType_;
00112     
00113 };
00114 
00115 
00116 double L2Norm(const Mesh& mesh, const CellFilter& domain,
00117   const Expr& expr, const QuadratureFamily& quad,
00118   const WatchFlag& watch=WatchFlag());
00119 
00120 
00121 double H1Seminorm(
00122   const Mesh& mesh,
00123   const CellFilter& filter,
00124   const Expr& f,
00125   const QuadratureFamily& quad,
00126   const WatchFlag& watch=WatchFlag());
00127 
00128 
00129 double H1Norm(
00130   const Mesh& mesh,
00131   const CellFilter& filter,
00132   const Expr& f,
00133   const QuadratureFamily& quad,
00134   const WatchFlag& watch=WatchFlag());
00135 }
00136 
00137 
00138 #endif