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.
explicit_filter.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: OptimizationApplication/license.txt
9 //
10 // Main authors: Baumgaertner Daniel
11 // Aditya Ghantasala
12 // Suneth Warnakulasuriya
13 //
14 
15 #pragma once
16 
17 // System includes
18 #include <string>
19 #include <variant>
20 
21 // Project includes
22 #include "includes/define.h"
23 #include "includes/model_part.h"
26 
27 // Application includes
28 #include "entity_point.h"
29 #include "filter_function.h"
30 #include "damping_function.h"
31 
32 namespace Kratos {
33 
36 
37 template<class TContainerType>
38 class KRATOS_API(OPTIMIZATION_APPLICATION) ExplicitFilter
39 {
40 public:
43 
44  using EntityType = typename TContainerType::value_type;
45 
46  using EntityPointVector = std::vector<typename EntityPoint<EntityType>::Pointer>;
47 
48  // Type definitions for tree-search
50 
52 
55 
59 
61  const ModelPart& rModelPart,
62  const std::string& rKernelFunctionType,
63  const IndexType MaxNumberOfNeighbours);
64 
66  const ModelPart& rModelPart,
67  const ModelPart& rFixedModelPart,
68  const std::string& rKernelFunctionType,
69  const std::string& rDampingFunctionType,
70  const IndexType MaxNumberOfNeighbours);
71 
74 
75  void SetFilterRadius(const ContainerExpression<TContainerType>& rContainerExpression);
76 
77  void Update();
78 
79  ContainerExpression<TContainerType> FilterField(const ContainerExpression<TContainerType>& rContainerExpression) const;
80 
81  ContainerExpression<TContainerType> FilterIntegratedField(const ContainerExpression<TContainerType>& rContainerExpression) const;
82 
83  void GetIntegrationWeights(ContainerExpression<TContainerType>& rContainerExpression) const;
84 
85  std::string Info() const;
86 
88 private:
91 
92  const ModelPart& mrModelPart;
93 
94  const ModelPart* mpFixedModelPart = nullptr;
95 
96  FilterFunction::UniquePointer mpKernelFunction;
97 
98  DampingFunction::UniquePointer mpDampingFunction;
99 
100  typename ContainerExpression<TContainerType>::Pointer mpFilterRadiusContainer;
101 
102  Expression::ConstPointer mpNodalDomainSizeExpression;
103 
104  EntityPointVector mEntityPointVector;
105 
106  EntityPointVector mFixedModelPartEntityPointVector;
107 
108  IndexType mBucketSize = 100;
109 
110  IndexType mMaxNumberOfNeighbors;
111 
112  typename KDTree::Pointer mpSearchTree;
113 
114  typename KDTree::Pointer mpFixedModelPartSearchTree;
115 
119 
120  template<class TWeightIntegrationType>
121  ContainerExpression<TContainerType> GenericFilterField(const ContainerExpression<TContainerType>& rContainerExpression) const;
122 
124 };
125 
128 
130 template<class TContainerType>
131 inline std::ostream& operator<<(
132  std::ostream& rOStream,
133  const ExplicitFilter<TContainerType>& rThis)
134 {
135  return rOStream << rThis.Info();
136 }
137 
139 
141 } // namespace Kratos
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Short class definition.
Definition: bucket.h:57
Container variable data holder.
Definition: container_expression.h:80
Definition: explicit_filter.h:39
typename TContainerType::value_type EntityType
Definition: explicit_filter.h:44
std::string Info() const
Definition: explicit_filter.cpp:378
KRATOS_CLASS_POINTER_DEFINITION(ExplicitFilter)
Pointer definition of ContainerMapper.
std::vector< typename EntityPoint< EntityType >::Pointer > EntityPointVector
Definition: explicit_filter.h:46
Kratos::intrusive_ptr< const Expression > ConstPointer
Definition: expression.h:46
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
A generic tree data structure for spatial partitioning.
Definition: tree.h:190
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432