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.
process_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: Wijtze Pieter Kikstra
11 // Anne van de Graaf
12 //
13 
14 #pragma once
15 
16 #include "processes/process.h"
17 
18 #include <map>
19 #include <memory>
20 #include <string>
21 #include <functional>
22 
23 namespace Kratos
24 {
25 
26 class Parameters;
27 
29 {
30 public:
31  using ProductType = std::unique_ptr<Process>;
32 
33  [[nodiscard]] ProductType Create(const std::string& rProcessClassName,
34  const Parameters& rProcessSettings) const;
35  void AddCreator(const std::string& rProcessClassName,
36  std::function<ProductType(const Parameters&)> Creator);
37 
38  void SetCallBackWhenProcessIsUnknown(const std::function<void(const std::string&)>& function);
39 
40 private:
41  std::map<std::string, std::function<ProductType(const Parameters&)>, std::less<>> mCreatorMap;
42  std::function<void(const std::string&)> mCallBackIfProcessIsUnknown;
43 };
44 
45 }
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: process_factory.hpp:29
std::unique_ptr< Process > ProductType
Definition: process_factory.hpp:31
void SetCallBackWhenProcessIsUnknown(const std::function< void(const std::string &)> &function)
Definition: process_factory.cpp:43
ProductType Create(const std::string &rProcessClassName, const Parameters &rProcessSettings) const
Definition: process_factory.cpp:20
void AddCreator(const std::string &rProcessClassName, std::function< ProductType(const Parameters &)> Creator)
Definition: process_factory.cpp:37
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21