Mordicus.Containers.ProblemData
- class ProblemData(problemName)[source]
Bases:
objectClass containing a problemData
- problemName
name of the ProblemData object
- Type:
str
- dataFolder
name of folder containing the data of the problemData, relative to the mordicus client script
- Type:
str
- solutions
dictionary with solutionNames (str) as keys and solution (Solution) as values
- Type:
dict
- initialCondition
initial condition of the problem
- Type:
- loadings
dictionary with identifier (str) as keys and loading (LoadingBase) as values
- Type:
list
- constitutiveLaws
dictionary with identifier (str) as keys and constitutive law (ConstitutiveLawBase) as values
- Type:
dict
- parameters
dictionary with time indices as keys and a np.ndarray of size (parameterDimension,) containing the parameters
- Type:
dict
- onlineData
dictionary with solutionNames (str) as keys and data structure used in the online stage as values. In simple methods, onlineData can directly be an operatorCompressionData generated during the offline stage and need in the online stage to compute the reduced problem
- Type:
dict(str: custom_data_structure)
- AddConstitutiveLaw(constitutiveLaw)[source]
Adds a constitutive law or a list of constitutive laws to constitutiveLaws
- Parameters:
constitutiveLaw (ConstitutiveLawBase) – the constitutive law of the problem for a given set and type
- AddLoading(loading)[source]
Adds a loading or a list of loadings to loadings
- Parameters:
loading (LoadingBase) – the loading of the problem for a given set and type
- AddOnlineData(onlineData)[source]
Adds an onlineData to onlineData
- Parameters:
onlineData (OnlineDataBase) – data structure used in the online stage
- AddParameter(parameter, time=0.0)[source]
Adds a parameter at time “time”
- Parameters:
parameter (np.ndarray) – of size (parameterDimension,)
time (float) – (optional) time of the snapshot, default: 0.
- AddSolution(solution)[source]
Adds a solution to solutions
- Parameters:
solution (Solution) – the solution of the problem for a given field
- CompressSolution(solutionName, reducedOrderBasis, snapshotCorrelationOperator=None)[source]
Compress solutions of name solutionName ; does nothing if no solution of name solutionName exists
- Parameters:
solutionName (str) – name of the solutions to compress
snapshotCorrelationOperator (scipy.sparse.csr) – correlation operator between the snapshots
reducedOrderBasis (np.ndarray) – of size (numberOfModes, numberOfDOFs)
- ConvertReducedCoordinatesReducedOrderBasis(solutionName, projectedReducedOrderBasis)[source]
Converts the reducedSnapshot from the current reducedOrderBasis to a newReducedOrderBasis using a projectedReducedOrderBasis between the current one and a new one
- Parameters:
solutionName (str) – name of the solution whose reducedCoordinates is to convert
projectedReducedOrderBasis (np.ndarray) – of size (newNumberOfModes, numberOfModes)
- GetConstitutiveLaws()[source]
Returns the complete constitutiveLaws dictionary
- Returns:
constitutive laws of the problem
- Return type:
dict
- GetConstitutiveLawsOfType(type)[source]
Returns all constitutive laws of a specific type, in a list
- Returns:
list of constitutive laws of type type
- Return type:
list
- GetInitialCondition()[source]
Returns the initial condition
- Returns:
initialCondition – initial condition of the problem
- Return type:
InitialCondition
- GetLoading(solutionName, type, set)[source]
Returns a specific loading for the identifiers elements
- Return type:
loading
- GetLoadings()[source]
Returns the complete loadings dictionary
- Returns:
loadings of the problem
- Return type:
dict
- GetLoadingsForSolution(solutionName)[source]
Returns all loadings for a specific solution name, in a list
- Returns:
list of loadings of type type
- Return type:
list
- GetLoadingsOfType(type)[source]
Returns all loadings of a specific type, in a list
- Returns:
list of loadings of type type
- Return type:
list
- GetOnlineData(solutionName)[source]
Returns the onlineData of name solutionName
- Parameters:
solutionName (str) – name of the onlineData to retrieve
- Return type:
- GetParameterAtTime(time)[source]
Returns the parameter value at a specitiy time (with time interpolation if needed)
- Parameters:
time (float) – time at which the parameter is retrieved
- Returns:
parameter
- Return type:
np.ndarray
- GetParameterDimension()[source]
Assert that the parameters have the same parameterDimension and return this size
- Returns:
common parameterDimension
- Return type:
int or None
- GetParametersList()[source]
Returns the parameter values in the form of a list
- Returns:
list containing the parameters
- Return type:
list
- GetParametersTimeSequence()[source]
Returns the time indices of the parameters
- Returns:
list containing the time indices of the parameters
- Return type:
list
- GetSetsOfConstitutiveOfType(type)[source]
Returns the sets of all constitutive laws of a specific type, in a set
- Returns:
set of strings of elementSets
- Return type:
set
- GetSolution(solutionName)[source]
Returns the solution of name solutionName
- Parameters:
solutionName (str) – name of the solution to retrieve
- Return type:
- SetDataFolder(dataFolder)[source]
Sets the dataFolder parameter
- Parameters:
dataFolder (str) – name of folder containing the data of the problemData, relative to the mordicus client script
- SetInitialCondition(initialCondition)[source]
Sets the initial condition
- Parameters:
initialCondition (InitialCondition) – initial condition of the problem
- UncompressSolution(solutionName, reducedOrderBasis)[source]
Uncompress solutions of name solutionName
- Parameters:
solutionName (str) – name of the solutions to uncompress
reducedOrderBasis (np.ndarray) – of size (numberOfModes, numberOfDOFs)
- UpdateLoading(loading)[source]
Update a loading or a list of loadings to loadings
- Parameters:
loading (LoadingBase) – the loading of the problem for a given set and type