G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPreCICEFunction< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsPreCICEFunction< T >

Class defining a gsFunction that reads from the precice::SolverInterface.

Template Parameters
TNumber format
+ Inheritance diagram for gsPreCICEFunction< T >:
+ Collaboration diagram for gsPreCICEFunction< T >:

Public Types

typedef memory::shared_ptr
< gsPreCICEFunction
Ptr
 Shared pointer for gsPreCICEFunction.
 
typedef memory::unique_ptr
< gsPreCICEFunction
uPtr
 Unique pointer for gsPreCICEFunction.
 

Public Member Functions

gsMatrix< index_tactive (const gsMatrix< T > &u) const
 Returns the indices of active (nonzero) functions at points u, as a list of indices. More...
 
void active_into (const gsMatrix< T > &u, gsMatrix< index_t > &result) const
 Indices of active (non-zero) function(s) for each point. More...
 
const gsBasis< T > & basis (const index_t k) const
 Helper which casts and returns the k-th piece of this function set as a gsBasis.
 
uPtr clone ()
 Clone methode. Produceds a deep copy inside a uPtr.
 
virtual void compute (const gsMatrix< T > &in, gsFuncData< T > &out) const
 Computes function data. More...
 
virtual void computeMap (gsMapData< T > &InOut) const
 Computes map function data. More...
 
gsFuncCoordinate< T > coord (const index_t c) const
 Returns the scalar function giving the i-th coordinate of this function.
 
gsMatrix< T > deriv (const gsMatrix< T > &u) const
 Evaluate the derivatives,. More...
 
gsMatrix< T > deriv2 (const gsMatrix< T > &u) const
 Evaluates the second derivatives of active (i.e., non-zero) basis at points u. More...
 
virtual void deriv2_into (const gsMatrix< T > &u, gsMatrix< T > &result) const
 See gsFunction.
 
virtual void deriv_into (const gsMatrix< T > &u, gsMatrix< T > &result) const
 See gsFunction.
 
virtual T distanceL2 (gsFunction< T > const &) const
 Computes the L2-distance between this function and the field and a function func.
 
virtual short_t domainDim () const
 See gsFunction.
 
gsMatrix< T > eval (const gsMatrix< T > &u) const
 Evaluate the function,. More...
 
virtual void eval_into (const gsMatrix< T > &u, gsMatrix< T > &result) const
 See gsFunction.
 
std::vector< gsMatrix< T > > evalAllDers (const gsMatrix< T > &u, int n) const
 Evaluate all derivatives upto order n,. More...
 
void evalAllDers_into (const gsMatrix< T > &u, int n, std::vector< gsMatrix< T > > &result) const
 See gsFunction.
 
const gsFunction< T > & function (const index_t k) const
 Helper which casts and returns the k-th piece of this function set as a gsFunction.
 
 gsPreCICEFunction ()
 Default constructor.
 
 gsPreCICEFunction (gsPreCICE< T > *interface, const index_t &meshID, const index_t &dataID, const gsMultiPatch< T > &patches, const bool parametric=false)
 Constructs a new instance of the gsPreCICEFunction. More...
 
virtual void invertPoints (const gsMatrix< T > &points, gsMatrix< T > &result, const T accuracy=1e-6, const bool useInitialPoint=false) const
 
int newtonRaphson (const gsVector< T > &value, gsVector< T > &arg, bool withSupport=true, const T accuracy=1e-6, int max_loop=100, T damping_factor=1) const
 
virtual index_t nPieces () const
 Number of pieces in the domain of definition.
 
virtual gsMatrix< T > parameterCenter () const
 Returns a "central" point inside inside the parameter domain.
 
gsMatrix< T > parameterCenter (const boxCorner &bc) const
 Get coordinates of the boxCorner bc in the parameter domain.
 
gsMatrix< T > parameterCenter (const boxSide &bs) const
 Get coordinates of the midpoint of the boxSide bs in the parameter domain.
 
const gsPreCICEFunction< T > & piece (const index_t) const
 Access a piece.
 
virtual std::ostream & print (std::ostream &os) const
 See gsFunction.
 
void recoverPoints (gsMatrix< T > &xyz, gsMatrix< T > &uv, index_t k, const T accuracy=1e-6) const
 
index_t size () const
 size More...
 
virtual short_t targetDim () const
 Gives the targetDomain, currently only scalar functions (todo)
 
Evaluation functions

These functions allow one to evaluate the function as well as its derivatives at one or more points in the parameter space. See also Evaluation members.

virtual void eval_component_into (const gsMatrix< T > &u, const index_t comp, gsMatrix< T > &result) const
 Evaluate the function for component comp in the target dimension at points u into result.
 
virtual void jacobian_into (const gsMatrix< T > &u, gsMatrix< T > &result) const
 Computes for each point u a block of result containing the Jacobian matrix.
 
void div_into (const gsMatrix< T > &u, gsMatrix< T > &result) const
 Computes for each point u a block of result containing the divergence matrix.
 
gsMatrix< T > jacobian (const gsMatrix< T > &u) const
 
virtual void hessian_into (const gsMatrix< T > &u, gsMatrix< T > &result, index_t coord=0) const
 
virtual gsMatrix< T > hessian (const gsMatrix< T > &u, index_t coord=0) const
 
