conesToolBox package
Submodules
conesToolBox.conesClasses module
- class conesToolBox.conesClasses.conesClip(name)[source]
Bases:
object
A Class for clippings
- Author:
Paolo Errante
- Version:
1.0.0
- class conesToolBox.conesClasses.conesEnKF(region)[source]
Bases:
object
A class containing all the basic elements to perform the Ensemble Kalman filter analysis phase
- anomaly(x)[source]
Calculate an anomaly matrix
- Parameters:
x (numpy ndarray) – Matrix containing the ensemble members data
- Returns:
The anomaly matrix
- Return type:
numpy ndarray
- dump_error_convergence()[source]
Dumps in file “err.log” the norm of the difference between observation and model sampling
- Returns:
None
- dump_params_convergence()[source]
Dumps in file “par.log” the updated parameter ensemble mean and standard deviation
- Returns:
None
- inflate(arr, infl)[source]
Applies stochastic inflation on a matrix
- Parameters:
arr (numpy ndarray) – the matrix to be inflated
infl (float) – inflation coefficient
- Returns:
arr
- Return type:
numpy ndarray
- inflateParams(infl)[source]
Stochastic inflation of the updated parameters matrix
- Parameters:
infl (float) – The inflation coefficient
- Returns:
None
- inflateState(infl)[source]
Stochastic inflation of the updated state matrix
- Parameters:
infl (float) – The inflation coefficient
- Returns:
None
- setParams(params)[source]
Set the EnKF parameters
- Parameters:
params (numpy ndarray) – The parameters vector
- Returns:
None
- setR()[source]
Set the observation covariance matrix from the conesRegions observations
- Returns:
R
- Return type:
numpy ndarray
- setSampling(sampling)[source]
Set the EnKF sampling H(x)
- Parameters:
sampling (numpy ndarray) – The sampling matrix
- Returns:
None
- class conesToolBox.conesClasses.conesParams[source]
Bases:
object
A Class for Parameters. It has to be developed.
- class conesToolBox.conesClasses.conesRegion[source]
Bases:
object
A class to define a Data Assimilation region
- addObs(obs)[source]
Method to include an observation to the region
- Parameters:
obs (conesStaticObservation) – The observation
- Returns:
None
- setParams(params)[source]
Set the parameters associated to the region
- Parameters:
params (numpy ndarray) – array of parameters
- Returns:
None
- class conesToolBox.conesClasses.conesSettings(casePath)[source]
Bases:
object
A class that groups settings for cones
- checkPath(path)[source]
Check if path exists
- Parameters:
path (str) – The file directory
- Returns:
Boolean
- Return type:
bool
- clipByRank()[source]
A function that separates clipping by rank :returns: list of clips :rtype: list
- get_clippings()[source]
Function that reads the clippings in polyMesh/sets/ Returns a list of clippings
- Returns:
list of clippings
- Return type:
list
- get_option(keyword, dictionary)[source]
A function to get options in an OpenFOAM dictionary :param keyword: the name of the option to get :type keyword: str :param dictionary: the name of the dictionary that contains the keyword :type dictionary: str :returns: The value set for the keyword
- get_ranks()[source]
A function that get the number of ranks in a OpenFOAM simulation
- Returns:
the number of processors of the original simulation
- Return type:
int
- mergeClips()[source]
Given a list of conesClip, finds clippings that shares cells and merge them
- Returns:
the list of conesClip after merge
- Return type:
list
- setGlobalCells()[source]
Generate a list of global cell ids splitted by ranks
- Returns:
list of global cells ids
- Return type:
list
- setGlobalStateCells()[source]
Sets a list of global cell ids belonging from which state variables are extracted
- Returns:
None
conesToolBox.conesErrors module
conesToolBox.conesFunctions module
- conesToolBox.conesFunctions.mergeClips(clipList, globalCellList)[source]
Given a list of conesClip, finds clippings that shares cells and merge them
- Parameters:
clipList (list) – the list of clippings
globalCellList (list) – the list of global cell ids
- Returns:
the list of global cells id of merged clips
- Return type:
list