Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SparseGenColLinSOE Class Reference

#include <SparseGenColLinSOE.h>

Inheritance diagram for SparseGenColLinSOE::

LinearSOE SystemOfEqn MovableObject List of all members.

Public Methods

 SparseGenColLinSOE (SparseGenColLinSolver &theSolver)
 SparseGenColLinSOE (int N, int NNZ, int *rowStartA, int *colA, SparseGenColLinSolver &theSolver)
 ~SparseGenColLinSOE ()
int getNumEqn (void) const
int setSize (Graph &theGraph)
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 VectorgetX (void)
const VectorgetB (void)
double normRHS (void)
void setX (int loc, double value)
int setSparseGenColSolver (SparseGenColLinSolver &newSolver)
int sendSelf (int commitTag, Channel &theChannel)
int recvSelf (int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)

Detailed Description

SparseGenColLinSOE is class which is used to store the matrix equation of order using a sparse column-compacted storage scheme for . The matrix is stored in a 1d double array with elements, where is the number of non-zeroes in the matrix . Two additional 1d integer arrays and are used to store information about the location of the coefficients, with storing the location in the 1d double array of the start of column and identifying the row in to which the component in the 1d double array. is of dimension and of dimension . For example

\left[ \begin{array}{ccccc} a_{0,0} & 0 & a_{0,2} & a_{0,3} & 0 \ a_{1,0} & a_{1,1} & 0 & 0 & 0 \ 0 & a_{2,1} & a_{2,2} & 0 & 0 \ 0 & 0 & 0 & a_{3,3} & a_{3,4} \ a_{4,0} & a_{4,1} & 0 & 0 & a_{4,4} \end{array} \right]

is stored in:

\left[ \begin{array}{cccccccccccccc} a_{0,0} & a_{1,0} & a_{4,0} & a_{1,1} & a_{2,1} & a_{4,1} & a_{0,2} & a_{2,2} & a_{0,3} & a_{3,3} & a_{3,4} & a_{4,4} \ \end{array} \right]

with

colStartA = \left[ \begin{array}{cccccccccccccc} 0 & 3 & 6 & 8 & 10 & 12 \end{array} \right]

and

rowA = \left[ \begin{array}{cccccccccccccc} 0 & 1 & 4 & 1 & 2 & 4 & 0 & 2 & 0 & 3 & 3 & 4 \end{array} \right] The and vectors are stored in 1d double arrays of length . \

{\bf Interface} \ {// Constructors} \ {SparseGenColLinSOE(SparseGenColLinSolver &theSolver);} \ {SparseGenColLinSOE(int N, int NNZ, int *colStartA, int *rowA, SparseGenColLinSolver &theSolver); }

Definition at line 112 of file SparseGenColLinSOE.h.


Constructor & Destructor Documentation

SparseGenColLinSOE::SparseGenColLinSOE ( SparseGenColLinSolver & theSolver )
 

Definition at line 47 of file SparseGenColLinSOE.cpp.

SparseGenColLinSOE::SparseGenColLinSOE ( int N,
int NNZ,
int * rowStartA,
int * colA,
SparseGenColLinSolver & 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 3 1d arrays.

Definition at line 58 of file SparseGenColLinSOE.cpp.

SparseGenColLinSOE::~SparseGenColLinSOE ( )
 

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 , the number of non-zeros is set to and the matrix is marked as not having been factored. 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 . 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. It is up to the user to ensure that {colStartA} and {rowA} are of the correct size and contain the correct data.

Definition at line 112 of file SparseGenColLinSOE.cpp.


Member Function Documentation

int SparseGenColLinSOE::addA ( const Matrix & m,
const ID & id,
double fact = 1.0 ) [virtual]
 

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 .

Reimplemented from LinearSOE.

Definition at line 291 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::addB ( const Vector & v,
const ID & id,
double fact = 1.0 ) [virtual]
 

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 .

Reimplemented from LinearSOE.

Definition at line 350 of file SparseGenColLinSOE.cpp.

const Vector & SparseGenColLinSOE::getB ( void ) [virtual]
 

Returns the Vector object created for .

Reimplemented from LinearSOE.

Definition at line 452 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::getNumEqn ( void ) const [virtual]
 

A method which returns the current size of the system.

Reimplemented from LinearSOE.

Definition at line 125 of file SparseGenColLinSOE.cpp.

const Vector & SparseGenColLinSOE::getX ( void ) [virtual]
 

Returns the Vector object created for .

Reimplemented from LinearSOE.

Definition at line 442 of file SparseGenColLinSOE.cpp.

double SparseGenColLinSOE::normRHS ( void ) [virtual]
 

Returns the 2-norm of the vector .

Reimplemented from LinearSOE.

Definition at line 462 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::recvSelf ( int commitTag,
Channel & theChannel,
FEM_ObjectBroker & theBroker ) [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 499 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::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 493 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::setB ( const Vector & v,
double fact = 1.0 ) [virtual]
 

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 .

Reimplemented from LinearSOE.

Definition at line 388 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::setSize ( Graph & theGraph ) [virtual]
 

The size of the system is determined from the Graph object {theGraph}, which must contain {size} vertices labelled through , the adjacency list for each vertex containing the associated vertices in a column of the matrix . The size is determined by invoking {getNumVertex()} on {theGraph} and the number of non-zeros is determined by looking at the size of the adjacenecy list of each vertex in the graph, allowing space for the diagonal term. If the old space allocated for the 1d arrays is not big enough, it the old space is returned to the heap and new space is allocated from the heap. Prints a warning message, sets size to and returns a , if not enough memory is available on the heap for the 1d arrays. 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. The and are then determined by looping through the vertices, setting the size of Vertices adjacency list and placing the contents of and the adjacency list into in ascending order. Finally, the result of invoking {setSize()} on the associated Solver object is returned.

Reimplemented from LinearSOE.

Definition at line 131 of file SparseGenColLinSOE.cpp.

int SparseGenColLinSOE::setSparseGenColSolver ( SparseGenColLinSolver & newSolver )
 

Definition at line 475 of file SparseGenColLinSOE.cpp.

void SparseGenColLinSOE::setX ( int loc,
double value ) [virtual]
 

If {loc} is within the range of , sets .

Reimplemented from LinearSOE.

Definition at line 435 of file SparseGenColLinSOE.cpp.

void SparseGenColLinSOE::zeroA ( void ) [virtual]
 

Zeros the entries in the 1d array for and marks the system as not having been factored.

Reimplemented from LinearSOE.

Definition at line 417 of file SparseGenColLinSOE.cpp.

void SparseGenColLinSOE::zeroB ( void ) [virtual]
 

Zeros the entries in the 1d array for .

Reimplemented from LinearSOE.

Definition at line 427 of file SparseGenColLinSOE.cpp.


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