Skip to content

Commit e705ef0

Browse files
author
Will Boyd
committed
Added attribute and method to query Solver class whether CMFD is in use
1 parent ebaa21d commit e705ef0

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ recursive-include src *.h *.cpp *.cu
22
recursive-include sample-input *.py *.h5 *.pbs
33
include *.rst
44
include setup.py
5-
include config.py
5+
include config.py

src/Solver.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Solver::Solver(Geometry* geometry, TrackGenerator* track_generator,
3131
_track_generator = NULL;
3232
_geometry = NULL;
3333
_cmfd = NULL;
34+
_using_cmfd = false;
3435

3536
_tracks = NULL;
3637
_azim_weights = NULL;
@@ -258,6 +259,15 @@ bool Solver::isUsingExponentialIntrinsic() {
258259
}
259260

260261

262+
/**
263+
* @brief Returns whether the Solver is has initialized Coarse Mesh
264+
* Finite Difference (CMFD) acceleration.
265+
* @return true if so, false otherwise
266+
*/
267+
bool Solver::isUsingCmfd() {
268+
return _using_cmfd;
269+
}
270+
261271

262272
/**
263273
* @brief Sets the Geometry for the Solver.
@@ -428,11 +438,13 @@ void Solver::initializeCmfd(){
428438
_cmfd = new Cmfd(_geometry);
429439

430440
if (_cmfd->getNumCmfdGroups() == 0)
431-
_cmfd->createGroupStructure(NULL, _num_groups+1);
441+
_cmfd->createGroupStructure(NULL, _num_groups+1);
432442

433443
_cmfd->setFSRVolumes(_FSR_volumes);
434444
_cmfd->setFSRMaterials(_FSR_materials);
435445
_cmfd->setFSRFluxes(_scalar_flux);
446+
447+
_using_cmfd = true;
436448
}
437449

438450

src/Solver.h

+4
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ class Solver {
210210
/** A pointer to a Coarse Mesh Finite Difference (CMFD) acceleration object */
211211
Cmfd* _cmfd;
212212

213+
/** Whether or not CMFD is initialized for use use */
214+
bool _using_cmfd;
215+
213216
int round_to_int(float x);
214217
int round_to_int(double x);
215218

@@ -313,6 +316,7 @@ class Solver {
313316
bool isUsingDoublePrecision();
314317
bool isUsingExponentialInterpolation();
315318
bool isUsingExponentialIntrinsic();
319+
bool isUsingCmfd();
316320

317321
/**
318322
* @brief Returns the scalar flux for a FSR and energy group.

0 commit comments

Comments
 (0)