FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
snl_fei Namespace Reference

Classes

class  BlkSizeMsgHandler
 
struct  BlockMatrixTraits
 
class  Broker
 
class  Broker_FEData
 
class  Broker_LinSysCore
 
class  Constraint
 
class  Factory
 
struct  FEMatrixTraits
 
struct  FEMatrixTraits< FiniteElementData >
 
struct  FEVectorTraits
 
struct  FEVectorTraits< FiniteElementData >
 
class  LinearSystem_FEData
 
class  LinearSystem_General
 
class  MapContig
 
struct  MapTraits
 
class  PointBlockMap
 
class  RaggedTable
 
class  RaggedTable< MapContig< fei::ctg_set< int > * >, fei::ctg_set< int > >
 
class  RecordCollection
 
class  RecordMsgHandler
 
struct  SetTraits
 
struct  SetTraits< fei::ctg_set< int > >
 
class  SubdMsgHandler
 

Functions

static unsigned getFieldSize (int fieldID, fei::VectorSpace *space1, fei::VectorSpace *space2)
 
template<typename T >
int binarySearch (const T &item, const T *list, int len)
 
template<typename T >
void insertion_sort_with_companions (int len, int *array, T *companions)
 
template<typename T >
int lowerBound (const T &item, const T *list, int len)
 
template<typename T >
int binarySearch (const T &item, const T *list, int len, int &insertPoint)
 
template<typename T >
int binarySearch (const T &item, const std::vector< T > &list, int &insertPoint)
 
template<typename T >
int binarySearch (const T &item, const std::vector< T > &list)
 
template<typename T >
int binarySearch (const T &item, const T *list, int, int start, int end, int &insertPoint)
 
template<typename T >
int binarySearch (int numItems, const T *items, int *offsets, const T *list, int listLength)
 
template<class T >
int sortedListInsert (const T &item, std::vector< T > &list)
 
template<class T >
int sortedListInsert (const T &item, T *&list, int &len, int &allocLen)
 
template<class T >
int listInsert (const T &item, int offset, T *&list, int &usedLength, int &allocatedLength, int allocChunkSize=200)
 
template<class T >
int searchList (const T &item, const T *list, int len)
 
const char * getParam (const char *key, int numParams, const char *const *paramStrings)
 
const char * getParamValue (const char *key, int numParams, const char *const *paramStrings, char separator=' ')
 
const char * getParamValue (const char *key, std::vector< std::string > &params, char separator=' ')
 
const char * getParamValue (const char *key, int numParams, const char *const *paramStrings, int &foundOffset, char separator=' ')
 
int getIntParamValue (const char *key, int numParams, const char *const *params, int &paramValue)
 
int getDoubleParamValue (const char *key, int numParams, const char *const *params, double &paramValue)
 
int getDoubleParamValue (const char *key, std::vector< std::string > &params, double &paramValue)
 
const char * getParam (const char *key, int numParams, const char *const *paramStrings, int &foundOffset)
 
const char * getParam (const char *key, std::vector< std::string > &paramStrings, int &foundOffset)
 
int storeNamedAttribute (const char *name, void *attribute, std::vector< char * > &attributeNames, std::vector< void * > &attributes)
 
void * retrieveNamedAttribute (const char *name, std::vector< char * > &attributeNames, std::vector< void * > &attributes)
 
void separate_string (const char *input_string, const char *substring, const char *&before_substring, int &len_before_substring, const char *&after_substring, int &len_after_substring)
 
unsigned leading_substring_length (const char *string)
 
const char * skipSeparator (const char *paramString, char separator=' ')
 
int mergeStringLists (char **&strings, int &numStrings, const char *const *stringsToMerge, int numStringsToMerge)
 
int resolveConflictingCRs (fei::MatrixGraph &matrixGraph, fei::Matrix &bcEqns, const std::vector< int > &bcEqnNumbers)
 
int gatherRemoteEssBCs (fei::CSVec &essBCs, fei::SparseRowGraph *remoteGraph, fei::Matrix &matrix)
 
fei::SharedPtr
< fei::SparseRowGraph
mergeSparseRowGraphs (const fei::SparseRowGraph *srg1, const fei::SparseRowGraph *srg2)
 
void copy2DBlockDiagToColumnContig (int numBlocks, const int *blockSizes, const double *const *values2d, int format, double *colcontigvalues)
 
void copy2DToColumnContig (int numrows, int numcols, const double *const *values2d, int format, double *colcontigvalues)
 

Function Documentation

