From 76e8fb57e69ad27762332841e9c4045252ee838c Mon Sep 17 00:00:00 2001 From: Leon Teichroeb <leon.teichroeb@cern.ch> Date: Wed, 3 Jul 2024 16:23:27 +0200 Subject: [PATCH] Fixed documentation links --- .../generate_model_docs/derivatives_md_template.md | 4 ++-- .../functions_md_files_template.md | 2 +- models/c/README.md | 4 ++-- tests/matlab/test_compiled_mex/README.md | 14 ++++++-------- tests/matlab/test_compiled_mex/example.m | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/generate_model_docs/derivatives_md_template.md b/docs/generate_model_docs/derivatives_md_template.md index a135d1e..f28bd01 100644 --- a/docs/generate_model_docs/derivatives_md_template.md +++ b/docs/generate_model_docs/derivatives_md_template.md @@ -16,6 +16,6 @@ Number of parameters: <<num_of_params>> Range: <<ranges |replace("'", "")>> -Source: https://gitlab.cern.ch/steam/steam-material-library/-/blob/master/Source_c/<<function_property_deriv[0]['function_name_deriv']>>.c +Source: https://gitlab.cern.ch/steam/steam-material-library/-/blob/master/models/c/derivatives/<<function_property_deriv[0]['function_name_deriv']>>.c -{% endfor %} \ No newline at end of file +{% endfor %} diff --git a/docs/generate_model_docs/functions_md_files_template.md b/docs/generate_model_docs/functions_md_files_template.md index 72f376a..f13672a 100644 --- a/docs/generate_model_docs/functions_md_files_template.md +++ b/docs/generate_model_docs/functions_md_files_template.md @@ -18,7 +18,7 @@ Number of parameters: <<num_of_params>> Range: <<ranges |replace("'", "")>> -Source: https://gitlab.cern.ch/steam/steam-material-library/-/blob/master/Source_c/<<function_property[0]['function_name']>>.c +Source: https://gitlab.cern.ch/steam/steam-material-library/-/blob/master/models/c/general/<<function_property[0]['function_name']>>.c Mex-MatLab testing plots (in case 'Error' is on the title, the corresponding Matlab function doesn't exist): diff --git a/models/c/README.md b/models/c/README.md index a165718..7e8b56b 100644 --- a/models/c/README.md +++ b/models/c/README.md @@ -3,14 +3,14 @@ For more information: https://steam-material-library.docs.cern.ch/ ## General Models -The `steam-material-library/source_c` folder includes C functions for the study of the LTS and HTS material properties. All the function curves in this folder, have been reproduced using fitting parameters generated from experimental measurements. +The `steam-material-library/models/c` folder includes C functions for the study of the LTS and HTS material properties. All the function curves in this folder, have been reproduced using fitting parameters generated from experimental measurements. Most of the functions have a range from 0 to 1400 K. The generated fittings are basically used for a range 0-300 K. Linear approximations have been applied to almost all of the functions at temperatures above 295-400 K (it differs in every function), and in many of them at temperatures close to 0. For Temperatures above 1400 or below 0, there is no approximation used. In this folder there are, also, functions that can calculate the critical temperatures TC & Tcs and the critical current densities Jc, using different methods. ## Derivatives -The analytical derivatives of material functions are contained in ```steam-material-library\models\c\general```. +The analytical derivatives of material functions are contained in `steam-material-library\models\c\derivatives`. They are used for example in the **Newton-Raphson algorithm** carried out by [CERNGetDP interface](https://gitlab.cern.ch/steam/cerngetdp). Since they are analytically calculated, these derivatives compute faster than the finite difference method that was used before. diff --git a/tests/matlab/test_compiled_mex/README.md b/tests/matlab/test_compiled_mex/README.md index baec603..3d2f4a4 100644 --- a/tests/matlab/test_compiled_mex/README.md +++ b/tests/matlab/test_compiled_mex/README.md @@ -1,18 +1,16 @@ # Mex - MatLab tests description ## Introduction -The `steam-material-library/source_c` ([here](https://gitlab.cern.ch/steam/steam-material-library/-/tree/master/Source_c)) contains the original material functions written in c. -Now, using the `generic_wrapper.cp` from `steam-material-library/mex_compilation` folder we can convert c files to -.mex. In the `steam-material-library/source_m` folder ([here](https://gitlab.cern.ch/steam/steam-material-library/-/tree/master/source_m)), one can find the corresponding material functions written and -used in MatLab. +The `steam-material-library/models/c` ([here](https://gitlab.cern.ch/steam/steam-material-library/-/tree/master/models/c)) contains the original material functions written in C. +Now, using the `generic_wrapper.cpp` from `steam-material-library/mex_compilation` folder we can convert C files to .mex. +In the `steam-material-library/models/matlab` folder ([here](https://gitlab.cern.ch/steam/steam-material-library/-/tree/master/models/matlab)), one can find the corresponding material functions written and used in MatLab. -The purpose of this procedure is to compile the c functions into mex files and compare them with the MatLab ones, -as far as speed and result accuracy is concerned. +The purpose of this procedure is to compile the c functions into mex files and compare them with the MatLab ones, as far as speed and result accuracy is concerned. ## Steps to run the tests 1) Clone the Git repository `steam-material-library` ([here](https://gitlab.cern.ch/steam/steam-material-library)) -2) Open powershell and run `.\run_tests.bat` **or** just double-click on the batch file. +2) Open powershell and run `.\tests\matlab\test_compiled_mex\run_tests.bat` **or** just double-click on the batch file. 3) Wait for the first part of the procedure to finish and then press 'enter', just as the command window indicates to continue to the next steps of the procedure. After the procedure is finished, you will be able to see 2 folders, one named `Outputs` and the other named `error.graphs`. @@ -30,4 +28,4 @@ To change the ranges of the functions' inputs, open `mat_mex_tests.xlsx` excel f the input ranges are in a row, as the original function indicates. For the functions with the same number of input parameters in MatLab and Mex, we use the same row of parameters, so we don't have to write them twice. For functions with different number instead, we should first provide the MatLab inputs and then continue with the mex/c ones. For more details on the structure of the inputs, one can search the original functions on their corresponding folders -(Those are mentioned [here](#introduction)). \ No newline at end of file +(Those are mentioned [here](#introduction)). diff --git a/tests/matlab/test_compiled_mex/example.m b/tests/matlab/test_compiled_mex/example.m index 6930c00..d57dbae 100644 --- a/tests/matlab/test_compiled_mex/example.m +++ b/tests/matlab/test_compiled_mex/example.m @@ -93,7 +93,7 @@ % clear % clc parentDirectory = fileparts(pwd); -addpath( genpath( fullfile(parentDirectory, '..\compile_STEAM_MatPro\compiled_STEAM_MatPro\') )) +addpath( genpath( fullfile(parentDirectory, '..\..\..\bindings\matlab\compiled_STEAM_MatPro\') )) functionSet='mex'; % functionSet='m'; in case we want to use the original MatLab functions STEAM_ML = STEAM_MatPro('mex'); -- GitLab