Chi-Tech
lbs::DiscreteOrdinatesAdjointSolver Class Reference

#include <lbsadj_solver.h>

Inheritance diagram for lbs::DiscreteOrdinatesAdjointSolver:
lbs::DiscreteOrdinatesSolver lbs::LBSSolver chi_physics::Solver ChiObject

Public Member Functions

 DiscreteOrdinatesAdjointSolver (const chi::InputParameters &params)
 
 DiscreteOrdinatesAdjointSolver (const std::string &solver_name)
 
 DiscreteOrdinatesAdjointSolver (const DiscreteOrdinatesAdjointSolver &)=delete
 
DiscreteOrdinatesAdjointSolveroperator= (const DiscreteOrdinatesAdjointSolver &)=delete
 
double ComputeInnerProduct ()
 
const std::vector< RespFuncAndSubs > & GetResponseFunctions () const
 
void Initialize () override
 
void MakeAdjointXSs ()
 
void InitQOIs ()
 
void Execute () override
 
size_t AddResponseFunction (const std::string &qoi_name, std::shared_ptr< chi_mesh::LogicalVolume > logical_volume, const std::string &lua_function_name)
 
void ExportImportanceMap (const std::string &file_name)
 
- Public Member Functions inherited from lbs::DiscreteOrdinatesSolver
 DiscreteOrdinatesSolver (const chi::InputParameters &params)
 
const std::string & SweepType () const
 
virtual ~DiscreteOrdinatesSolver () override
 
std::pair< size_t, size_t > GetNumPhiIterativeUnknowns () override
 
void Initialize () override
 
void ScalePhiVector (PhiSTLOption which_phi, double value) override
 
void SetGSPETScVecFromPrimarySTLvector (LBSGroupset &groupset, Vec x, PhiSTLOption which_phi) override
 
void SetPrimarySTLvectorFromGSPETScVec (LBSGroupset &groupset, Vec x_src, PhiSTLOption which_phi) override
 
void GSScopedCopyPrimarySTLvectors (LBSGroupset &groupset, PhiSTLOption from_which_phi, PhiSTLOption to_which_phi) override
 
void SetMultiGSPETScVecFromPrimarySTLvector (const std::vector< int > &gs_ids, Vec x, PhiSTLOption which_phi) override
 
void SetPrimarySTLvectorFromMultiGSPETScVecFrom (const std::vector< int > &gs_ids, Vec x_src, PhiSTLOption which_phi) override
 
void ZeroOutflowBalanceVars (LBSGroupset &groupset)
 
void ComputeBalance ()
 
std::vector< double > ComputeLeakage (int groupset_id, uint64_t boundary_id) const
 
- Public Member Functions inherited from lbs::LBSSolver
 LBSSolver (const std::string &text_name)
 
 LBSSolver (const chi::InputParameters &params)
 
 LBSSolver (const LBSSolver &)=delete
 
LBSSolveroperator= (const LBSSolver &)=delete
 
virtual ~LBSSolver ()=default
 
size_t GetSourceEventTag () const
 
double LastRestartWrite () const
 
double & LastRestartWrite ()
 
lbs::OptionsOptions ()
 
const lbs::OptionsOptions () const
 
void SetOptions (const chi::InputParameters &params)
 
void SetBoundaryOptions (const chi::InputParameters &params)
 
size_t NumMoments () const
 
size_t NumGroups () const
 
size_t NumPrecursors () const
 
size_t GetMaxPrecursorsPerMaterial () const
 
void AddGroup (int id)
 
const std::vector< LBSGroup > & Groups () const
 
void AddGroupset ()
 
std::vector< LBSGroupset > & Groupsets ()
 
const std::vector< LBSGroupset > & Groupsets () const
 
void AddPointSource (PointSource psrc)
 
void ClearPointSources ()
 
const std::vector< PointSource > & PointSources () const
 
const std::map< int, XSPtr > & GetMatID2XSMap () const
 
const std::map< int, IsotropicSrcPtr > & GetMatID2IsoSrcMap () const
 
const chi_math::SpatialDiscretizationSpatialDiscretization () const
 
const std::vector< UnitCellMatrices > & GetUnitCellMatrices () const
 
const chi_mesh::MeshContinuumGrid () const
 
const std::vector< lbs::CellLBSView > & GetCellTransportViews () const
 
std::map< uint64_t, BoundaryPreference > & BoundaryPreferences ()
 
const chi_math::UnknownManagerUnknownManager () const
 
