KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
builder_and_solver_factory.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Richard Faasse
11 //
12 #pragma once
13 
14 #include <memory>
17 
18 namespace Kratos
19 {
20 
21 template<class TSparseSpace, class TDenseSpace, class TLinearSolver>
23 {
24 
25 public:
27 
28  static std::shared_ptr<BuilderAndSolverType> Create(const Parameters& rSolverSettings,
29  typename TLinearSolver::Pointer pNewLinearSystemSolver)
30  {
31  const std::string block_builder_entry = "block_builder";
32  KRATOS_ERROR_IF_NOT(rSolverSettings.Has(block_builder_entry)) <<
33  "the block_builder parameter is not defined, aborting BuilderAndSolverCreation";
34 
35  if (rSolverSettings[block_builder_entry].GetBool())
36  {
37  return std::make_shared<ResidualBasedBlockBuilderAndSolver<TSparseSpace, TDenseSpace, TLinearSolver>>(pNewLinearSystemSolver);
38  }
39 
40  return std::make_shared<ResidualBasedEliminationBuilderAndSolver<TSparseSpace, TDenseSpace, TLinearSolver>>(pNewLinearSystemSolver);
41  }
42 };
43 
44 
45 }
Definition: builder_and_solver_factory.hpp:23
static std::shared_ptr< BuilderAndSolverType > Create(const Parameters &rSolverSettings, typename TLinearSolver::Pointer pNewLinearSystemSolver)
Definition: builder_and_solver_factory.hpp:28
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
bool Has(const std::string &rEntry) const
This method checks if the Parameter contains a certain entry.
Definition: kratos_parameters.cpp:520
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21