LifeV
|
BCDataInterpolator - Class for interpolating boundary functions from scattered data. More...
#include <BCDataInterpolator.hpp>
Data Structures | |
struct | BCDataInterpolator_point |
Private Attributes | |
matrix_Type | M_interpolationMatrix |
vector_Type | M_rhs_x |
vector_Type | M_rhs_y |
vector_Type | M_rhs_z |
vector_Type | M_coeffs_x |
vector_Type | M_coeffs_y |
vector_Type | M_coeffs_z |
solver_Type | M_denseSolver |
BCInterpolationMethod | M_interpolationMethod |
boost::shared_array< BCDataInterpolator_point > | M_dataSites |
boost::shared_array< BCDataInterpolator_point > | M_dataValues |
boost::shared_array< BCDataInterpolator_point > | M_dataValues_timeSamples |
UInt | M_nofControlPoints |
Int | M_filteringLevel |
Real | M_lastInterpolatedAtTime |
Real | M_timePeriod |
Real | M_timeInterval |
bool | M_flagInterpolated |
bool | M_verbose |
Public Types | |
enum | BCInterpolationMethod { RBF_InverseMultiQuadric, RBF_Gaussian, RBF_ThinPlateSpline, RBF_MultiQuadric, RBF_Cubic } |
typedef Epetra_SerialDenseSolver | solver_Type |
typedef Epetra_SerialDenseMatrix | matrix_Type |
typedef Epetra_SerialDenseVector | vector_Type |
typedef std::shared_ptr< matrix_Type > | matrixPtr_Type |
typedef std::shared_ptr< vector_Type > | vectorPtr_Type |
Constructor & Destructor | |
BCDataInterpolator () | |
Constructors for an data interpolator. More... | |
virtual | ~BCDataInterpolator () |
Destructor. More... | |
Methods | |||
| |||
Real | interpolatedDataFunction (const Real &t, const Real &x, const Real &y, const Real &z, const ID &component) | ||
Evaluate the interpolated function. More... | |||
void | showMe (bool verbose=false, std::ostream &out=std::cout) const | ||
Display the content of the variables. More... | |||
void | readData (const std::string &fileName) | ||
Read control points and data from a file. More... | |||
void | exportInterpolationMatrix () const | ||
Export the interpolation matrix for debugging purposes. More... | |||
Set Methods | |
void | setInterpolationMethod (const BCInterpolationMethod &bcInterpolationMethod) |
Set the interpolation method. More... | |
void | setFilteringLevel (const Int &filteringLevel) |
Set the filtering level. More... | |
Get Methods | |
const UInt & | nofControlPoints () const |
Returns the number of control points. More... | |
Private Methods | |
void | formRBFMatrix () |
void | solveInterpolationSystem () |
BCDataInterpolator_point | interpolateVectorialFunction (const Real &t, const Real &x, const Real &y, const Real &z) |
Real | evaluateRBF (const BCDataInterpolator_point point1, const BCDataInterpolator_point point2) |
bool | needSideConstraints () const |
void | formRBFvectors () |
void | interpolateDataValuesInTime (const Real t) |
Int | indexInTime (const Int dataSite, const Int timeInstant) const |
Additional Inherited Members | |
Public Types inherited from BCFunctionBase | |
typedef std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &) > | function_Type |
typedef std::shared_ptr< BCFunctionBase > | BCFunctionBasePtr_Type |
Public Member Functions inherited from BCFunctionBase | |
BCFunctionBase () | |
Empty Constructor. More... | |
BCFunctionBase (function_Type userDefinedFunction) | |
Constructor for a user defined function. More... | |
BCFunctionBase (const BCFunctionBase &bcFunctionBase) | |
Copy Constructor. More... | |
virtual | ~BCFunctionBase () |
Destructor. More... | |
virtual BCFunctionBase & | operator= (const BCFunctionBase &bcFunctionBase) |
Assignment Operator. More... | |
Real | operator() (const Real &t, const Real &x, const Real &y, const Real &z, const ID &component) const |
Overloading function operator by calling M_userDefinedFunction. More... | |
void | setFunction (function_Type userDefinedFunction) |
Set the user defined function. More... | |
const function_Type & | Function () const |
Get the function. More... | |
virtual BCFunctionBasePtr_Type | clone () const |
Clone the current object. More... | |
Protected Attributes inherited from BCFunctionBase | |
function_Type | M_userDefinedFunction |
user defined function More... | |
BCDataInterpolator - Class for interpolating boundary functions from scattered data.
Implements Radial Basis Function (RBF) interpolation of pointwise scalar or vectorial functions defined on a set of scattered interpolation points. Currently implements a variety of different basis functions for interpolation. Temporal interpolation done with trigonometric polynomials.
Inherits BCFunctionBase
to facilitate use of interpolated data as boundary condition.
If the interpolated data depends on time, the user must pass the data values at 2n specific time instances, uniformly sampled at interval M_timeInterval and with period M_timePeriod. The values of the data between these time instances is interpolated using Fourier interpolation, i.e. the interpolant is a trigonometric polynomial of order 2n and periodic with period M_timePeriod.
The format of the data file passed to readData() is the following:
nof_data_sites nof_data_dimensions t_interval t_period filtering_level
data_site_1_x_coord data_site_1_y_coord data_site_1_z_coord
...
data_site_n_x_coord data_site_n_y_coord data_site_n_z_coord
data_value_1_x_coord data_value_1_y_coord data_value_1_z_coord
...
data_value_n_x_coord data_value_n_y_coord data_value_n_z_coord
data_value_1_x_coord data_value_1_y_coord data_value_1_z_coord
...
data_value_n_x_coord data_value_n_y_coord data_value_n_z_coord
The variable nof_data_dimensions has to equal 1 or 3, depending on whether scalar or vectorial data is being interpolated. The variable nof_data_sites has to equal the number of rows passed in both the section involving the data_sites and the data values. The data value section has to be repeated t_period / t_interval times. The value filtering_level >= 0 is used to drop the most oscillatory terms in the trigonometric polynomial, and should be an integer.
Warning: in the current implementation the data sites are assumed fixed in time and they do not move with the mesh. Thus they should only be used in a Lagrangian frame of reference, i.e. with structural BC's.
Definition at line 100 of file BCDataInterpolator.hpp.
typedef Epetra_SerialDenseSolver solver_Type |
Definition at line 108 of file BCDataInterpolator.hpp.
typedef Epetra_SerialDenseMatrix matrix_Type |
Definition at line 109 of file BCDataInterpolator.hpp.
typedef Epetra_SerialDenseVector vector_Type |
Definition at line 110 of file BCDataInterpolator.hpp.
typedef std::shared_ptr<matrix_Type> matrixPtr_Type |
Definition at line 111 of file BCDataInterpolator.hpp.
typedef std::shared_ptr<vector_Type> vectorPtr_Type |
Definition at line 112 of file BCDataInterpolator.hpp.
Enumerator | |
---|---|
RBF_InverseMultiQuadric | Inverse multiquadrics |
RBF_Gaussian | Gaussians |
RBF_ThinPlateSpline | Thin plate splines |
RBF_MultiQuadric | Multiquadrics |
RBF_Cubic | Cubics |
Definition at line 122 of file BCDataInterpolator.hpp.
|
explicit |
Constructors for an data interpolator.
Definition at line 56 of file BCDataInterpolator.cpp.
|
virtual |
Destructor.
Definition at line 79 of file BCDataInterpolator.cpp.
Real interpolatedDataFunction | ( | const Real & | t, |
const Real & | x, | ||
const Real & | y, | ||
const Real & | z, | ||
const ID & | component | ||
) |
Evaluate the interpolated function.
t | Time |
x | Coordinate |
y | Coordinate |
z | Coordinate |
component | The component of the vector function |
Definition at line 99 of file BCDataInterpolator.cpp.
void showMe | ( | bool | verbose = false , |
std::ostream & | out = std::cout |
||
) | const |
Display the content of the variables.
verbose | The verbosity (default: false) |
out | The ostream output (default: std::cout) |
Definition at line 124 of file BCDataInterpolator.cpp.
void readData | ( | const std::string & | fileName | ) |
Read control points and data from a file.
filename | The filename for the data sites and data values |
Definition at line 153 of file BCDataInterpolator.cpp.
void exportInterpolationMatrix | ( | ) | const |
Export the interpolation matrix for debugging purposes.
Definition at line 227 of file BCDataInterpolator.cpp.
|
inline |
Set the interpolation method.
bcInterpolationMethod | The interpolation method |
Definition at line 210 of file BCDataInterpolator.hpp.
|
inline |
Set the filtering level.
filteringLevel | The filtering level |
Definition at line 219 of file BCDataInterpolator.hpp.
|
inline |
Returns the number of control points.
Definition at line 232 of file BCDataInterpolator.hpp.
|
private |
|
private |
|
private |
|
private |
Definition at line 381 of file BCDataInterpolator.cpp.
|
private |
|
private |
|
private |
|
private |
Definition at line 270 of file BCDataInterpolator.hpp.
|
private |
Definition at line 272 of file BCDataInterpolator.hpp.
|
private |
Definition at line 272 of file BCDataInterpolator.hpp.
|
private |
Definition at line 272 of file BCDataInterpolator.hpp.
|
private |
Definition at line 273 of file BCDataInterpolator.hpp.
|
private |
Definition at line 273 of file BCDataInterpolator.hpp.
|
private |
Definition at line 273 of file BCDataInterpolator.hpp.
|
private |
Definition at line 275 of file BCDataInterpolator.hpp.
|
private |
Definition at line 277 of file BCDataInterpolator.hpp.
|
private |
Definition at line 279 of file BCDataInterpolator.hpp.
|
private |
Definition at line 280 of file BCDataInterpolator.hpp.
|
private |
Definition at line 281 of file BCDataInterpolator.hpp.
|
private |
Definition at line 283 of file BCDataInterpolator.hpp.
|
private |
Definition at line 285 of file BCDataInterpolator.hpp.
|
private |
Definition at line 287 of file BCDataInterpolator.hpp.
|
private |
Definition at line 288 of file BCDataInterpolator.hpp.
|
private |
Definition at line 289 of file BCDataInterpolator.hpp.
|
private |
Definition at line 291 of file BCDataInterpolator.hpp.
|
private |
Definition at line 292 of file BCDataInterpolator.hpp.