Skip to content

Commit

Permalink
Modified BartDriver so vectors don't live in it. SlaybaughLab#10
Browse files Browse the repository at this point in the history
  • Loading branch information
Weixiong Zheng committed Aug 10, 2017
1 parent 7eaecdf commit 83f96c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 75 deletions.
11 changes: 7 additions & 4 deletions src/common/bart_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ void BartDriver<dim>::initialize_dealii_objects ()
false);

// be careful with the following
SparsityTools::distribute_sparsity_pattern (dsp,
dof_handler.n_locally_owned_dofs_per_processor (),
MPI_COMM_WORLD,
relevant_dofs);
SparsityTools::distribute_sparsity_pattern
(dsp,
dof_handler.n_locally_owned_dofs_per_processor (),
MPI_COMM_WORLD,
relevant_dofs);

itr_ptr->initialize_system_matrices_vectors (dsp);
}
Expand All @@ -146,6 +147,8 @@ void BartDriver<dim>::output_results () const
DataOut<dim> data_out;
data_out.attach_dof_handler (dof_handler);

itr_ptr->get_flux_this_proc (sflx_proc);

for (unsigned int g=0; g<n_group; ++g)
{
std::ostringstream os;
Expand Down
7 changes: 7 additions & 0 deletions src/iteration/iteration_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ void IterationBase<dim>::do_iterations ()
}
}

template <int dim>
void IterationBase<dim>::get_flux_this_proc
(std::vector<Vector<double> > &sflxes_proc)
{
sflxes_proc = this->sflx_proc;
}

// explicit instantiation to avoid linking error
template class IterationBase<2>;
template class IterationBase<3>;
76 changes: 5 additions & 71 deletions src/iteration/iteration_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,80 +57,14 @@ template <int dim>
class TransportBase
{
public:
TransportBase (ParameterHandler &prm);// : ProblemDefinition<dim> (prm){}
virtual ~TransportBase ();

void run ();

virtual void pre_assemble_cell_matrices
(const std_cxx11::shared_ptr<FEValues<dim> > fv,
typename DoFHandler<dim>::active_cell_iterator &cell,
std::vector<std::vector<FullMatrix<double> > > &streaming_at_qp,
std::vector<FullMatrix<double> > &collision_at_qp);

virtual void integrate_cell_bilinear_form
(const std_cxx11::shared_ptr<FEValues<dim> > fv,
typename DoFHandler<dim>::active_cell_iterator &cell,
FullMatrix<double> &cell_matrix,
unsigned int &i_dir,
unsigned int &g,
std::vector<std::vector<FullMatrix<double> > > &streaming_at_qp,
std::vector<FullMatrix<double> > &collision_at_qp);

virtual void integrate_boundary_bilinear_form
(const std_cxx11::shared_ptr<FEFaceValues<dim> > fvf,
typename DoFHandler<dim>::active_cell_iterator &cell,
unsigned int &fn,/*face number*/
FullMatrix<double> &cell_matrix,
unsigned int &i_dir,
unsigned int &g);

virtual void integrate_reflective_boundary_linear_form
(const std_cxx11::shared_ptr<FEFaceValues<dim> > fvf,
typename DoFHandler<dim>::active_cell_iterator &cell,
unsigned int &fn,/*face number*/
std::vector<Vector<double> > &cell_rhses,
unsigned int &i_dir,
unsigned int &g);

virtual void integrate_interface_bilinear_form
(const std_cxx11::shared_ptr<FEFaceValues<dim> > fvf,
const std_cxx11::shared_ptr<FEFaceValues<dim> > fvf_nei,
typename DoFHandler<dim>::active_cell_iterator &cell,
typename DoFHandler<dim>::cell_iterator &neigh,/*cell iterator for cell*/
unsigned int &fn,/*concerning face number in local cell*/
unsigned int &i_dir,
unsigned int &g,
FullMatrix<double> &vp_up,
FullMatrix<double> &vp_un,
FullMatrix<double> &vn_up,
FullMatrix<double> &vn_un);

virtual void generate_moments ();
virtual void postprocess ();
virtual void generate_ho_rhs ();
virtual void generate_ho_fixed_source ();
IterationBase (ParameterHandler &prm);// : ProblemDefinition<dim> (prm){}
virtual ~IterationBase ();

void do_iterations ();

void initialize_system_matrices_vectors (SparsityPatternType &dsp);

private:
void setup_system ();
void generate_globally_refined_grid ();
void report_system ();
void print_angular_quad ();

// void setup_lo_system();
void setup_boundary_ids ();
void get_cell_mfps (unsigned int &material_id, double &cell_dimension,
std::vector<double> &local_mfps);
void do_iterations ();
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 ();
Expand All @@ -140,6 +74,7 @@ class TransportBase
void renormalize_sflx (std::vector<LA::MPI::Vector*> &target_sflxes);
void NDA_PI ();
void NDA_SI ();
void get_flux_this_proc (std::vector<Vector<double> > &sflxes_proc);

double estimate_k (double &fiss_source,
double &fiss_source_prev_gen,
Expand Down Expand Up @@ -172,7 +107,6 @@ class TransportBase
const double err_phi_tol;
const double err_phi_eigen_tol;

double ssor_omega;
double keff;
double keff_prev_gen;
double total_angle;
Expand Down

0 comments on commit 83f96c6

Please sign in to comment.