size_t LocalNodeCount () const
 
size_t GlobalNodeCount () const
 
std::vector< double > & QMomentsLocal ()
 
const std::vector< double > & QMomentsLocal () const
 
std::vector< double > & ExtSrcMomentsLocal ()
 
const std::vector< double > & ExtSrcMomentsLocal () const
 
std::vector< double > & PhiOldLocal ()
 
const std::vector< double > & PhiOldLocal () const
 
std::vector< double > & PhiNewLocal ()
 
const std::vector< double > & PhiNewLocal () const
 
std::vector< double > & PrecursorsNewLocal ()
 
const std::vector< double > & PrecursorsNewLocal () const
 
std::vector< VecDbl > & PsiNewLocal ()
 
const std::vector< VecDbl > & PsiNewLocal () const
 
const std::map< uint64_t, std::shared_ptr< SweepBndry > > & SweepBoundaries () const
 
SetSourceFunction GetActiveSetSourceFunction () const
 
AGSLinSolverPtr GetPrimaryAGSSolver ()
 
std::vector< LinSolvePtr > & GetWGSSolvers ()
 
WGSContext< Mat, Vec, KSP > & GetWGSContext (int groupset_id)
 
virtual std::pair< size_t, size_t > GetNumPhiIterativeUnknowns ()
 
size_t MapPhiFieldFunction (size_t g, size_t m) const
 
size_t GetHandleToPowerGenFieldFunc () const
 
void Initialize () override
 
void InitMaterials ()
 
void InitializePointSources ()
 
void InitWGDSA (LBSGroupset &groupset, bool vaccum_bcs_are_dirichlet=true)
 
std::vector< double > WGSCopyOnlyPhi0 (const LBSGroupset &groupset, const std::vector< double > &phi_in)
 
void GSProjectBackPhi0 (const LBSGroupset &groupset, const std::vector< double > &input, std::vector< double > &output)
 
void AssembleWGDSADeltaPhiVector (const LBSGroupset &groupset, const std::vector< double > &phi_in, std::vector< double > &delta_phi_local)
 
void DisAssembleWGDSADeltaPhiVector (const LBSGroupset &groupset, const std::vector< double > &delta_phi_local, std::vector< double > &ref_phi_new)
 
void AssembleTGDSADeltaPhiVector (const LBSGroupset &groupset, const std::vector< double > &phi_in, std::vector< double > &delta_phi_local)
 
void DisAssembleTGDSADeltaPhiVector (const LBSGroupset &groupset, const std::vector< double > &delta_phi_local, std::vector< double > &ref_phi_new)
 
void WriteRestartData (const std::string &folder_name, const std::string &file_base)
 
void ReadRestartData (const std::string &folder_name, const std::string &file_base)
 
void WriteGroupsetAngularFluxes (const LBSGroupset &groupset, const std::string &file_base)
 
void ReadGroupsetAngularFluxes (LBSGroupset &groupset, const std::string &file_base)
 
std::vector< double > MakeSourceMomentsFromPhi ()
 
void WriteFluxMoments (const std::string &file_base, const std::vector< double > &flux_moments)
 
void ReadFluxMoments (const std::string &file_base, std::vector< double > &flux_moments, bool single_file=false)
 
void UpdateFieldFunctions ()
 
void SetPhiFromFieldFunctions (PhiSTLOption which_phi, const std::vector< size_t > &m_indices, const std::vector< size_t > &g_indices)
 
double ComputeFissionProduction (const std::vector< double > &phi)
 
double ComputeFissionRate (const std::vector< double > &phi)
 
void ComputePrecursors ()
 
virtual void SetPhiVectorScalarValues (std::vector< double > &phi_vector, double value)
 
virtual void ScalePhiVector (PhiSTLOption which_phi, double value)
 
virtual void SetGSPETScVecFromPrimarySTLvector (LBSGroupset &groupset, Vec x, PhiSTLOption which_phi)
 
virtual void SetPrimarySTLvectorFromGSPETScVec (LBSGroupset &groupset, Vec x_src, PhiSTLOption which_phi)
 
virtual void GSScopedCopyPrimarySTLvectors (LBSGroupset &groupset, const std::vector< double > &x_src, std::vector< double > &y)
 
virtual void GSScopedCopyPrimarySTLvectors (LBSGroupset &groupset, PhiSTLOption from_which_phi, PhiSTLOption to_which_phi)
 
