12 #include <fei_iostream.hpp>
13 #include <fei_fstream.hpp>
17 #define dbgOut() if (debugOutputLevel_ > 0) *dbgOStreamPtr_
20 #include <fei_FiniteElementData.hpp>
22 #include <snl_fei_Utils.hpp>
33 comm_(comm), numProcs_(1), localProc_(0),
40 if (MPI_Comm_rank(comm_, &localProc_) != MPI_SUCCESS) MPI_Abort(comm_,-1);
41 if (MPI_Comm_size(comm_, &numProcs_) != MPI_SUCCESS) MPI_Abort(comm_,-1);
48 if (dbgFileOpened_ ==
true) { dbgFStreamPtr_->close(); }
51 delete dbgOStreamPtr_;
70 dbgOut() <<
"setLookup" << FEI_ENDL;
79 const int* numElemsPerBlock,
80 const int* numNodesPerElem,
81 const int* elemMatrixSizePerBlock,
86 dbgOut() <<
"describeStructure" << FEI_ENDL
87 <<
" numElemBlocks: " << numElemBlocks << FEI_ENDL;
88 for(
int i=0; i<numElemBlocks; i++) {
89 dbgOut() <<
" elem-block " << i <<
": " << FEI_ENDL
90 <<
" number of elements: " << numElemsPerBlock[i] << FEI_ENDL
91 <<
" nodes per element: " << numNodesPerElem[i] << FEI_ENDL;
92 dbgOut() <<
" elemMatrixSizePerBlock: "
93 << elemMatrixSizePerBlock[i] << FEI_ENDL;
103 const int* nodeNumbers,
104 const int* numDofPerNode,
107 dbgOut() <<
"setConnectivity" << FEI_ENDL
108 <<
" elemBlockID: " << elemBlockID <<
", elemID: " << elemID
109 <<
", numNodes: " << numNodes << FEI_ENDL
111 for(
int i=0; i<numNodes; i++) {
112 dbgOut() << nodeNumbers[i] <<
" ";
114 dbgOut() << FEI_ENDL;
116 dbgOut() <<
" numDOFPerNode: ";
117 for(
int j=0; j<numNodes; j++) {
118 dbgOut() << numDofPerNode[j] <<
" ";
120 dbgOut() << FEI_ENDL;
129 const int* nodeNumbers,
130 const int* dofPerNode,
132 const double *
const * coefs)
134 dbgOut() <<
"setElemMatrix" << FEI_ENDL
135 <<
" elemBlockID: " << elemBlockID <<
", elemID: " << elemID << FEI_ENDL
136 <<
" numNodes: " << numNodes << FEI_ENDL;
138 dbgOut() <<
" nodeNumbers: ";
139 for(i=0; i<numNodes; i++) {
140 dbgOut() << nodeNumbers[i] <<
" ";
142 dbgOut() << FEI_ENDL <<
" dofPerNode: ";
144 for(i=0; i<numNodes; i++) {
145 dbgOut() << dofPerNode[i] <<
" ";
146 numRows += dofPerNode[i];
148 dbgOut() << FEI_ENDL <<
" coefs:" << FEI_ENDL;
149 for(i=0; i<numRows; i++) {
151 for(
int j=0; j<numRows; j++) {
152 dbgOut() << coefs[i][j] <<
" ";
154 dbgOut() << FEI_ENDL;
164 const int* nodeNumbers,
165 const int* dofPerNode,
169 dbgOut() <<
"setElemVector" << FEI_ENDL
170 <<
" elemBlockID: " << elemBlockID <<
", elemID: " << elemID << FEI_ENDL
171 <<
" numNodes: " << numNodes << FEI_ENDL;
173 dbgOut() <<
" nodeNumbers: ";
174 for(i=0; i<numNodes; i++) {
175 dbgOut() << nodeNumbers[i] <<
" ";
177 dbgOut() << FEI_ENDL <<
" dofPerNode: ";
179 for(i=0; i<numNodes; i++) {
180 dbgOut() << dofPerNode[i] <<
" ";
181 numRows += dofPerNode[i];
183 dbgOut() << FEI_ENDL <<
" coefs:" << FEI_ENDL <<
" ";
184 for(i=0; i<numRows; i++) {
185 dbgOut() << coefs[i] <<
" ";
187 dbgOut() << FEI_ENDL;
192 const int* nodeNumbers,
193 const int* dofOffsets,
194 const double* values)
196 dbgOut() <<
"setDirichletBCs" << FEI_ENDL
197 <<
" numBCs: " << numBCs << FEI_ENDL;
198 for(
int i=0; i<numBCs; i++) {
199 dbgOut() <<
" nodeNumber: " << nodeNumbers[i] <<
", "
200 <<
"dof-offset: " << dofOffsets[i] <<
", value: " << values[i]<<FEI_ENDL;
207 const int* rowNodeNumbers,
208 const int* rowDofOffsets,
209 const int* numColNodesPerRow,
210 const int* colNodeNumbers,
211 const int* colDofOffsets,
214 dbgOut() <<
"sumIntoMatrix, numRowNodes: " << numRowNodes << FEI_ENDL;
216 for(
int i=0; i<numRowNodes; i++) {
217 dbgOut() <<
" rowNodeNumber " << rowNodeNumbers[i]
218 <<
", rowDofOffset " << rowDofOffsets[i] << FEI_ENDL;
219 for(
int j=0; j<numColNodesPerRow[i]; j++) {
220 dbgOut() <<
" colNodeNumber " << colNodeNumbers[offset]
221 <<
", colDofOffset " << colDofOffsets[offset]
222 <<
", value: " << coefs[offset]<<FEI_ENDL;
230 int sumIntoRHSVector(
int numNodes,
231 const int* nodeNumbers,
232 const int* dofOffsets,
235 dbgOut() <<
"sumIntoRHSVector, numNodes: " << numNodes << FEI_ENDL;
236 for(
int i=0; i<numNodes; i++) {
237 dbgOut() <<
" nodeNumber " << nodeNumbers[i]
238 <<
", dof-offset " << dofOffsets[i] <<
", value: " << coefs[i]<<FEI_ENDL;
244 int putIntoRHSVector(
int numNodes,
245 const int* nodeNumbers,
246 const int* dofOffsets,
249 dbgOut() <<
"putIntoRHSVector, numNodes: " << numNodes << FEI_ENDL;
250 for(
int i=0; i<numNodes; i++) {
251 dbgOut() <<
" nodeNumber " << nodeNumbers[i]
252 <<
", dof-offset " << dofOffsets[i] <<
", value: " << coefs[i]<<FEI_ENDL;
260 dbgOut() <<
"loadComplete" << FEI_ENDL;
276 dbgOut() <<
"launchSolver" << FEI_ENDL;
286 dbgOut() <<
"reset" << FEI_ENDL;
292 dbgOut() <<
"resetRHSVector" << FEI_ENDL;
298 dbgOut() <<
"resetMatrix" << FEI_ENDL;
304 dbgOut() <<
"deleteConstraints" << FEI_ENDL;
312 dbgOut() <<
"getSolnEntry, nodeNumber: " << nodeNumber
313 <<
", dofOffset: " << dofOffset << FEI_ENDL;
322 lagrangeMultiplier = -999.99;
340 const int* nodeNumbers,
343 dbgOut() <<
"putNodalFieldData, fieldID: " << fieldID <<
", fieldSize: "
344 << fieldSize << FEI_ENDL;
346 for(
int i=0; i<numNodes; i++) {
347 dbgOut() <<
" nodeNumber " << nodeNumbers[i] <<
", coefs: ";
348 for(
int j=0; j<fieldSize; j++) {
349 dbgOut() << coefs[offset++] <<
" ";
351 dbgOut() << FEI_ENDL;
359 const int* nodeNumbers,
360 const int* dofOffsets,
361 const double* coefWeights,
364 dbgOut() <<
"setMultiplierCR, CRID: " << CRID <<
", numNodes: " << numNodes << FEI_ENDL;
365 for(
int i=0; i<numNodes; i++) {
366 dbgOut() <<
" nodeNumber " << nodeNumbers[i] <<
", dof-offset "
367 << dofOffsets[i] <<
", coefWeight: " << coefWeights[i] <<FEI_ENDL;
370 dbgOut() <<
" rhsValue: " << rhsValue << FEI_ENDL;
377 const int* nodeNumbers,
378 const int* dofOffsets,
379 const double* coefWeights,
383 dbgOut() <<
"setPenaltyCR, CRID: " << CRID <<
", numNodes: " << numNodes << FEI_ENDL;
384 for(
int i=0; i<numNodes; i++) {
385 dbgOut() <<
" nodeNumber " << nodeNumbers[i] <<
", dof-offset "
386 << dofOffsets[i] <<
", coefWeight: " << coefWeights[i] <<FEI_ENDL;
389 dbgOut() <<
" penaltyValue: " << penaltyValue << FEI_ENDL;
390 dbgOut() <<
" rhsValue: " << rhsValue << FEI_ENDL;
396 int setDebugLog(
int debugOutputLevel,
const char* path);
399 int numProcs_, localProc_;
401 int debugOutputLevel_;
403 FEI_OSTREAM* dbgOStreamPtr_;
405 FEI_OFSTREAM* dbgFStreamPtr_;
int getMultiplierSoln(int CRID, double &lagrangeMultiplier)
int setElemMatrix(int elemBlockID, int elemID, int numNodes, const int *nodeNumbers, const int *dofPerNode, const int *dof_ids, const double *const *coefs)
int launchSolver(int &solveStatus, int &iterations)
int describeStructure(int numElemBlocks, const int *numElemsPerBlock, const int *numNodesPerElem, const int *elemMatrixSizePerBlock, int totalNumNodes, int numSharedNodes, int numMultCRs)
int setMultiplierCR(int CRID, int numNodes, const int *nodeNumbers, const int *dofOffsets, const double *coefWeights, double rhsValue)
int parameters(int numParams, char **params)
int setConnectivity(int elemBlockID, int elemID, int numNodes, const int *nodeNumbers, const int *numDofPerNode, const int *dof_ids)
int setPenaltyCR(int CRID, int numNodes, const int *nodeNumbers, const int *dofOffsets, const double *coefWeights, double penaltyValue, double rhsValue)
int getSolnEntry(int nodeNumber, int dofOffset, double &value)
int setDirichletBCs(int numBCs, const int *nodeNumbers, const int *dofOffsets, const double *values)
int sumIntoMatrix(int numRowNodes, const int *rowNodeNumbers, const int *rowDofOffsets, const int *numColNodesPerRow, const int *colNodeNumbers, const int *colDofOffsets, const double *coefs)
int setElemVector(int elemBlockID, int elemID, int numNodes, const int *nodeNumbers, const int *dofPerNode, const int *dof_ids, const double *coefs)
int setLookup(Lookup &lookup)
int putNodalFieldData(int fieldID, int fieldSize, int numNodes, const int *nodeNumbers, const double *coefs)