FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
fei::MatrixGraph_Impl2 Class Reference

#include <fei_MatrixGraph_Impl2.hpp>

Inheritance diagram for fei::MatrixGraph_Impl2:
Inheritance graph
[legend]

Classes

class  Factory
 

Public Member Functions

 MatrixGraph_Impl2 (fei::SharedPtr< fei::VectorSpace > rowSpace, fei::SharedPtr< fei::VectorSpace > colSpace, const char *name=NULL)
 
virtual ~MatrixGraph_Impl2 ()
 
void setParameters (const fei::ParameterSet &params)
 
void setRowSpace (fei::SharedPtr< fei::VectorSpace > rowSpace)
 
fei::SharedPtr< fei::VectorSpacegetRowSpace ()
 
void setColumnSpace (fei::SharedPtr< fei::VectorSpace > columnSpace)
 
fei::SharedPtr< fei::VectorSpacegetColSpace ()
 
int definePattern (int numIDs, int idType)
 
int definePattern (int numIDs, int idType, int fieldID)
 
int definePattern (int numIDs, int idType, const int *numFieldsPerID, const int *fieldIDs)
 
int definePattern (int numIDs, const int *idTypes, const int *numFieldsPerID, const int *fieldIDs)
 
int initConnectivityBlock (int blockID, int numConnectivityLists, int patternID, bool diagonal=false)
 
int initConnectivityBlock (int numConnectivityLists, int patternID, bool diagonal=false)
 
int initConnectivityBlock (int blockID, int numConnectivityLists, int rowPatternID, int colPatternID)
 
int initConnectivity (int blockID, int connectivityID, const int *connectedIdentifiers)
 
int initConnectivity (int blockID, int connectivityID, const int *rowConnectedIdentifiers, const int *colConnectedIdentifiers)
 
int initConnectivity (int patternID, const int *connectedIdentifiers)
 
int initConnectivity (int rowPatternID, const int *rowConnectedIdentifiers, int colPatternID, const int *colConnectedIdentifiers)
 
int initConnectivity (int idType, int numRows, const int *rowIDs, const int *rowOffsets, const int *packedColumnIDs)
 
int initConnectivity (int idType, int fieldID, int numRows, const int *rowIDs, const int *rowOffsets, const int *packedColumnIDs)
 
int initConnectivity (int idType, int numRows, const int *rowIDs, const int *rowLengths, const int *const *columnIDs)
 
int initLagrangeConstraint (int constraintID, int constraintIDType, int numIDs, const int *idTypes, const int *IDs, const int *fieldIDs)
 
int initPenaltyConstraint (int constraintID, int constraintIDType, int numIDs, const int *idTypes, const int *IDs, const int *fieldIDs)
 
int initSlaveConstraint (int numIDs, const int *idTypes, const int *IDs, const int *fieldIDs, int offsetOfSlave, int offsetIntoSlaveField, const double *weights, double rhsValue)
 
bool newSlaveData ()
 
bool hasSlaveDof (int ID, int idType)
 
int initComplete ()
 
fei::SharedPtr
< fei::SparseRowGraph
createGraph (bool blockEntryGraph, bool localRowGraph_includeSharedRows=false)
 
int compareStructure (const fei::MatrixGraph &matrixGraph, bool &equivalent) const
 
int getNumConnectivityBlocks () const
 
std::map< int,
fei::ConnectivityBlock * > & 
getConnectivityBlocks ()
 
int getConnectivityBlockIDs (std::vector< int > &blockIDs) const
 
int getNumIDsPerConnectivityList (int blockID) const
 
int getConnectivityNumIndices (int blockID) const
 
int getConnectivityNumIndices (int blockID, int &numRowIndices, int &numColIndices)
 
int getConnectivityIndices (int blockID, int connectivityID, int indicesAllocLen, int *indices, int &numIndices)
 
int getConnectivityIndices (int blockID, int connectivityID, int rowIndicesAllocLen, int *rowIndices, int &numRowIndices, int colIndicesAllocLen, int *colIndices, int &numColIndices)
 
int getPatternNumIndices (int patternID, int &numIndices)
 
int getPatternIndices (int patternID, const int *IDs, std::vector< int > &indices)
 
int getLocalNumLagrangeConstraints () const
 
int getGlobalNumSlaveConstraints () const
 
ConstraintTypegetLagrangeConstraint (int constraintID)
 
std::map< int, ConstraintType * > & getLagrangeConstraints ()
 
ConstraintTypegetPenaltyConstraint (int constraintID)
 
ConstraintTypegetSlaveConstraint (int constraintID)
 
int getConstraintConnectivityIndices (ConstraintType *cr, std::vector< int > &globalIndices)
 
const fei::ConnectivityBlockgetConnectivityBlock (int blockID) const
 
fei::ConnectivityBlockgetConnectivityBlock (int blockID)
 
void setIndicesMode (int mode)
 
fei::SharedPtr< FillableMatgetSlaveDependencyMatrix ()
 
fei::PatterngetPattern (int patternID)
 
int createSlaveMatrices ()
 
fei::SharedPtr< fei::ReducergetReducer ()
 
fei::SharedPtr
< fei::SparseRowGraph
getRemotelyOwnedGraphRows ()
 
void getConstrainedIndices (std::vector< int > &crindices) const
 
- Public Member Functions inherited from fei::MatrixGraph
virtual ~MatrixGraph ()
 

Private Member Functions

int createAlgebraicGraph (bool blockEntryGraph, fei::Graph *graph, bool gatherFromOverlap)
 
