Ejemplo n.º 1
0
/**
 * @brief Constructor initializes an empty Solver class with array pointers
 *        set to NULL.
 * @details If the constructor receives Geometry and TrackGenerator 
 *          objects it will retrieve the number of energy groups
 *          and FSRs from the Geometry and azimuthal angles from the
 *          TrackGenerator.
 * @param geometry an optional pointer to a Geometry object
 * @param track_generator an optional pointer to a TrackGenerator object
 */
Solver::Solver(Geometry* geometry, TrackGenerator* track_generator) {

  /* Default values */
  _num_materials = 0;
  _num_groups = 0;
  _num_azim = 0;
  _polar_times_groups = 0;

  _num_FSRs = 0;
  _num_fissionable_FSRs = 0;
  _num_mesh_cells = 0;
  _FSR_volumes = NULL;
  _FSR_materials = NULL;
  _surface_currents = NULL;

  _quad = NULL;
  _track_generator = NULL;
  _geometry = NULL;
  _cmfd = NULL;

  _tracks = NULL;
  _azim_weights = NULL;
  _polar_weights = NULL;
  _boundary_flux = NULL;
  _boundary_leakage = NULL;

  _scalar_flux = NULL;
  _fission_sources = NULL;
  _scatter_sources = NULL;
  _old_fission_sources = NULL;
  _reduced_sources = NULL;
  _source_residuals = NULL;

  _interpolate_exponential = true;
  _exp_table = NULL;

  if (geometry != NULL){
    _cmfd = geometry->getCmfd();
    setGeometry(geometry);
  }

  if (track_generator != NULL)
    setTrackGenerator(track_generator);

  /* Default polar quadrature */
  _quadrature_type = TABUCHI;
  _num_polar = 3;
  _two_times_num_polar = 2 * _num_polar;

  _num_iterations = 0;
  _source_convergence_thresh = 1E-3;
  _converged_source = false;

  _timer = new Timer();

}
Ejemplo n.º 2
0
/**
 * @brief Constructor initializes NULL arrays for source, flux, etc.
 * @param track_generator an optional pointer to a TrackGenerator object
 */
VectorizedSolver::VectorizedSolver(TrackGenerator* track_generator) :
  CPUSolver(track_generator) {

  if (_cmfd != NULL)
    log_printf(ERROR, "The VectorizedSolver is not yet configured for CMFD");

  _delta_psi = NULL;
  _thread_taus = NULL;
  _thread_exponentials = NULL;

  if (track_generator != NULL)
    setTrackGenerator(track_generator);

  vmlSetMode(VML_EP);
}