v0.15.0
Loading...
Searching...
No Matches
NormsOperators.hpp
Go to the documentation of this file.
1/** \file NormsOperators.hpp
2 * \brief User data Operators for calculating norms
3
4*/
5
6#ifndef __NORM_OPERATORS_HPP__
7#define __NORM_OPERATORS_HPP__
8
9namespace MoFEM {
10
11/** \brief Get norm of input VectorDouble for Tensor0
12 *
13 */
14
16
17 OpCalcNormL2Tensor0(boost::shared_ptr<VectorDouble> data_ptr,
18 SmartPetscObj<Vec> data_vec, const int index,
19 boost::shared_ptr<VectorDouble> diff_data_ptr = nullptr,
20 boost::shared_ptr<Range> ent_ptr = nullptr);
21
22 /**
23 * \brief calculate norm of scalar values at integration points
24 * @param side side entity number
25 * @param type side entity type
26 * @param data entity data
27 * @return error code
28 */
29 MoFEMErrorCode doWork(int side, EntityType type,
31
32protected:
33 boost::shared_ptr<VectorDouble> dataPtr;
34 boost::shared_ptr<VectorDouble> diffDataPtr;
35 boost::shared_ptr<Range> entsPtr;
37 const int iNdex;
38};
39
40/** \brief Get norm of input MatrixDouble for Tensor1
41 *
42 */
43template <int DIM>
45
46 OpCalcNormL2Tensor1(boost::shared_ptr<MatrixDouble> data_ptr,
47 SmartPetscObj<Vec> data_vec, const int index,
48 boost::shared_ptr<MatrixDouble> diff_data_ptr = nullptr,
49 boost::shared_ptr<Range> ent_ptr = nullptr);
50 /**
51 * \brief calculate norm of vector values at integration points
52 * @param side side entity number
53 * @param type side entity type
54 * @param data entity data
55 * @return error code
56 */
57 MoFEMErrorCode doWork(int side, EntityType type,
59
60protected:
61 boost::shared_ptr<MatrixDouble> dataPtr;
62 boost::shared_ptr<MatrixDouble> diffDataPtr;
63 boost::shared_ptr<Range> entsPtr;
65 const int iNdex;
66};
67
68/** \brief Get norm of input MatrixDouble for Tensor2
69 *
70 */
71template <int DIM_1, int DIM_2>
73
74 OpCalcNormL2Tensor2(boost::shared_ptr<MatrixDouble> data_ptr,
75 SmartPetscObj<Vec> data_vec, const int index,
76 boost::shared_ptr<MatrixDouble> diff_data_ptr = nullptr,
77 boost::shared_ptr<Range> ent_ptr = nullptr);
78
79 /**
80 * \brief calculate norm of tensor values at integration points
81 * @param side side entity number
82 * @param type side entity type
83 * @param data entity data
84 * @return error code
85 */
86 MoFEMErrorCode doWork(int side, EntityType type,
88
89protected:
90 boost::shared_ptr<MatrixDouble> dataPtr;
91 boost::shared_ptr<MatrixDouble> diffDataPtr;
93 boost::shared_ptr<Range> entsPtr;
94 const int iNdex;
95};
96
97typedef boost::function<VectorDouble(const double, const double, const double)>
99
100/** \brief Get values from scalar function at integration points and save them
101 * to VectorDouble for Tensor0
102 *
103 */
104
106
107 OpGetTensor0fromFunc(boost::shared_ptr<VectorDouble> data_ptr,
108 ScalarFun scalar_function);
109
110 /**
111 * \brief calculate values of scalar function at integration points
112 * @param side side entity number
113 * @param type side entity type
114 * @param data entity data
115 * @return error code
116 */
117 MoFEMErrorCode doWork(int side, EntityType type,
119
120protected:
122 boost::shared_ptr<VectorDouble> dataPtr;
123};
124
125template <int SPACE_DIM, int BASE_DIM>
127
128 OpGetTensor1fromFunc(boost::shared_ptr<MatrixDouble> data_ptr,
129 VectorFunc vector_function);
130
131 /**
132 * \brief calculate values of vector function at integration points
133 * @param side side entity number
134 * @param type side entity type
135 * @param data entity data
136 * @return error code
137 */
138 MoFEMErrorCode doWork(int side, EntityType type,
140
141private:
143 boost::shared_ptr<MatrixDouble> dataPtr;
144};
145
146} // namespace MoFEM
147
148#endif // __NORM_OPERATORS_HPP__
boost::function< double(const double, const double, const double)> ScalarFun
Scalar function type.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< double > VectorDouble
Definition Types.hpp:68
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
boost::function< VectorDouble(const double, const double, const double)> VectorFunc
Data on single entity (This is passed as argument to DataOperator::doWork)
Get norm of input VectorDouble for Tensor0.
boost::shared_ptr< VectorDouble > dataPtr
boost::shared_ptr< VectorDouble > diffDataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate norm of scalar values at integration points
OpCalcNormL2Tensor0(boost::shared_ptr< VectorDouble > data_ptr, SmartPetscObj< Vec > data_vec, const int index, boost::shared_ptr< VectorDouble > diff_data_ptr=nullptr, boost::shared_ptr< Range > ent_ptr=nullptr)
SmartPetscObj< Vec > dataVec
boost::shared_ptr< Range > entsPtr
Get norm of input MatrixDouble for Tensor1.
boost::shared_ptr< MatrixDouble > diffDataPtr
OpCalcNormL2Tensor1(boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const int index, boost::shared_ptr< MatrixDouble > diff_data_ptr=nullptr, boost::shared_ptr< Range > ent_ptr=nullptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate norm of vector values at integration points
boost::shared_ptr< Range > entsPtr
SmartPetscObj< Vec > dataVec
boost::shared_ptr< MatrixDouble > dataPtr
Get norm of input MatrixDouble for Tensor2.
OpCalcNormL2Tensor2(boost::shared_ptr< MatrixDouble > data_ptr, SmartPetscObj< Vec > data_vec, const int index, boost::shared_ptr< MatrixDouble > diff_data_ptr=nullptr, boost::shared_ptr< Range > ent_ptr=nullptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate norm of tensor values at integration points
boost::shared_ptr< MatrixDouble > diffDataPtr
boost::shared_ptr< MatrixDouble > dataPtr
SmartPetscObj< Vec > dataVec
boost::shared_ptr< Range > entsPtr
Get values from scalar function at integration points and save them to VectorDouble for Tensor0.
OpGetTensor0fromFunc(boost::shared_ptr< VectorDouble > data_ptr, ScalarFun scalar_function)
boost::shared_ptr< VectorDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate values of scalar function at integration points
OpGetTensor1fromFunc(boost::shared_ptr< MatrixDouble > data_ptr, VectorFunc vector_function)
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
calculate values of vector function at integration points
intrusive_ptr for managing petsc objects