Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
BandSPDLinSOE Class Reference#include <BandSPDLinSOE.h>
Inheritance diagram for BandSPDLinSOE::
List of all members.
Public Methods |
| BandSPDLinSOE (BandSPDLinSolver &theSolver) |
| BandSPDLinSOE (int N, int bandwidth, BandSPDLinSolver &theSolver) |
| ~BandSPDLinSOE () |
int | getNumEqn (void) const |
int | setSize (Graph &theGraph) |
| pure virtual functions. More...
|
int | addA (const Matrix &, const ID &, double fact=1.0) |
int | addB (const Vector &, const ID &, double fact=1.0) |
int | setB (const Vector &, double fact=1.0) |
void | zeroA (void) |
void | zeroB (void) |
const Vector& | getX (void) |
const Vector& | getB (void) |
double | normRHS (void) |
void | setX (int loc, double value) |
int | setBandSPDSolver (BandSPDLinSolver &newSolver) |
int | sendSelf (int commitTag, Channel &theChannel) |
int | recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) |
Detailed Description
BandSPDLinSOE is class which is used to store a banded symmetric system with ku superdiagonals. The
matrix is stored in a 1d double array with (ku+1)*n elements, where n is the size of the system.
is stored at location
, where
and
range from
to
, i.e. C notation. For example when
,
:
\left[ \begin{array}{ccccc} a_{0,0} & a_{0,1} & a_{0,1} & 0 & 0 \ a_{1,0} & a_{1,1} & a_{1,2} & a_{1,3} & 0 \ a_{2,0} & a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} \ 0 & a_{3,1} & a_{3,2} & a_{3,3} & a_{3,4} \ 0 & 0 & a_{4,2} & a_{4,3} & a_{4,4} \ \end{array} \right]
is stored in:
\left[ \begin{array}{cccccccccccccccccccc} & * & a_{0,0} & * & a_{0,1} & a_{1,1} & a_{0,2} & a_{1,2} & a_{2,2} & a_{1,3} & a_{2,3} & a_{3,3} & a_{2,4} & a_{3,4} & a_{4,4}\ \end{array} \right]
The
and
vectors are stored in 1d double arrays of length
. \
{\bf Interface} \ {// Constructors} \ {BandSPDLinSOE(BandSPDLinSolver &theSolver);} \ {BandSPDLinSOE(int N, int ku, BandSPDLinSolver &theSolver);}\ \ {// Destructor} \ {\form#41BandSPDLinSOE();}\\ \ {// Public Methods } \ {int setBandSPDSolver(BandSPDLinSolver &newSolver);}\ {int setSize(const Graph &theGraph) =0; } \ {int getNumEqn(void) =0; } \ {int addA(const Matrix &theMatrix, const ID & loc, doublefact = 1.0) =0;} \ {int addB(const Vector & theVector, const ID & loc, double fact = 1.0) =0;} \ {int setB(const Vector & theVector, double fact = 1.0) =0;} \ {void zeroA(void) =0;} \ {void zeroB(void) =0;} \ {const Vector &getX(void) = 0;} \ {const Vector &getB(void) = 0;} \ {double normRHS(void) =0;} \ {void setX(int loc, double value) =0;}\ {int sendSelf(int commitTag, Channel &theChannel);}\ {int recvSelf(int commitTag, Channel &theChannel, FEM\_ObjectBroker &theBroker);}\
{\bf Constructors} \ {BandSPDLinSOE(BandSPDLinSolver &solver);} \ The {solver} and a unique class tag (defined in
classTags.h\form#24) are passed to the LinearSOE constructor. The system size is set to
and the matrix
is marked as not having been factored. Invokes {setLinearSOE(*this)} on the {solver}. No memory is allocated for the 3 1d arrays. \
{BandSPDLinSOE(int N, int ku, BandSPDLinSolver &theSolver);}\ The {solver} and a unique class tag (defined in
classTags.h\form#24) are passed to the LinearSOE constructor. Sets the size of the system to
, the number of superdiagonals to {ku}. Allocates memory for the arrays; if not enough memory is available a warning message is printed and the system size is set to
. Sets the solver to be called when solving the equations to {theSolver}. Invokes {setLinearSOE(*this)} and {setSize()} on the {theSolver}, printing a warning message if {setSize()} returns a negative number. Also creates Vector objects for
and
using the {(double *,int)} Vector constructor. \
{\bf Destructor} \ {\form#41BandSPDLinSOE();}\\ Calls delete on any arrays created. \
{\bf Public Methods } \ {int setBandSPDSolver(BandSPDLinSolver &newSolver);}\ Invokes {setLinearSOE(*this)} on {newSolver}. If the system size is not equal to
, it also invokes {setSize()} on {newSolver}, printing a warning and returning the returned value if this method returns a number less than
. Finally it returns the result of invoking the LinearSOE classes {setSolver()} method. \
{int getNumEqn(void) =0; } \ A method which returns the current size of the system. \
{int setSize(const Graph &G); } \ The size of the system is determined by looking at the adjacency ID of each Vertex in the Graph object {G}. This is done by first setting {ku} equal to
and then checking for each Vertex in {G}, whether any of the vertex tags in the Vertices adjacency ID results in {ku} being increased. Knowing {ku} and the size of the system (the number of Vertices in {G}, a check to see if the previously allocated 1d arrays for
,
and
are large enough. If the memory portions allocated for the 1d arrays are not big enough, the old space is returned to the heap and new space is allocated from the heap. Prints a warning message if not enough memory is available on the heap for the 1d arrays and returns a
. If memory is available, the components of the arrays are zeroed and
is marked as being unfactored. If the system size has increased, new Vector objects for
and
using the {(double ,int)} Vector constructor are created. Finally, the result of invoking {setSize()} on the associated Solver object is returned. \
{int addA(const Matrix &M, const ID & loc, doublefact = 1.0) =0;} \ First tests that {loc} and {M} are of compatible sizes; if not a warning message is printed and a
is returned. The LinearSOE object then assembles {fact} times the Matrix {M} into the matrix
. The Matrix is assembled into
at the locations given by the ID object {loc}, i.e.
. If the location specified is outside the range, i.e.
the corresponding entry in {M} is not added to
. If {fact} is equal to
or
, more efficient steps are performed. Returns
. \
{int addB(const Vector & V, const ID & loc, double fact = 1.0) =0;} \ First tests that {loc} and {V} are of compatible sizes; if not a warning message is printed and a
is returned. The LinearSOE object then assembles {fact} times the Vector {V} into the vector
. The Vector is assembled into
at the locations given by the ID object {loc}, i.e.
. If a location specified is outside the range, e.g.
, the corresponding entry in {V} is not added to
. If {fact} is equal to
,
or
, more efficient steps are performed. Returns
. \
{int setB(const Vector & V, double fact = 1.0) =0;} \ First tests that {V} and the size of the system are of compatible sizes; if not a warning message is printed and a
is returned. The LinearSOE object then sets the vector {b} to be {fact} times the Vector {V}. If {fact} is equal to
,
or
, more efficient steps are performed. Returns
. \
{void zeroA(void) =0;} \ Zeros the entries in the 1d array for
and marks the system as not having been factored. \
{void zeroB(void) =0;} \ Zeros the entries in the 1d array for
. \
{const Vector &getX(void) = 0;} \ Returns the Vector object created for
. \
{const Vector &getB(void) = 0;} \ Returns the Vector object created for
. \
{double normRHS(void) =0;} \ Returns the 2-norm of the vector
. \
{void setX(int loc, double value) =0;}\ If {loc} is within the range of
, sets
. \
{int sendSelf(int commitTag, Channel &theChannel);}\ Returns
. The object does not send any data or connectivity information as this is not needed in the finite element design. \
{int recvSelf(int commitTag, Channel &theChannel, FEM\_ObjectBroker &theBroker);}\ Returns
. The object does not receive any data or connectivity information as this is not needed in the finite element design.
Definition at line 227 of file BandSPDLinSOE.h.
Constructor & Destructor Documentation
BandSPDLinSOE::BandSPDLinSOE (
|
int N,
|
|
int bandwidth,
|
|
BandSPDLinSolver & theSolver )
|
|
BandSPDLinSOE::~BandSPDLinSOE (
|
)
|
|
Member Function Documentation
int BandSPDLinSOE::addA (
|
const Matrix & m,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
int BandSPDLinSOE::addB (
|
const Vector & v,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
const Vector & BandSPDLinSOE::getB (
|
void ) [virtual]
|
|
|
To return as a Vector object the vector
. A const reference is returned, meaning the Vector that is returned cannot be modified, i.e. no non-const method can be invoked on the Vector.
Reimplemented from LinearSOE.
Definition at line 382 of file BandSPDLinSOE.cpp. |
int BandSPDLinSOE::getNumEqn (
|
void ) const [virtual]
|
|
|
A method which returns the number of equations in the system, i.e. the number of unknowns.
Reimplemented from LinearSOE.
Definition at line 124 of file BandSPDLinSOE.cpp. |
const Vector & BandSPDLinSOE::getX (
|
void ) [virtual]
|
|
|
To return, as a Vector object, the vector
. A const reference is returned, meaning the Vector that is returned cannot be modified, i.e. no non-const method can be invoked on the Vector.
Reimplemented from LinearSOE.
Definition at line 372 of file BandSPDLinSOE.cpp. |
double BandSPDLinSOE::normRHS (
|
void ) [virtual]
|
|
|
This is a pure virtual method, one must be written for each instantiable subclass of MovableObject. Each object has to receive the data needed to be able to recreate itself in the new process after it has been sent through {theChannel}. If the object is an aggregation containing other objects, new objects of the correct type can be constructed using {theBroker}. To return
if successful or a
if not.
Reimplemented from MovableObject.
Definition at line 429 of file BandSPDLinSOE.cpp. |
int BandSPDLinSOE::sendSelf (
|
int commitTag,
|
|
Channel & theChannel ) [virtual]
|
|
|
This is a pure virtual method, one must be written for each instantiable subclass of MovableObject. Each object has to send the data needed to be able to reproduce that object in a remote process. The object uses the methods provided by {theChannel} object to send the data to another channel at the remote actor, the address of the channel is set before this method is called. An object of similar type at the remote actor is invoked with a {receiveSelf()} to receive the data. Returns
if successful (successful in that the data got to the channel), or a
if no data was sent.
Reimplemented from MovableObject.
Definition at line 422 of file BandSPDLinSOE.cpp. |
int BandSPDLinSOE::setB (
|
const Vector & v,
|
|
double fact = 1.0 ) [virtual]
|
|
int BandSPDLinSOE::setSize (
|
Graph & theGraph ) [virtual]
|
|
void BandSPDLinSOE::setX (
|
int loc,
|
|
double value ) [virtual]
|
|
void BandSPDLinSOE::zeroA (
|
void ) [virtual]
|
|
void BandSPDLinSOE::zeroB (
|
void ) [virtual]
|
|
The documentation for this class was generated from the following files:
|