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.
model_part_operator_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 #pragma once
14 
15 // System includes
16 #include <vector>
17 #include <set>
18 
19 // External includes
20 
21 // Project includes
22 
23 namespace Kratos {
24 
27 
29  template <class TCheckType>
30  static bool IsValid(
31  const TCheckType& rEntity,
32  const std::vector<std::set<TCheckType>>& mUnionSets)
33  {
34  bool is_valid = false;
35 
36  for (const auto& r_set : mUnionSets) {
37  if (r_set.find(rEntity) != r_set.end()) {
38  is_valid = true;
39  break;
40  }
41  }
42 
43  return is_valid;
44  }
45 };
46 
48  template <class TCheckType>
49  static bool IsValid(
50  const TCheckType& rEntity,
51  const std::vector<std::set<TCheckType>>& mSubstractionSets)
52  {
53  bool is_valid = true;
54 
55  for (const auto& r_set : mSubstractionSets) {
56  if (r_set.find(rEntity) != r_set.end()) {
57  is_valid = false;
58  break;
59  }
60  }
61 
62  return is_valid;
63  }
64 };
65 
67  template <class TCheckType>
68  static bool IsValid(
69  const TCheckType& rEntity,
70  const std::vector<std::set<TCheckType>>& mIntersectionSets)
71  {
72  bool is_valid = true;
73 
74  for (const auto& r_set : mIntersectionSets) {
75  if (r_set.find(rEntity) == r_set.end()) {
76  is_valid = false;
77  break;
78  }
79  }
80 
81  return is_valid;
82  }
83 };
84 
86 
87 } // namespace Kratos
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Definition: model_part_operator_utilities.h:66
static bool IsValid(const TCheckType &rEntity, const std::vector< std::set< TCheckType >> &mIntersectionSets)
Definition: model_part_operator_utilities.h:68
Definition: model_part_operator_utilities.h:47
static bool IsValid(const TCheckType &rEntity, const std::vector< std::set< TCheckType >> &mSubstractionSets)
Definition: model_part_operator_utilities.h:49
Definition: model_part_operator_utilities.h:28
static bool IsValid(const TCheckType &rEntity, const std::vector< std::set< TCheckType >> &mUnionSets)
Definition: model_part_operator_utilities.h:30