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.
sensitivity_utilities.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: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_SENSITIVITY_UTILITIES_H_INCLUDED)
14 #define KRATOS_SENSITIVITY_UTILITIES_H_INCLUDED
15 
16 // System includes
17 #include <unordered_map>
18 #include <vector>
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "includes/model_part.h"
25 
26 namespace Kratos
27 {
30 
31 class KRATOS_API(KRATOS_CORE) SensitivityUtilities
32 {
33 public:
36 
65  template <class TContainerType>
66  static void AssignEntityDerivativesToNodes(
67  ModelPart& rModelPart,
68  const int DerivativeDimension,
69  const Variable<Matrix>& rDerivativeVariable,
70  const std::unordered_map<int, std::vector<int>>& rNeighbourNodeIdsMap,
71  const double Weight,
72  const Flags& rFlag,
73  const bool CheckValue = true);
74 
76 private:
79 
80  static void ComputeEntityGeometryNeighbourNodeMap(
81  std::unordered_map<int, std::unordered_map<int, int>>& rDerivativeNodesMap,
82  const std::unordered_map<int, std::vector<int>>& rNeighbourNodeIdsMap,
83  const Geometry<ModelPart::NodeType>& rEntityGeometry,
84  const Flags& rFlag,
85  const bool CheckValue);
86 
87  template<class TContainerType>
88  static TContainerType& GetContainer(ModelPart& rModelPart);
89 
90  static void AddMatrixSubBlock(
91  Matrix& rOutput,
92  const Matrix& rInput,
93  const int RowOffset,
94  const int ColOffset);
95 
96  static void GetMatrixSubBlock(
97  Matrix& rOutput,
98  const Matrix& rInput,
99  const int RowOffset,
100  const int Rows,
101  const int ColOffset,
102  const int Cols);
103 
105 };
106 } // namespace Kratos
107 
108 #endif // KRATOS_SENSITIVITY_UTILITIES_H_INCLUDED
Definition: flags.h:58
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: sensitivity_utilities.h:32
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
TContainerType & GetContainer(ModelPart::MeshType &rMesh)
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21