61 template<
class TContainerType>
76 static double InnerProduct(
94 template<
class TContainerType>
95 static void ProductWithEntityMatrix(
114 template<
class TContainerType>
115 static void ProductWithEntityMatrix(
128 static void Transpose(
140 static void Transpose(
155 template<
class TContainerType>
156 static void ComputeNumberOfNeighbourEntities(
174 template<
class TContainerType>
175 static void MapContainerVariableToNodalVariable(
193 template<
class TContainerType>
194 static void MapNodalVariableToContainerVariable(
215 template<
class TContainerType>
216 static void ComputeNodalVariableProductWithEntityMatrix(
220 TContainerType& rEntities);
226 #ifndef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_1
227 #define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_1(METHOD_NAME) \
228 static CollectiveExpression METHOD_NAME(const CollectiveExpression& rCollectiveExpression) \
231 auto result = rCollectiveExpression; \
232 auto r_list_of_container_expressions = result.GetContainerExpressions(); \
233 for (IndexType i = 0; i < r_list_of_container_expressions.size(); ++i) { \
235 [](auto& pResult) { \
236 *pResult = ExpressionUtils::METHOD_NAME(*pResult); \
238 r_list_of_container_expressions[i]); \
245 #ifndef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_2
246 #define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_2(METHOD_NAME) \
247 static double METHOD_NAME(const CollectiveExpression& rCollectiveExpression) \
250 double value = 0.0; \
251 auto r_list_of_container_expressions = \
252 rCollectiveExpression.GetContainerExpressions(); \
253 for (IndexType i = 0; i < r_list_of_container_expressions.size(); ++i) { \
254 value += std::visit( \
255 [](const auto& pResult) { \
256 return ExpressionUtils::METHOD_NAME(*pResult); \
258 r_list_of_container_expressions[i]); \
265 #ifndef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_3
266 #define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_3(METHOD_NAME) \
267 static CollectiveExpression METHOD_NAME( \
268 const CollectiveExpression& rCollectiveExpression, const double V) \
271 auto result = rCollectiveExpression; \
272 auto r_list_of_container_expressions = result.GetContainerExpressions(); \
273 for (IndexType i = 0; i < r_list_of_container_expressions.size(); ++i) { \
275 [V](auto& pResult) { \
276 *pResult = ExpressionUtils::METHOD_NAME(*pResult, V); \
278 r_list_of_container_expressions[i]); \
283 static CollectiveExpression METHOD_NAME( \
284 const CollectiveExpression& rCollectiveExpression1, \
285 const CollectiveExpression& rCollectiveExpression2) \
289 KRATOS_ERROR_IF_NOT(rCollectiveExpression1.IsCompatibleWith(rCollectiveExpression2)) \
290 << "Unsupported collective variable data holders provided for " \
292 << #METHOD_NAME << "\"." \
293 << "\nLeft operand : " << rCollectiveExpression1 \
294 << "\nRight operand: " << rCollectiveExpression2 << std::endl; \
296 auto result = rCollectiveExpression1; \
297 auto r_list_of_container_expressions = result.GetContainerExpressions(); \
298 const auto& r_right_container_expressions = \
299 rCollectiveExpression2.GetContainerExpressions(); \
300 for (IndexType i = 0; i < r_list_of_container_expressions.size(); ++i) { \
302 [&r_right_container_expressions, i](auto& pResult) { \
303 auto p_right = std::get<std::decay_t<decltype(pResult)>>( \
304 r_right_container_expressions[i]); \
305 *pResult = ExpressionUtils::METHOD_NAME(*pResult, *p_right); \
307 r_list_of_container_expressions[i]); \
326 #undef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_1
327 #undef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_2
328 #undef KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_3
Construct a new CollectiveExpression instance.
Definition: collective_expression.h:41
Container variable data holder.
Definition: container_expression.h:80
Definition: container_expression_utils.h:34
SparseSpaceType::MatrixType SparseMatrixType
Definition: container_expression_utils.h:43
std::size_t IndexType
Definition: container_expression_utils.h:39
A class template for handling data types, matrices, and vectors in a Ublas space.
Definition: ublas_space.h:121
TMatrixType MatrixType
The matrix type considered.
Definition: ublas_space.h:133
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_3(METHOD_NAME)
Definition: container_expression_utils.h:266
#define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_2(METHOD_NAME)
Definition: container_expression_utils.h:246
#define KRATOS_OPTAPP_EXPRESSION_UTILS_CEXP_METHOD_1(METHOD_NAME)
Definition: container_expression_utils.h:227
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21