int addBlockToGraph_multiField_symmetric (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addBlockToGraph_multiField_nonsymmetric (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addBlockToGraph_singleField_symmetric (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addBlockToGraph_singleField_nonsymmetric (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addBlockToGraph_noField_symmetric (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addBlockToGraph_sparse (fei::Graph *graph, fei::ConnectivityBlock *cblock)
 
int addPattern (fei::Pattern *pattern)
 
int getConnectivityIndices_multiField (const snl_fei::RecordCollection *const *recordCollections, int *records, int numRecords, const int *numFieldsPerID, const int *fieldIDs, const int *fieldSizes, int indicesAllocLen, int *indices, int &numIndices)
 
int getConnectivityIndices_singleField (const snl_fei::RecordCollection *const *recordCollections, int *records, int numRecords, int fieldID, int fieldSize, int indicesAllocLen, int *indices, int &numIndices)
 
int getConnectivityIndices_noField (const snl_fei::RecordCollection *const *recordCollections, int *records, int numRecords, int indicesAllocLen, int *indices, int &numIndices)
 
int getConnectivityRecords (fei::VectorSpace *vecSpace, int idType, int numIDs, const int *IDs, int *records)
 
int getConnectivityRecords (fei::VectorSpace *vecSpace, int idType, int fieldID, int numIDs, const int *IDs, int *records)
 
int getConnectivityRecords (fei::Pattern *pattern, fei::VectorSpace *solnSpace, const int *connectedIdentifiers, int *recordList)
 
int exchangeBlkEqnSizes (fei::Graph *graph)
 
int addLagrangeConstraintsToGraph (fei::Graph *graph)
 
int addPenaltyConstraintsToGraph (fei::Graph *graph)
 
void setName (const char *name)
 
- Private Member Functions inherited from fei::Logger
 Logger ()
 
virtual ~Logger ()
 
void setOutputLevel (OutputLevel olevel)
 
void addLogID (int ID)
 
void addLogEqn (int eqn)
 
bool isLogID (int ID)
 
bool isLogEqn (int eqn)
 
std::set< int > & getLogIDs ()
 
std::set< int > & getLogEqns ()
 

Private Attributes

int localProc_
 
int numProcs_
 
MPI_Comm comm_
 
fei::SharedPtr< fei::VectorSpacerowSpace_
 
fei::SharedPtr< fei::VectorSpacecolSpace_
 
bool haveRowSpace_
 
bool haveColSpace_
 
bool symmetric_
 
fei::SharedPtr
< fei::SparseRowGraph
remotelyOwnedGraphRows_
 
bool simpleProblem_
 
bool blockEntryGraph_
 
std::map< int, fei::Pattern * > patterns_
 
std::map< int,
fei::ConnectivityBlock * > 
connectivityBlocks_
 
int arbitraryBlockCounter_
 
std::vector
< fei::ConnectivityBlock * > 
sparseBlocks_
 
std::map< int, ConstraintType * > lagrangeConstraints_
 
std::map< int, ConstraintType * > penaltyConstraints_
 
std::map< int, ConstraintType * > slaveConstraints_
 
bool ptEqualBlk_
 
bool newSlaveData_
 
int localNumSlaves_
 
int globalNumSlaves_
 
fei::SharedPtr< FillableMatD_
 
fei::SharedPtr< CSVecg_
 
bool g_nonzero_
 
fei::SharedPtr< fei::Reducerreducer_
 
std::string name_
 
std::string dbgprefix_
 
std::vector< int > tmpIntArray1_
 
std::vector< int > tmpIntArray2_
 
int * vspcEqnPtr_
 
std::set< int > constrained_indices_
 
bool includeAllSlaveConstraints_
 
- Private Attributes inherited from fei::Logger
OutputLevel output_level_
 
FEI_OSTREAMoutput_stream_
 
std::set< int > logIDs_
 
std::set< int > logEqns_
 

Additional Inherited Members

- Public Types inherited from fei::MatrixGraph
enum  { REDUCED_INDICES = 0, UNREDUCED_INDICES = 1, BLOCK_ENTRY_GRAPH = 2, POINT_ENTRY_GRAPH = 3 }
 

Detailed Description

A container for the data that defines connectivity, and which will ultimately be used to generate a matrix graph.

Definition at line 33 of file fei_MatrixGraph_Impl2.hpp.

Constructor & Destructor Documentation

fei::MatrixGraph_Impl2::MatrixGraph_Impl2 ( fei::SharedPtr< fei::VectorSpace rowSpace,
fei::SharedPtr< fei::VectorSpace colSpace,
const char *  name = NULL 
)

Constructor.

Parameters
rowSpace
colSpace
name

Definition at line 93 of file fei_MatrixGraph_Impl2.cpp.

References colSpace_, comm_, fei::SharedPtr< T >::get(), haveColSpace_, haveRowSpace_, fei::localProc(), localProc_, fei::numProcs(), numProcs_, rowSpace_, setName(), and voidERReturn.

fei::MatrixGraph_Impl2::~MatrixGraph_Impl2 ( )
virtual

Destructor.

Definition at line 141 of file fei_MatrixGraph_Impl2.cpp.

References fei::destroyValues().

Member Function Documentation

void fei::MatrixGraph_Impl2::setParameters ( const fei::ParameterSet params)
virtual

Set parameters from a ParameterSet object. Currently two parameters are recognized: "debugOutput 'path'" where 'path' is the path to the location where debug-log files will be produced.
"name 'string'" where 'string' is an identifier that will be used in debug-log file-names.

Implements fei::MatrixGraph.

Definition at line 165 of file fei_MatrixGraph_Impl2.cpp.

References fei::Param::BAD_TYPE, fei::Param::BOOL, fei::ParameterSet::get(), fei::Param::getBoolValue(), fei::Param::getIntValue(), fei::LogManager::getLogManager(), fei::Param::getStringValue(), fei::Param::getType(), fei::Param::INT, fei::LogManager::setOutputLevel(), fei::Param::STRING, and fei::utils::string_to_output_level().

void fei::MatrixGraph_Impl2::setRowSpace ( fei::SharedPtr< fei::VectorSpace rowSpace)
virtual

Provide a VectorSpace to be used for looking up indices, field-masks, etc., for the row-space. If no column-VectorSpace is provided, it will be assumed that the column-space equals the row-space.

Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 222 of file fei_MatrixGraph_Impl2.cpp.

fei::SharedPtr< fei::VectorSpace > fei::MatrixGraph_Impl2::getRowSpace ( )
inlinevirtual

Obtain the VectorSpace that corresponds to the row-space for this MatrixGraph object.

Implements fei::MatrixGraph.

Definition at line 715 of file fei_MatrixGraph_Impl2.hpp.

References rowSpace_.

void fei::MatrixGraph_Impl2::setColumnSpace ( fei::SharedPtr< fei::VectorSpace columnSpace)
virtual

Provide a VectorSpace to be used for looking up indices, field-masks, etc., for the column-space. If no column-VectorSpace is provided, it will be assumed that the column-space equals the row-space.

Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 230 of file fei_MatrixGraph_Impl2.cpp.

fei::SharedPtr< fei::VectorSpace > fei::MatrixGraph_Impl2::getColSpace ( )
inlinevirtual

Obtain the VectorSpace that corresponds to the column-space for this MatrixGraph object.

Implements fei::MatrixGraph.

Definition at line 720 of file fei_MatrixGraph_Impl2.hpp.

References colSpace_.

int fei::MatrixGraph_Impl2::definePattern ( int  numIDs,
int  idType 
)
virtual

Define a pattern to use for subsequent blocked-contributions. Examples include element-contributions. returns patternID.

This is the simplest of the pattern-definition methods. IMPORTANT NOTE: this method does not associate a field with the identifiers. Only use this method for problems where you explicitly don't want or need to associate fields with identifiers. Examples would include problems where only a single scalar field exists across the entire mesh and thus doesn't need to be explicitly referenced. Other cases where this might be used is for non finite-element problems that don't have identifier/field pairs.

Parameters
numIDsInput. number of identifiers per pattern 'instance'.
idTypeInput. Specifies which type of identifiers are associated with instances of this pattern. Must be one of the idTypes defined for a VectorSpace that is associated with this MatrixGraph. idTypes are defined via the method VectorSpace::defineIDTypes().
Returns
patternID

Implements fei::MatrixGraph.

Definition at line 266 of file fei_MatrixGraph_Impl2.cpp.

Referenced by test_MatrixGraph_test7(), and test_MatrixGraph_test8().

int fei::MatrixGraph_Impl2::definePattern ( int  numIDs,
int  idType,
int  fieldID 
)
virtual

Define a pattern to use for subsequent blocked-contributions. Examples include element-contributions. returns patternID.

This is the simplest of the 3 pattern-definition methods that associate fields with identifiers (there is one pattern-definition method above that allows for specifying a pattern of identifiers that don't have associated fields). This method defines patterns for contributions where a single field is associated with each identifier in a list of identifiers, and all the identifiers in the list are of the same type.

Parameters
numIDsInput. number of identifiers per pattern 'instance'.
idTypeInput. Specifies which type of identifiers are associated with instances of this pattern. Must be one of the idTypes defined for a VectorSpace that is associated with this MatrixGraph. idTypes are defined via the method VectorSpace::defineIDTypes().
fieldIDInput. field-identifier for the single field that is to reside at each identifier.
Returns
patternID Identifier to be used later when referring to this pattern.

Implements fei::MatrixGraph.

Definition at line 277 of file fei_MatrixGraph_Impl2.cpp.

References FEI_OSTRINGSTREAM, and snl_fei::getFieldSize().

int fei::MatrixGraph_Impl2::definePattern ( int  numIDs,
int  idType,
const int *  numFieldsPerID,
const int *  fieldIDs 
)
virtual

Define a pattern to use for subsequent blocked-contributions. Examples include element-contributions. returns patternID

This is the 'middle' of the pattern-definition methods, in terms of the complexity of pattern that can be defined. This method defines patterns for contributions where the identifiers are all of the same type, but an arbitrary list of fields can be associated with each identifier.

Parameters
numIDsInput. number of identifiers per pattern 'instance'.
idTypeInput. Specifies which type of identifiers are associated with instances of this pattern. Must be one of the idTypes defined for a VectorSpace that is associated with this MatrixGraph. idTypes are defined via the method VectorSpace::defineIDTypes().
numFieldsPerIDInput. List of length numIDs. i-th entry ives the number of fields to be associated with the i-th identifier in a contribution.
fieldIDsInput. Packed list of length sum(numFieldsPerID[i]). Contains the fieldIDs to be associated with the identifiers for a contribution.
Returns
patternID Identifier to be used later when referring to this pattern.

Implements fei::MatrixGraph.

Definition at line 300 of file fei_MatrixGraph_Impl2.cpp.

References FEI_OSTRINGSTREAM, and snl_fei::getFieldSize().

int fei::MatrixGraph_Impl2::definePattern ( int  numIDs,
const int *  idTypes,
const int *  numFieldsPerID,
const int *  fieldIDs 
)
virtual

Define a pattern to use for subsequent blocked-contributions. Examples include element-contributions.

This is the most general of the pattern-definition methods. This method defines a pattern consisting of a mixture of identifier-types, with each identifier having an arbitrary list of associated fields.

Parameters
numIDsInput. number of identifiers per pattern 'instance'.
idTypesInput. List of length numIDs. Specifies the type of each identifier to be contributed for instances of this pattern. Each of the idTypes must be one of the idTypes defined for a VectorSpace that is associated with this MatrixGraph. idTypes are defined via the method VectorSpace::defineIDTypes().
numFieldsPerIDInput. List of length numIDs. i-th entry gives the number of fields to be associated with the i-th identifier in a contribution.
fieldIDsInput. Packed list of length sum(numFieldsPerID[i]). Contains the fieldIDs to be associated with the identifiers for a contribution.
Returns
patternID Identifier to be used later when referring to this pattern.

Implements fei::MatrixGraph.

Definition at line 330 of file fei_MatrixGraph_Impl2.cpp.

References FEI_OSTRINGSTREAM, and snl_fei::getFieldSize().

int fei::MatrixGraph_Impl2::initConnectivityBlock ( int  blockID,
int  numConnectivityLists,
int  patternID,
bool  diagonal = false 
)
virtual

Initialize a block of connectivity contributions. An example is a block of elements which share a common layout of nodes/fields per element.
This method accepts only one pattern-id, implying that connectivities in this block describe a symmetric structure. See the other overloading of this method for the non-symmetric case.

Parameters
blockIDInput. User-specified identifier for this block. Will generally be required to be non-negative.
numConnectivityListsInput. Number of connectivity-lists that will be supplied for this block.
patternIDInput. Descriptor for the connectivities to be provided. Must be a pattern that was previously defined via definePattern().
diagonalOptional argument, defaults to false. If specified as true, each connectivity list will only contribute diagonal entries to the graph. This is used if the connectivity-block represents a collection of lumped- mass submatrix contributions, or something similar.
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 376 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, fei::console_out(), ERReturn, FEI_ENDL, and fei::ConnectivityBlock::setIsDiagonal().

Referenced by test_MatrixGraph_test8().

int fei::MatrixGraph_Impl2::initConnectivityBlock ( int  numConnectivityLists,
int  patternID,
bool  diagonal = false 
)
virtual

Initialize a block of connectivity contributions. An example is a block of elements which share a common layout of nodes/fields per element.
This method accepts only one pattern-id, implying that connectivities in this block describe a symmetric structure. See the other overloading of this method for the non-symmetric case.

Parameters
blockIDInput. User-specified identifier for this block. Will generally be required to be non-negative.
numConnectivityListsInput. Number of connectivity-lists that will be supplied for this block.
patternIDInput. Descriptor for the connectivities to be provided. Must be a pattern that was previously defined via definePattern().
diagonalOptional argument, defaults to false. If specified as true, each connectivity list will only contribute diagonal entries to the graph. This is used if the connectivity-block represents a collection of lumped- mass submatrix contributions, or something similar.
Returns
identifier for the new connectivity-block.

Implements fei::MatrixGraph.

Definition at line 414 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, FEI_ENDL, FEI_OSTRINGSTREAM, and fei::ConnectivityBlock::setIsDiagonal().

int fei::MatrixGraph_Impl2::initConnectivityBlock ( int  blockID,
int  numConnectivityLists,
int  rowPatternID,
int  colPatternID 
)
virtual

Initialize a block of connectivity contributions. An example is a block of elements which share a common layout of nodes/fields per element.
This method accepts two pattern-ids, implying that connectivities in this block describe a non-symmetric structure. See the other overloading of this method for the symmetric case.

Parameters
blockIDInput. User-specified identifier for this block. Will generally be required to be non-negative.
numConnectivityListsInput. Number of connectivity-lists that will be supplied for this block.
rowPatternIDInput. Descriptor for the row-connectivities to be provided. Must be a pattern that was previously defined via definePattern().
colPatternIDInput. Descriptor for the column-connectivities to be provided. Must be a pattern that was previously defined via definePattern().
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 447 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, ERReturn, FEI_ENDL, and FEI_OSTRINGSTREAM.

int fei::MatrixGraph_Impl2::initConnectivity ( int  blockID,
int  connectivityID,
const int *  connectedIdentifiers 
)
virtual

Make a contribution to the MatrixGraph's connectivity. Examples would include element-node connectivity lists, etc.

Parameters
blockIDInput. Must correspond to a blockID that was previously used in a call to initConnectivityBlock().
connectivityIDInput. Identifier for this connectivity list. May be an element-identifier, etc.
connectedIdentifiersInput. List of the identifiers that form this connectivity list.
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 489 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, CHK_ERR, ERReturn, FEI_ENDL, FEI_OSTREAM, FEI_OSTRINGSTREAM, fei::ConnectivityBlock::getConnectivityIDs(), fei::Pattern::getNumFieldsPerID(), fei::Pattern::getNumIDs(), fei::Pattern::getRecordCollections(), snl_fei::RecordCollection::getRecordWithLocalID(), fei::ConnectivityBlock::getRowConnectivities(), and fei::ConnectivityBlock::getRowPattern().

Referenced by test_Algebraic::serialtest1(), test_Algebraic::serialtest2(), and test_MatrixGraph_test8().

int fei::MatrixGraph_Impl2::initConnectivity ( int  blockID,
int  connectivityID,
const int *  rowConnectedIdentifiers,
const int *  colConnectedIdentifiers 
)
virtual

Make a contribution to the MatrixGraph's connectivity. This overloading of initConnectivity() provides for structurally non-symmetric entries.

Parameters
blockIDInput. Must correspond to a blockID that was previously used in a call to initConnectivityBlock().
connectivityIDInput. Identifier for this connectivity list. May be an element-identifier, etc.
rowConnectedIdentifiersInput. List of the identifiers that form the connectivity list for the row-space.
colConnectedIdentifiersInput. List of the identifiers that form the connectivity list for the column-space.
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 753 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, ERReturn, FEI_OSTRINGSTREAM, fei::ConnectivityBlock::getColConnectivities(), fei::ConnectivityBlock::getColPattern(), fei::ConnectivityBlock::getConnectivityIDs(), fei::Pattern::getNumIDs(), fei::Pattern::getRecordCollections(), snl_fei::RecordCollection::getRecordWithLocalID(), fei::ConnectivityBlock::getRowConnectivities(), and fei::ConnectivityBlock::getRowPattern().

int fei::MatrixGraph_Impl2::initConnectivity ( int  patternID,
const int *  connectedIdentifiers 
)
virtual

Make a contribution to the MatrixGraph's connectivity. This overloading of initConnectivity() assumes structurally symmetric entries.

Parameters
patternIDInput. Must correspond to a Pattern ID that was previously used in a call to definePattern().
connectedIdentifiersInput. List of the identifiers that form the connectivity list for the row-space.
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 814 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, and ERReturn.

int fei::MatrixGraph_Impl2::initConnectivity ( int  rowPatternID,
const int *  rowConnectedIdentifiers,
int  colPatternID,
const int *  colConnectedIdentifiers 
)
virtual

Make a contribution to the MatrixGraph's connectivity. This overloading of initConnectivity() provides for structurally non-symmetric entries.

Parameters
rowPatternIDInput. Must correspond to a Pattern ID that was previously used in a call to definePattern().
rowConnectedIdentifiersInput. List of the identifiers that form the connectivity list for the row-space.
colPatternIDInput. Must correspond to a Pattern ID that was previously used in a call to definePattern().
colConnectedIdentifiersInput. List of the identifiers that form the connectivity list for the column-space.
Returns
error-code 0 if successful

Implements fei::MatrixGraph.

Definition at line 833 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, and ERReturn.

int fei::MatrixGraph_Impl2::initConnectivity ( int  idType,
int  numRows,
const int *  rowIDs,
const int *  rowOffsets,
const int *  packedColumnIDs 
)
virtual

Initialize a set of arbitrary positions in the graph by providing data in a "raw" or "purely algebraic" format similar to what might be used with a standard sparse CSR (compressed sparse row) matrix.

Parameters
idTypeidentifier-type
numRowsNumber of rows, length of the following 'rowIDs' list.
rowIDsList of length 'numRows', specifying identifiers in the row-space.
rowOffsetsList of length numRows+1, giving offsets into the 'packedColumnIDs' list at which each row begins. i.e., the column IDs for rowIDs[i] are packedColumnIDs[rowOffsets[i]...rowOffsets[i+1]-1].
packedColumnIDsPacked list of length rowOffsets[numRows], containing the column IDs.

Implements fei::MatrixGraph.

Definition at line 560 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, fei::ConnectivityBlock::getColConnectivities(), fei::ConnectivityBlock::getRowConnectivities(), and fei::ConnectivityBlock::setRowPattern().

int fei::MatrixGraph_Impl2::initConnectivity ( int  idType,
int  fieldID,
int  numRows,
const int *  rowIDs,
const int *  rowOffsets,
const int *  packedColumnIDs 
)
virtual

Initialize a set of arbitrary positions in the graph by providing data in a "raw" or "purely algebraic" format similar to what might be used with a standard sparse CSR (compressed sparse row) matrix. Also specify a fieldID to be associated with these graph positions.

Parameters
idTypeidentifier-type
fieldIDfield-identifier
numRowsNumber of rows, length of the following 'rowIDs' list.
rowIDsList of length 'numRows', specifying identifiers in the row-space.
rowOffsetsList of length numRows+1, giving offsets into the 'packedColumnIDs' list at which each row begins. i.e., the column IDs for rowIDs[i] are packedColumnIDs[rowOffsets[i]...rowOffsets[i+1]-1].
packedColumnIDsPacked list of length rowOffsets[numRows], containing the column IDs.

Implements fei::MatrixGraph.

Definition at line 909 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, fei::ConnectivityBlock::getColConnectivities(), and fei::ConnectivityBlock::getRowConnectivities().

int fei::MatrixGraph_Impl2::initConnectivity ( int  idType,
int  numRows,
const int *  rowIDs,
const int *  rowLengths,
const int *const *  columnIDs 
)
virtual

Initialize a set of arbitrary positions in the graph by providing data in a "raw" or "purely algebraic" format similar to what might be used with a standard sparse CSR (compressed sparse row) matrix.

Parameters
idTypeidentifier-type
numRowsNumber of rows, length of the following 'rowIDs' list.
rowIDsList of length 'numRows', specifying identifiers in the row-space.
rowLengthsList of length numRows, giving the number of column IDs for each row ID.
columnIDsC-style table (list of lists) containing the column IDs. Number of rows is numRows, length of i-th row is rowLengths[i].

Implements fei::MatrixGraph.

Definition at line 600 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, fei::ConnectivityBlock::getColConnectivities(), fei::ConnectivityBlock::getRowConnectivities(), and fei::ConnectivityBlock::setRowPattern().

int fei::MatrixGraph_Impl2::initLagrangeConstraint ( int  constraintID,
int  constraintIDType,
int  numIDs,
const int *  idTypes,
const int *  IDs,
const int *  fieldIDs 
)
virtual

Initialize a lagrange-multiplier constraint.

Implements fei::MatrixGraph.

Definition at line 940 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR, and ERReturn.

int fei::MatrixGraph_Impl2::initPenaltyConstraint ( int  constraintID,
int  constraintIDType,
int  numIDs,
const int *  idTypes,
const int *  IDs,
const int *  fieldIDs 
)
virtual

Initialize a penalty constraint.

Implements fei::MatrixGraph.

Definition at line 988 of file fei_MatrixGraph_Impl2.cpp.

References ERReturn.

int fei::MatrixGraph_Impl2::initSlaveConstraint ( int  numIDs,
const int *  idTypes,
const int *  IDs,
const int *  fieldIDs,
int  offsetOfSlave,
int  offsetIntoSlaveField,
const double *  weights,
double  rhsValue 
)
virtual

Initialize a slave constraint. (Note to self: document the parameters.)

Implements fei::MatrixGraph.

Definition at line 1047 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, ERReturn, FEI_ENDL, FEI_ISTRINGSTREAM, FEI_OSTREAM, FEI_OSTRINGSTREAM, fei::FULL_LOGS, and snl_fei::Constraint< RecordType >::structurallySame().

bool fei::MatrixGraph_Impl2::newSlaveData ( )
virtual

Implements fei::MatrixGraph.

Definition at line 1121 of file fei_MatrixGraph_Impl2.cpp.

References fei::Allreduce().

bool fei::MatrixGraph_Impl2::hasSlaveDof ( int  ID,
int  idType 
)
virtual

Query whether a given mesh object has one or more slave DOFs.

Implements fei::MatrixGraph.

Definition at line 1026 of file fei_MatrixGraph_Impl2.cpp.

References FEI_OSTRINGSTREAM, snl_fei::RecordCollection::getRecordWithID(), and fei::Record< GlobalIDType >::hasSlaveDof().

int fei::MatrixGraph_Impl2::initComplete ( )
virtual

Signal the MatrixGraph object that initialization is complete. At this point the MatrixGraph implementation performs internal synchronizations etc. This is a collective method.

Implements fei::MatrixGraph.

Definition at line 1164 of file fei_MatrixGraph_Impl2.cpp.

References fei::BRIEF_LOGS, CHK_ERR, ERReturn, FEI_ENDL, and fei::GlobalSum().

Referenced by test_Algebraic::serialtest1(), test_Algebraic::serialtest2(), and test_MatrixGraph_test8().

fei::SharedPtr< fei::SparseRowGraph > fei::MatrixGraph_Impl2::createGraph ( bool  blockEntryGraph,
bool  localRowGraph_includeSharedRows = false 
)
virtual

Generate a sparse row-based graph from structural data that has been accumulated. Don't use this until after initComplete() has been called.

Parameters
locallyOwnedRowsThose rows that are owned by the local processor.
blockEntryGraphSpecifies whether the graph should be constructed on a block-entry or point-entry basis. If there is only 1 scalar DOF at each mesh-object, then a block-entry graph is the same as a point-entry graph.

Implements fei::MatrixGraph.

Definition at line 1300 of file fei_MatrixGraph_Impl2.cpp.

References fei::SparseRowGraph::blockEntries, fei::createSparseRowGraph(), fei::SharedPtr< T >::get(), fei::Graph::getLocalGraph(), fei::Graph::getRemoteGraph(), snl_fei::mergeSparseRowGraphs(), and fei::SharedPtr< T >::reset().

Referenced by test_Algebraic::serialtest1(), test_Algebraic::serialtest2(), and test_MatrixGraph_test8().

int fei::MatrixGraph_Impl2::compareStructure ( const fei::MatrixGraph matrixGraph,
bool &  equivalent 
) const
virtual
int fei::MatrixGraph_Impl2::getNumConnectivityBlocks ( ) const
virtual

Query how many connectivity blocks have been initialized.

Implements fei::MatrixGraph.

Definition at line 1801 of file fei_MatrixGraph_Impl2.cpp.

std::map< int, fei::ConnectivityBlock * > & fei::MatrixGraph_Impl2::getConnectivityBlocks ( )
inlinevirtual

Query for the container of connectivity-blocks.

Implements fei::MatrixGraph.

Definition at line 725 of file fei_MatrixGraph_Impl2.hpp.

References connectivityBlocks_.

int fei::MatrixGraph_Impl2::getConnectivityBlockIDs ( std::vector< int > &  blockIDs) const
virtual

Query for the list of connectivity-block-IDs.

Implements fei::MatrixGraph.

Definition at line 1807 of file fei_MatrixGraph_Impl2.cpp.

int fei::MatrixGraph_Impl2::getNumIDsPerConnectivityList ( int  blockID) const
virtual

Query how many IDs are in each connectivity list in the specified connectivity block.

Implements fei::MatrixGraph.

Definition at line 1823 of file fei_MatrixGraph_Impl2.cpp.

References fei::Pattern::getNumIDs(), and fei::ConnectivityBlock::getRowPattern().

int fei::MatrixGraph_Impl2::getConnectivityNumIndices ( int  blockID) const
virtual

Query how many scatter-indices are associated with each connectivity list for a given connectivity-block.

Implements fei::MatrixGraph.

Definition at line 1833 of file fei_MatrixGraph_Impl2.cpp.

References fei::Pattern::getNumIDs(), fei::Pattern::getNumIndices(), and fei::ConnectivityBlock::getRowPattern().

int fei::MatrixGraph_Impl2::getConnectivityNumIndices ( int  blockID,
int &  numRowIndices,
int &  numColIndices 
)
virtual

Query how many scatter-indices are associated with each connectivity list for a given connectivity-block, in both the row-dimension and the column-dimension.

Implements fei::MatrixGraph.

Definition at line 1844 of file fei_MatrixGraph_Impl2.cpp.

References fei::ConnectivityBlock::getColPattern(), fei::Pattern::getNumIndices(), fei::ConnectivityBlock::getRowPattern(), and fei::ConnectivityBlock::isSymmetric().

int fei::MatrixGraph_Impl2::getConnectivityIndices ( int  blockID,
int  connectivityID,
int  indicesAllocLen,
int *  indices,
int &  numIndices 
)
virtual
int fei::MatrixGraph_Impl2::getConnectivityIndices ( int  blockID,
int  connectivityID,
int  rowIndicesAllocLen,
int *  rowIndices,
int &  numRowIndices,
int  colIndicesAllocLen,
int *  colIndices,
int &  numColIndices 
)
virtual
int fei::MatrixGraph_Impl2::getPatternNumIndices ( int  patternID,
int &  numIndices 
)
virtual

Query associated with Pattern rather than connectivity-block.

Implements fei::MatrixGraph.

Definition at line 863 of file fei_MatrixGraph_Impl2.cpp.

References ERReturn, and fei::Pattern::getNumIndices().

int fei::MatrixGraph_Impl2::getPatternIndices ( int  patternID,
const int *  IDs,
std::vector< int > &  indices 
)
virtual
int fei::MatrixGraph_Impl2::getLocalNumLagrangeConstraints ( ) const
virtual

Query number of local lagrange constraints

Implements fei::MatrixGraph.

Definition at line 2064 of file fei_MatrixGraph_Impl2.cpp.

int fei::MatrixGraph_Impl2::getGlobalNumSlaveConstraints ( ) const
inlinevirtual

Query number of slave-constraints

Implements fei::MatrixGraph.

Definition at line 730 of file fei_MatrixGraph_Impl2.hpp.

References globalNumSlaves_.

fei::ConstraintType * fei::MatrixGraph_Impl2::getLagrangeConstraint ( int  constraintID)
virtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 1132 of file fei_MatrixGraph_Impl2.cpp.

std::map< int, ConstraintType * > & fei::MatrixGraph_Impl2::getLagrangeConstraints ( )
inlinevirtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 735 of file fei_MatrixGraph_Impl2.hpp.

References lagrangeConstraints_.

fei::ConstraintType * fei::MatrixGraph_Impl2::getPenaltyConstraint ( int  constraintID)
virtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 1154 of file fei_MatrixGraph_Impl2.cpp.

fei::ConstraintType * fei::MatrixGraph_Impl2::getSlaveConstraint ( int  constraintID)
virtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 1143 of file fei_MatrixGraph_Impl2.cpp.

int fei::MatrixGraph_Impl2::getConstraintConnectivityIndices ( ConstraintType cr,
std::vector< int > &  globalIndices 
)
virtual
const fei::ConnectivityBlock * fei::MatrixGraph_Impl2::getConnectivityBlock ( int  blockID) const
virtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 1861 of file fei_MatrixGraph_Impl2.cpp.

fei::ConnectivityBlock * fei::MatrixGraph_Impl2::getConnectivityBlock ( int  blockID)
virtual

Won't typically be of interest to application users of fei:: methods.

Implements fei::MatrixGraph.

Definition at line 1871 of file fei_MatrixGraph_Impl2.cpp.

void fei::MatrixGraph_Impl2::setIndicesMode ( int  mode)
virtual

Utility method.

Implements fei::MatrixGraph.

Definition at line 2669 of file fei_MatrixGraph_Impl2.cpp.

References voidERReturn.

fei::SharedPtr< fei::FillableMat > fei::MatrixGraph_Impl2::getSlaveDependencyMatrix ( )
virtual

Utility method.

Implements fei::MatrixGraph.

Definition at line 2686 of file fei_MatrixGraph_Impl2.cpp.

fei::Pattern * fei::MatrixGraph_Impl2::getPattern ( int  patternID)
virtual

Retrieve pointer to specified Pattern object. If specified pattern is not found, return NULL.

Implements fei::MatrixGraph.

Definition at line 362 of file fei_MatrixGraph_Impl2.cpp.

Referenced by test_MatrixGraph_test7(), and test_MatrixGraph_test8().

int fei::MatrixGraph_Impl2::createSlaveMatrices ( )
virtual
fei::SharedPtr< fei::Reducer > fei::MatrixGraph_Impl2::getReducer ( )
virtual

query for the equation-reduction manager.

Implements fei::MatrixGraph.

Definition at line 1564 of file fei_MatrixGraph_Impl2.cpp.

fei::SharedPtr< fei::SparseRowGraph > fei::MatrixGraph_Impl2::getRemotelyOwnedGraphRows ( )
virtual

query for shared-but-not-owned graph rows

Implements fei::MatrixGraph.

Definition at line 1571 of file fei_MatrixGraph_Impl2.cpp.

void fei::MatrixGraph_Impl2::getConstrainedIndices ( std::vector< int > &  crindices) const
virtual

fill a vector with eqn-numbers of constrained ids

Implements fei::MatrixGraph.

Definition at line 1577 of file fei_MatrixGraph_Impl2.cpp.

int fei::MatrixGraph_Impl2::createAlgebraicGraph ( bool  blockEntryGraph,
fei::Graph graph,
bool  gatherFromOverlap 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_multiField_symmetric ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_multiField_nonsymmetric ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_singleField_symmetric ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_singleField_nonsymmetric ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_noField_symmetric ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addBlockToGraph_sparse ( fei::Graph graph,
fei::ConnectivityBlock cblock 
)
private
int fei::MatrixGraph_Impl2::addPattern ( fei::Pattern pattern)
private

Definition at line 239 of file fei_MatrixGraph_Impl2.cpp.

int fei::MatrixGraph_Impl2::getConnectivityIndices_multiField ( const snl_fei::RecordCollection *const *  recordCollections,
int *  records,
int  numRecords,
const int *  numFieldsPerID,
const int *  fieldIDs,
const int *  fieldSizes,
int  indicesAllocLen,
int *  indices,
int &  numIndices 
)
private
int fei::MatrixGraph_Impl2::getConnectivityIndices_singleField ( const snl_fei::RecordCollection *const *  recordCollections,
int *  records,
int  numRecords,
int  fieldID,
int  fieldSize,
int  indicesAllocLen,
int *  indices,
int &  numIndices 
)
private
int fei::MatrixGraph_Impl2::getConnectivityIndices_noField ( const snl_fei::RecordCollection *const *  recordCollections,
int *  records,
int  numRecords,
int  indicesAllocLen,
int *  indices,
int &  numIndices 
)
private
int fei::MatrixGraph_Impl2::getConnectivityRecords ( fei::VectorSpace vecSpace,
int  idType,
int  numIDs,
const int *  IDs,
int *  records 
)
private
int fei::MatrixGraph_Impl2::getConnectivityRecords ( fei::VectorSpace vecSpace,
int  idType,
int  fieldID,
int  numIDs,
const int *  IDs,
int *  records 
)
private
int fei::MatrixGraph_Impl2::getConnectivityRecords ( fei::Pattern pattern,
fei::VectorSpace solnSpace,
const int *  connectedIdentifiers,
int *  recordList 
)
private
int fei::MatrixGraph_Impl2::exchangeBlkEqnSizes ( fei::Graph graph)
private

Definition at line 1366 of file fei_MatrixGraph_Impl2.cpp.

References CHK_ERR.

int fei::MatrixGraph_Impl2::addLagrangeConstraintsToGraph ( fei::Graph graph)
private
int fei::MatrixGraph_Impl2::addPenaltyConstraintsToGraph ( fei::Graph graph)
private

Definition at line 1704 of file fei_MatrixGraph_Impl2.cpp.

References fei::Graph::addSymmetricIndices(), and CHK_ERR.

void fei::MatrixGraph_Impl2::setName ( const char *  name)
private

Definition at line 2658 of file fei_MatrixGraph_Impl2.cpp.

Referenced by MatrixGraph_Impl2().

Member Data Documentation

int fei::MatrixGraph_Impl2::localProc_
private

Definition at line 665 of file fei_MatrixGraph_Impl2.hpp.

Referenced by MatrixGraph_Impl2().

int fei::MatrixGraph_Impl2::numProcs_
private

Definition at line 665 of file fei_MatrixGraph_Impl2.hpp.

Referenced by MatrixGraph_Impl2().

MPI_Comm fei::MatrixGraph_Impl2::comm_
private

Definition at line 667 of file fei_MatrixGraph_Impl2.hpp.

Referenced by MatrixGraph_Impl2().

fei::SharedPtr<fei::VectorSpace> fei::MatrixGraph_Impl2::rowSpace_
private

Definition at line 669 of file fei_MatrixGraph_Impl2.hpp.

Referenced by getRowSpace(), and MatrixGraph_Impl2().

fei::SharedPtr<fei::VectorSpace> fei::MatrixGraph_Impl2::colSpace_
private

Definition at line 670 of file fei_MatrixGraph_Impl2.hpp.

Referenced by getColSpace(), and MatrixGraph_Impl2().

bool fei::MatrixGraph_Impl2::haveRowSpace_
private

Definition at line 671 of file fei_MatrixGraph_Impl2.hpp.

Referenced by MatrixGraph_Impl2().

bool fei::MatrixGraph_Impl2::haveColSpace_
private

Definition at line 672 of file fei_MatrixGraph_Impl2.hpp.

Referenced by MatrixGraph_Impl2().

bool fei::MatrixGraph_Impl2::symmetric_
private

Definition at line 673 of file fei_MatrixGraph_Impl2.hpp.

fei::SharedPtr<fei::SparseRowGraph> fei::MatrixGraph_Impl2::remotelyOwnedGraphRows_
private

Definition at line 675 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::simpleProblem_
private

Definition at line 677 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::blockEntryGraph_
private

Definition at line 678 of file fei_MatrixGraph_Impl2.hpp.

std::map<int,fei::Pattern*> fei::MatrixGraph_Impl2::patterns_
private

Definition at line 680 of file fei_MatrixGraph_Impl2.hpp.

std::map<int,fei::ConnectivityBlock*> fei::MatrixGraph_Impl2::connectivityBlocks_
private

Definition at line 682 of file fei_MatrixGraph_Impl2.hpp.

Referenced by getConnectivityBlocks().

int fei::MatrixGraph_Impl2::arbitraryBlockCounter_
private

Definition at line 683 of file fei_MatrixGraph_Impl2.hpp.

std::vector<fei::ConnectivityBlock*> fei::MatrixGraph_Impl2::sparseBlocks_
private

Definition at line 685 of file fei_MatrixGraph_Impl2.hpp.

std::map<int, ConstraintType* > fei::MatrixGraph_Impl2::lagrangeConstraints_
private

Definition at line 688 of file fei_MatrixGraph_Impl2.hpp.

Referenced by getLagrangeConstraints().

std::map<int, ConstraintType* > fei::MatrixGraph_Impl2::penaltyConstraints_
private

Definition at line 688 of file fei_MatrixGraph_Impl2.hpp.

std::map<int, ConstraintType* > fei::MatrixGraph_Impl2::slaveConstraints_
private

Definition at line 688 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::ptEqualBlk_
private

Definition at line 690 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::newSlaveData_
private

Definition at line 692 of file fei_MatrixGraph_Impl2.hpp.

int fei::MatrixGraph_Impl2::localNumSlaves_
private

Definition at line 694 of file fei_MatrixGraph_Impl2.hpp.

int fei::MatrixGraph_Impl2::globalNumSlaves_
private

Definition at line 695 of file fei_MatrixGraph_Impl2.hpp.

Referenced by getGlobalNumSlaveConstraints().

fei::SharedPtr<FillableMat> fei::MatrixGraph_Impl2::D_
private

Definition at line 697 of file fei_MatrixGraph_Impl2.hpp.

fei::SharedPtr<CSVec> fei::MatrixGraph_Impl2::g_
private

Definition at line 698 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::g_nonzero_
private

Definition at line 699 of file fei_MatrixGraph_Impl2.hpp.

fei::SharedPtr<fei::Reducer> fei::MatrixGraph_Impl2::reducer_
private

Definition at line 701 of file fei_MatrixGraph_Impl2.hpp.

std::string fei::MatrixGraph_Impl2::name_
private

Definition at line 703 of file fei_MatrixGraph_Impl2.hpp.

std::string fei::MatrixGraph_Impl2::dbgprefix_
private

Definition at line 704 of file fei_MatrixGraph_Impl2.hpp.

std::vector<int> fei::MatrixGraph_Impl2::tmpIntArray1_
private

Definition at line 706 of file fei_MatrixGraph_Impl2.hpp.

std::vector<int> fei::MatrixGraph_Impl2::tmpIntArray2_
private

Definition at line 706 of file fei_MatrixGraph_Impl2.hpp.

int* fei::MatrixGraph_Impl2::vspcEqnPtr_
private

Definition at line 708 of file fei_MatrixGraph_Impl2.hpp.

std::set<int> fei::MatrixGraph_Impl2::constrained_indices_
private

Definition at line 710 of file fei_MatrixGraph_Impl2.hpp.

bool fei::MatrixGraph_Impl2::includeAllSlaveConstraints_
private

Definition at line 712 of file fei_MatrixGraph_Impl2.hpp.


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