static unsigned snl_fei::getFieldSize ( int  fieldID,
fei::VectorSpace space1,
fei::VectorSpace space2 
)
static
template<typename T >
int snl_fei::binarySearch ( const T &  item,
const T *  list,
int  len 
)

Binary search of a list that's assumed to be sorted.

Parameters
itemto be searched for.
listList to be searched.
lenLength of list.
Returns
offset Offset at which item was found, or -1 if not found.

Definition at line 27 of file snl_fei_ArrayUtils.hpp.

Referenced by binarySearch(), and sortedListInsert().

template<typename T >
void snl_fei::insertion_sort_with_companions ( int  len,
int *  array,
T *  companions 
)

sort the specified array, and move the contents of the specified companions array to match the new order. This is an implementation of the insertion sort algorithm.

Definition at line 63 of file snl_fei_ArrayUtils.hpp.

template<typename T >
int snl_fei::lowerBound ( const T &  item,
const T *  list,
int  len 
)

Lower bound finds the first entry in list that is not less than item. A binary search is used, and list is assumed to be sorted.

Definition at line 87 of file snl_fei_ArrayUtils.hpp.

template<typename T >
int snl_fei::binarySearch ( const T &  item,
const T *  list,
int  len,
int &  insertPoint 
)

Binary search of a list that's assumed to be sorted.

Parameters
itemto be searched for.
listList to be searched.
lenLength of list.
insertPointIf item is not found, this is the offset into list at which item could be inserted while maintaining sortedness. Not referenced if item is found.
Returns
offset Offset at which item was found, or -1 if not found.

Definition at line 128 of file snl_fei_ArrayUtils.hpp.

template<typename T >
int snl_fei::binarySearch ( const T &  item,
const std::vector< T > &  list,
int &  insertPoint 
)

Binary search of an std::vector that's assumed to be sorted.

Definition at line 191 of file snl_fei_ArrayUtils.hpp.

References binarySearch().

template<typename T >
int snl_fei::binarySearch ( const T &  item,
const std::vector< T > &  list 
)

Binary search of an std::vector that's assumed to be sorted.

Definition at line 203 of file snl_fei_ArrayUtils.hpp.

References binarySearch().

template<typename T >
int snl_fei::binarySearch ( const T &  item,
const T *  list,
int  ,
int  start,
int  end,
int &  insertPoint 
)

Perform a binary search but limit the search to a given range.

