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.
Added bart_builder.h SlaybaughLab#10
1. Added bart_builder.h and .cc. bart_build contains functions we can use to project base classes to specific models. 2. Explicitly use PETScWrappers namespace instead of redefining one as LA 3. Changed main.cc so we can build the whole thing through BartDriver
- Loading branch information
Weixiong Zheng
committed
Jul 24, 2017
1 parent
2f2ded6
commit 734385f
Showing
11 changed files
with
2,461 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "bart_builder.h" | ||
#include "../transport/even_parity.h" | ||
#include "../aqdata/aq_lsgc" | ||
|
||
|
||
template <int dim> | ||
std_cxx11::shared_ptr<TransportBase<dim> > | ||
build_transport_model (ParameterHandler &prm) | ||
{ | ||
std::string transport_model_name = prm.get ("transport model"); | ||
AssertThrow (transport_model_name!="none", | ||
ExcMessage("transport model name incorrect or missing")); | ||
std_cxx11::shared_ptr<TransportBase<dim> > transport_class; | ||
if (transport_model_name=="ep") | ||
transport_class = | ||
std_cxx11::shared_ptr<TransportBase<dim> > (new EvenParity<dim> (prm)); | ||
return transport_class; | ||
} | ||
|
||
template <int dim> | ||
std_cxx11::shared_ptr<AQBase<dim> > | ||
build_aq_model (ParameterHandler &prm) | ||
{ | ||
std::string aq_name = prm.get ("angular quadrature name"); | ||
AssertThrow (aq_name!="none", | ||
ExcMessage("angular quadrature name incorrect or missing")); | ||
std_cxx11::shared_ptr<AQBase<dim> > aq_class; | ||
if (aq_name=="lsgc") | ||
aq_class = std_cxx11::shared_ptr<AQBase<dim> > (new LSGC<dim>(prm)); | ||
return aq_class; | ||
} | ||
|
||
template std_cxx11::shared_ptr<TransportBase<2> > build_transport_model; | ||
template std_cxx11::shared_ptr<TransportBase<3> > build_transport_model; | ||
template std_cxx11::shared_ptr<AQBase<2> > build_aq_model; | ||
template std_cxx11::shared_ptr<AQBase<3> > build_aq_model; | ||
|
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,21 @@ | ||
#ifndef __bart_builder_h__ | ||
#define __bart_builder_h__ | ||
|
||
#include <deal.II/base/parameter_handler.h> | ||
|
||
#include <string> | ||
#include <map> | ||
|
||
#include "../transport/transport_base.h" | ||
|
||
using namespace dealii; | ||
|
||
template <int dim> | ||
std_cxx11::shared_ptr<TransportBase<dim> > | ||
build_transport_model (ParameterHandler &prm); | ||
|
||
template <int dim> | ||
std_cxx11::shared_ptr<AQBase<dim> > | ||
build_aq_model (ParameterHandler &prm); | ||
|
||
#endif //__bart_builder_h__ |
Oops, something went wrong.