@@ -32,7 +32,6 @@ License
32
32
#include "volFields.H"
33
33
#include "OFstream.H"
34
34
#include "OSspecific.H"
35
- #include "meshSearch.H"
36
35
#include "labelVector.H"
37
36
#include "pointMVCWeight.H"
38
37
@@ -76,7 +75,8 @@ Foam::functionObjects::ExaCA::ExaCA
76
75
IOobject ::NO_WRITE
77
76
),
78
77
vpi_ .interpolate (T_ )
79
- )
78
+ ),
79
+ searchEngine_ (mesh_ , polyMesh ::CELL_TETS )
80
80
{
81
81
read (dict );
82
82
@@ -227,13 +227,11 @@ bool Foam::functionObjects::ExaCA::execute()
227
227
228
228
void Foam ::functionObjects ::ExaCA ::mapPoints ()
229
229
{
230
- mesh_ .time ().cpuTimeIncrement ();
231
-
232
230
if (events .size () == 0 )
233
231
{
234
232
return ;
235
233
}
236
-
234
+
237
235
// find event sub-space before constructing interpolant weights
238
236
const pointField & points = mesh_ .points ();
239
237
@@ -260,15 +258,15 @@ void Foam::functionObjects::ExaCA::mapPoints()
260
258
}
261
259
262
260
// find interpolant weigthts for each point
263
- meshSearch searchEngine (mesh_ , polyMesh ::CELL_TETS );
264
-
265
261
label pI = 0 ;
266
262
label seedi = events [0 ][0 ];
267
263
268
264
pointsInCell .setSize (mesh_ .nCells ());
269
265
270
266
const labelVector nPoints (vector ::one + box_ .span () / dx_ );
271
267
268
+ Info << "starting point loop" << endl ;
269
+
272
270
for (label k = 0 ; k < nPoints .z (); ++ k )
273
271
{
274
272
for (label j = 0 ; j < nPoints .y (); ++ j )
@@ -282,7 +280,7 @@ void Foam::functionObjects::ExaCA::mapPoints()
282
280
// shift point during search to avoid edges in pointMVC
283
281
const point spt = pt - vector ::one * 1e-10 ;
284
282
285
- label celli = searchEngine .findCell (spt , seedi , true);
283
+ label celli = searchEngine_ .findCell (spt , seedi , true);
286
284
287
285
if (celli != -1 )
288
286
{
@@ -296,7 +294,7 @@ void Foam::functionObjects::ExaCA::mapPoints()
296
294
297
295
pI ++ ;
298
296
}
299
-
297
+
300
298
seedi = celli ;
301
299
}
302
300
}
@@ -311,16 +309,10 @@ void Foam::functionObjects::ExaCA::mapPoints()
311
309
{
312
310
pic .shrink ();
313
311
}
314
-
315
- Info << "Successfully mapped points to mesh in: "
316
- << returnReduce (mesh_ .time ().cpuTimeIncrement (), maxOp < scalar > ( )) << " s"
317
- << endl << endl ;
318
312
}
319
313
320
314
void Foam ::functionObjects ::ExaCA ::interpolate ()
321
- {
322
- mesh_ .time ().cpuTimeIncrement ();
323
-
315
+ {
324
316
if (events .size () == 0 )
325
317
{
326
318
return ;
@@ -423,24 +415,28 @@ void Foam::functionObjects::ExaCA::interpolate()
423
415
}
424
416
os << data [i ][n ] << "\n" ;
425
417
}
426
-
427
- Info << "Successfully interpolated and wrote ExaCA data in: "
428
- << returnReduce (mesh_ .time ().cpuTimeIncrement (), maxOp < scalar > ( )) << " s"
429
- << endl << endl ;
430
418
}
431
419
432
420
bool Foam ::functionObjects ::ExaCA ::end ()
433
421
{
422
+ //- sort events by cell and in time
434
423
events .shrink ();
435
424
436
425
sort (events );
437
426
438
427
Info << "Number of solidification events: "
439
428
<< returnReduce (events .size (), sumOp < scalar > ( )) << endl ;
440
-
441
- mapPoints ();
442
429
430
+ //- map points to cells
431
+ mesh_ .time ().cpuTimeIncrement ();
432
+
433
+ mapPoints ();
434
+
435
+ Info << "Successfully mapped points to mesh in: "
436
+ << returnReduce (mesh_ .time ().cpuTimeIncrement (), maxOp < scalar > ( )) << " s"
437
+ << endl << endl ;
443
438
439
+ //- interpolate and write ExaCA data in reduced data format
444
440
const fileName exacaPath
445
441
(
446
442
mesh_ .time ().rootPath ()/mesh_ .time ().globalCaseName ()/"ExaCA "
@@ -449,6 +445,10 @@ bool Foam::functionObjects::ExaCA::end()
449
445
mkDir (exacaPath );
450
446
451
447
interpolate ();
448
+
449
+ Info << "Successfully interpolated and wrote ExaCA data in: "
450
+ << returnReduce (mesh_ .time ().cpuTimeIncrement (), maxOp < scalar > ( )) << " s"
451
+ << endl << endl ;
452
452
453
453
return true;
454
454
}
0 commit comments