Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
ProfileSPDLinSOE Class Reference#include <ProfileSPDLinSOE.h>
Inheritance diagram for ProfileSPDLinSOE::
List of all members.
Public Methods |
| ProfileSPDLinSOE (ProfileSPDLinSolver &theSolver) |
| ProfileSPDLinSOE (int N, int *iLoc, ProfileSPDLinSolver &theSolver) |
| ~ProfileSPDLinSOE () |
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) |
void | setX (int loc, double value) |
const Vector& | getX (void) |
const Vector& | getB (void) |
double | normRHS (void) |
int | setProfileSPDSolver (ProfileSPDLinSolver &newSolver) |
int | sendSelf (int commitTag, Channel &theChannel) |
int | recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) |
Detailed Description
ProfileSPDLinSOE is class which is used to store a symmetric system of equations using a profile storage scheme. The upper triangular part of
is stored in a 1d double array with the diagonals of
located at positions given by an integer array
. For example when
and
as shown below:
\left[ \begin{array}{ccccc} a_{0,0} & a_{0,1} & 0 & 0 & a_{0,4} \ 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]
this is stored using:
A = \left[ \begin{array}{cccccccccccccccccccc} a_{0,0} & a_{0,1} & a_{1,1} & a_{1,2} & a_{2,2} & a_{1,3} & a_{2,3} & a_{3,3} & a_{0,4} & 0 & a_{2,4} & a_{3,4} & a_{4,4}\ \end{array} \right]
and
iLoc = \left[ \begin{array}{cccccccccccccccccccc} 1 & 3 & 5 & 8 & 13 \ \end{array} \right]
Note
stores the diagonal locations using Fortran indexing. This is to facilitate calls to Fortran libraries, e.g. Digital's DXML. The
and
vectors are stored in 1d double arrays of length
. \
{\bf Interface} \ {// Constructors} \ {ProfileSPDLinSOE(Solver &theSolver);} \ {ProfileSPDLinSOE(int N, int *iLoc, ProfileSPDLinSolver &theSolver);}\ \ {// Destructor} \ {\form#41ProfileSPDLinSOE();}\\ \ {// Public Methods } \ {int setProfileSPDSolver(ProfileSPDLinSolver &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} \ {ProfileSPDLinSOE(Solver &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 {solver}. No memory is allocated for the 1d arrays. \
{ProfileSPDLinSOE(int N, int *newIloc, ProfileSPDLinSolver &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 or condensed. Obtains memory from the heap for the 1d arrays storing the data for
,
,
and
and stores the size of these arrays. If not enough memory is available for these arrays a warning message is printed and the system size is set to
. The size of
is given by
, if this is not a valid address in {newIloc} a segmentation fault or erronious results will result. The contents of
are set equal to those of {newIloc}. Invokes {setLinearSOE(*this)} and {setSize()} on {solver}, printing a warning message if {setSize()} returns a negative number. Also creates Vector objects for
and
using the {(double *,int)} Vector constructor. \
{\bf Destructor} \ {virtual~
ProfileSPDLinSOE();}\ Calls delete on any arrays created. \
{\bf Public Methods } \ {int setProfileSPDSolver(ProfileSPDLinSolver &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 determining the column height for each Vertex
in {G}, done by setting
equal to
and then checking for each Vertex in {G}, whether any of the vertex tags in the Vertices adjacency ID results in
being increased. Knowing the col height of each column, the values of {iLoc} can be determined. Knowing {iLoc} 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. Printins 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 compatable 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 corrseponding 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 compatable 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 compatable 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 245 of file ProfileSPDLinSOE.h.
Constructor & Destructor Documentation
ProfileSPDLinSOE::~ProfileSPDLinSOE (
|
)
|
|
Member Function Documentation
int ProfileSPDLinSOE::addA (
|
const Matrix & m,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
int ProfileSPDLinSOE::addB (
|
const Vector & v,
|
|
const ID & id,
|
|
double fact = 1.0 ) [virtual]
|
|
const Vector & ProfileSPDLinSOE::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 444 of file ProfileSPDLinSOE.cpp. |
int ProfileSPDLinSOE::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 126 of file ProfileSPDLinSOE.cpp. |
const Vector & ProfileSPDLinSOE::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 434 of file ProfileSPDLinSOE.cpp. |
double ProfileSPDLinSOE::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 492 of file ProfileSPDLinSOE.cpp. |
int ProfileSPDLinSOE::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 485 of file ProfileSPDLinSOE.cpp. |
int ProfileSPDLinSOE::setB (
|
const Vector & v,
|
|
double fact = 1.0 ) [virtual]
|
|
int ProfileSPDLinSOE::setSize (
|
Graph & theGraph ) [virtual]
|
|
void ProfileSPDLinSOE::setX (
|
int loc,
|
|
double value ) [virtual]
|
|
void ProfileSPDLinSOE::zeroA (
|
void ) [virtual]
|
|
void ProfileSPDLinSOE::zeroB (
|
void ) [virtual]
|
|
The documentation for this class was generated from the following files:
|