Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
BandGenLinSOE Class Reference#include <BandGenLinSOE.h>
Inheritance diagram for BandGenLinSOE::
List of all members.
Public Methods |
| BandGenLinSOE (BandGenLinSolver &theSolver) |
| BandGenLinSOE (int N, int numSuperDiagonals, int numSubDiagonal, BandGenLinSolver &theSolver) |
| ~BandGenLinSOE () |
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 | setBandGenSolver (BandGenLinSolver &newSolver) |
int | sendSelf (int commitTag, Channel &theChannel) |
int | recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) |
Detailed Description
BandGenLinSOE is class which is used to store a banded unsymmetric system with kl subdiagonals and ku superdiagonals. The
matrix is stored in a 1d double array with (kl+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
,
and
:
\left[ \begin{array}{ccccc} a_{0,0} & a_{0,1} & 0 & 0 & 0 \ a_{1,0} & a_{1,1} & a_{1,2} & 0 & 0 \ a_{2,0} & a_{2,1} & a_{2,2} & a_{2,3} & 0 \ 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}{ccccccccccccccccccccc} & a_{0,0} & a_{1,0} & a_{2,0} & a_{0,1} & a_{1,1} & a_{2,1} & a_{3,1} & a_{1,2} & a_{2,2} & a_{3,2} & a_{4,2} & a_{2,3} & a_{3,3} & a_{4,3} & * & a_{3,4} & a_{4,4} & * & * \ \end{array} \right]
The
and
vectors are stored in 1d double arrays of length
. To allow the solvers access to this data, the solvers that use this class are all declared as friend classes. \
{\bf Interface} \ {// Constructors} \ {BandGenLinSOE(BandGenLinSolver &theSolver);} \ {BandGenLinSOE(int N, int numSuperDiagonals, int numSubDiagonal, BandGenLinSolver &theSolver); }\ \ {// Destructor} \ {\form#41BandGenLinSOE();}\\ \ {// Public Methods } \ {int setBandGenSolver(BandGenLinSolver &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} \ {BandGenLinSOE(BandGenLinSolver &theSolver);} \ 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 {theSolver}. No memory is allocated for the 3 1d arrays. \
{BandGenLinSOE(int N, int numSuperDiagonals, int numSubDiagonal, BandGenLinSolver &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 {numSuperDiagonals} and number of subdiagonals to {numSubDiagonals}. 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}. Also creates Vector objects for
and
using the {(double *,int)} Vector constructor. \
{\bf Destructor} \ {\form#25BandGenLinSOE();}\\ Calls delete on any arrays created. \
{\bf Public Methods} \ {int setBandGenSolver(BandGenLinSolver &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 {kl} and {ku} equal to
and then checking for each Vertex in {G}, whether any of the vertex tags in the Vertices adjacency ID results in {kl} or {ku} being increased. Knowing {kl}, {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 241 of file BandGenLinSOE.h.
Constructor & Destructor Documentation
BandGenLinSOE::BandGenLinSOE (
|
int N,
|
|
int numSuperDiagonals,
|
|
int numSubDiagonal,
|
|
BandGenLinSolver & theSolver )
|
|
BandGenLinSOE::~BandGenLinSOE (
|
)
|
|
Member Function Documentation
int BandGenLinSOE::addA (
|
const Matrix & m,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
int BandGenLinSOE::addB (
|
const Vector & v,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
const Vector & BandGenLinSOE::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 403 of file BandGenLinSOE.cpp. |
int BandGenLinSOE::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 105 of file BandGenLinSOE.cpp. |
const Vector & BandGenLinSOE::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 392 of file BandGenLinSOE.cpp. |
double BandGenLinSOE::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 459 of file BandGenLinSOE.cpp. |
int BandGenLinSOE::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 452 of file BandGenLinSOE.cpp. |
int BandGenLinSOE::setB (
|
const Vector & v,
|
|
double fact = 1.0 ) [virtual]
|
|
int BandGenLinSOE::setSize (
|
Graph & theGraph ) [virtual]
|
|
void BandGenLinSOE::setX (
|
int loc,
|
|
double value ) [virtual]
|
|
void BandGenLinSOE::zeroA (
|
void ) [virtual]
|
|
void BandGenLinSOE::zeroB (
|
void ) [virtual]
|
|
The documentation for this class was generated from the following files:
|