Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DislocationGlideSolverFactory.cpp
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_DislocationGlideSolverFactory_cpp_
9#define model_DislocationGlideSolverFactory_cpp_
10
11//#include <PlanarDislocationNode.h>
12
14#include <GalerkinGlideSolver.h>
15#include <PyGlideSolver.h>
16
17#include <DislocationNetwork.h>
18
19namespace model
20{
21
22 template <int dim>
29
30template <int dim>
31std::shared_ptr<DislocationGlideSolverBase<dim>> DislocationGlideSolverFactory<dim>::getGlideSolver(const DislocationNetwork<dim>& DN,const std::string& solverType)
32{
33 if(solverType=="Galerkin" || solverType=="galerkin")
34 {
35 return std::shared_ptr<DislocationGlideSolverBase<dim>>(new GalerkinGlideSolver<dim>(DN));
36 }
37 else if(solverType=="Pybind11" || solverType=="pybind11")
38 {
39 return std::shared_ptr<DislocationGlideSolverBase<dim>>(new PyGlideSolver<dim>(DN));
40 }
41 else
42 {
43 std::cout<<redBoldColor<<"Unknown glide solver type "<<solverType<<". Glide disabled."<<defaultColor<<std::endl;
44 return nullptr;
45 }
46
47}
48
49 template struct DislocationGlideSolverBase<3>;
51
52}
53#endif
static std::string redBoldColor
static std::string defaultColor
DislocationGlideSolverBase(const DislocationNetwork< dim > &)
static std::shared_ptr< DislocationGlideSolverBase< dim > > getGlideSolver(const DislocationNetwork< dim > &DN, const std::string &solverType)
DislocationVelocitySolverBase(const DislocationNetwork< dim > &)