diff --git a/src/aqdata/aq_lsgc.cc b/src/aqdata/lsgc.cc similarity index 92% rename from src/aqdata/aq_lsgc.cc rename to src/aqdata/lsgc.cc index ec9c1c4d1..027af6faf 100644 --- a/src/aqdata/aq_lsgc.cc +++ b/src/aqdata/lsgc.cc @@ -2,22 +2,22 @@ #include -#include "aq_lsgc.h" +#include "lsgc.h" template -AQLSGC::AQLSGC (ParameterHandler &prm) +LSGC::LSGC (ParameterHandler &prm) : AQBase (prm) { } template -AQLSGC::~AQLSGC () +LSGC::~LSGC () { } template -void AQLSGC::produce_angular_quad () +void LSGC::produce_angular_quad () { AssertThrow (dim>=2, ExcMessage("1D is not implemented")); @@ -69,5 +69,5 @@ void AQLSGC::produce_angular_quad () } } -template class AQLSGC<2>; -template class AQLSGC<3>; +template class LSGC<2>; +template class LSGC<3>; diff --git a/src/aqdata/aq_lsgc.h b/src/aqdata/lsgc.h similarity index 52% rename from src/aqdata/aq_lsgc.h rename to src/aqdata/lsgc.h index 22d6fa00b..765710582 100644 --- a/src/aqdata/aq_lsgc.h +++ b/src/aqdata/lsgc.h @@ -1,16 +1,16 @@ -#ifndef __aq_lsgc_h__ -#define __aq_lsgc_h__ +#ifndef __lsgc_h__ +#define __lsgc_h__ #include "aq_base.h" using namespace dealii; template -class AQLSGC : public AQBase +class LSGC : public AQBase { public: - AQLSGC (ParameterHandler &prm); - ~AQLSGC (); + LSGC (ParameterHandler &prm); + ~LSGC (); void produce_angular_quad (); }; diff --git a/src/common/bart_driver.cc b/src/common/bart_driver.cc index 2460935da..444edd959 100644 --- a/src/common/bart_driver.cc +++ b/src/common/bart_driver.cc @@ -27,6 +27,7 @@ dof_handler (triangulation), err_k_tol(1.0e-6), err_phi_tol(1.0e-7), err_phi_eigen_tol(1.0e-5), +prm(prm), ho_linear_solver_name(prm.get("HO linear solver name")), ho_preconditioner_name(prm.get("HO preconditioner name")), pcout(std::cout, @@ -57,62 +58,21 @@ TransportBase::~TransportBase () template void TransportBase::process_input () { - // basic parameters - { - // from basic problem definition - transport_model_name = def_ptr->get_transport_model (); - n_group = def_ptr->get_n_group (); - n_material = mat_ptr->get_n_material (); - p_order = def_ptr->get_fe_order (); - discretization = def_ptr->get_discretization (); - have_reflective_bc = def_ptr->get_reflective_bool (); - do_nda = def_ptr->get_nda_bool (); - is_eigen_problem = def_ptr->get_eigen_problem_bool (); - do_print_sn_quad = def_ptr->get_print_sn_quad_bool (); - global_refinements = def_ptr->get_uniform_refinement (); - namebase = def_ptr->get_output_namebase (); - - // from angular quadrature data - n_azi = aqd_ptr->get_sn_order (); - n_dir = aqd_ptr->get_n_dir (); - component_index = aqd_ptr->get_component_index_map (); - inverse_component_index = aqd_ptr->get_inv_component_map (); - wi = aqd_ptr->get_angular_weights (); - omega_i = aqd_ptr->get_all_directions (); - if (transport_model_name=="ep" && - discretization=="dfem") - { - tensor_norms = aqd_ptr->get_tensor_norms (); - c_penalty = 1.0 * p_order * (p_order + 1.0); - } - } - - if (have_reflective_bc) - { - is_reflective_bc = msh_ptr->get_reflective_bc_map (); - reflective_direction_index = aqd_ptr->get_reflective_direction_index_map (); - } - - // material properties - { - relative_position_to_id = msh_ptr->get_id_map (); - all_sigt = mat_ptr->get_sigma_t (); - all_inv_sigt = mat_ptr->get_inv_sigma_t (); - all_sigs = mat_ptr->get_sigma_s (); - all_sigs_per_ster = mat_ptr->get_sigma_s_per_ster (); - if (is_eigen_problem) - { - is_material_fissile = mat_ptr->get_fissile_id_map (); - all_nusigf = mat_ptr->get_nusigf (); - all_ksi_nusigf = mat_ptr->get_ksi_nusigf (); - all_ksi_nusigf_per_ster = mat_ptr->get_ksi_nusigf_per_ster (); - } - else - { - all_q = mat_ptr->get_q (); - all_q_per_ster = mat_ptr->get_q_per_ster (); - } - } + transport_model_name = def_ptr->get_transport_model (); + n_group = def_ptr->get_n_group (); + n_material = mat_ptr->get_n_material (); + p_order = def_ptr->get_fe_order (); + discretization = def_ptr->get_discretization (); + have_reflective_bc = def_ptr->get_reflective_bool (); + do_nda = def_ptr->get_nda_bool (); + is_eigen_problem = def_ptr->get_eigen_problem_bool (); + do_print_sn_quad = def_ptr->get_print_sn_quad_bool (); + global_refinements = def_ptr->get_uniform_refinement (); + namebase = def_ptr->get_output_namebase (); + + // from angular quadrature data + n_azi = aqd_ptr->get_sn_order (); + n_dir = aqd_ptr->get_n_dir (); } template diff --git a/src/common/bart_driver.h b/src/common/bart_driver.h index a1419f9c9..5d4d1e883 100644 --- a/src/common/bart_driver.h +++ b/src/common/bart_driver.h @@ -154,6 +154,8 @@ class TransportBase double estimate_phi_diff (std::vector &phis_newer, std::vector &phis_older); + const ParameterHandler &prm; + std_cxx11::shared_ptr def_ptr; std_cxx11::shared_ptr > msh_ptr; std_cxx11::shared_ptr mat_ptr; @@ -168,7 +170,6 @@ class TransportBase std::string namebase; std::string aq_name; -protected: unsigned int get_component_index (unsigned int incident_angle_index, unsigned int g); unsigned int get_component_direction (unsigned int comp_ind); unsigned int get_component_group (unsigned int comp_ind); diff --git a/src/common/main.cc b/src/common/main.cc index 1f33ebf4b..615d740d6 100644 --- a/src/common/main.cc +++ b/src/common/main.cc @@ -29,9 +29,21 @@ int main(int argc, char *argv[]) ProblemDefinition::declare_parameters (prm); prm.read_input(argv[1]); Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - // ModelManager modeler (prm); - dimension = - modeler.build_and_run_model (prm); + unsigned int dim = prm.get_integer ("problem dimension"); + switch (dim) + { + case 2: + BartDriver<2> drive (prm); + drive.run (); + break; + + case 3: + BartDriver<3> drive (prm); + drive.run (); + + default: + break; + } } catch (std::exception &exc) {