TerraNeo: Refactor temperature initialization methods and update parameters for improved flexibility
Summary
This merge request includes updates and improvement to address issue #287 (closed) . The changes are aimed at enhancing functionality, fixing bugs, and improving code quality. It also ensures compatibility with older versions and includes a new test case for legacy parameter files.
Changes Made
- Temperature Initialization Parameter Refactoring:
- Added new switch parameter
initialTemperatureDeviatonMethod
for different temperature deviation methods, includingSINGLE_SPH
,RANDOM_SUPERPOSITION_SPH
, andWHITE_NOISE
. - Merged parameter
noiseFactor
tobuoyancyFactor
- Added
superpositionSPHRandomSeed
for controlling the coefficients generated inRANDOM_SUPERPOSITION_SPH
- Parameters related are regroupped in
.prm
files - Remove unused parameters, e.g.
temperatureSphericalHarmonic
- Include
version
parameter is added in the file for version control (Update 2024.12.19 - 2) -
shearHeatingScaling
is renamed tolithosphereShearHeatingScaling
(Update 2024.12.20)
- Added new switch parameter
- Temperature Initialization Code Cleanup:
- Rename some of the classes and structs to remove ambiguity and improve clarity.
- Moved
initialTemperatureSteepness
as a variable inTN.initialisationParam
, it fits better there. -
sphTool
is created atParameterIO.hpp
, we don't need to create it again and again in function that returns the temperature -
temperatureSingleSPH
andtemperatureRandomSuperpositioneSPH
are created for easier code-reading - Now
TemperatureInitializationParameters
gets a copy ofTemperatureDeivationInitialisationParameters
fromTerraNeoParameters
, so we don't need to awkwardly pass every single parameter to the temperature methods
- Bug Fixes:
- Moved the generation of
superpositionRand
atParameterIO.hpp
from function that returns the temperature at each point
- Moved the generation of
Parameter File Version 0.2 Standard (Update 2024.12.19 - 2)
This merge request establishes version 0.2 as the new standard for parameter files. TerraNeo parameter files now require a version
field, with version 0.2;
indicating compliance with the updated structure and features. Files without a version
field will default to version 0.1 to maintain backward compatibility. The introduction of versioning ensures clarity and enables seamless evolution of the parameter file format in future updates.
Additional Updates
2024.12.19 - 1
- Backward Compatibility: Adjusted code to support old parameter file versions.
- New Test Case: Added a dedicated test case to validate legacy parameter file functionality
2024.12.19 - 2
- Add versioning support to parameter files and update test configurations
- A new ParameterFileVersion struct is created for this specific purpose
- All
.prm
file withoutversion
parameter will be seen as version0.1
(previous version)
2024.12.20
-
shearHeatingScaling
is renamed tolithosphereShearHeatingScaling
as discussed in the meeting on 2024.12.20
Edited by Parry Choi