24#ifndef _GEMA_INTERPOLATOR_INPUT_BINDINGS_H_
25#define _GEMA_INTERPOLATOR_INPUT_BINDINGS_H_
48 virtual int size()
const = 0;
67 virtual const double*
value(
int srcIndex) = 0;
99template <
class Base,
class Ac>
110 virtual int numSrcs() {
return 1; }
116 virtual int valueSize(
int srcIndex)
const { Q_UNUSED(srcIndex); assert(srcIndex == 0);
return _valueAc->valueSize(); }
125 virtual const double* value(
int srcIndex) { Q_UNUSED(srcIndex); assert(srcIndex == 0); assert(
_currIndex >= 0);
return _valueAc->value(
_currIndex); }
148 virtual void setValue(
int srcIndex,
const double* value)
150 Q_UNUSED(srcIndex); assert(srcIndex == 0); assert(
_currIndex >= 0);
161template <
class Base,
class Ac>
178 virtual int valueSize(
int srcIndex)
const { assert(srcIndex >= 0 && srcIndex <
_valueAcList.
size());
return _valueAcList.
at(srcIndex)->valueSize(); }
210 virtual void setValue(
int srcIndex,
const double* value)
226template <
class Base,
class Ac>
237 virtual int numSrcs() {
return 1; }
243 virtual int valueSize(
int srcIndex)
const { Q_UNUSED(srcIndex); assert(srcIndex == 0);
return _valueAc->valueSize(); }
252 virtual const double* value(
int srcIndex)
255 assert(srcIndex == 0);
257 if(
_valueAc->info()->canStoreFunctions())
289 virtual void setValue(
int srcIndex,
const double* value)
291 Q_UNUSED(srcIndex); assert(srcIndex == 0); assert(
_currElem);
301template <
class Base,
class Ac>
318 virtual int valueSize(
int srcIndex)
const { assert(srcIndex >= 0 && srcIndex <
_valueAcList.
size());
return _valueAcList.
at(srcIndex)->valueSize(); }
327 virtual const double* value(
int srcIndex)
363 virtual void setValue(
int srcIndex,
const double* value)
390 if (pointSet->
size() != dsize) {
394 int ncols = pointSet->
size();
397 for (
int i = 0; i < op; ++i) {
413 virtual int valueSize(
int srcIndex)
const { Q_UNUSED(srcIndex); assert(srcIndex == 0);
return _data.n_rows; }
447 if (pointSet->
size() != dsize) {
451 int ncols = pointSet->
size();
452 for (
const auto& m :
_data) {
455 for (
int i = 0; i < op; ++i) {
457 newMat.col(cid++) = m.col(i);
An auxiliary vector WRAPPER that binds the vector to a CONST memory area with data already initialize...
Definition gmVector.h:72
void setMemory(const double *data, int nlin)
Exchanges the memory area used by the vector. Same caveats explained in the class documentation apply...
Definition gmVector.h:102
const unsigned int n_rows
number of rows in the vector (read-only)
Definition gmVector.h:89
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
Basic interface for a set storing point cartesian coordinates. This set can be filled with points fro...
Definition gmInterpolatorCoordinateBindings.h:75
virtual int originalSize() const =0
Returns the number of coordinates stored by this set before filtering by any discontinuitySet.
virtual void reset()=0
Resets the coordinate iterator. The following call to nextCoordinate() will return the first coordina...
virtual bool validIndex(int i) const =0
Returns true if i in [0, originalSize() -1] is valid (can be iterated through nextXXX() methods)
virtual int size() const =0
Returns the number of coordinates stored by this set.
Interface for a coordinate set that stores Gauss point coordinates. Besides returning coordinates,...
Definition gmInterpolatorCoordinateBindings.h:176
virtual bool ipNaturalCoord(const GmElement *elem, int ip, GmVector &ipCoord) const =0
virtual bool next(GmCRVector &coord, const GmElement **elem, int *ip)=0
Similar to nextCoordinate(), returns both the next coordinate and Gauss point index....
A GmInterpolatorInputDataBinding implementation returning values provided by a Gauss value accessor....
Definition gmInterpolatorInputBindings.h:228
GmCRVector _currCoord
The current coordinate.
Definition gmInterpolatorInputBindings.h:275
GmInterpolatorGaussDataBinding(GmInterpolatorGaussCoordinateSetBinding *pointSet, Ac gaussAc)
Constructor, receiving the point set for which this binding will return values and the accessor used ...
Definition gmInterpolatorInputBindings.h:233
const GmElement * _currElem
The current element.
Definition gmInterpolatorInputBindings.h:273
GmInterpolatorGaussCoordinateSetBinding * _pointSet
The point set providing the indices used to access values.
Definition gmInterpolatorInputBindings.h:271
int _currIp
The current integration point index.
Definition gmInterpolatorInputBindings.h:274
Ac _valueAc
The accessor for the interpolated Gauss values.
Definition gmInterpolatorInputBindings.h:272
GmInterpolatorInOutDataBinding implementation working with values provided by a Gauss value accessor.
Definition gmInterpolatorInputBindings.h:283
virtual void setValue(int srcIndex, const double *value)
Updates the value pointed to by the current iterator position, for the given data source index (betwe...
Definition gmInterpolatorInputBindings.h:289
A version of GmInterpolatorInputDataBinding that lets us to also update the stored data.
Definition gmInterpolatorInputBindings.h:81
virtual void setValue(int srcIndex, const double *value)=0
Updates the value pointed to by the current iterator position, for the given data source index (betwe...
A GmInterpolatorInputDataBinding implementation returning values provided by a list of Gauss value ac...
Definition gmInterpolatorInputBindings.h:303
QVector< Ac > _valueAcList
The list of accessors for the interpolated Gauss values.
Definition gmInterpolatorInputBindings.h:346
int _currIp
The current integration point index.
Definition gmInterpolatorInputBindings.h:348
const GmElement * _currElem
The current element.
Definition gmInterpolatorInputBindings.h:347
GmInterpolatorMGaussDataBinding(GmInterpolatorGaussCoordinateSetBinding *pointSet, const QVector< Ac > &gaussAccessors)
Constructor, receiving the point set for which this binding will return values and the list of access...
Definition gmInterpolatorInputBindings.h:308
GmCRVector _currCoord
The current coordinate.
Definition gmInterpolatorInputBindings.h:349
GmInterpolatorGaussCoordinateSetBinding * _pointSet
The point set providing the indices used to access values.
Definition gmInterpolatorInputBindings.h:345
GmInterpolatorInOutDataBinding implementation working with values provided by a list of Gauss value a...
Definition gmInterpolatorInputBindings.h:357
virtual void setValue(int srcIndex, const double *value)
Updates the value pointed to by the current iterator position, for the given data source index (betwe...
Definition gmInterpolatorInputBindings.h:363
A GmInterpolatorInputDataBinding implementation returning values provided by a list of node value acc...
Definition gmInterpolatorInputBindings.h:163
GmInterpolatorNodeCoordinateSetBinding * _pointSet
The point set providing the indices used to access values.
Definition gmInterpolatorInputBindings.h:193
int _currIndex
The current index.
Definition gmInterpolatorInputBindings.h:195
QVector< Ac > _valueAcList
The list of accessors for the interpolated node values.
Definition gmInterpolatorInputBindings.h:194
GmInterpolatorMNodeDataBinding(GmInterpolatorNodeCoordinateSetBinding *pointSet, const QVector< Ac > &nodeAccessors)
Constructor, receiving the point set for which this binding will return values and the list of access...
Definition gmInterpolatorInputBindings.h:168
GmCRVector _currCoord
The current coordinate.
Definition gmInterpolatorInputBindings.h:196
GmInterpolatorInOutDataBinding implementation working with values provided by a list of node value ac...
Definition gmInterpolatorInputBindings.h:204
virtual void setValue(int srcIndex, const double *value)
Updates the value pointed to by the current iterator position, for the given data source index (betwe...
Definition gmInterpolatorInputBindings.h:210
Interface for a coordinate set that stores node coordinates. Besides returning coordinates,...
Definition gmInterpolatorCoordinateBindings.h:153
virtual bool next(GmCRVector &coord, int *index)=0
Similar to nextCoordinate(), returns both the next coordinate and node index. Same caveats apply....
A GmInterpolatorInputDataBinding implementation returning values provided by a node value accessor....
Definition gmInterpolatorInputBindings.h:101
GmInterpolatorNodeCoordinateSetBinding * _pointSet
The point set providing the indices used to access values.
Definition gmInterpolatorInputBindings.h:131
GmCRVector _currCoord
The current coordinate.
Definition gmInterpolatorInputBindings.h:134
Ac _valueAc
The accessor for the interpolated node values.
Definition gmInterpolatorInputBindings.h:132
int _currIndex
The current index.
Definition gmInterpolatorInputBindings.h:133
GmInterpolatorNodeDataBinding(GmInterpolatorNodeCoordinateSetBinding *pointSet, Ac nodeAc)
Constructor, receiving the point set for which this binding will return values and the accessor used ...
Definition gmInterpolatorInputBindings.h:106
GmInterpolatorInOutDataBinding implementation working with values provided by a node value accessor.
Definition gmInterpolatorInputBindings.h:142
virtual void setValue(int srcIndex, const double *value)
Updates the value pointed to by the current iterator position, for the given data source index (betwe...
Definition gmInterpolatorInputBindings.h:148
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
virtual bool setValue(int index, const double *value)=0
Allows for altering the value associated with entry "index" in the value set. This version of the fun...
Declaration of useful configuration definitions for the Core library.
Implementation of the GmGaussAccessor proxy class.
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
void append(const T &value)
const T & at(int i) const const
bool isEmpty() const const