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: FictitiousDomainMethod.hpp,v 1.11 2007/08/18 15:57:41 delpinux Exp $ 00019 00020 #ifndef FICTITIOUS_DOMAIN_METHOD_HPP 00021 #define FICTITIOUS_DOMAIN_METHOD_HPP 00022 00023 #include <BaseMatrix.hpp> 00024 #include <BaseVector.hpp> 00025 00026 #include <Method.hpp> 00027 00028 #include <Problem.hpp> 00029 #include <PDESystem.hpp> 00030 00031 #include <Solution.hpp> 00032 00033 #include <DegreeOfFreedomSet.hpp> 00034 00035 #include <Mesh.hpp> 00036 00037 #include <DiscretizationType.hpp> 00038 00039 class BoundaryConditionDiscretization; 00040 00049 class FictitiousDomainMethod 00050 : public Method 00051 { 00052 protected: 00053 ReferenceCounting<BaseMatrix> __A; 00054 ReferenceCounting<BaseVector> __b; 00056 ConstReferenceCounting<Mesh> __mesh; 00058 ConstReferenceCounting<Problem> __problem; 00060 const DegreeOfFreedomSet& __degreeOfFreedomSet; 00062 private: 00070 template <typename MeshType> 00071 void __computesDegreesOfFreedom(ConstReferenceCounting<Problem> givenProblem); 00072 00073 template <typename CellType> 00074 real_t __integrateCharacteristicFunction(const CellType& e, const Domain& D); 00075 00080 template <typename MeshType, 00081 ScalarDiscretizationTypeBase::Type TypeOfDiscretization> 00082 void __discretizeOnMesh(); 00083 00088 template <ScalarDiscretizationTypeBase::Type TypeOfDiscretization> 00089 void __discretize(); 00090 00091 protected: 00097 virtual ReferenceCounting<BoundaryConditionDiscretization> discretizeBoundaryConditions() = 0; 00098 00105 void computesDegreesOfFreedom(ConstReferenceCounting<Problem> givenProblem); 00106 public: 00112 void Discretize (ConstReferenceCounting<Problem> P); 00113 00119 void Compute (Solution& u); 00120 00126 const Problem& problem() const 00127 { 00128 return *__problem; 00129 } 00130 00136 const Mesh& mesh() const 00137 { 00138 return *__mesh; 00139 } 00140 00150 FictitiousDomainMethod(const DiscretizationType& discretization, 00151 ConstReferenceCounting<Mesh> mesh, 00152 const DegreeOfFreedomSet& dof) 00153 : Method(discretization), 00154 __mesh(mesh), 00155 __degreeOfFreedomSet(dof) 00156 { 00157 ; 00158 } 00159 00164 virtual ~FictitiousDomainMethod() 00165 { 00166 ; 00167 } 00168 }; 00169 00170 #endif // FICTITIOUS_DOMAIN_METHOD_HPP
1.5.6