This file is indexed.

/usr/include/trilinos/FEData.hpp is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
#ifndef _FEData_h_
#define _FEData_h_

/*--------------------------------------------------------------------*/
/*    Copyright 2005 Sandia Corporation.                              */
/*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
/*    non-exclusive license for use of this work by or on behalf      */
/*    of the U.S. Government.  Export of this program may require     */
/*    a license from the United States Government.                    */
/*--------------------------------------------------------------------*/

#include <fei_iostream.hpp>
#include <fei_fstream.hpp>

#include <fei_mpi.h>

#define dbgOut() if (debugOutputLevel_ > 0) *dbgOStreamPtr_

#include <fei_defs.h>
#include <fei_FiniteElementData.hpp>

#include <snl_fei_Utils.hpp>

/** Simply a test harness to use for checking the FEI layer's usage of the
    FiniteElementData interface.
*/

class FEData : public virtual FiniteElementData {
 public:
  /** Constructor. */
  FEData(MPI_Comm comm)
    :
    comm_(comm), numProcs_(1), localProc_(0),
    debugOutputLevel_(0),
    dbgPath_(NULL),
    dbgOStreamPtr_(NULL),
    dbgFileOpened_(false)
    {
#ifndef FEI_SER
      if (MPI_Comm_rank(comm_, &localProc_) != MPI_SUCCESS) MPI_Abort(comm_,-1);
      if (MPI_Comm_size(comm_, &numProcs_) != MPI_SUCCESS) MPI_Abort(comm_,-1);
#endif
      setDebugLog(0, ".");
    }

  virtual ~FEData()
    {
      if (dbgFileOpened_ == true) { dbgFStreamPtr_->close(); }

      delete [] dbgPath_;
      delete dbgOStreamPtr_;
    }

  /** For setting argc/argv style parameters.
     @param numParams Number of strings in the params argument
     @param params A list of strings which will usually contain space-separated
        key-value pairs. Example: "debugOutput /usr/users/me/work_dir"
  */
  int parameters(int numParams, char** params);

  /** Supply the FiniteElementData implementation with an object (created and
      owned by the caller) that can be used to obtain various information about
      problem layout, shared finite-element nodes, etc.
      For details, see the documentation for the Lookup interface.
      @param lookup Input. Reference to an implementation of the
      Lookup interface
  */
  int setLookup(Lookup& lookup)
    {
      dbgOut() << "setLookup" << FEI_ENDL;
      return(0);
    }


  /** For describing the general structure of the finite-element problem that
      is to be assembled.
  */
  int describeStructure(int numElemBlocks,
			const int* numElemsPerBlock,
			const int* numNodesPerElem,
			const int* elemMatrixSizePerBlock,
			int totalNumNodes,
			int numSharedNodes,
			int numMultCRs)
    {
      dbgOut() << "describeStructure" << FEI_ENDL
	<< "   numElemBlocks: " << numElemBlocks << FEI_ENDL;
      for(int i=0; i<numElemBlocks; i++) {
	dbgOut() << "   elem-block " << i << ": " << FEI_ENDL
	  << "      number of elements: " << numElemsPerBlock[i] << FEI_ENDL
	  << "      nodes per element:  " << numNodesPerElem[i] << FEI_ENDL;
	dbgOut() << "         elemMatrixSizePerBlock: "
	    << elemMatrixSizePerBlock[i] << FEI_ENDL;
      }
      return(0);
    }

   /** For passing element-connectivity arrays.
   */
   int setConnectivity(int elemBlockID,
		       int elemID,
		       int numNodes,
		       const int* nodeNumbers,
		       const int* numDofPerNode,
           const int* dof_ids)
     {
       dbgOut() << "setConnectivity" << FEI_ENDL
	 << "   elemBlockID: " << elemBlockID << ", elemID: " << elemID 
		<< ", numNodes: " << numNodes << FEI_ENDL
	 << "   nodeNumbers: ";
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << nodeNumbers[i] << " ";
       }
       dbgOut() << FEI_ENDL;

       dbgOut() << "   numDOFPerNode: ";
       for(int j=0; j<numNodes; j++) {
	 dbgOut() << numDofPerNode[j] << " ";
       }
       dbgOut() << FEI_ENDL;

