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.
basset_force_tools.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: G.Casas (gcasas@cimmne.upc.edu) $
4 // Date: $Date: 2016-5-13 08:56:42 $
5 // Revision: $Revision: 1.5 $
6 //
7 //
8 //README::::look to the key word "VERSION" if you want to find all the points where you have to change something so that you can pass from a kdtree to a bin data search structure;
9 
10 #if !defined(KRATOS_BASSET_FORCE_TOOLS)
11 #define KRATOS_BASSET_FORCE_TOOLS
12 
13 // /* External includes */
14 #ifdef _OPENMP
15 #include <omp.h>
16 #endif
17 
18 // System includes
19 #include <vector>
20 
21 // Project includes
22 #include "includes/model_part.h"
23 #include "utilities/timer.h"
24 #include "utilities/openmp_utils.h"
26 
27 //Database includes
29 #include "includes/define.h"
33 #include "includes/define.h"
34 #include "custom_utilities/AuxiliaryFunctions.h"
37 #include "utilities/geometry_utilities.h"
38 
39 namespace Kratos
40 {
41 class KRATOS_API(SWIMMING_DEM_APPLICATION) BassetForceTools
42 {
43 public:
44 
45 typedef ModelPart::ElementsContainerType::iterator ElementIterator;
46 typedef ModelPart::NodesContainerType::iterator NodeIterator;
48 
50 
52  : mFirstTimeAppending(true), mNumberOfQuadratureStepsInWindow(0), mTimeWindow(0.0)
53 {
54  Parameters default_parameters( R"(
55  {
56  "do_use_mae": false,
57  "m": 10,
58  "window_time_interval": 0.1,
59  "type": 2
60  }
61  )" );
62 
63  r_parameters.ValidateAndAssignDefaults(default_parameters);
64  mBassetForceType = r_parameters["type"].GetInt();
65 
66 }
68 
69 virtual ~BassetForceTools(){}
70 
72 
73 void FillDaitcheVectors(const int N, const int order, const int n_steps_per_quad_step);
74 void FillHinsbergVectors(ModelPart& r_model_part, const int m, const int n_quad_delta_times_window);
75 void AppendIntegrands(ModelPart& r_model_part);
76 void AppendIntegrandsImplicit(ModelPart& r_model_part);
77 void AppendIntegrandsWindow(ModelPart& r_model_part);
78 
79 //**************************************************************************************************************************************************
80 //**************************************************************************************************************************************************
81 
82 private:
83 
84 bool mFirstTimeAppending;
85 int mBassetForceType;
86 int mNumberOfQuadratureStepsInWindow;
87 int mNumberOfExponentials;
88 double mTimeWindow;
89 
90 //**************************************************************************************************************************************************
91 //**************************************************************************************************************************************************
92 
96 DenseVector<unsigned int> mElementsPartition;
97 
101 
102 DenseVector<unsigned int>& GetElementPartition()
103 {
104  return mElementsPartition;
105 }
106 
107 ElementIterator GetElementPartitionBegin(ModelPart& r_model_part, unsigned int k)
108 {
109  return r_model_part.GetCommunicator().LocalMesh().Elements().ptr_begin() + mElementsPartition[k];
110 }
111 
112 ElementIterator GetElementPartitionEnd(ModelPart& r_model_part, unsigned int k)
113 {
114  return r_model_part.GetCommunicator().LocalMesh().Elements().ptr_begin() + mElementsPartition[k + 1];
115 }
116 
117 //**************************************************************************************************************************************************
118 //**************************************************************************************************************************************************
119 
120 }; // Class BassetForceTools
121 } // namespace Kratos.
122 
123 #endif // KRATOS_CREATE_AND_DESTROY defined
124 
125 
Definition: basset_force_tools.h:42
BassetForceTools(Parameters &r_parameters)
Definition: basset_force_tools.h:51
virtual ~BassetForceTools()
Calculator.
Definition: basset_force_tools.h:69
ModelPart::ElementsContainerType::iterator ElementIterator
Definition: basset_force_tools.h:45
ModelPart::NodesContainerType::iterator NodeIterator
Definition: basset_force_tools.h:46
KRATOS_CLASS_POINTER_DEFINITION(BassetForceTools)
ModelPart::NodesContainerType NodesArrayType
Definition: basset_force_tools.h:47
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
MeshType::ElementIterator ElementIterator
Definition: regenerate_pfem_pressure_conditions_process.h:31
int k
Definition: quadrature.py:595
int m
Definition: run_marine_rain_substepping.py:8
N
Definition: sensitivityMatrix.py:29