virtual void SetGroupScopedPETScVecFromPrimarySTLvector (int first_group_id, int last_group_id, Vec x, const std::vector< double > &y)
 
virtual void SetPrimarySTLvectorFromGroupScopedPETScVec (int first_group_id, int last_group_id, Vec x_src, std::vector< double > &y)
 
virtual void SetMultiGSPETScVecFromPrimarySTLvector (const std::vector< int > &gs_ids, Vec x, PhiSTLOption which_phi)
 
virtual void SetPrimarySTLvectorFromMultiGSPETScVecFrom (const std::vector< int > &gs_ids, Vec x_src, PhiSTLOption which_phi)
 
- Public Member Functions inherited from chi_physics::Solver
 Solver (std::string in_text_name)
 
 Solver (std::string in_text_name, std::initializer_list< BasicOption > in_options)
 
 Solver (const chi::InputParameters &params)
 
virtual ~Solver ()=default
 
std::string TextName () const
 
BasicOptionsGetBasicOptions ()
 
const BasicOptionsGetBasicOptions () const
 
std::vector< std::shared_ptr< FieldFunctionGridBased > > & GetFieldFunctions ()
 
const std::vector< std::shared_ptr< FieldFunctionGridBased > > & GetFieldFunctions () const
 
TimeStepperGetTimeStepper ()
 
const TimeStepperGetTimeStepper () const
 
virtual void Initialize ()
 
virtual void Execute ()
 
virtual void Step ()
 
virtual void Advance ()
 
virtual chi::ParameterBlock GetInfo (const chi::ParameterBlock &params) const
 
virtual void SetProperties (const chi::ParameterBlock &params)
 
chi::ParameterBlock GetInfoWithPreCheck (const chi::ParameterBlock &params) const
 
- Public Member Functions inherited from ChiObject
 ChiObject ()
 
 ChiObject (const chi::InputParameters &params)
 
void SetStackID (size_t stack_id)
 
size_t StackID () const
 
virtual void PushOntoStack (std::shared_ptr< ChiObject > &new_object)
 
virtual ~ChiObject ()=default
 

Static Public Member Functions

static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from lbs::DiscreteOrdinatesSolver
static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from lbs::LBSSolver
static chi::InputParameters GetInputParameters ()
 
static chi::InputParameters OptionsBlock ()
 
static chi::InputParameters BoundaryOptionsBlock ()
 
- Static Public Member Functions inherited from chi_physics::Solver
static chi::InputParameters GetInputParameters ()
 
- Static Public Member Functions inherited from ChiObject
static chi::InputParameters GetInputParameters ()
 

Data Fields

std::vector< std::vector< double > > m_moment_buffers_
 

Protected Types

typedef std::vector< size_t > VecSize_t
 
typedef std::pair< ResponseFunctionDesignation, VecSize_tRespFuncAndSubs
 
- Protected Types inherited from lbs::DiscreteOrdinatesSolver
typedef chi_mesh::sweep_management::SweepChunk SweepChunk
 
typedef std::shared_ptr< chi_math::AngularQuadratureAngQuadPtr
 
typedef std::pair< UniqueSOGroupings, DirIDToSOMapSwpOrderGroupingInfo
 
typedef std::shared_ptr< chi_mesh::sweep_management::SPDSSPDS_ptr
 
typedef std::vector< SPDS_ptrSPDS_ptrs
 
typedef chi_mesh::sweep_management::FLUDSCommonData FLUDSCommonData
 
typedef std::unique_ptr< FLUDSCommonDataFLUDSCommonDataPtr
 
typedef std::vector< FLUDSCommonDataPtrFLUDSCommonDataPtrs
 
- Protected Types inherited from lbs::LBSSolver
typedef chi_mesh::sweep_management::CellFaceNodalMapping CellFaceNodalMapping
 

Protected Attributes

std::vector< RespFuncAndSubsresponse_functions_
 
- Protected Attributes inherited from lbs::DiscreteOrdinatesSolver
std::map< AngQuadPtr, SwpOrderGroupingInfoquadrature_unq_so_grouping_map_
 
std::map< AngQuadPtr, SPDS_ptrsquadrature_spds_map_
 
std::map< AngQuadPtr, FLUDSCommonDataPtrsquadrature_fluds_commondata_map_
 
std::vector< size_t > verbose_sweep_angles_
 
const std::string sweep_type_
 
- Protected Attributes inherited from lbs::LBSSolver
size_t source_event_tag_ = 0
 
