SpectralLegendreDiscretizationConform Class Reference

#include <SpectralLegendreDiscretizationConform.hpp>

Inheritance diagram for SpectralLegendreDiscretizationConform:

Inheritance graph
[legend]
Collaboration diagram for SpectralLegendreDiscretizationConform:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void assembleMatrix ()
void timesX (const BaseVector &u, BaseVector &v) const
void transposedTimesX (const BaseVector &u, BaseVector &v) const
void getDiagonal (BaseVector &z) const
void getMultiDiagonal (BaseMatrix &A) const
void assembleSecondMember ()
 SpectralLegendreDiscretizationConform (const Problem &p, const SpectralMesh &m, BaseMatrix &a, BaseVector &bb, const DegreeOfFreedomSet &dof, const DiscretizationType &discretizationType)
 ~SpectralLegendreDiscretizationConform ()
void setDirichletList (const Vector< bool > &dirichletList)
const Problemproblem () const
BaseMatrixA ()
BaseVectorb ()

Protected Attributes

const DiscretizationType __discretizationType
const Problem__problem
 The PDEProblem to discretize.
BaseMatrix__A
 The matrix which will contain the discretization.
BaseVector__b
 The second member.
const Vector< bool > * __dirichletList
 elimination dirichlet informations

Private Attributes

SpectralLegendreDiscretizer __spectralLegendreDiscretizer
const DegreeOfFreedomSet__degreeOfFreedomSet
const SpectralMesh__mesh


Detailed Description

Definition at line 41 of file SpectralLegendreDiscretizationConform.hpp.


Constructor & Destructor Documentation

SpectralLegendreDiscretizationConform::SpectralLegendreDiscretizationConform ( const Problem p,
const SpectralMesh m,
BaseMatrix a,
BaseVector bb,
const DegreeOfFreedomSet dof,
const DiscretizationType discretizationType 
)

Constructor of the discretization

Parameters:
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 23 of file SpectralLegendreDiscretizationConform.cpp.

00029   : Discretization(discretizationType,
00030                    p, a, bb),
00031     __spectralLegendreDiscretizer(p,m,a,bb,dof,discretizationType),
00032     __degreeOfFreedomSet(dof),
00033     __mesh(m)
00034 {
00035   ;
00036 }

SpectralLegendreDiscretizationConform::~SpectralLegendreDiscretizationConform (  ) 

Destructor

Definition at line 39 of file SpectralLegendreDiscretizationConform.cpp.

00040 {
00041   ;
00042 }


Member Function Documentation

void SpectralLegendreDiscretizationConform::assembleMatrix (  )  [inline, virtual]

Assembles the matrix associated to the PDE operators of the PDE problem.

Implements Discretization.

Definition at line 57 of file SpectralLegendreDiscretizationConform.hpp.

References Discretization::__A, Discretization::A(), BaseMatrix::doubleHashedMatrix, UnAssembledMatrix::setDiscretization(), BaseMatrix::unAssembled, and ErrorHandler::unexpected.

00058   {
00059     switch ((this->__A).type()) {
00060     case BaseMatrix::doubleHashedMatrix: {
00061       throw ErrorHandler(__FILE__,__LINE__,
00062                          "Spectral Method cannot be used with assembled matrices",
00063                          ErrorHandler::unexpected);
00064     }
00065     case BaseMatrix::unAssembled: {
00066       UnAssembledMatrix& A = dynamic_cast<UnAssembledMatrix&>(this->__A);
00067       A.setDiscretization(this);
00068       break;
00069     }
00070     default: {
00071       throw ErrorHandler(__FILE__,__LINE__,
00072                          "unexpected matrix type",
00073                          ErrorHandler::unexpected);
00074     }
00075     }
00076   }

Here is the call graph for this function:

void SpectralLegendreDiscretizationConform::timesX ( const BaseVector u,
BaseVector v 
) const [inline, virtual]

Applies directly the operator discretization to the vector X.

Parameters:
u input vector
v $ v=Au $

Implements Discretization.

Definition at line 84 of file SpectralLegendreDiscretizationConform.hpp.