       return(0);
     }


   int setElemMatrix(int elemBlockID,
		     int elemID,
		     int numNodes,
		     const int* nodeNumbers,
		     const int* dofPerNode,
         const int* dof_ids,
		     const double *const * coefs)
     {
       dbgOut() << "setElemMatrix" << FEI_ENDL
	 << "   elemBlockID: " << elemBlockID << ", elemID: " << elemID << FEI_ENDL
	 << "   numNodes: " << numNodes << FEI_ENDL;
       int i;
       dbgOut() << "   nodeNumbers: ";
       for(i=0; i<numNodes; i++) {
	 dbgOut() << nodeNumbers[i] << " ";
       }
       dbgOut() << FEI_ENDL << "   dofPerNode: ";
       int numRows = 0;
       for(i=0; i<numNodes; i++) {
	 dbgOut() << dofPerNode[i] << " ";
	 numRows += dofPerNode[i];
       }
       dbgOut() << FEI_ENDL << "   coefs:" << FEI_ENDL;
       for(i=0; i<numRows; i++) {
	 dbgOut() << "      ";
	 for(int j=0; j<numRows; j++) {
	   dbgOut() << coefs[i][j] << " ";
	 }
	 dbgOut() << FEI_ENDL;
       }

       return(0);
     }


   int setElemVector(int elemBlockID,
		     int elemID,
		     int numNodes,
		     const int* nodeNumbers,
		     const int* dofPerNode,
         const int* dof_ids,
		     const double* coefs)
     {
       dbgOut() << "setElemVector" << FEI_ENDL
	 << "   elemBlockID: " << elemBlockID << ", elemID: " << elemID << FEI_ENDL
	 << "   numNodes: " << numNodes << FEI_ENDL;
       int i;
       dbgOut() << "   nodeNumbers: ";
       for(i=0; i<numNodes; i++) {
	 dbgOut() << nodeNumbers[i] << " ";
       }
       dbgOut() << FEI_ENDL << "   dofPerNode: ";
       int numRows = 0;
       for(i=0; i<numNodes; i++) {
	 dbgOut() << dofPerNode[i] << " ";
	 numRows += dofPerNode[i];
       }
       dbgOut() << FEI_ENDL << "   coefs:" << FEI_ENDL << "      ";
       for(i=0; i<numRows; i++) {
	 dbgOut() << coefs[i] << " ";
       }
       dbgOut() << FEI_ENDL;
       return(0);
     }

   int setDirichletBCs(int numBCs,
		       const int* nodeNumbers,
		       const int* dofOffsets,
		       const double* values)
     {
       dbgOut() << "setDirichletBCs" << FEI_ENDL
	 << "   numBCs: " << numBCs << FEI_ENDL;
       for(int i=0; i<numBCs; i++) {
	 dbgOut() << "     nodeNumber: " << nodeNumbers[i] << ", "
	   << "dof-offset: " << dofOffsets[i] << ", value: " << values[i]<<FEI_ENDL;
       }

       return(0);
     }

   int sumIntoMatrix(int numRowNodes,
		     const int* rowNodeNumbers,
		     const int* rowDofOffsets,
		     const int* numColNodesPerRow,
		     const int* colNodeNumbers,
		     const int* colDofOffsets,
		     const double* coefs)
     {
       dbgOut() << "sumIntoMatrix, numRowNodes: " << numRowNodes << FEI_ENDL;
       int offset = 0;
       for(int i=0; i<numRowNodes; i++) {
	 dbgOut() << "   rowNodeNumber " << rowNodeNumbers[i]
	   << ", rowDofOffset " << rowDofOffsets[i] << FEI_ENDL;
	 for(int j=0; j<numColNodesPerRow[i]; j++) {
	   dbgOut() << "      colNodeNumber " << colNodeNumbers[offset]
		    << ", colDofOffset " << colDofOffsets[offset]
		    << ", value: " << coefs[offset]<<FEI_ENDL;
	   offset++;
	 }
       }

       return(0);
     }

   int sumIntoRHSVector(int numNodes,
		     const int* nodeNumbers,
		     const int* dofOffsets,
		     const double* coefs)
     {
       dbgOut() << "sumIntoRHSVector, numNodes: " << numNodes << FEI_ENDL;
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << "   nodeNumber " << nodeNumbers[i]
	   << ", dof-offset " << dofOffsets[i] << ", value: " << coefs[i]<<FEI_ENDL;
       }

       return(0);
     }

   int putIntoRHSVector(int numNodes,
		     const int* nodeNumbers,
		     const int* dofOffsets,
		     const double* coefs)
     {
       dbgOut() << "putIntoRHSVector, numNodes: " << numNodes << FEI_ENDL;
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << "   nodeNumber " << nodeNumbers[i]
	   << ", dof-offset " << dofOffsets[i] << ", value: " << coefs[i]<<FEI_ENDL;
       }

       return(0);
     }

   int loadComplete()
     {
       dbgOut() << "loadComplete" << FEI_ENDL;

       return(0);
     }

   /** Function called to request the launching of the linear solver.
    @param solveStatus Output, should indicate the status of the solve. A
    successful solve is usually indicated by a value of 0.
    @param iterations Output, how many iterations were performed.
    @return error-code, 0 if convergence tolerance was achieved within the
     specified maximum number of iterations. If error return is non-zero, the
    calling application will be expected to check solveStatus, and consult the
    solver-library's documentation to figure out exactly what happened.
   */
   int launchSolver(int& solveStatus, int& iterations)
     {
       dbgOut() << "launchSolver" << FEI_ENDL;

       solveStatus = 0;
       iterations = 0;

       return(0);
     }

   int reset()
     {
       dbgOut() << "reset" << FEI_ENDL;
       return(0);
     }

   int resetRHSVector()
     {
       dbgOut() << "resetRHSVector" << FEI_ENDL;
       return(0);
     }

   int resetMatrix()
     {
       dbgOut() << "resetMatrix" << FEI_ENDL;
       return(0);
     }

   int deleteConstraints()
     {
       dbgOut() << "deleteConstraints" << FEI_ENDL;
       return(0);
     }

   int getSolnEntry(int nodeNumber,
		    int dofOffset,
		    double& value)
     {
       dbgOut() << "getSolnEntry, nodeNumber: " << nodeNumber 
	 << ", dofOffset: " << dofOffset << FEI_ENDL;

       value = -999.99;

       return(0);
    }

   int getMultiplierSoln(int CRID, double& lagrangeMultiplier)
     {
       lagrangeMultiplier = -999.99;
       return(0);
     }

   /** Pass nodal data that probably doesn't mean anything to the FEI
     implementation, but may mean something to the linear solver. Examples:
     geometric coordinates, nullspace data, etc.
    @param fieldID Identifier for the field that describes this data. Lists of
       field identifiers and field sizes defined for the finite-element problem
       may be obtained from the Lookup interface that is supplied to the
       ESI_Broker by the FEI implementation.
    @param nodeNumbers List of nodes for which data is being supplied.
    @param numNodes
    @param data List of length numNodes * (size of field 'fieldID')
   */
   int putNodalFieldData(int fieldID,
			 int fieldSize,
			 int numNodes,
			 const int* nodeNumbers,
			 const double* coefs)
     {
       dbgOut() << "putNodalFieldData, fieldID: " << fieldID << ", fieldSize: "
	 << fieldSize << FEI_ENDL;
       int offset = 0;
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << "   nodeNumber " << nodeNumbers[i] << ", coefs: ";
	 for(int j=0; j<fieldSize; j++) {
	   dbgOut() << coefs[offset++] << " ";
	 }
	 dbgOut() << FEI_ENDL;
       }
       
       return(0);
     }

   int setMultiplierCR(int CRID,
		       int numNodes,
		       const int* nodeNumbers,
		       const int* dofOffsets,
		       const double* coefWeights,
		       double rhsValue)
     {
       dbgOut() << "setMultiplierCR, CRID: " << CRID << ", numNodes: " << numNodes << FEI_ENDL;
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << "   nodeNumber " << nodeNumbers[i] << ", dof-offset "
		  << dofOffsets[i] << ", coefWeight: " << coefWeights[i] <<FEI_ENDL;
       }

       dbgOut() << "   rhsValue: " << rhsValue << FEI_ENDL;

       return(0);
     }

   int setPenaltyCR(int CRID,
		    int numNodes,
		    const int* nodeNumbers,
		    const int* dofOffsets,
		    const double* coefWeights,
		    double penaltyValue,
		    double rhsValue)
     {
       dbgOut() << "setPenaltyCR, CRID: " << CRID << ", numNodes: " << numNodes << FEI_ENDL;
       for(int i=0; i<numNodes; i++) {
	 dbgOut() << "   nodeNumber " << nodeNumbers[i] << ", dof-offset "
		  << dofOffsets[i] << ", coefWeight: " << coefWeights[i] <<FEI_ENDL;
       }

       dbgOut() << "   penaltyValue: " << penaltyValue << FEI_ENDL;
       dbgOut() << "   rhsValue: " << rhsValue << FEI_ENDL;

       return(0);
     }

 private:
   int setDebugLog(int debugOutputLevel, const char* path);

   MPI_Comm comm_;
   int numProcs_, localProc_;

   int debugOutputLevel_;
   char* dbgPath_;
   FEI_OSTREAM* dbgOStreamPtr_;
   bool dbgFileOpened_;
   FEI_OFSTREAM* dbgFStreamPtr_;
};

#endif // _FEData_h_