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.
retention_law_factory.h
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: Vahid Galavi
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <string>
17 #include <iostream>
18 #include "includes/define.h"
19 
20 // External includes
21 
22 // Project includes
27 
28 // Application includes
30 
31 namespace Kratos
32 {
33 
39 class KRATOS_API(GEO_MECHANICS_APPLICATION) RetentionLawFactory
40 {
41 public:
44 
45  static unique_ptr<RetentionLaw> Clone(const Properties& rMaterialProperties)
46  {
47  if (rMaterialProperties.Has(RETENTION_LAW))
48  {
49  const std::string &RetentionLawName = rMaterialProperties[RETENTION_LAW];
50  if (RetentionLawName == "VanGenuchtenLaw")
51  return make_unique<VanGenuchtenLaw>();
52 
53  if (RetentionLawName == "SaturatedLaw")
54  return make_unique<SaturatedLaw>();
55 
56  if (RetentionLawName == "SaturatedBelowPhreaticLevelLaw")
57  return make_unique<SaturatedBelowPhreaticLevelLaw>();
58 
59  KRATOS_ERROR << "Undefined RETENTION_LAW! "
60  << RetentionLawName
61  << std::endl;
62 
63  return nullptr;
64  }
65 
66  // default is saturated law
67  return make_unique<SaturatedLaw>();
68 
69  }
70 
71 }; // Class RetentionLawFactory
72 } // namespace Kratos.
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
bool Has(TVariableType const &rThisVariable) const
Definition: properties.h:578
Definition: retention_law_factory.h:40
KRATOS_CLASS_POINTER_DEFINITION(RetentionLawFactory)
Counted pointer of RetentionLawFactory.
static unique_ptr< RetentionLaw > Clone(const Properties &rMaterialProperties)
Definition: retention_law_factory.h:45
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33