diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo
index 83571dfe..8c8d0255 100644
--- a/docs/build/html/.buildinfo
+++ b/docs/build/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 08325090b65bbf2ce8b62235eb64fbdd
+config: f0c6b704ed37b7ff305e99b6bbef7c48
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/build/html/LICENSE.html b/docs/build/html/LICENSE.html
index 60efed21..83ac9758 100644
--- a/docs/build/html/LICENSE.html
+++ b/docs/build/html/LICENSE.html
@@ -1,39 +1,42 @@
-
-
+
[docs]def__len__(self):
+ """
+ This method returns the number of snapshots.
+
+ :rtype: int
+ """
+ returnlen(self._snapshots)
[docs]defadd(self,parameters,snapshots):"""
+ Add (by row) new sets of snapshots and parameters to the original
+ database.
+
+ :param array_like parameters: the parameters to add.
+ :param array_like snapshots: the snapshots to add. """
-
- iflen(parameters)isnotlen(snapshots):
+ iflen(parameters)!=len(snapshots):raiseRuntimeError('Different number of parameters and snapshots.')ifself._parametersisNoneandself._snapshotsisNone:
@@ -244,23 +260,28 @@
:param array_like points: the coordinates of the points. :param array_like values: the values in the points. """
- self.intepolator=LinearNDInterpolator(points,values)
"""
+Module for Proper Orthogonal Decomposition (POD).
+Three different methods can be employed: Truncated Singular Value Decomposition,
+Truncated Randomized Singular Value Decomposition, Truncated Singular Value
+Decomposition via correlation matrix."""importnumpyasnp
-from.reductionimportReduction
+from.reductionimportReduction
[docs]def_truncation(self,X,s):""" Return the number of modes to select according to the `rank` parameter. See POD.__init__ for further info.
+ :param numpy.ndarray X: the matrix to decompose.
+ :param numpy.ndarray s: the singular values of X.
+
:return: the number of modes :rtype: int """
@@ -239,11 +253,11 @@
:param array_like values: the values in the points. """self.interpolators=[]
- forvalueinvalues:
+ forvalueinvalues.T:argument=np.hstack([points,value.reshape(-1,1)]).Tself.interpolators.append(Rbf(*argument,smooth=self.smooth,function=self.kernel))
@@ -202,30 +221,36 @@
Source code for ezyrb.rbf
:return: the interpolated values. :rtype: numpy.ndarray """
- returnnp.array([interp(*new_point)forinterpinself.interpolators])
[docs]deftest_error(self,test,norm=np.linalg.norm):
+ """
+ Compute the mean norm of the relative error vectors of predicted
+ test snapshots.
+
+ :param database.Database test: the input test database.
+ :param function func: the function used to assign at the vector of
+ errors a float number. It has to take as input a 'numpy.ndarray'
+ and returns a float. Default value is the L2 norm.
+ :return: the mean L2 norm of the relative errors of the estimated
+ test snapshots.
+ :rtype: numpy.float64
+ """
+ predicted_test=self.predict(test.parameters)
+ returnnp.mean(norm(predicted_test-test.snapshots,axis=1)/norm(test.snapshots,axis=1))
Module for Proper Orthogonal Decomposition (POD).
+Three different methods can be employed: Truncated Singular Value Decomposition,
+Truncated Randomized Singular Value Decomposition, Truncated Singular Value
+Decomposition via correlation matrix.
Method implementing the computation of the volume of a N dimensional simplex. Source from: wikipedia.org/wiki/Simplex. :param numpy.ndarray simplex_vertices: Nx3 array containing the parameter values representing the vertices of a simplex. N is the dimensionality of the parameters. :return: N dimensional volume of the simplex. :rtype: float.
Estimate the approximation error using leave-one-out strategy. The
main idea is to create several reduced spaces by combining all the
snapshots except one. The error vector is computed as the difference
@@ -265,14 +277,14 @@
parametric points.
Return the parametric points where new high-fidelity solutions have to
be computed in ordere to globaly reduce the estimated error. These
points are the barycentric center of the region (simplex) with higher
@@ -280,9 +292,9 @@
Parameters
-
error (numpy.ndarray) – the estimated error evaluated for each
+
error (numpy.ndarray) – the estimated error evaluated for each
snapshot; if error array is not passed, it is computed using
-loo_error() with the default function. Default value is None.
+loo_error() with the default function. Default value is None.
k (int) – the number of optimal points to return. Default value is
1.
func (function) – the function used to assign at the vector of
+errors a float number. It has to take as input a ‘numpy.ndarray’
+and returns a float. Default value is the L2 norm.
+
+
+
Returns
+
the mean L2 norm of the relative errors of the estimated
+test snapshots.