Tensors module
Module holding the model’s tendencies tensor encoding each of their additive terms.
qgs tensor module
This module computes and holds the tensors representing the tendencies of the model’s equations.
TODO: Add a list of the different tensor available
- class qgs.tensors.qgtensor.QgsTensor(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
object
qgs tendencies tensor class.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type
- load_from_file(filename, **kwargs)[source]
Function to load previously a saved tensor object with the method
save_to_file()
.
- print_jacobian_tensor(tensor_name='')[source]
Routine to print the Jacobian tensor.
- Parameters
tensor_name (str, optional) – Specify the name to print beside the values of the tensor. Default to QgsTensorJacobian.
- print_jacobian_tensor_to_file(filename, tensor_name='')[source]
Routine to print the Jacobian tensor to a file.
- print_tensor(tensor_name='')[source]
Routine to print the tensor.
- Parameters
tensor_name (str, optional) – Specify the name to print beside the values of the tensor. Default to QgsTensor.
- save_to_file(filename, **kwargs)[source]
Function to save the tensor object to a file with the
pickle
module.
- class qgs.tensors.qgtensor.QgsTensorDynamicT(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
QgsTensor
qgs dynamical temperature first order (linear) tendencies tensor class.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type
- class qgs.tensors.qgtensor.QgsTensorT4(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
QgsTensorDynamicT
qgs \(T^4\) tendencies tensor class. Implies dynamical zeroth-order temperature.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type
qgs atmospheric thermodynamic tensor module
This module computes and holds the tensors representing the atmospheric thermodynamic tendencies of the model’s equations needed to compute the vertical wind velocity \(\omega\).
TODO: Add a list of the different tensor available
- class qgs.tensors.atmo_thermo_tensor.AtmoThermoTensor(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
QgsTensor
Atmospheric thermodynamic tendencies tensor class.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type
- class qgs.tensors.atmo_thermo_tensor.AtmoThermoTensorDynamicT(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
AtmoThermoTensor
Atmospheric thermodynamic dynamical temperature first order (linear) tendencies tensor class.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type
- class qgs.tensors.atmo_thermo_tensor.AtmoThermoTensorT4(params=None, atmospheric_inner_products=None, oceanic_inner_products=None, ground_inner_products=None)[source]
Bases:
AtmoThermoTensorDynamicT
Atmospheric thermodynamic \(T^4\) tendencies tensor class. Implies dynamical zeroth-order temperature.
- Parameters
params (None or QgParams, optional) – The models parameters to configure the tensor. None to initialize an empty tensor. Default to None.
atmospheric_inner_products (None or AtmosphericInnerProducts, optional) – The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
oceanic_inner_products (None or OceanicInnerProducts, optional) – The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
ground_inner_products (None or GroundInnerProducts, optional) – The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- params
The models parameters used to configure the tensor. None for an empty tensor.
- Type
None or QgParams
- atmospheric_inner_products
The inner products of the atmospheric basis functions on which the model’s PDE atmospheric equations are projected. If None, disable the atmospheric tendencies. Default to None.
- Type
None or AtmosphericInnerProducts
- oceanic_inner_products
The inner products of the oceanic basis functions on which the model’s PDE oceanic equations are projected. If None, disable the oceanic tendencies. Default to None.
- Type
None or OceanicInnerProducts
- ground_inner_products
The inner products of the ground basis functions on which the model’s PDE ground equations are projected. If None, disable the ground tendencies. Default to None.
- Type
None or GroundInnerProducts
- tensor
The tensor \(\mathcal{T}_{i,j,k}\) \(i\)-th components.
- Type
- jacobian_tensor
The jacobian tensor \(\mathcal{T}_{i,j,k} + \mathcal{T}_{i,k,j}\) \(i\)-th components.
- Type