public class FemFieldApproximation
extends java.lang.Object
Constructor and Description |
---|
FemFieldApproximation(FemElementSampler sampler) |
Modifier and Type | Method and Description |
---|---|
void |
computeIntegralIPointValues(FemElement3d elem,
Function3x1 func,
VectorNd out)
Computes best-fitting coefficients {w_i} to minimize the error between shape-function integrals:
E = ||int_x f(x)\phi_i(x)dx - \hat{g}||^2, where
\hat{g} = \sum_j w_i p_i(x_j)*\phi_j(x_j)|dx/dX|(x) is the discretized integral of
f(x)\phi_j(x) using the element's quadrature rules.
|
void |
computeIntegralNodeValues(FemElement3d elem,
Function3x1 func,
VectorNd out)
Computes best-fitting coefficients {w_i} to minimize the error between shape-function integrals:
E = ||int_x f(x)\phi_i(x)dx - int_x \hat{f}(x)\phi_i(x)dx||^2, where
\hat{f}(x) = \sum_j w_i \phi_j(x) interpolates the target function according to the FEM
shape functions.
|
void |
computeLeastSquaresNodeValues(FemElement3d elem,
Function3x1 func,
VectorNd out)
Computes best-fitting coefficients {w_i} to minimize the least squared error
\sum_i ||f(x_i) - \hat{f}(x_i)||^2, where \hat{f}(x) = \sum_j w_i \phi_j(x) interpolates
the target function according to the FEM shape functions
|
MatrixNd |
computeMassMatrix(FemElement3d elem) |
void |
setIntegrationLimits(int minSamples,
int maxSamples,
double maxVariance) |
void |
setNumLSQSamples(int n)
Number of samples to use when approximating function with least-squares
|
void |
setSampler(FemElementSampler sampler) |
public FemFieldApproximation(FemElementSampler sampler)
public void setNumLSQSamples(int n)
n
- samplespublic void setSampler(FemElementSampler sampler)
public void setIntegrationLimits(int minSamples, int maxSamples, double maxVariance)
public void computeLeastSquaresNodeValues(FemElement3d elem, Function3x1 func, VectorNd out)
elem
- element to fitfunc
- function to fitout
- node valuespublic MatrixNd computeMassMatrix(FemElement3d elem)
public void computeIntegralNodeValues(FemElement3d elem, Function3x1 func, VectorNd out)
elem
- element to evaluatefunc
- function to fitout
- node valuespublic void computeIntegralIPointValues(FemElement3d elem, Function3x1 func, VectorNd out)
elem
- element to considerfunc
- function to approximateout
- ipnt values