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.
trilinos_displacement_criteria.h
Go to the documentation of this file.
1 // KRATOS _____ _ _ _
2 // |_ _| __(_) (_)_ __ ___ ___
3 // | || '__| | | | '_ \ / _ \/ __|
4 // | || | | | | | | | | (_) \__
5 // |_||_| |_|_|_|_| |_|\___/|___/ APPLICATION
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Jordi Cotela
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
21 
22 namespace Kratos
23 {
24 
27 
30 
39 template<class TSparseSpace,
40  class TDenseSpace
41  >
43  : public DisplacementCriteria< TSparseSpace, TDenseSpace >
44 {
45 public:
48 
51 
54 
57 
60 
62  using TDataType = typename BaseType::TDataType;
63 
65  using DofType = typename Node::DofType;
66 
70 
73  : BaseType()
74  {
75  }
76 
82  : BaseType()
83  {
84  // Validate and assign defaults
85  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
86  this->AssignSettings(ThisParameters);
87  }
88 
95  TDataType NewRatioTolerance,
96  TDataType AlwaysConvergedNorm)
97  : BaseType(NewRatioTolerance, AlwaysConvergedNorm)
98  {
99  }
100 
106  :BaseType(rOther)
107  {
108  }
109 
114 
118 
122 
127  typename BaseConvergenceCriteriaType::Pointer Create(Parameters ThisParameters) const override
128  {
129  return Kratos::make_shared<ClassType>(ThisParameters);
130  }
131 
136  static std::string Name()
137  {
138  return "trilinos_displacement_criteria";
139  }
140 
146  {
147  Parameters default_parameters = Parameters(R"(
148  {
149  "name" : "trilinos_displacement_criteria",
150  "displacement_relative_tolerance" : 1.0e-4,
151  "displacement_absolute_tolerance" : 1.0e-9
152  })");
153 
154  // Getting base class default parameters
155  const Parameters base_default_parameters = BaseType::GetDefaultParameters();
156  default_parameters.RecursivelyAddMissingParameters(base_default_parameters);
157  return default_parameters;
158  }
159 
163 
167 
171 
173  std::string Info() const override
174  {
175  return "TrilinosDisplacementCriteria";
176  }
177 
179  void PrintInfo(std::ostream& rOStream) const override
180  {
181  rOStream << Info();
182  }
183 
185  void PrintData(std::ostream& rOStream) const override
186  {
187  rOStream << Info();
188  }
189 
193 
195 protected:
198 
202 
206 
210 
215  void AssignSettings(const Parameters ThisParameters) override
216  {
217  BaseType::AssignSettings(ThisParameters);
218  }
219 
223 
227 
231 
233 private:
236 
240 
244 
248 
252 
256 
260 
262 }; // Class ClassName
263 
267 
269 
270 } // namespace Kratos.
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: convergence_criteria.h:466
TSparseSpace::DataType TDataType
Data type definition.
Definition: convergence_criteria.h:70
This is a convergence criteria that considers the increment on the solution as criteria.
Definition: displacement_criteria.h:59
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: displacement_criteria.h:289
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: displacement_criteria.h:365
typename Node::DofType DofType
The definition of the DoF data type.
Definition: displacement_criteria.h:83
typename BaseType::TDataType TDataType
The data type.
Definition: displacement_criteria.h:77
Dof< double > DofType
Dof type.
Definition: node.h:83
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
MPI version of the DisplacementCriteria.
Definition: trilinos_displacement_criteria.h:44
TrilinosDisplacementCriteria(TDataType NewRatioTolerance, TDataType AlwaysConvergedNorm)
Constructor 2 arguments.
Definition: trilinos_displacement_criteria.h:94
TrilinosDisplacementCriteria(Kratos::Parameters ThisParameters)
Default constructor. (with parameters)
Definition: trilinos_displacement_criteria.h:81
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: trilinos_displacement_criteria.h:145
TrilinosDisplacementCriteria(TrilinosDisplacementCriteria const &rOther)
Copy constructor.
Definition: trilinos_displacement_criteria.h:105
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: trilinos_displacement_criteria.h:179
TrilinosDisplacementCriteria()
Default constructor.
Definition: trilinos_displacement_criteria.h:72
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: trilinos_displacement_criteria.h:215
std::string Info() const override
Turn back information as a string.
Definition: trilinos_displacement_criteria.h:173
BaseConvergenceCriteriaType::Pointer Create(Parameters ThisParameters) const override
Create method.
Definition: trilinos_displacement_criteria.h:127
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: trilinos_displacement_criteria.h:185
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: trilinos_displacement_criteria.h:136
~TrilinosDisplacementCriteria() override
Destructor.
Definition: trilinos_displacement_criteria.h:113
KRATOS_CLASS_POINTER_DEFINITION(TrilinosDisplacementCriteria)
Pointer definition of TrilinosDisplacementCriteria.
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21