Parameters
itemValue to be searched for.
list
listLength
startStarting offset of search 'window'.
endEnding offset of search 'window'. end should be less than listLength.
insertPoint
Returns
offset position at which item was found. If not found, returns -1. (Since 0-based indexing is used, 'end' can't be greater than listLength-1.)

Definition at line 221 of file snl_fei_ArrayUtils.hpp.

template<typename T >
int snl_fei::binarySearch ( int  numItems,
const T *  items,
int *  offsets,
const T *  list,
int  listLength 
)

Perform a binary search for each item in a sorted input list.

Parameters
numItemsnumber of items to be searched for
itemslist of items (length numItems) to be searched for
offsetslist (length numItems) allocated by caller. On exit, offsets[i] contains the offset of item in 'list', or -1 if item is not present in 'list'.
listarray (length 'listLength') to be searched
listLengthlength of input array 'list'

Definition at line 291 of file snl_fei_ArrayUtils.hpp.

References binarySearch().

template<class T >
int snl_fei::sortedListInsert ( const T &  item,
std::vector< T > &  list 
)

Insert an item into a sorted list, maintaining sortedness. If the item is inserted, return the offset at which it was inserted. If the item was already present, return -1.

Definition at line 318 of file snl_fei_ArrayUtils.hpp.

template<class T >
int snl_fei::sortedListInsert ( const T &  item,
T *&  list,
int &  len,
int &  allocLen 
)

Insert an item into a sorted list, maintaining sortedness.

Definition at line 334 of file snl_fei_ArrayUtils.hpp.

References binarySearch().

template<class T >
int snl_fei::listInsert ( const T &  item,
int  offset,
T *&  list,
int &  usedLength,
int &  allocatedLength,
int  allocChunkSize = 200 
)

Insert an item into a list at a specified position.

Definition at line 364 of file snl_fei_ArrayUtils.hpp.

template<class T >
int snl_fei::searchList ( const T &  item,
const T *  list,
int  len 
)

Simple exhaustive search of a list.

Returns
offset at which item is found, or -1 if not found.

Definition at line 405 of file snl_fei_ArrayUtils.hpp.

const char * snl_fei::getParam ( const char *  key,
int  numParams,
const char *const *  paramStrings 
)

Given a search key, and a list of strings, search the list of strings looking for a string that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to that string.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

Parameters
keyString to be searched for.
numParamsNumber of strings to be searched.
paramStringsList of strings to be searched.
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 32 of file snl_fei_Utils.cpp.

Referenced by getParamValue(), mergeStringLists(), SNL_FEI_Structure::parameters(), snl_fei::LinearSystem_General::parameters(), LinSysCoreFilter::parameters(), Filter::parameters(), retrieveNamedAttribute(), and storeNamedAttribute().

const char * snl_fei::getParamValue ( const char *  key,
int  numParams,
const char *const *  paramStrings,
char  separator = ' ' 
)

Given a search key, and a list of strings containing key-value pairs, search the list of strings looking for one that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to the value portion of that key-value pair.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

Parameters
keyString to be searched for.
numParamsNumber of strings to be searched.
paramStringsList of strings to be searched.
separatorOptional argument, defaults to ' ' (space). This is the character that is the separator between keys and values in the parameter strings.
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 41 of file snl_fei_Utils.cpp.

References getParam(), and skipSeparator().

Referenced by getDoubleParamValue(), getIntParamValue(), driverData::getKeyword(), FEData::parameters(), SNL_FEI_Structure::parameters(), snl_fei::LinearSystem_General::parameters(), FEI_Implementation::parameters(), and LinSysCoreFilter::parameters().

const char * snl_fei::getParamValue ( const char *  key,
std::vector< std::string > &  params,
char  separator = ' ' 
)

Given a search key, and a vector of strings containing key-value pairs, search the strings looking for one that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to the value portion of that key-value pair.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

Parameters
keyString to be searched for.
paramsvector of strings to be searched.
separatorOptional separator char, defaults to space
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 170 of file snl_fei_Utils.cpp.

References getParam(), and skipSeparator().

const char * snl_fei::getParamValue ( const char *  key,
int  numParams,
const char *const *  paramStrings,
int &  foundOffset,
char  separator = ' ' 
)

Given a search key, and a list of strings containing key-value pairs, search the list of strings looking for one that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to the value portion of that key-value pair.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

Parameters
keyString to be searched for.
numParamsNumber of strings to be searched.
paramStringsList of strings to be searched.
foundOffsetoffset at which key was found in paramStrings. If not found, then this parameter is set to -1.
separatorOptional argument, defaults to ' ' (space). This is the character that is the separator between keys and values in the parameter strings.
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 52 of file snl_fei_Utils.cpp.

References getParam(), and skipSeparator().

int snl_fei::getIntParamValue ( const char *  key,
int  numParams,
const char *const *  params,
int &  paramValue 
)

Get the integer value of a named key-value pair from an array of strings.

Definition at line 64 of file snl_fei_Utils.cpp.

References FEI_ISTRINGSTREAM, and getParamValue().

Referenced by FEI_Implementation::parameters(), FEDataFilter::parameters(), and FEI_tester::setIDlists().

int snl_fei::getDoubleParamValue ( const char *  key,
int  numParams,
const char *const *  params,
double &  paramValue 
)

Get the double-precision value of a named key-value pair from an array of strings.

Definition at line 79 of file snl_fei_Utils.cpp.

References FEI_ISTRINGSTREAM, and getParamValue().

Referenced by fei_test_utils::get_file_benchmark(), and test_Utils::serialtest2().

int snl_fei::getDoubleParamValue ( const char *  key,
std::vector< std::string > &  params,
double &  paramValue 
)

Get the double-precision value of a named key-value pair from a vector of strings.

Definition at line 94 of file snl_fei_Utils.cpp.

References FEI_ISTRINGSTREAM, and getParamValue().

const char * snl_fei::getParam ( const char *  key,
int  numParams,
const char *const *  paramStrings,
int &  foundOffset 
)

Given a search key, and a list of strings, search the list of strings looking for a string that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to that string, and also provide the offset of the location in 'paramStrings' at which it was found.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

This method is case-sensitive.

Parameters
keyString to be searched for.
numParamsNumber of strings to be searched.
paramStringsList of strings to be searched.
foundOffsetoffset at which key was found in paramStrings. If not found, then this parameter is set to -1.
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 108 of file snl_fei_Utils.cpp.

References leading_substring_length().

const char * snl_fei::getParam ( const char *  key,
std::vector< std::string > &  paramStrings,
int &  foundOffset 
)

Given a search key, and a vector of strings, search the strings looking for a string that starts with the search key. i.e., a string such that key is a leading substring. If found, return a pointer to that string, and also provide the offset of the location in 'paramStrings' at which it was found.
Important Note: The returned pointer should be treated as read-only. It is not a separate copy of the string being pointed to.

This method is case-sensitive.

Parameters
keyString to be searched for.
paramStringsvector of strings to be searched.
foundOffsetoffset at which key was found in paramStrings. If not found, then this parameter is set to -1.
Returns
search-result Pointer to the entry in paramStrings that has key as a leading substring, or NULL if key is not found.

Definition at line 145 of file snl_fei_Utils.cpp.

int snl_fei::storeNamedAttribute ( const char *  name,
void *  attribute,
std::vector< char * > &  attributeNames,
std::vector< void * > &  attributes 
)

stored a named void pointer in a vector. (poor-man's map)

Definition at line 220 of file snl_fei_Utils.cpp.

References getParam().

Referenced by fei::LinearSystem::putAttribute().

void * snl_fei::retrieveNamedAttribute ( const char *  name,
std::vector< char * > &  attributeNames,
std::vector< void * > &  attributes 
)

retrived a named void pointer from a vector. (poor-man's map)

Definition at line 244 of file snl_fei_Utils.cpp.

References getParam().

Referenced by fei::LinearSystem::getAttribute().

void snl_fei::separate_string ( const char *  input_string,
const char *  substring,
const char *&  before_substring,
int &  len_before_substring,
const char *&  after_substring,
int &  len_after_substring 
)

separate a string into pieces. unsupported, for power-users only

Definition at line 179 of file snl_fei_Utils.cpp.

References skipSeparator().

Referenced by mergeStringLists(), and fei::utils::parse_strings().

unsigned snl_fei::leading_substring_length ( const char *  string)

Given a string, return the length of the leading substring, which is the characters that precede any space, tab, equals sign, or null character.

Definition at line 266 of file snl_fei_Utils.cpp.

Referenced by getParam(), and test_Utils::serialtest1().

const char * snl_fei::skipSeparator ( const char *  paramString,
char  separator = ' ' 
)

Given a parameter-string, which is assumed to contain a pair of substrings (key-value pair) separated by a specified separator character, return a pointer to the second substring. In other words, return a pointer to the first character after the separator. Allows for the possibility that the substrings are separated by more than one copy of the separator.

Parameters
paramStringString to be searched.
separatorOptional parameter, defaults to ' ' (space).
Returns
result First character after separator, or NULL if separator is not found in paramString.

Definition at line 284 of file snl_fei_Utils.cpp.

Referenced by getParamValue(), and separate_string().

int snl_fei::mergeStringLists ( char **&  strings,
int &  numStrings,
const char *const *  stringsToMerge,
int  numStringsToMerge 
)

Merge a list of strings into a list of other strings. Maintain uniqueness, don't merge strings that are already present.

Definition at line 300 of file snl_fei_Utils.cpp.

References getParam(), and separate_string().

Referenced by fei::FEI_Impl::parameters(), and FEI_Implementation::parameters().

int snl_fei::resolveConflictingCRs ( fei::MatrixGraph matrixGraph,
fei::Matrix bcEqns,
const std::vector< int > &  bcEqnNumbers 
)
int snl_fei::gatherRemoteEssBCs ( fei::CSVec essBCs,
fei::SparseRowGraph remoteGraph,
fei::Matrix matrix 
)
fei::SharedPtr< fei::SparseRowGraph > snl_fei::mergeSparseRowGraphs ( const fei::SparseRowGraph srg1,
const fei::SparseRowGraph srg2 
)
void snl_fei::copy2DBlockDiagToColumnContig ( int  numBlocks,
const int *  blockSizes,
const double *const *  values2d,
int  format,
double *  colcontigvalues 
)

Copy values from a 2D "C-style" block-diagonal table (list of pointers) to a "fortran-style" flat column-contiguous array.

Definition at line 540 of file snl_fei_Utils.cpp.

References FEI_BLOCK_DIAGONAL_ROW, and FEI_OSTRINGSTREAM.

Referenced by fei::Matrix_Impl< T >::sumIn(), and test_Utils::test3().

void snl_fei::copy2DToColumnContig ( int  numrows,
int  numcols,
const double *const *  values2d,
int  format,
double *  colcontigvalues 
)

Copy values from a 2D "C-style" table (list of pointers) to a "fortran-style" flat column-contiguous array.

Definition at line 571 of file snl_fei_Utils.cpp.

References FEI_DENSE_COL, FEI_DENSE_ROW, and FEI_OSTRINGSTREAM.

Referenced by fei::Matrix_Impl< T >::sumIn(), and test_Utils::test3().