Skip to content

Commit

Permalink
Moved tensor_norm from LSGC to EvenParity SlaybaughLab#10
Browse files Browse the repository at this point in the history
  • Loading branch information
Weixiong Zheng committed Aug 10, 2017
1 parent dce8c94 commit 827f339
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 63 deletions.
6 changes: 0 additions & 6 deletions src/aqdata/aq_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,5 @@ std::vector<Tensor<1, dim> > AQBase<dim>::get_all_directions ()
return omega_i;
}

template <int dim>
std::vector<double> AQBase<dim>::get_tensor_norms ()
{
return tensor_norms;
}

template class AQBase<2>;
template class AQBase<3>;
1 change: 0 additions & 1 deletion src/aqdata/aq_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class AQBase
unsigned int get_n_dir ();
unsigned int get_n_total_ho_vars ();
std::vector<double> get_angular_weights ();
std::vector<double> get_tensor_norms ();
std::vector<Tensor<1, dim> > get_all_directions ();
std::map<std::pair<unsigned int, unsigned int>, unsigned int>
get_component_index_map ();
Expand Down
8 changes: 0 additions & 8 deletions src/aqdata/lsgc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ void LSGC<dim>::produce_angular_quad ()
ExcMessage("calculated number of angles should be the same as number of angles"));

this->n_total_ho_vars = this->n_dir * this->n_group;
// estimate tensor norm to do penalty method for EP
if (this->transport_model_name=="ep" &&
this->discretization=="dfem")
for (unsigned int i=0; i<this->n_dir; ++i)
{
Tensor<2, dim> tensor_tmp = outer_product(this->omega_i[i], this->omega_i[i]);
this->tensor_norms.push_back(tensor_tmp.norm());
}
}

template class LSGC<2>;
Expand Down
48 changes: 1 addition & 47 deletions src/common/bart_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,10 @@ class BartDriver
void assemble_lo_system ();
void prepare_correction_aflx ();
void initialize_ho_preconditioners ();
void ho_solve ();
void lo_solve ();
void refine_grid ();
void output_results () const;
void power_iteration ();
void initialize_fiss_process ();
void update_ho_moments_in_fiss ();
void update_fiss_source_keff ();
void source_iteration ();
void scale_fiss_transfer_matrices ();
void renormalize_sflx (std::vector<LA::MPI::Vector*> &target_sflxes);
void NDA_PI ();
void NDA_SI ();
void initialize_aq (ParameterHandler &prm);

double estimate_k (double &fiss_source,
double &fiss_source_prev_gen,
double &k_prev_gen);
double estimate_fiss_source (std::vector<Vector<double> > &phis_this_process);
double estimate_phi_diff (std::vector<LA::MPI::Vector*> &phis_newer,
std::vector<LA::MPI::Vector*> &phis_older);

const ParameterHandler &prm;

std_cxx11::shared_ptr<ProblemDefinition> def_ptr;
Expand All @@ -108,24 +90,7 @@ class BartDriver
std::string discretization;
std::string namebase;
std::string aq_name;

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);

unsigned int get_reflective_direction_index (unsigned int boundary_id,
unsigned int incident_angle_index);

void radio (std::string str);
void radio (std::string str1, std::string str2);
void radio (std::string str1, unsigned int num1,
std::string str2, unsigned int num2,
std::string str3, unsigned int num3);
void radio (std::string str, double num);
void radio (std::string str, unsigned int num);
void radio (std::string str, bool boolean);
void radio ();


std::vector<typename DoFHandler<dim>::active_cell_iterator> local_cells;
std::vector<typename DoFHandler<dim>::active_cell_iterator> ref_bd_cells;
std::vector<bool> is_cell_at_bd;
Expand All @@ -138,27 +103,16 @@ class BartDriver
std_cxx11::shared_ptr<FEFaceValues<dim> > fvf;
std_cxx11::shared_ptr<FEFaceValues<dim> > fvf_nei;


MPI_Comm mpi_communicator;

parallel::distributed::Triangulation<dim> triangulation;

DoFHandler<dim> dof_handler;

IndexSet local_dofs;
IndexSet relevant_dofs;

const double err_k_tol;
const double err_phi_tol;
const double err_phi_eigen_tol;

double ssor_omega;
double keff;
double keff_prev_gen;
double total_angle;
double c_penalty;
double fission_source;
double fission_source_prev_gen;

bool is_eigen_problem;
bool do_nda;
Expand Down
6 changes: 5 additions & 1 deletion src/transport/even_parity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ TransportBase<dim>(prm, msh_ptr, aqd_ptr, mat_ptr)
{
if (this->discretization=="dfem")
{
tensor_norms = aqd_ptr->get_tensor_norms ();
for (unsigned int i=0; i<this->n_dir; ++i)
{
Tensor<2, dim> tensor_tmp = outer_product(this->omega_i[i], this->omega_i[i]);
tensor_norms.push_back(tensor_tmp.norm());
}
// note that the first constant on rhs is tunable and should be cautious
// when tuning it.
c_penalty = 1.0 * this->p_order * (this->p_order + 1.0);
Expand Down

0 comments on commit 827f339

Please sign in to comment.