double last_restart_write_ = 0.0
 
lbs::Options options_
 
size_t num_moments_ = 0
 
size_t num_groups_ = 0
 
size_t num_precursors_ = 0
 
size_t max_precursors_per_material_ = 0
 
std::vector< LBSGroupgroups_
 
std::vector< LBSGroupsetgroupsets_
 
std::vector< PointSourcepoint_sources_
 
std::map< int, XSPtrmatid_to_xs_map_
 
std::map< int, IsotropicSrcPtrmatid_to_src_map_
 
std::shared_ptr< chi_math::SpatialDiscretizationdiscretization_ = nullptr
 
chi_mesh::MeshContinuumPtr grid_ptr_
 
std::vector< CellFaceNodalMappinggrid_nodal_mappings_
 
MPILocalCommSetPtr grid_local_comm_set_ = nullptr
 
GridFaceHistogramPtr grid_face_histogram_ = nullptr
 
std::vector< UnitCellMatricesunit_cell_matrices_
 
std::map< uint64_t, UnitCellMatricesunit_ghost_cell_matrices_
 
std::vector< lbs::CellLBSViewcell_transport_views_
 
std::map< uint64_t, BoundaryPreferenceboundary_preferences_
 
std::map< uint64_t, std::shared_ptr< SweepBndry > > sweep_boundaries_
 
chi_math::UnknownManager flux_moments_uk_man_
 
size_t max_cell_dof_count_ = 0
 
uint64_t local_node_count_ = 0
 
uint64_t glob_node_count_ = 0
 
std::vector< double > q_moments_local_
 
std::vector< double > ext_src_moments_local_
 
std::vector< double > phi_new_local_
 
std::vector< double > phi_old_local_
 
std::vector< std::vector< double > > psi_new_local_
 
std::vector< double > precursor_new_local_
 
SetSourceFunction active_set_source_function_
 
std::vector< AGSLinSolverPtrags_solvers_
 
std::vector< LinSolvePtrwgs_solvers_
 
AGSLinSolverPtr primary_ags_solver_
 
std::map< std::pair< size_t, size_t >, size_t > phi_field_functions_local_map_
 
size_t power_gen_fieldfunc_local_handle_ = 0
 
std::shared_ptr< const chi_math::TimeIntegrationtime_integration_ = nullptr
 
- Protected Attributes inherited from chi_physics::Solver
BasicOptions basic_options_
 
std::vector< std::shared_ptr< FieldFunctionGridBased > > field_functions_
 
std::shared_ptr< TimeSteppertimestepper_ = nullptr
 

Additional Inherited Members

- Public Types inherited from lbs::LBSSolver
typedef std::shared_ptr< AGSLinearSolver< Mat, Vec, KSP > > AGSLinSolverPtr
 
typedef std::shared_ptr< chi_math::LinearSolver< Mat, Vec, KSP > > LinSolvePtr
 
- Protected Member Functions inherited from lbs::DiscreteOrdinatesSolver
 DiscreteOrdinatesSolver (const std::string &text_name)
 
void InitializeWGSSolvers () override
 
void InitializeSweepDataStructures ()
 
void InitFluxDataStructures (LBSGroupset &groupset)
 
void ResetSweepOrderings (LBSGroupset &groupset)
 
virtual std::shared_ptr< SweepChunkSetSweepChunk (LBSGroupset &groupset)
 
- Protected Member Functions inherited from lbs::LBSSolver
virtual void PerformInputChecks ()
 
void PrintSimHeader ()
 
virtual void InitializeSpatialDiscretization ()
 
void ComputeUnitIntegrals ()
 
void InitializeGroupsets ()
 
void ComputeNumberOfMoments ()
 
virtual void InitializeParrays ()
 
void InitializeFieldFunctions ()
 
void InitializeBoundaries ()
 
virtual void InitializeSolverSchemes ()
 
virtual void InitializeWGSSolvers ()
 
void InitTGDSA (LBSGroupset &groupset)
 
- Static Protected Member Functions inherited from lbs::DiscreteOrdinatesSolver
static std::pair< UniqueSOGroupings, DirIDToSOMapAssociateSOsAndDirections (const chi_mesh::MeshContinuum &grid, const chi_math::AngularQuadrature &quadrature, AngleAggregationType agg_type, lbs::GeometryType lbs_geo_type)
 
- Static Protected Member Functions inherited from lbs::LBSSolver
static void CleanUpWGDSA (LBSGroupset &groupset)
 
