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.
variable_redistribution_utility.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ruben Zorrilla
11 // Jordi Cotela
12 //
13 
14 #if !defined(KRATOS_VARIABLE_REDISTRIBUTION_UTILITY_H_INCLUDED )
15 #define KRATOS_VARIABLE_REDISTRIBUTION_UTILITY_H_INCLUDED
16 
17 
18 
19 // System includes
20 #include <string>
21 #include <iostream>
22 
23 
24 // External includes
25 
26 
27 // Project includes
28 #include "includes/define.h"
29 #include "includes/model_part.h"
31 
32 
33 namespace Kratos
34 {
37 
40 
44 
48 
52 
56 
58 
63  class KRATOS_API(KRATOS_CORE) VariableRedistributionUtility
64  {
65  public:
68 
69  typedef Node NodeType;
70 
73 
77 
78 
82 
83 
87 
98  static void ConvertDistributedValuesToPoint(
99  ModelPart& rModelPart,
100  const Variable< double >& rDistributedVariable,
101  const Variable< double >& rPointVariable);
102 
113  static void ConvertDistributedValuesToPoint(
114  ModelPart& rModelPart,
116  const Variable< double >& rDistributedVariable,
117  const Variable< double >& rPointVariable);
118 
129  static void ConvertDistributedValuesToPoint(
130  ModelPart& rModelPart,
132  const Variable< double >& rDistributedVariable,
133  const Variable< double >& rPointVariable);
134 
145  static void ConvertDistributedValuesToPoint(
146  ModelPart& rModelPart,
147  const Variable< array_1d<double,3> >& rDistributedVariable,
148  const Variable< array_1d<double,3> >& rPointVariable);
149 
160  static void ConvertDistributedValuesToPoint(
161  ModelPart& rModelPart,
163  const Variable< array_1d<double,3> >& rDistributedVariable,
164  const Variable< array_1d<double,3> >& rPointVariable);
165 
176  static void ConvertDistributedValuesToPoint(
177  ModelPart& rModelPart,
179  const Variable< array_1d<double,3> >& rDistributedVariable,
180  const Variable< array_1d<double,3> >& rPointVariable);
181 
194  static void DistributePointValues(
195  ModelPart& rModelPart,
196  const Variable<double>& rPointVariable,
197  const Variable<double>& rDistributedVariable,
198  double Tolerance,
199  unsigned int MaximumIterations);
200 
213  static void DistributePointValues(
214  ModelPart& rModelPart,
216  const Variable<double>& rPointVariable,
217  const Variable<double>& rDistributedVariable,
218  double Tolerance,
219  unsigned int MaximumIterations);
220 
233  static void DistributePointValues(
234  ModelPart& rModelPart,
236  const Variable<double>& rPointVariable,
237  const Variable<double>& rDistributedVariable,
238  double Tolerance,
239  unsigned int MaximumIterations);
240 
254  ModelPart& rModelPart,
255  const Variable<array_1d<double,3>>& rPointVariable,
256  const Variable<array_1d<double,3>>& rDistributedVariable,
257  double Tolerance,
258  unsigned int MaximumIterations);
259 
273  ModelPart& rModelPart,
275  const Variable<array_1d<double,3>>& rPointVariable,
276  const Variable<array_1d<double,3>>& rDistributedVariable,
277  double Tolerance,
278  unsigned int MaximumIterations);
279 
294  ModelPart& rModelPart,
296  const Variable<array_1d<double,3>>& rPointVariable,
297  const Variable<array_1d<double,3>>& rDistributedVariable,
298  double Tolerance,
299  unsigned int MaximumIterations);
300 
311  static void ConvertDistributedValuesToPointNonHistorical(
312  ModelPart& rModelPart,
314  const Variable< double >& rDistributedVariable,
315  const Variable< double >& rPointVariable);
316 
327  static void ConvertDistributedValuesToPointNonHistorical(
328  ModelPart& rModelPart,
330  const Variable< double >& rDistributedVariable,
331  const Variable< double >& rPointVariable);
332 
343  static void ConvertDistributedValuesToPointNonHistorical(
344  ModelPart& rModelPart,
346  const Variable< array_1d<double,3> >& rDistributedVariable,
347  const Variable< array_1d<double,3> >& rPointVariable);
348 
359  static void ConvertDistributedValuesToPointNonHistorical(
360  ModelPart& rModelPart,
362  const Variable< array_1d<double,3> >& rDistributedVariable,
363  const Variable< array_1d<double,3> >& rPointVariable);
364 
377  static void DistributePointValuesNonHistorical(
378  ModelPart& rModelPart,
380  const Variable<double>& rPointVariable,
381  const Variable<double>& rDistributedVariable,
382  double Tolerance,
383  unsigned int MaximumIterations);
384 
397  static void DistributePointValuesNonHistorical(
398  ModelPart& rModelPart,
400  const Variable<double>& rPointVariable,
401  const Variable<double>& rDistributedVariable,
402  double Tolerance,
403  unsigned int MaximumIterations);
404 
418  ModelPart& rModelPart,
420  const Variable<array_1d<double,3>>& rPointVariable,
421  const Variable<array_1d<double,3>>& rDistributedVariable,
422  double Tolerance,
423  unsigned int MaximumIterations);
424 
439  ModelPart& rModelPart,
441  const Variable<array_1d<double,3>>& rPointVariable,
442  const Variable<array_1d<double,3>>& rDistributedVariable,
443  double Tolerance,
444  unsigned int MaximumIterations);
445 
449 
450 
454 
455 
459 
460 
464 
465 
467  private:
470 
474 
478 
482 
494  template< const bool TIsHistorical, class TContainerType, class TValueType >
495  static void CallSpecializedConvertDistributedValuesToPoint(
496  ModelPart& rModelPart,
497  TContainerType& rEntitiesContainer,
498  const Variable< TValueType >& rDistributedVariable,
499  const Variable< TValueType >& rPointVariable);
500 
514  template< const bool TIsHistorical, class TContainerType, class TValueType >
515  static void CallSpecializedDistributePointValues(
516  ModelPart& rModelPart,
517  TContainerType& rEntitiesContainer,
518  const Variable< TValueType >& rPointVariable,
519  const Variable< TValueType >& rDistributedVariable,
520  double Tolerance,
521  unsigned int MaximumIterations);
522 
536  template< const bool TIsHistorical, class TContainerType, GeometryData::KratosGeometryFamily TFamily, unsigned int TPointNumber, class TValueType >
537  static void SpecializedConvertDistributedValuesToPoint(
538  ModelPart& rModelPart,
539  TContainerType& rEntitiesContainer,
540  const Variable< TValueType >& rDistributedVariable,
541  const Variable< TValueType >& rPointVariable);
542 
555  template< const bool TIsHistorical, class TValueType >
556  static void DummySpecializedConvertDistributedValuesToPoint(
557  ModelPart& rModelPart,
558  const Variable< TValueType >& rDistributedVariable,
559  const Variable< TValueType >& rPointVariable);
560 
575  template< const bool TIsHistorical, class TContainerType, GeometryData::KratosGeometryFamily TFamily, unsigned int TPointNumber, class TValueType >
576  static void SpecializedDistributePointValues(
577  ModelPart& rModelPart,
578  TContainerType& rEntitiesContainer,
579  const Variable< TValueType >& rPointVariable,
580  const Variable< TValueType >& rDistributedVariable,
581  double Tolerance,
582  unsigned int MaximumIterations);
583 
597  template< const bool TIsHistorical, class TValueType >
598  static void DummySpecializedDistributePointValues(
599  ModelPart& rModelPart,
600  const Variable< TValueType >& rDistributedVariable,
601  double Tolerance,
602  unsigned int MaximumIterations);
603 
611  template<class TContainerType>
612  static void ComputeNodalSizes(
613  ModelPart& rModelPart,
614  TContainerType& rEntitiesContainer);
615 
623  template< GeometryData::KratosGeometryFamily TFamily, unsigned int TNumNodes >
624  static void ConsistentMassMatrix(BoundedMatrix<double, TNumNodes, TNumNodes>& rMassMatrix);
625 
638  template< const bool TIsHistorical, class TContainerType, unsigned int TNumNodes, class TValueType >
639  static void UpdateDistributionRHS(
640  ModelPart& rModelPart,
641  TContainerType& rEntitiesContainer,
642  const Variable< TValueType >& rPointVariable,
643  const Variable< TValueType >& rDistributedVariable,
645 
656  template< class TValueType >
657  static void DummyUpdateDistributionRHS(
658  ModelPart& rModelPart,
659  const Variable< TValueType >& rDistributedVariable);
660 
670  template< const bool TIsHistorical, class TValueType >
671  static double SolveDistributionIteration(
672  ModelPart& rModelPart,
673  const Variable< TValueType >& rDistributedVariable);
674 
686  template< class TValueType >
687  static double DummySolveDistributionIteration(
688  ModelPart& rModelPart,
689  const Variable< TValueType >& rDistributedVariable);
690 
698  template< class TValueType >
699  static const Variable< TValueType >& GetRHSVariable(const Variable<TValueType>& rVariable);
700 
709  template< class TValueType >
710  static double AddToNorm(TValueType NodalValue, double NodalSize);
711 
720  template< class TContainerType >
721  static std::size_t NumberOfLocalEntities(
722  const ModelPart& rModelPart,
723  const TContainerType& rEntitiesContainer);
724 
734  template< const bool TIsHistorical, class TDataType >
735  static TDataType& AuxiliaryGet(
736  const Variable<TDataType>& rVariable,
737  NodeType& rNode);
738 
748  template< const bool TIsHistorical, class TDataType >
749  static void AuxiliarySet(
750  const Variable<TDataType>& rVariable,
751  const TDataType& rData,
752  NodeType& rNode);
753 
757 
761 
765 
768 
771 
774 
776 
777  }; // Class VariableRedistributionUtility
778 
780 
783 
787 
789 
791 
792 } // namespace Kratos.
793 
794 #endif // KRATOS_VARIABLE_REDISTRIBUTION_UTILITY_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
Helper utility to transform between point-wise nodal variables and distributed values.
Definition: variable_redistribution_utility.h:64
static void DistributePointValuesNonHistorical(ModelPart &rModelPart, ModelPart::ConditionsContainerType &rConditions, const Variable< array_1d< double, 3 >> &rPointVariable, const Variable< array_1d< double, 3 >> &rDistributedVariable, double Tolerance, unsigned int MaximumIterations)
Tranform a set of concentrated nodal values to a variable distributed over the conditions of rModelPa...
static void DistributePointValues(ModelPart &rModelPart, ModelPart::ElementsContainerType &rElements, const Variable< array_1d< double, 3 >> &rPointVariable, const Variable< array_1d< double, 3 >> &rDistributedVariable, double Tolerance, unsigned int MaximumIterations)
Tranform a set of concentrated nodal values to a variable distributed over the conditions of rModelPa...
static void DistributePointValues(ModelPart &rModelPart, ModelPart::ConditionsContainerType &rConditions, const Variable< array_1d< double, 3 >> &rPointVariable, const Variable< array_1d< double, 3 >> &rDistributedVariable, double Tolerance, unsigned int MaximumIterations)
Tranform a set of concentrated nodal values to a variable distributed over the conditions of rModelPa...
static void DistributePointValues(ModelPart &rModelPart, const Variable< array_1d< double, 3 >> &rPointVariable, const Variable< array_1d< double, 3 >> &rDistributedVariable, double Tolerance, unsigned int MaximumIterations)
Tranform a set of concentrated nodal values to a variable distributed over the conditions of rModelPa...
KRATOS_CLASS_POINTER_DEFINITION(VariableRedistributionUtility)
Pointer definition of VariableRedistributionUtility.
Node NodeType
Definition: variable_redistribution_utility.h:69
static void DistributePointValuesNonHistorical(ModelPart &rModelPart, ModelPart::ElementsContainerType &rElements, const Variable< array_1d< double, 3 >> &rPointVariable, const Variable< array_1d< double, 3 >> &rDistributedVariable, double Tolerance, unsigned int MaximumIterations)
Tranform a set of concentrated nodal values to a variable distributed over the conditions of rModelPa...
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21