FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
snl_fei_Utils.hpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _snl_fei_Utils_hpp_
10 #define _snl_fei_Utils_hpp_
11 
12 #include <fei_fwd.hpp>
13 #include <fei_mpi.h>
14 #include <fei_SharedPtr.hpp>
15 
16 namespace fei {
17  class CSVec;
18  class Matrix;
19 }
20 
21 #include <vector>
22 #include <map>
23 #include <string>
24 
25 namespace snl_fei {
26 
41  const char* getParam(const char* key,
42  int numParams,
43  const char* const* paramStrings);
44 
61  const char* getParamValue(const char* key,
62  int numParams,
63  const char* const* paramStrings,
64  char separator=' ');
65 
79  const char* getParamValue(const char* key,
80  std::vector<std::string>& params,
81  char separator=' ');
82 
101  const char* getParamValue(const char* key,
102  int numParams,
103  const char* const* paramStrings,
104  int& foundOffset,
105  char separator=' ');
106 
109  int getIntParamValue(const char* key,
110  int numParams,
111  const char*const* params,
112  int& paramValue);
113 
117  int getDoubleParamValue(const char* key,
118  int numParams,
119  const char*const* params,
120  double& paramValue);
121 
125  int getDoubleParamValue(const char* key,
126  std::vector<std::string>& params,
127  double& paramValue);
128 
147  const char* getParam(const char* key,
148  int numParams,
149  const char* const* paramStrings,
150  int& foundOffset);
151 
169  const char* getParam(const char* key,
170  std::vector<std::string>& paramStrings,
171  int& foundOffset);
172 
174  int storeNamedAttribute(const char* name,
175  void* attribute,
176  std::vector<char*>& attributeNames,
177  std::vector<void*>& attributes);
178 
180  void* retrieveNamedAttribute(const char* name,
181  std::vector<char*>& attributeNames,
182  std::vector<void*>& attributes);
183 
185  void separate_string(const char* input_string,
186  const char* substring,
187  const char*& before_substring,
188  int& len_before_substring,
189  const char*& after_substring,
190  int& len_after_substring);
191 
195  unsigned leading_substring_length(const char* string);
196 
208  const char* skipSeparator(const char* paramString,
209  char separator=' ');
210 
214  int mergeStringLists(char**& strings, int& numStrings,
215  const char*const* stringsToMerge, int numStringsToMerge);
216 
220  int resolveConflictingCRs(fei::MatrixGraph& matrixGraph,
221  fei::Matrix& bcEqns,
222  const std::vector<int>& bcEqnNumbers);
223 
227  int gatherRemoteEssBCs(fei::CSVec& essBCs,
228  fei::SparseRowGraph* remoteGraph,
229  fei::Matrix& matrix);
230 
233  const fei::SparseRowGraph* srg2);
234 
238  void copy2DBlockDiagToColumnContig(int numBlocks,
239  const int* blockSizes,
240  const double*const* values2d,
241  int format,
242  double* colcontigvalues);
243 
247  void copy2DToColumnContig(int numrows,
248  int numcols,
249  const double*const* values2d,
250  int format,
251  double* colcontigvalues);
252 } //namespace snl_fei
253 
254 #endif // _snl_fei_Utils_hpp_
255 
const char * skipSeparator(const char *paramString, char separator=' ')
void copy2DToColumnContig(int numrows, int numcols, const double *const *values2d, int format, double *colcontigvalues)
unsigned leading_substring_length(const char *string)
int gatherRemoteEssBCs(fei::CSVec &essBCs, fei::SparseRowGraph *remoteGraph, fei::Matrix &matrix)
int mergeStringLists(char **&strings, int &numStrings, const char *const *stringsToMerge, int numStringsToMerge)
int getDoubleParamValue(const char *key, int numParams, const char *const *params, double &paramValue)
int resolveConflictingCRs(fei::MatrixGraph &matrixGraph, fei::Matrix &bcEqns, const std::vector< int > &bcEqnNumbers)
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)
const char * getParam(const char *key, int numParams, const char *const *paramStrings)
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)
void copy2DBlockDiagToColumnContig(int numBlocks, const int *blockSizes, const double *const *values2d, int format, double *colcontigvalues)
fei::SharedPtr< fei::SparseRowGraph > mergeSparseRowGraphs(const fei::SparseRowGraph *srg1, const fei::SparseRowGraph *srg2)
int getIntParamValue(const char *key, int numParams, const char *const *params, int &paramValue)
const char * getParamValue(const char *key, int numParams, const char *const *paramStrings, char separator=' ')