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.
permeability_tensor_communicator_utility.hpp
Go to the documentation of this file.
1 /*
2  * Author: Miguel Angel Celigueta
3  *
4  * maceli@cimne.upc.edu
5  */
6 
7 #ifndef PERMEABILITY_TENSOR_COMMUNICATOR_UTILITY_H
8 #define PERMEABILITY_TENSOR_COMMUNICATOR_UTILITY_H
9 
10 #include "includes/variables.h"
11 #include <limits>
12 #include <iostream>
13 #include <iomanip>
14 
15 #ifdef _OPENMP
16 #include <omp.h>
17 #endif
18 
19 #include "includes/define.h"
20 #include "includes/condition.h"
21 #include "includes/model_part.h"
23 #include "../../PoromechanicsApplication/poromechanics_application_variables.h"
24 #include "../../DEMApplication/DEM_application_variables.h"
26 
27 // Project includes
29 #include "utilities/openmp_utils.h"
30 
31 // Configures
32 #include "../../DEMApplication/custom_utilities/discrete_particle_configure.h"
33 #include "../../DEMApplication/custom_utilities/geometrical_object_configure.h"
34 #include "../../DEMApplication/custom_utilities/node_configure.h"
35 #include "../../DEMApplication/custom_utilities/omp_dem_search.h"
36 
37 // Search
41 
42 namespace Kratos {
43 
44  class KRATOS_API(DEM_STRUCTURES_COUPLING_APPLICATION) PermeabilityTensorCommunicatorUtility {
45 
46  public:
47 
48  typedef ModelPart::NodesContainerType::ContainerType::iterator NodesIteratorType;
53  typedef ContainerType::value_type PointerType;
54  typedef ContainerType::iterator IteratorType;
55  typedef ElementsContainerType::iterator ElementIteratorType;
59  typedef std::unique_ptr<BinsType> BinsUniquePointerType;
62 
64 
65  PermeabilityTensorCommunicatorUtility(ModelPart& r_source_model_part, ModelPart& destination_model_part):mrDEMModelPart(r_source_model_part), mrFEMModelPart(destination_model_part) {
66  Check();
67  }
68 
70  delete mpSearchStructure;
71  }
72 
73  void Initialize() {
74  mpSearchStructure = new BinBasedFastPointLocator<2>(mrDEMModelPart);
75  mpSearchStructure->UpdateSearchDatabase();
76  }
77 
79  void EigenVectors(const BoundedMatrix<double, 3, 3>& A,
81  double zero_tolerance =1e-14,
82  int max_iterations = 50);
83 
85 
86  void TrasferUpdatedPermeabilityTensor();
87 
88  virtual std::string Info() const { return "";}
89  virtual void PrintInfo(std::ostream& rOStream) const {}
90  virtual void PrintData(std::ostream& rOStream) const {}
91 
92  private:
93 
94  ModelPart& mrDEMModelPart;
95  ModelPart& mrFEMModelPart;
96  BinBasedFastPointLocator<2>* mpSearchStructure;
97 
99 
100  void Check() {}
101 
102  }; // class PermeabilityTensorCommunicatorUtility
103 
104 } // namespace Kratos
105 
106 #endif // PERMEABILITY_TENSOR_COMMUNICATOR_UTILITY_H
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Short class definition.
Definition: bins_dynamic_objects.h:57
Definition: discrete_particle_configure.h:46
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: permeability_tensor_communicator_utility.hpp:44
ContainerType::iterator IteratorType
Definition: permeability_tensor_communicator_utility.hpp:54
ElementsContainerType::ContainerType ResultElementsContainerType
Definition: permeability_tensor_communicator_utility.hpp:60
ElementsContainerType::iterator ElementIteratorType
Definition: permeability_tensor_communicator_utility.hpp:55
virtual std::string Info() const
Definition: permeability_tensor_communicator_utility.hpp:88
SpatialSearch SearchType
Definition: permeability_tensor_communicator_utility.hpp:49
virtual void PrintData(std::ostream &rOStream) const
Definition: permeability_tensor_communicator_utility.hpp:90
DiscreteParticleConfigure< 3 > ElementConfigureType
Definition: permeability_tensor_communicator_utility.hpp:57
SearchType::ElementsContainerType::ContainerType ResultContainerType
Definition: permeability_tensor_communicator_utility.hpp:56
SearchType::NodesContainerType NodesContainerType
Definition: permeability_tensor_communicator_utility.hpp:52
void Initialize()
Definition: permeability_tensor_communicator_utility.hpp:73
SearchType::ElementsContainerType ElementsContainerType
Definition: permeability_tensor_communicator_utility.hpp:50
PermeabilityTensorCommunicatorUtility(ModelPart &r_source_model_part, ModelPart &destination_model_part)
Definition: permeability_tensor_communicator_utility.hpp:65
BinsObjectDynamic< ElementConfigureType > BinsType
Definition: permeability_tensor_communicator_utility.hpp:58
ModelPart::NodesContainerType::ContainerType::iterator NodesIteratorType
Definition: permeability_tensor_communicator_utility.hpp:48
SpatialSearch::DistanceType DistanceType
Definition: permeability_tensor_communicator_utility.hpp:61
ContainerType::value_type PointerType
Definition: permeability_tensor_communicator_utility.hpp:53
std::unique_ptr< BinsType > BinsUniquePointerType
Definition: permeability_tensor_communicator_utility.hpp:59
virtual ~PermeabilityTensorCommunicatorUtility()
Definition: permeability_tensor_communicator_utility.hpp:69
virtual void PrintInfo(std::ostream &rOStream) const
Definition: permeability_tensor_communicator_utility.hpp:89
KRATOS_CLASS_POINTER_DEFINITION(PermeabilityTensorCommunicatorUtility)
SearchType::ElementsContainerType::ContainerType ContainerType
Definition: permeability_tensor_communicator_utility.hpp:51
This class is used to search for elements, conditions and nodes in a given model part.
Definition: spatial_search.h:50
ModelPart::NodesContainerType NodesContainerType
Nodes classes.
Definition: spatial_search.h:80
ModelPart::ElementsContainerType ElementsContainerType
Elements classes.
Definition: spatial_search.h:85
std::vector< double > DistanceType
Definition: spatial_search.h:96
void Diagonalize(const double(&A)[3][3], double(&Q)[3][3], double(&D)[3][3])
Definition: mesh_to_clu_converter.cpp:411
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int max_iterations
Definition: ProjectParameters.py:53
tuple Q
Definition: isotropic_damage_automatic_differentiation.py:235
A
Definition: sensitivityMatrix.py:70
e
Definition: run_cpp_mpi_tests.py:31
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247