GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmAggregator.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2026 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
23#ifndef _GEMA_AGGREGATOR_H_
24#define _GEMA_AGGREGATOR_H_
25
26#include "gmCoreConfig.h"
27#include "gmVector.h"
28
29class GmCell;
30class GmElement;
31class GmValueAccessor;
33class GmGaussAccessor;
35
36enum GmAggregationType {
37 GM_NO_AGGREGATION = 0,
38 GM_MAX_AGGREGATION,
39 GM_MIN_AGGREGATION,
40 GM_ABS_MIN_AGGREGATION,
41 GM_ABS_MAX_AGGREGATION,
43 GM_AGGREGATION_COUNT
44};
45
47{
48public:
49 static QString aggregationTypeToStr(GmAggregationType type);
50 static GmAggregationType strToAggregationType(const QString& str);
51
52 /*
53 Aggregates values from cell's nodes or element's gauss points,
54 according to the specified aggregation type and value accessor.
55
56 If a discontinuity set is given, it also requires a coordinate vector
57 to be use the discontinuity aware aggregation.
58 For Gauss points it may happens that with a given discontinuitySet no
59 point is valid for aggregation.
60 In that case, the function should return false.
61
62 Parameters:
63 - GmCell* or GmElement*: the cell or element to aggregate values from
64 - GmVector& result: the aggregated result is returned in this vector
65 - GmAggregationType type: the type of aggregation to be performed
66 - GmValueAccessor* ac: the accessor used to retrieve values for aggregation
67 - GmValueAccessor* coordAc: the accessor used to retrieve coordinates for discontinuity aware aggregation (can be NULL if ds is NULL)
68 - GmVector* coord: the coordinates to be used for discontinuity aware aggregation (can be NULL if ds is NULL)
69 - GmDiscontinuitySet* ds: the discontinuity set to be used for aggregation (can be NULL for regular aggregation)
70 */
71 static bool aggregateNode(const GmCell* c, double* result, GmAggregationType type, const GmValueAccessor* ac,
72 const GmValueAccessor* coordAc = NULL, const GmVector* coord = NULL, const GmDiscontinuitySet* ds = NULL, int dim = -1);
73
74 static bool aggregateGauss(const GmElement* e, double* result, GmAggregationType type, const GmGaussAccessor* ac,
75 const GmValueAccessor* coordAc = NULL, const GmVector* coord = NULL, const GmDiscontinuitySet* ds = NULL, const GmIntegrationRule* ir = NULL, int dim = -1);
76
77};
78
79#endif
Definition gmAggregator.h:47
Base interface for mesh cells.
Definition gmCell.h:88
Base interface for providing discontinuity geometry information for spatial indices.
Definition gmDiscontinuitySet.h:59
Base interface for FEM (finite element) mesh elements.
Definition gmElement.h:38
The GmGaussAccessor class is a proxy object to a value accessor implementing a more convenient interf...
Definition gmGaussAccessor.h:39
Integration rule base classe.
Definition gmIntegrationRule.h:89
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmVector class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34