References __spectralLegendreDiscretizer, and SpectralLegendreDiscretizer::timesX().

00085   {
00086     dynamic_cast<Vector<real_t>&>(v)=0;
00087     __spectralLegendreDiscretizer.timesX(u,v);
00088   }

Here is the call graph for this function:

void SpectralLegendreDiscretizationConform::transposedTimesX ( const BaseVector u,
BaseVector v 
) const [inline, virtual]

Applies directly the operator discretization to the vector X.

Parameters:
u input vector
v $ v=A^T u $

Implements Discretization.

Definition at line 96 of file SpectralLegendreDiscretizationConform.hpp.

References __spectralLegendreDiscretizer, and SpectralLegendreDiscretizer::transposedTimesX().

00097   {
00098     dynamic_cast<Vector<real_t>&>(v) = 0;
00099     __spectralLegendreDiscretizer.transposedTimesX(u,v);
00100   }

Here is the call graph for this function:

void SpectralLegendreDiscretizationConform::getDiagonal ( BaseVector z  )  const [inline, virtual]

Computes diagonal of the operator

Parameters:
z diagonal of the operator

Implements Discretization.

Definition at line 107 of file SpectralLegendreDiscretizationConform.hpp.

References __spectralLegendreDiscretizer, and SpectralLegendreDiscretizer::getDiagonal().

00108   {
00109     dynamic_cast<Vector<real_t>&>(z)=0;
00110     __spectralLegendreDiscretizer.getDiagonal(z);
00111   }

Here is the call graph for this function:

void SpectralLegendreDiscretizationConform::getMultiDiagonal ( BaseMatrix A  )  const [inline]

Computes diagonal of the operator

Parameters:
A multi-diagonal matrix

Definition at line 118 of file SpectralLegendreDiscretizationConform.hpp.

References __spectralLegendreDiscretizer, SpectralLegendreDiscretizer::getMultiDiagonal(), and BaseMatrix::reset().

00119   {
00120     A.reset();
00121     __spectralLegendreDiscretizer.getMultiDiagonal(A);
00122   }

Here is the call graph for this function:

void SpectralLegendreDiscretizationConform::assembleSecondMember (  )  [inline, virtual]

Second member assembling

The elementary vector

Implements Discretization.

Definition at line 128 of file SpectralLegendreDiscretizationConform.hpp.

References Discretization::__b, __spectralLegendreDiscretizer, SpectralLegendreDiscretizer::assembleSecondMember(), Discretization::b(), ffout(), Timer::start(), and Timer::stop().

00129   {
00130     Timer t;
00131     t.start();
00132     
00133     ffout(2) << "- assembling second member\n";
00134     
00136     Vector<real_t>& b = (static_cast<Vector<real_t>&>(this->__b));
00137     b = 0;
00138 
00139     __spectralLegendreDiscretizer.assembleSecondMember();
00140 
00141     ffout(2) << "- assembling second member: done";
00142     t.stop();
00143     ffout(3) << " [cost: " << t << ']';
00144     ffout(2) << '\n';
00145   }

Here is the call graph for this function:

void Discretization::setDirichletList ( const Vector< bool > &  dirichletList  )  [inline, inherited]

Sets dirichlet vertices list

Parameters:
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]

BaseMatrix& Discretization::A (  )  [inline, inherited]

Read only access to the discretization type

Returns:
__type Access to the matrix

__A

Definition at line 130 of file Discretization.hpp.

References Discretization::__A.

Referenced by SpectralLegendreDiscretizationNonConform::assembleMatrix(), assembleMatrix(), FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleMatrix(), and FEMDiscretization< GivenMeshType, TypeOfDiscretization >::assembleMatrix().

00131   {
00132     return __A;
00133   }

BaseVector& Discretization::b (  )  [inline, inherited]


Member Data Documentation

Definition at line 47 of file SpectralLegendreDiscretizationConform.hpp.

Definition at line 49 of file SpectralLegendreDiscretizationConform.hpp.

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]

BaseVector& Discretization::__b [protected, inherited]

const Vector<bool>* Discretization::__dirichletList [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Wed Nov 19 00:14:45 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6