00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: VariationalProblemExpression.hpp,v 1.9 2007/12/19 00:45:45 delpinux Exp $ 00019 00020 #ifndef VARIATIONAL_PROBLEM_EXPRESSION_HPP 00021 #define VARIATIONAL_PROBLEM_EXPRESSION_HPP 00022 00023 #include <Expression.hpp> 00024 00025 #include <ProblemExpression.hpp> 00026 00027 #include <VariationalFormulaExpression.hpp> 00028 #include <VariationalDirichletListExpression.hpp> 00029 00030 #include <UnknownListExpression.hpp> 00031 #include <TestFunctionExpressionList.hpp> 00032 00033 #include <BoundaryConditionSet.hpp> 00034 class PDECondition; 00035 class Boundary; 00036 00046 class VariationalProblem; 00047 class VariationalProblemExpression 00048 : public ProblemExpression 00049 { 00050 private: 00051 ReferenceCounting<VariationalFormulaExpression> 00052 __variationalFormula; 00054 ReferenceCounting<VariationalDirichletListExpression> 00055 __dirichletList; 00057 ReferenceCounting<UnknownListExpression> 00058 __unknownList; 00060 ReferenceCounting<TestFunctionExpressionList> 00061 __testFunctionList; 00063 ReferenceCounting<VariationalProblem> 00064 __variationalProblem; 00073 std::ostream& put(std::ostream& os) const 00074 { 00075 os << *__variationalFormula << '\n'; 00076 os << *__dirichletList << '\n'; 00077 return os; 00078 } 00079 00080 class AlgebraicPlus; 00081 class AlgebraicMinus; 00082 00089 template <typename AlgebraicOperator> 00090 void __internalSetBilinear(VariationalFormulaExpression::BilinearOperatorList& bilinearList); 00091 00098 template <typename AlgebraicOperator> 00099 void __internalSetLinear(VariationalFormulaExpression::LinearOperatorList& linearList); 00100 00107 template <typename AlgebraicOperator> 00108 void __internalSetBilinearBC(VariationalFormulaExpression::BilinearOperatorList& bilinearList); 00109 00116 template <typename AlgebraicOperator> 00117 void __internalSetLinearBC(VariationalFormulaExpression::LinearOperatorList& linearList); 00118 00126 void __splitLinearBoundaryList(const size_t& testNumber, 00127 const ScalarFunctionBase* f, 00128 const Boundary* b); 00129 00138 void __splitBilinearBoundaryList(const size_t& unknownNumber, 00139 const size_t& testNumber, 00140 const ScalarFunctionBase* alpha, 00141 const Boundary* b); 00142 00150 void __splitBoundaryList(BoundaryConditionSet& bcSet, 00151 const PDECondition* pde, 00152 const Boundary* b); 00153 00154 public: 00155 00162 bool hasPOVBoundary() const; 00163 00172 bool hasPredefinedBoundary() const; 00173 00180 ReferenceCounting<VariationalProblem> variationalProblem(); 00181 00186 void execute(); 00187 00195 VariationalProblemExpression(ReferenceCounting<VariationalFormulaExpression> v, 00196 ReferenceCounting<VariationalDirichletListExpression> d, 00197 ReferenceCounting<TestFunctionExpressionList> t); 00198 00204 VariationalProblemExpression(const VariationalProblemExpression& vp); 00205 00210 ~VariationalProblemExpression(); 00211 }; 00212 00213 #endif // VARIATIONAL_PROBLEM_EXPRESSION_HPP 00214
1.5.6