virtual gsMatrix< T > laplacian (const gsMatrix< T > &u) const
 Evaluate the Laplacian at points u. More...
 

Static Public Member Functions

static uPtr make (const gsPreCICE< T > *interface, const index_t &meshID, const index_t &dataID, const gsMultiPatch< T > &patches, const bool parametric=false)
 Constructs a function pointer.
 

Constructor & Destructor Documentation

gsPreCICEFunction ( gsPreCICE< T > *  interface,
const index_t meshID,
const index_t dataID,
const gsMultiPatch< T > &  patches,
const bool  parametric = false 
)
inline

Constructs a new instance of the gsPreCICEFunction.

Parameters
interfaceThe precice::SolverInterface (see gsPreCICE)
[in]meshIDThe ID of the mesh on which the data is located
[in]dataIDThe ID of the data
[in]patchesThe geometry
[in]parametricSpecifies whether the data is defined on the parametric domain or not

Member Function Documentation

gsMatrix<index_t> active ( const gsMatrix< T > &  u) const
inlineinherited

Returns the indices of active (nonzero) functions at points u, as a list of indices.

See Also
active_into()
void active_into ( const gsMatrix< T > &  u,
gsMatrix< index_t > &  result 
) const
inlinevirtualinherited

Indices of active (non-zero) function(s) for each point.

The columns are sorted in increasing order, if on a point there are less active then the number of rows in the result matrix (some other point has more actives) then the rest of the column is filled with 0s.

Parameters
u
result

Reimplemented from gsFunctionSet< T >.

void compute ( const gsMatrix< T > &  in,
gsFuncData< T > &  out 
) const
virtualinherited

Computes function data.

This function evaluates the functions and their derivatives at the points in and writes them in the corresponding fields of out. Which field to write (and what to compute) is controlled by the out.flags (see also gsFuncData).

The input points in are expected to be compatible with the implementation/representation of the function, i.e. they should be points inside the domain of definitition of the function

Parameters
[in]in
[out]out

Reimplemented in gsGeometry< T >, and gsConstantFunction< T >.

void computeMap ( gsMapData< T > &  InOut) const
virtualinherited

Computes map function data.

This function evaluates the functions and their derivatives at the points InOut.points and writes them in the corresponding fields of InOut. Which field to write (and what to compute) is controlled by the InOut.flags (see also gsMapData). This is intended for parametrizations only and it works on functions sets of cardinality 1 only.

Parameters
[in,out]InOut
gsMatrix< T > deriv ( const gsMatrix< T > &  u) const
inherited

Evaluate the derivatives,.

See Also
deriv_into()
gsMatrix< T > deriv2 ( const gsMatrix< T > &  u) const
inherited

Evaluates the second derivatives of active (i.e., non-zero) basis at points u.

See documentation for deriv2_into() (the one without input parameter coefs) for details.

See Also
deriv2_into()
Parameters
[in]uEvaluation points in columns.
Returns
For every column of u, a column containing the second derivatives. See documentation for deriv2_into() (the one without input parameter coefs) for details.
gsMatrix< T > eval ( const gsMatrix< T > &  u) const
inherited

Evaluate the function,.

See Also
eval_into()
std::vector< gsMatrix< T > > evalAllDers ( const gsMatrix< T > &  u,
int  n 
) const
inherited

Evaluate all derivatives upto order n,.

See Also
evalAllDers_into
virtual gsMatrix<T> hessian ( const gsMatrix< T > &  u,
index_t  coord = 0 
) const
inlinevirtualinherited

Evaluates the Hessian (matrix of second partial derivatives) of coordinate coord at points u.

void invertPoints ( const gsMatrix< T > &  points,
gsMatrix< T > &  result,
const T  accuracy = 1e-6,
const bool  useInitialPoint = false 
) const
virtualinherited

Takes the physical points and computes the corresponding parameter values. If the point cannot be inverted (eg. is not part of the geometry) the corresponding parameter values will be undefined

gsMatrix< T > laplacian ( const gsMatrix< T > &  u) const
virtualinherited

Evaluate the Laplacian at points u.

By default uses central finite differences with h=0.00001

Reimplemented in gsFunctionExpr< T >.

int newtonRaphson ( const gsVector< T > &  value,
gsVector< T > &  arg,
bool  withSupport = true,
const T  accuracy = 1e-6,
int  max_loop = 100,
damping_factor = 1 
) const
inherited

Newton-Raphson method to find a solution of the equation f(arg) = value with starting vector arg. If the point cannot be inverted the corresponding parameter values will be undefined

void recoverPoints ( gsMatrix< T > &  xyz,
gsMatrix< T > &  uv,
index_t  k,
const T  accuracy = 1e-6 
) const
inherited

Recovers a point on the (geometry) together with its parameters uv, assuming that the k-th coordinate of the point xyz is not known (and has a random value as input argument).

index_t size ( ) const
inlinevirtualinherited

size

Warning
gsFunction and gsGeometry have size() == 1. This should not be confused with the size eg. of gsGeometry::basis(), which is the number of basis functions in the basis
Returns
the size of the function set: the total number of functions

Reimplemented from gsFunctionSet< T >.

Reimplemented in gsPiecewiseFunction< T >.