forked from SlaybaughLab/BART
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In progress of changing structure SlaybaughLab#10
- Loading branch information
Weixiong Zheng
committed
Aug 21, 2017
1 parent
2bfab7c
commit f0e4705
Showing
20 changed files
with
458 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include "eigen_base.h" | ||
|
||
template <int dim> | ||
EigenBase<dim>::EigenBase () : IterationBase<dim> (), | ||
err_k_tol(1.0e-6), | ||
err_phi_tol(1.0e-7), | ||
err_phi_eigen_tol(1.0e-5), | ||
keff(1.0) | ||
{ | ||
} | ||
|
||
template <int dim> | ||
EigenBase<dim>::~EigenBase () | ||
{ | ||
} | ||
|
||
template <int dim> | ||
EigenBase<dim>::do_iterations () | ||
{ | ||
this->initialize_equations (); | ||
eigen_iterations (); | ||
} | ||
|
||
template <int dim> | ||
void EigenBase<dim>::generate_system_matrices | ||
(std::vector<PETScWrappers::MPI::SparseMatrix*> sys_mats) | ||
{ | ||
// EquationBase will be instantiated in InGroupBase | ||
mgs_ptr->generate_system_matrices (sys_mats); | ||
} | ||
|
||
template <int dim> | ||
void EigenBase<dim>::initialize_fiss_process () | ||
{ | ||
for (unsigned int g=0; g<n_group; ++g) | ||
this->sflx_proc[g] = 1.0; | ||
|
||
fission_source = this->trm_ptr->estimate_fiss_source (this->sflx_proc); | ||
} | ||
|
||
template <int dim> | ||
double EigenBase<dim>::estimate_k (double &fiss_source, | ||
double &fiss_source_prev, | ||
double &k_prev) | ||
{ | ||
return k_prev * fiss_source / fiss_source_prev; | ||
} | ||
|
||
template <int dim> | ||
double EigenBase<dim>::estimate_k_err (double &k, double &k_prev) | ||
{ | ||
return std::fabs (k - k_prev)/k; | ||
} | ||
|
||
template <int dim> | ||
void EigenBase<dim>::eigen_iteration (double &keff, | ||
std_cxx11::shared_ptr<MGSolver<dim> > mgs_ptr) | ||
{ | ||
} | ||
|
||
template class EigenBase<2>; | ||
template class EigenBase<3>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef __eigen_base_h__ | ||
#define __eigen_base_h__ | ||
|
||
template <int dim> | ||
class EigenBase : public IterationBase | ||
{ | ||
public: | ||
EigenBase (); | ||
virtual ~EigenBase (); | ||
|
||
virtual void do_iterations (); | ||
virtual void eigen_iterations (); | ||
|
||
double get_keff (); | ||
|
||
protected: | ||
double estimate_fission_source (std::vector<Vector<double> > &sflx_proc); | ||
double estimate_k (double &fiss_src, double &fiss_src_prev_gen, double &k_prev); | ||
double estimate_k_err (double &k, double &k_prev); | ||
|
||
double keff; | ||
double keff_prev; | ||
} | ||
|
||
#endif //__eigen_base_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "in_group_base.h" | ||
#include "../common/preconditioner_solver.h" | ||
|
||
template <int dim> | ||
InGroupBase<dim>::InGroupBase () | ||
: | ||
IterationBase<dim> () | ||
{ | ||
sol_ptr = build_linalg (prm); | ||
} | ||
|
||
template <int dim> | ||
InGroupBase<dim>::~InGroupBase () | ||
{ | ||
} | ||
|
||
template <int dim> | ||
InGroupBase<dim>::solve_in_group () | ||
{ | ||
} | ||
|
||
template class InGroupBase<2>; | ||
template class InGroupBase<3>; |
Oops, something went wrong.