#include <SpectralLegendreDiscretizationNonConform.hpp>


Definition at line 41 of file SpectralLegendreDiscretizationNonConform.hpp.
| SpectralLegendreDiscretizationNonConform::SpectralLegendreDiscretizationNonConform | ( | const Problem & | p, | |
| const OctreeMesh & | m, | |||
| BaseMatrix & | a, | |||
| BaseVector & | bb, | |||
| const DegreeOfFreedomSet & | dof, | |||
| const DiscretizationType & | discretizationType | |||
| ) | [inline] |
Constructor of the discretization
| p | the problem | |
| m | the mesh used for discretization | |
| a | matrix storing discretization | |
| bb | vector that stores second member discretization | |
| dof | degrees of freedom set | |
| discretizationType | type of discretization |
Definition at line 214 of file SpectralLegendreDiscretizationNonConform.hpp.
00220 : Discretization(discretizationType, 00221 p, a, bb), 00222 __degreeOfFreedomSet(dof), 00223 __mesh(m), 00224 __discretizationType(discretizationType), 00225 __quadratureDegree(SpectralLegendreDiscretizationNonConform::_getQuadratureDegree(discretizationType)) 00226 { 00227 ; 00228 }
| SpectralLegendreDiscretizationNonConform::~SpectralLegendreDiscretizationNonConform | ( | ) | [inline] |
| static TinyVector<3,size_t> SpectralLegendreDiscretizationNonConform::_getQuadratureDegree | ( | const DiscretizationType & | discretizationType | ) | [inline, static, private] |
Definition at line 53 of file SpectralLegendreDiscretizationNonConform.hpp.
References ASSERT, DiscretizationType::number(), and ScalarDiscretizationTypeBase::spectralLegendre.
00054 { 00055 #ifndef NDEBUG 00056 for (size_t i=0; i<discretizationType.number(); ++i) { 00057 ASSERT(discretizationType[i].type() == ScalarDiscretizationTypeBase::spectralLegendre); 00058 } 00059 #endif // NDEBUG 00060 00061 TinyVector<3,size_t> quadratureDegree 00062 = dynamic_cast <const ScalarDiscretizationTypeSpectral&> (discretizationType[0]).degrees(); 00063 00064 for (size_t i=1; i<discretizationType.number(); ++i) { 00065 TinyVector<3,size_t> degree 00066 = dynamic_cast <const ScalarDiscretizationTypeSpectral&>(discretizationType[i]).degrees(); 00067 for (size_t j=0; j<3; ++j) { 00068 quadratureDegree[j] = std::max(quadratureDegree[j], degree[j]); 00069 } 00070 } 00071 00072 return quadratureDegree; 00073 }

| ReferenceCounting<SpectralLegendreDiscretizer> SpectralLegendreDiscretizationNonConform::_getLocalDiscretizer | ( | const CartesianHexahedron & | h | ) | const [inline, private] |
Definition at line 76 of file SpectralLegendreDiscretizationNonConform.hpp.
References Discretization::__A, Discretization::__b, __degreeOfFreedomSet, __discretizationType, __quadratureDegree, Discretization::b(), and Discretization::problem().
Referenced by assembleSecondMember(), getDiagonal(), timesX(), and transposedTimesX().
00077 { 00078 const TinyVector<3,real_t>& a = h(0); 00079 const TinyVector<3,real_t>& b = h(6); 00080 00081 Structured3DMeshShape s3dM(__quadratureDegree,a,b); 00082 ReferenceCounting<VerticesCorrespondance> correspondance 00083 = new VerticesCorrespondance((__quadratureDegree[0]+1)* 00084 (__quadratureDegree[1]+1)* 00085 (__quadratureDegree[2]+1)); 00086 00087 SpectralMesh quadratureMesh(s3dM,correspondance); 00088 00089 return new SpectralLegendreDiscretizer(this->problem(), 00090 quadratureMesh, 00091 __A, 00092 __b, 00093 __degreeOfFreedomSet, 00094 __discretizationType); 00095 }

| void SpectralLegendreDiscretizationNonConform::assembleMatrix | ( | ) | [inline, virtual] |
Assembles the matrix associated to the PDE operators of the PDE problem.
Implements Discretization.
Definition at line 103 of file SpectralLegendreDiscretizationNonConform.hpp.
References Discretization::__A, Discretization::A(), BaseMatrix::doubleHashedMatrix, UnAssembledMatrix::setDiscretization(), BaseMatrix::unAssembled, and ErrorHandler::unexpected.
00104 { 00105 switch ((this->__A).type()) { 00106 case BaseMatrix::doubleHashedMatrix: { 00107 throw ErrorHandler(__FILE__,__LINE__, 00108 "Spectral Method cannot be used with assembled matrices", 00109 ErrorHandler::unexpected); 00110 } 00111 case BaseMatrix::unAssembled: { 00112 UnAssembledMatrix& A = dynamic_cast<UnAssembledMatrix&>(this->__A); 00113 A.setDiscretization(this); 00114 break; 00115 } 00116 default: { 00117 throw ErrorHandler(__FILE__,__LINE__, 00118 "unexpected matrix type", 00119 ErrorHandler::unexpected); 00120 } 00121 } 00122 }

| void SpectralLegendreDiscretizationNonConform::timesX | ( | const BaseVector & | u, | |
| BaseVector & | v | |||
| ) | const [inline, virtual] |
Applies directly the operator discretization to the vector X.
| u | input vector | |
| v | |
Implements Discretization.
Definition at line 130 of file SpectralLegendreDiscretizationNonConform.hpp.
References __mesh, and _getLocalDiscretizer().
00131 { 00132 dynamic_cast<Vector<real_t>&>(v)=0; 00133 for (OctreeMesh::const_iterator icell(__mesh); 00134 not icell.end(); ++icell) { 00135 const CartesianHexahedron& h = *icell; 00136 00137 this->_getLocalDiscretizer(h)->timesX(u,v); 00138 } 00139 }

| void SpectralLegendreDiscretizationNonConform::transposedTimesX | ( | const BaseVector & | u, | |
| BaseVector & | v | |||
| ) | const [inline, virtual] |
Applies directly the operator discretization to the vector X.
| u | input vector | |
| v | |
Implements Discretization.
Definition at line 147 of file SpectralLegendreDiscretizationNonConform.hpp.
References __mesh, and _getLocalDiscretizer().
00148 { 00149 dynamic_cast<Vector<real_t>&>(v) = 0; 00150 for (OctreeMesh::const_iterator icell(__mesh); 00151 not icell.end(); ++icell) { 00152 const CartesianHexahedron& h = *icell; 00153 00154 this->_getLocalDiscretizer(h)->transposedTimesX(u,v); 00155 } 00156 }

| void SpectralLegendreDiscretizationNonConform::getDiagonal | ( | BaseVector & | z | ) | const [inline, virtual] |
Computes diagonal of the operator
| z | diagonal of the operator |
Implements Discretization.
Definition at line 163 of file SpectralLegendreDiscretizationNonConform.hpp.
References __mesh, and _getLocalDiscretizer().
00164 { 00165 dynamic_cast<Vector<real_t>&>(z)=0; 00166 for (OctreeMesh::const_iterator icell(__mesh); 00167 not icell.end(); ++icell) { 00168 const CartesianHexahedron& h = *icell; 00169 00170 this->_getLocalDiscretizer(h)->getDiagonal(z); 00171 } 00172 }

| void SpectralLegendreDiscretizationNonConform::assembleSecondMember | ( | ) | [inline, virtual] |
Second member assembling
The elementary vector
Implements Discretization.
Definition at line 178 of file SpectralLegendreDiscretizationNonConform.hpp.
References Discretization::__b, __mesh, _getLocalDiscretizer(), Discretization::b(), ffout(), Timer::start(), and Timer::stop().
00179 { 00180 Timer t; 00181 t.start(); 00182 00183 ffout(2) << "- assembling second member\n"; 00184 00186 Vector<real_t>& b = (static_cast<Vector<real_t>&>(this->__b)); 00187 b = 0; 00188 00189 for (OctreeMesh::const_iterator icell(__mesh); 00190 not icell.end(); ++icell) { 00191 const CartesianHexahedron& h = *icell; 00192 00193 this->_getLocalDiscretizer(h)->assembleSecondMember(); 00194 } 00195 00196 ffout(2) << "- assembling second member: done"; 00197 t.stop(); 00198 ffout(3) << " [cost: " << t << ']'; 00199 ffout(2) << '\n'; 00200 }

| void Discretization::setDirichletList | ( | const Vector< bool > & | dirichletList | ) | [inline, inherited] |
Sets dirichlet vertices list
| dirichletList | list of dirichlet vertices |
Definition at line 63 of file Discretization.hpp.
References Discretization::__dirichletList, and ASSERT.
00064 { 00065 ASSERT(__dirichletList == 0); 00066 __dirichletList = &dirichletList; 00067 }
| const Problem& Discretization::problem | ( | ) | const [inline, inherited] |
Read only access to the problem
Definition at line 109 of file Discretization.hpp.
References Discretization::__problem.
Referenced by _getLocalDiscretizer(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleSecondMember().
00110 { 00111 return __problem; 00112 }
| BaseMatrix& Discretization::A | ( | ) | [inline, inherited] |
Read only access to the discretization type
__A
Definition at line 130 of file Discretization.hpp.
References Discretization::__A.
Referenced by assembleMatrix(), SpectralLegendreDiscretizationConform::assembleMatrix(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleMatrix(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleMatrix().
00131 { 00132 return __A; 00133 }
| BaseVector& Discretization::b | ( | ) | [inline, inherited] |
Access to the second member
Definition at line 140 of file Discretization.hpp.
References Discretization::__b.
Referenced by _getLocalDiscretizer(), assembleSecondMember(), SpectralLegendreDiscretizationConform::assembleSecondMember(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleSecondMember().
00141 { 00142 return __b; 00143 }
Definition at line 46 of file SpectralLegendreDiscretizationNonConform.hpp.
Referenced by _getLocalDiscretizer().
const OctreeMesh& SpectralLegendreDiscretizationNonConform::__mesh [private] |
Definition at line 48 of file SpectralLegendreDiscretizationNonConform.hpp.
Referenced by assembleSecondMember(), getDiagonal(), timesX(), and transposedTimesX().
The full description of the discretization
Reimplemented from Discretization.
Definition at line 49 of file SpectralLegendreDiscretizationNonConform.hpp.
Referenced by _getLocalDiscretizer().
const TinyVector<3,size_t> SpectralLegendreDiscretizationNonConform::__quadratureDegree [private] |
Definition at line 50 of file SpectralLegendreDiscretizationNonConform.hpp.
Referenced by _getLocalDiscretizer().
const Problem& Discretization::__problem [protected, inherited] |
The PDEProblem to discretize.
Definition at line 46 of file Discretization.hpp.
Referenced by Discretization::problem().
BaseMatrix& Discretization::__A [protected, inherited] |
The matrix which will contain the discretization.
Definition at line 49 of file Discretization.hpp.
Referenced by _getLocalDiscretizer(), Discretization::A(), assembleMatrix(), SpectralLegendreDiscretizationConform::assembleMatrix(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleMatrix(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleMatrix().
BaseVector& Discretization::__b [protected, inherited] |
The second member.
Definition at line 52 of file Discretization.hpp.
Referenced by _getLocalDiscretizer(), assembleSecondMember(), SpectralLegendreDiscretizationConform::assembleSecondMember(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleSecondMember(), and Discretization::b().
const Vector<bool>* Discretization::__dirichletList [protected, inherited] |
elimination dirichlet informations
Definition at line 55 of file Discretization.hpp.
Referenced by Discretization::setDirichletList(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::timesX(), FEMDiscretization< GivenMeshType, TypeOfDiscretization >::timesX(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::transposedTimesX(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::transposedTimesX().
1.5.6