13 #ifndef KRATOS_KUTTA_CONDITION_PROCESS_H
14 #define KRATOS_KUTTA_CONDITION_PROCESS_H
22 #include "utilities/geometry_utilities.h"
30 #include <boost/functional/hash.hpp>
31 #include <unordered_map>
67 mrModelPart(rModelPart)
96 if(mrModelPart.
Elements().size() == 0)
97 KRATOS_THROW_ERROR(std::invalid_argument,
"the number of elements in the domain is zero. kutta condition can not be applied",
"")
99 using normal_map_type = std::unordered_map<std::size_t, array_1d<double,3> >;
102 if(it->Is(STRUCTURE)) it->Set(VISITED,
false);
107 auto geom = it->GetGeometry();
109 for(
unsigned int i=0;
i<geom.size(); ++
i)
111 if(geom[
i].
Is(STRUCTURE))
120 normal_map_type normal_map;
121 for(
auto it=kutta_elements.
begin(); it!=kutta_elements.
end(); ++it)
126 const Vector& elemental_distances = it->GetValue(ELEMENTAL_DISTANCES);
130 bounded_matrix<double,4,3> DN_DX;
138 auto geom = it->GetGeometry();
139 for(
unsigned int i=0;
i<geom.size(); ++
i)
141 if(geom[
i].
Is(STRUCTURE))
143 geom[
i].Set(VISITED,
true);
144 normal_map[geom[
i].Id()] =
n;;
151 for(
auto it=kutta_elements.
begin(); it!=kutta_elements.
end(); ++it)
153 it->Set(MARKER,
false);
154 Vector& elemental_distances = it->GetValue(ELEMENTAL_DISTANCES);
157 auto geom = it->GetGeometry();
159 for(
unsigned int i=0;
i<geom.size(); ++
i)
161 if(geom[
i].
Is(STRUCTURE) && geom[
i].Is(VISITED))
164 n = normal_map[geom[
i].Id()];
171 it->Set(ACTIVE,
false);
178 double dkutta = -1
e-3;
179 for(
int i=0; i<static_cast<int>(geom.size()); ++
i)
188 elemental_distances[
i] = dkutta;
192 unsigned int npos = 0;
193 unsigned int nneg = 0;
194 for(
unsigned int i=0;
i<geom.size(); ++
i)
195 if(elemental_distances[
i] >= 0)
200 if(nneg > 0 && npos >0)
201 it->Set(MARKER,
true);
226 std::string
Info()
const override
228 return "KuttaConditionProcess";
234 rOStream <<
"KuttaConditionProcess";
305 rOStream << std::endl;
Base class for all Conditions.
Definition: condition.h:59
Base class for all Elements.
Definition: element.h:60
bool Is(Flags const &rOther) const
Definition: flags.h:274
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
Definition: kutta_condition_process.h:38
std::string Info() const override
Turn back information as a string.
Definition: kutta_condition_process.h:226
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: kutta_condition_process.h:80
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: kutta_condition_process.h:238
ModelPart::ConditionType ConditionType
Definition: kutta_condition_process.h:47
void Execute() override
Check elements to make sure that their jacobian is positive and conditions to ensure that their face ...
Definition: kutta_condition_process.h:92
~KuttaConditionProcess() override
Destructor.
Definition: kutta_condition_process.h:72
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: kutta_condition_process.h:232
KRATOS_CLASS_POINTER_DEFINITION(KuttaConditionProcess)
Pointer definition of Process.
KuttaConditionProcess(ModelPart &rModelPart)
Constructor for KuttaConditionProcess Process.
Definition: kutta_condition_process.h:64
ModelPart::ElementType ElementType
Definition: kutta_condition_process.h:46
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
ElementIterator ElementsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1179
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
iterator end()
Definition: pointer_vector.h:177
iterator begin()
Definition: pointer_vector.h:169
void push_back(const TPointerType &x)
Definition: pointer_vector.h:270
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
v
Definition: generate_convection_diffusion_explicit_element.py:114
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31