static void CleanUpTGDSA (LBSGroupset &groupset)
 

Detailed Description

Definition at line 16 of file lbsadj_solver.h.

Member Typedef Documentation

◆ RespFuncAndSubs

◆ VecSize_t

typedef std::vector<size_t> lbs::DiscreteOrdinatesAdjointSolver::VecSize_t
protected

Definition at line 19 of file lbsadj_solver.h.

Constructor & Destructor Documentation

◆ DiscreteOrdinatesAdjointSolver() [1/3]

lbs::DiscreteOrdinatesAdjointSolver::DiscreteOrdinatesAdjointSolver ( const chi::InputParameters params)
explicit

Constructor.

Definition at line 31 of file lbsadj_solver_00_constrdestr.cc.

◆ DiscreteOrdinatesAdjointSolver() [2/3]

lbs::DiscreteOrdinatesAdjointSolver::DiscreteOrdinatesAdjointSolver ( const std::string &  solver_name)
explicit

Constructor.

Definition at line 40 of file lbsadj_solver_00_constrdestr.cc.

◆ DiscreteOrdinatesAdjointSolver() [3/3]

lbs::DiscreteOrdinatesAdjointSolver::DiscreteOrdinatesAdjointSolver ( const DiscreteOrdinatesAdjointSolver )
delete

Member Function Documentation

◆ AddResponseFunction()

size_t lbs::DiscreteOrdinatesAdjointSolver::AddResponseFunction ( const std::string &  qoi_name,
std::shared_ptr< chi_mesh::LogicalVolume logical_volume,
const std::string &  lua_function_name 
)

Subscribes cells to QOIs.

Definition at line 9 of file lbsadj_solver_04_qoi.cc.

◆ ComputeInnerProduct()

double lbs::DiscreteOrdinatesAdjointSolver::ComputeInnerProduct ( )

Computes the inner product of the flux and the material source.

Definition at line 7 of file lbsadj_innerproduct.cc.

◆ Execute()

void lbs::DiscreteOrdinatesAdjointSolver::Execute ( )
overridevirtual

Main execution function.

Reimplemented from chi_physics::Solver.

Definition at line 11 of file lbsadj_solver_02_main_execute.cc.

◆ ExportImportanceMap()

void lbs::DiscreteOrdinatesAdjointSolver::ExportImportanceMap ( const std::string &  file_name)

Exports an importance map in binary format.

Definition at line 17 of file lbsadj_solver_05a_export_imp.cc.

◆ GetInputParameters()

chi::InputParameters lbs::DiscreteOrdinatesAdjointSolver::GetInputParameters ( )
static

Returns the input parameters.

Definition at line 13 of file lbsadj_solver_00_constrdestr.cc.

◆ GetResponseFunctions()

const std::vector< lbs::DiscreteOrdinatesAdjointSolver::RespFuncAndSubs > & lbs::DiscreteOrdinatesAdjointSolver::GetResponseFunctions ( ) const

Returns the list of volumetric response functions.

Definition at line 49 of file lbsadj_solver_00_constrdestr.cc.

◆ Initialize()

void lbs::DiscreteOrdinatesAdjointSolver::Initialize ( )
overridevirtual

Initialize the solver.

Reimplemented from lbs::DiscreteOrdinatesSolver.

Definition at line 8 of file lbsadj_solver_01_main_initialize.cc.

◆ InitQOIs()

void lbs::DiscreteOrdinatesAdjointSolver::InitQOIs ( )

Definition at line 12 of file lbsadj_solver_01b_initQOIs.cc.

◆ MakeAdjointXSs()

void lbs::DiscreteOrdinatesAdjointSolver::MakeAdjointXSs ( )

Definition at line 9 of file lbsadj_solver_01a_make_adjointXS.cc.

◆ operator=()

DiscreteOrdinatesAdjointSolver & lbs::DiscreteOrdinatesAdjointSolver::operator= ( const DiscreteOrdinatesAdjointSolver )
delete

Field Documentation

◆ m_moment_buffers_

std::vector<std::vector<double> > lbs::DiscreteOrdinatesAdjointSolver::m_moment_buffers_

Definition at line 24 of file lbsadj_solver.h.

◆ response_functions_

std::vector<RespFuncAndSubs> lbs::DiscreteOrdinatesAdjointSolver::response_functions_
protected

Definition at line 21 of file lbsadj_solver.h.


The documentation for this class was generated from the following files: