Skip to main content
zenodoopen

Data of "Self-consistency Reinforced minimal Gated Recurrent Unit for surrogate modeling of history-dependent non-linear problems: application to history-dependent homogenized response of heterogeneous materials"

<h1>Development of the Self-Consistency reinforced Minimum Recurrent Unit (SC-MRU)</h1> <p>This directory contains the data and algorithms generated in publication<sup><a href="#fn-1-5292">1</a></sup></p> <h2>Table of Contents</h2> <ol> <li><a href="#dependencies-and-prerequisites">Dependencies and Prerequisites</a></li> <li><a href="#structure-of-repository">Structure of Repository</a></li> <li><a href="#part-1-data-preparation">Part 1: Data preparation</a></li> <li><a href="#part-2-rnn-training">Part 2: RNN training</a></li> <li><a href="#part-3-multiscale-analysis">Part 3: Multiscale analysis</a></li> <li><a href="#part-4-reproduce-paper1-figures">Part 4: Reproduce paper[^1] figures</a></li> </ol> <h2>Dependencies and Prerequisites</h2> <p>&nbsp;</p> <ul> <li> <p>Python, pandas, matplotlib, texttabble and latextable are pre requisites for visualizing and navigating the data.</p> </li> <li> <p>For generating mesh and for vizualization, gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>) is required.</p> </li> <li> <p>For running simulations, cm3Libraries (<a href="http://www.ltas-cm3.ulg.ac.be/openSource.htm" target="_blank" rel="nofollow noreferrer noopener">http://www.ltas-cm3.ulg.ac.be/openSource.htm</a>) is required.</p> </li> </ul> <h3>Instructions using apt &amp; pip3 package manager</h3> <p>Instructions for Debian/Ubuntu based workstations are as follows.</p> <h3>python, pandas and dependencies</h3> <div> <pre><code> sudo apt install python3 python3-scipy libpython3-dev python3-numpy python3-pandas</code></pre> </div> <h3>matplotlib, texttabble and latextable</h3> <div> <pre><code> pip3 install matplotlib texttable latextable</code></pre> </div> <h3>Pytorch (only for run with cm3Libraries)</h3> <ul> <li>Without GPU</li> </ul> <div> <pre><code> pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu</code></pre> </div> <ul> <li>With GPU</li> </ul> <div> <pre><code> pip3 install torch torchvision torchaudio</code></pre> </div> <h3>Libtorch (for compiling the cells)</h3> <ul> <li>Without GPU: In a local directory (e.g. <code>~/local</code> with <code>export TORCHDIR=$HOME/local/libtorch</code>)</li> </ul> <div> <pre><code> wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.1.1%2Bcpu.zip unzip libtorch-shared-with-deps-2.1.1%2Bcpu.zip</code></pre> </div> <ul> <li>With GPU: In a local directory (e.g. <code>~/local</code> with <code>export TORCHDIR=$HOME/local/libtorch</code>)</li> </ul> <div> <pre><code> wget https://download.pytorch.org/libtorch/cu121/libtorch-shared-with-deps-2.1.1%2Bcu121.zip unzip libtorch-shared-with-deps-2.1.1+cu121.zip</code></pre> </div> <h2>Structure of Repository</h2> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/All_Path_Res">All_Path_Res</a>: results of the direct numerical simulations used as training and testing data, see details in <a href="#part-1-data-preparation">Part 1: Data preparation</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/ConstRVE">ConstRVE</a>: script to run direct numerical finite element simulations, see details in <a href="#part-1-data-preparation">Part 1: Data preparation</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale">MultiScale</a>: scripts to run and visualise the multiscale analyses, see details in <a href="#part-3-multiscale-analysis">Part 3: Multiscale analysis</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU</a>: implementation of the RNN and scripts to train them, see details in <a href="#part-2-rnn-training">Part 2: RNN training</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingData">TrainingData</a>: scripts to collect, normalise and truncate the RVEs direct simulation results as training and testing data, see details in <a href="#part-1-data-preparation">Part 1: Data preparation</a>. The director also contained the storred processed data used in <sup><a href="#fn-1">1</a></sup>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingPaths">TrainingPaths</a>: scripts to generate the different loading paths for the direct numerical simulations used as training and testing data, see details in <a href="#part-1-data-preparation">Part 1: Data preparation</a>.</li> </ul> <h2>Part 1: Data preparation</h2> <h3>Generate the loading paths</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingPaths/testGenerationData.py">TrainingPaths/testGenerationData.py</a> is used to generate random walk paths, with the options <ul> <li><code>Rmax = 0.11</code> # bound on the final Green Lagrange strain</li> <li><code>TimeStep = 1.</code> # in second</li> <li><code>EvalStep = [1e-4,5e-3]</code> #Bounds on the Green Lagrange increments</li> <li><code>Nmax = 2500</code> #maximum length of the sequence</li> <li><code>k = 4000</code> # number of path to generate</li> <li>The path are storred by default in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Paths">ConstRVE/Paths/</a>. The path has to be existing before launching the script. You can change the name in line 123 <code>saveDir = '../ConstRVE'+'/Paths/'</code>.</li> <li>Examples of generated paths can be found in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/ConstRVE/PathsExamples">ConstRVE/PathsExamples/</a></li> <li>The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingPaths">TrainingPaths</a> is</li> </ul> </li> </ul> <div> <pre><code>(mkdir ../ConstRVE/Paths) #if needed python3 testGenerationData.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingPaths/generationData_Cyclic.py">TrainingPaths/generationData_Cyclic.py</a> is used to generate random cylic paths, with the options <ul> <li><code>Rmax = [np.random.uniform(0.,0.04),np.random.uniform(0.,0.06),np.random.uniform(0.0,0.09),0.12]</code> # bound on the final Green Lagrange strain is random</li> <li><code>TimeStep = 1.</code> # in second</li> <li><code>EvalStep = [1e-4,5e-3]</code> #Bounds on the Green Lagrange increments</li> <li><code>Nmax = 2500</code> #maximum length of the sequence</li> <li><code>k = 2000</code> # number of path to generate</li> <li>The path are stored by default in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Paths">ConstRVE/Paths/</a>. You can change the name in line 123 <code>saveDir = '../ConstRVE'+'/Paths/'</code>.</li> <li>The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingPaths">TrainingPaths</a> is</li> </ul> </li> </ul> <div> <pre><code>(mkdir ../ConstRVE/Paths) #if needed python3 generationData_Cyclic.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingPaths/countPathLength.py">TrainingPaths/countPathLength.py</a> gives average, minimum and maximum lengths of the generated paths and the distribution of the <code>\Delta R</code>. By default the paths are read in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Paths">ConstRVE/Paths/</a> but the directory can be given as an argument. The file can be used to read <ul> <li>either the generated loading paths</li> </ul> </li> </ul> <div> <pre><code> python3 countPathLength.py '../ConstRVE/PathsExamples'</code></pre> </div> <ul> <li> <ul> <li>or the results of the <a href="#generate-the-rves-direct-simulation-results">simulations</a></li> </ul> </li> </ul> <div> <pre><code> python3 countPathLength.py '../All_Path_Res/Path_Res9'</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingPaths/graphData.py">TrainingPaths/graphData.py</a> generates illustrations from randomly picked paths in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Paths">ConstRVE/Paths/</a> and generate png figures.</li> </ul> <h3>Generate the RVEs direct simulation results</h3> <ul> <li>Uses the loading paths existing in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Paths">ConstRVE/Paths/</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/rve.geo">ConstRVE/rve.geo</a> is the RVE geometry file that can be read by gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>).</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/rve.msh">ConstRVE/rve.msh</a> is the RVE mesh file that can be read by gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>).</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/utilsFunc.py">ConstRVE/utilsFunc.py</a> contains python tools to be used.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/ConstRVE/Rve_withoutInternalVars.py">ConstRVE/Rve_withoutInternalVars.py</a> is used to run all the RVE simulations: <ul> <li>This requires cm3Libraries (<a href="http://www.ltas-cm3.ulg.ac.be/openSource.htm" target="_blank" rel="nofollow noreferrer noopener">http://www.ltas-cm3.ulg.ac.be/openSource.htm</a>).</li> <li>All the ouptus are stored in <code>All_Path_Res/Path_Res12</code>, you can change the name in line 71 <code>Path_Res = '../All_Path_Res/Path_Res12/'</code>. The results of RVE simulations are saved as the sequence (one configuration per line) of the Green-Lagrange strains and Second Piola-Kirchhoff stress (in column). One example can be found in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/All_Path_Res/Path_Res1/data_path1000.csv">All_Path_Res/Path_Res1/data_path1000.csv</a>.</li> <li>The command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/ConstRVE">ConstRVE</a> directory is</li> </ul> </li> </ul> <div> <pre><code> python3 Rve_withoutInternalVars.py</code></pre> </div> <h3>Collect, normalised and truncate the RVEs direct simulation results as training and testing data</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/CheckNanData.py">TrainingData/CheckNanData.py</a> is used to check the integrity of the direct numerical simulations results <ul> <li>DNS results are read from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/All_Path_Res/Path_res1">All_Path_Res/Path_res1</a> to <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/All_Path_Res/Path_res11">All_Path_Res/Path_res11</a> subdirectories.</li> <li>The command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingData">TrainingData</a> directory is</li> </ul> </li> </ul> <div> <pre><code> python3 CheckNanData.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/CollectData.py">TrainingData/CollectData.py</a> is used to gather all the direct numerical simulations results <ul> <li>DNS results are read from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/All_Path_Res/Path_res1">All_Path_Res/Path_res1</a> to <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/All_Path_Res/Path_res11">All_Path_Res/Path_res11</a> subdirectories. It can be changed in line 31 <code>for ll in range(11):</code>.</li> <li>It saves the bounds and raw data in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Bounds_GS">TrainingData/Processed_Data/Bounds_GS</a> and <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Origin_GS">TrainingData/Processed_Data/Origin_GS</a>, respectively.</li> <li>The command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingData">TrainingData</a> directory is</li> </ul> </li> </ul> <div> <pre><code> python3 CollectData.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Normalization.py">TrainingData/Normalization.py</a> is used to normalise the gathered direct numerical simulations results <ul> <li>Bounds and raw data are read from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Bounds_GS">TrainingData/Processed_Data/Bounds_GS</a> and <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Origin_GS">TrainingData/Processed_Data/Origin_GS</a>, respectively.</li> <li>It saves the normalized training (75%) and testing (25%) data in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Normalized_GS_Train">TrainingData/Processed_Data/Normalized_GS_Train</a> and <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Normalized_GS_Test">TrainingData/Processed_Data/Normalized_GS_Test</a>, respectively.</li> <li>The command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingData">TrainingData</a> directory is</li> </ul> </li> </ul> <div> <pre><code> python3 Normalization.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/GaussCollectData.py">TrainingData/GaussCollectData.py</a> is an alternative using Gaussian normaliation and is used to gather all the direct numerical simulations results.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/GaussNormalization.py">TrainingData/GaussNormalization.py</a> is an alternative to normalise following a Gaussian the gathered direct numerical simulations results.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Data_Padding.py">TrainingData/Data_Padding.py</a> is used to pad and trim the normalised data <ul> <li>Normalized training (75%) and testing (25%) data in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Normalized_GS_Train">TrainingData/Processed_Data/Normalized_GS_Train</a> and <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data/Normalized_GS_Test">TrainingData/Processed_Data/Normalized_GS_Test</a>, respectively.</li> <li>The final length of the sequence (including zero padding and trimming) is given by <code>N = 200</code>.</li> <li>It saves the trimmed and padded normalised training and testing data in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data">TrainingData/Processed_Data/</a> as <code>'GS_Train'N</code> and <code>'GS_Test'N</code>, respectively.</li> <li>The command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingData">TrainingData</a> directory is</li> </ul> </li> </ul> <div> <pre><code> python3 Data_Padding.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Tool.py">TrainingData/Tool.py</a> is a list of function used to normalise dat.</li> </ul> <h2>Part 2: RNN training</h2> <h3>Available rnn</h3> <ul> <li>The different cells are in the following directories <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_SMRU">SC_MRU/MGRU/NNW_SMRU</a>: Neural network with SMRU recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_SCMRU_T">SC_MRU/MGRU/NNW_SCMRU_T</a>: Neural network with SC-MRU-T recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_MGRU">SC_MRU/MGRU/NNW_MGRU</a>: Neural network with orginal MGRU recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_MGRU_M">SC_MRU/MGRU/NNW_MGRU_M</a>: Neural network with modified MGRU recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/FNN_LeakyReLU">SC_MRU/FNN_LeakyReLU/NNW_<code>X</code>Fw</a>: Neural network with SC-MRU-I recurrent cell using <code>X</code> Feed Forward non-linear transition layers.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/Quadratic_NLT">SC_MRU/Quandratic_NLT/NNW_<code>X</code>Q, NNW_Q_Fw, NNW_Fw_Q</a>: Neural network with SC-MRU-I recurrent cell using <code>X</code> quadratic or mixed feed-forward-quadratic non-linear transition layers.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/ReferenceRNN">SC_MRU/ReferenceRNN/NNW_<code>X</code>Layers</a>: Neural network with SC-LMSC recurrent cell using <code>X</code> non-linear transition layers.</li> </ul> </li> </ul> <h3>Compile the neural network models</h3> <ul> <li>In the adequate directory, e.g. <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_SMRU">SC_MRU/MGRU/NNW_SMRU</a> for the Neural network with SMRU recurrent cell.</li> </ul> <div> <pre><code> cd build rm -rf * cmake -DCMAKE_PREFIX_PATH=$TORCHDIR .. make</code></pre> </div> <ul> <li>This create the RNN_<code>CELL</code> model in the build directory</li> </ul> <h3>Train the neural network models</h3> <ul> <li>In the adequate directory, e.g. <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/MGRU/NNW_SMRU">SC_MRU/MGRU/NNW_SMRU</a> for the Neural network with SMRU recurrent cell.</li> <li>Requires to have <a href="#compile-the-neural-network-models">compiled</a> the RNN model.</li> <li>The file <code>Train.py</code> <ul> <li>Uses the RNN_<code>CELL</code> model compiled in the <code>build</code> directory.</li> <li>Uses the trimmed and padded normalised training and testing data in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/TrainingData/Processed_Data">TrainingData/Processed_Data/</a> as <code>'GS_Train'N</code> and <code>'GS_Test'N</code>, respectively.</li> <li>Can be modified to use the requested ratios of training and testing sequences of different lengths to prepate the mini-baches, e.g.: <ul> <li><code>ratio = [0.2,0.02,0.6,0.06,0.01,0.9]</code></li> <li><code>PathIn1 = ['../../../TrainingData/Processed_data/GS_Train200','../../../TrainingData/Processed_data/GS_Train2500','../../../TrainingData/Processed_data/GS_Test200','../../../TrainingData/Processed_data/GS_Test2500']</code></li> <li><code>PathIn2 = ['../../../TrainingData/Processed_data/GS_Test200','../../../TrainingData/Processed_data/GS_Test400','../../../TrainingData/Processed_data/GS_Test2500','../../../TrainingData/Processed_data/GS_Test400']</code></li> </ul> </li> <li>Saves the mini-batches in <ul> <li><code>PathOut = "TrainingData.pt"</code></li> </ul> </li> <li>Saves the model <code>module-checkpoint.pt</code> and <code>module-checkpoint-optimizer.pt</code>, and loss evolution <code>Loss.txt</code> in <ul> <li>Module/H<code>n</code> with <code>n</code> the number of hiden variables.</li> <li>Output directory can be changes in NNW_<code>CELL</code>.cpp of the cell name <code>CELL</code> (and recompiling).</li> <li>Warm start can be disabled in by commenting <code>torch::load(net, "./Module/H120/module-checkpoint_CM0.pt");</code> and <code>torch::load(optimizer, "./Module/H120/module-optimizer-checkpoint_CM0.pt");</code> in NNW_<code>CELL</code>.cpp of the cell name <code>CELL</code> (and recompiling).</li> <li>Is executed with</li> </ul> </li> </ul> </li> </ul> <div> <pre><code> python3 Train.py</code></pre> </div> <h3>Convert trained c++ models for pyTorch (in view of multiscale simulations)</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/Save_RU.py">SC_MRU/CheckLoss/RU.py</a>: functions used to read and use the rnn models.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/Save_RNN_script.py">SC_MRU/CheckLoss/Save_RNN_script.py</a>: <ul> <li>Converts c++ trained models to pyTorch models</li> <li>Reads the trained models in SC_MRU/CELL_<code>Kind</code>/NNW_<code>CELL</code>/Module/H<code>N</code>/module.pt</li> <li>Save the converted models to <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> and to <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/Model">MultiScale/Model/</a></li> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells <code>cell=["SC_MRU_T","SC_MRU_I","SMRU"]</code>.</li> <li>The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is</li> </ul> </li> </ul> <div> <pre><code>python3 Save_RNN_script.py</code></pre> </div> <h3>Vizualize loss evolution and testing results</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/Data_prepare.py">SC_MRU/CheckLoss/Data_prepare.py</a> contains fucntion used for testing.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/LossVS_insertN.py">SC_MRU/CheckLoss/LossVS_insertN.py</a> tests the effect of testing data augmentation: <ul> <li>Requires to have <a href="#compile-the-neural-network-models">compiled</a> the RNN models.</li> <li>Cell type and augmentation kind can be modified: <ul> <li><code>repeat = 10</code> #number of tests</li> <li><code>dataType ='random'</code> #'even' or 'random'</li> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells ```cell=["SC_MRU_T","SC_MRU_I","SMRU"]``</li> <li><code>reevaluate= False</code> # <code>False</code> to use the saved loss values and <code>True</code> to evaluate the loss values</li> <li><code>fastshifting=False</code> # <code>False</code> to vizualize before fast shifting (Fig. 11) and <code>True</code> after (Fig. 12). When <code>reevaluate== True</code>, this has no effect: the training with fast-shifting or not has to be done manually, see <a href="#train-the-neural-network-models">details</a>.</li> </ul> </li> <li>Generates new Loss_<code>CELL</code>.txt and TrainingData.pt files in case <code>reevaluate== True</code>, read the existing one if <code>reevaluate== False</code>.</li> <li>Generates Figs. 11 and 12 from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a></li> </ul> </li> </ul> <div> <pre><code> python3 LossVS_insertN.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/Plot_GS.py">SC_MRU/CheckLoss/Plot_GS.py</a> test the different NNW on RVE testing paths: <ul> <li>Requires to have <a href="#compile-the-neural-network-models">compiled</a> the RNN models.</li> <li>Cell type and augmentation kind can be modified: <ul> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells ```cell=["SC_MRU_T","SC_MRU_I","SMRU"]``</li> </ul> </li> <li>Generate Figs. 13, 14 and 15 from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a></li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 Plot_GS.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/CheckLoss/Plot_GS_step.py">SC_MRU/CheckLoss/Plot_GS_step.py</a> tests the different pyTorch NNWs on the RVE testing paths: <ul> <li>Requires to have <a href="#convert-trained-c-models-for-pytorch-in-view-of-multiscale-simulations">converted</a> the RNN models.</li> <li>Cell type and augmentation kind can be modified: <ul> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells ```cell=["SC_MRU_T","SC_MRU_I","SMRU"]``</li> </ul> </li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 Plot_GS_step.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_HiddenV.py">SC_MRU/PlotLoss_HiddenV.py</a> shows the loss evolution for the different number of hidden variables --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- for the SMRU cell: <ul> <li>Generates Fig. 8.</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_HiddenV.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_3MRU.py">SC_MRU/PlotLoss_3MRU.py</a> shows the loss evolution for the different recurrent units --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- for the 120 hidden variables: <ul> <li>Generates Fig. 9.</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_3MRU.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_RefNL_H120.py">SC_MRU/PlotLoss_RefNL_H120.py</a> shows the loss evolution for the different SC-LMSC and SC-MRU-I cells --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- for 120 hidden variables: <ul> <li>Generates Fig. 10.</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_RefNL_H120.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_MGRU.py">SC_MRU/PlotLoss_MGRU.py</a> shows the loss evolution for the original and modified MGRU --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- and for the 120 hidden variables: <ul> <li>Generates Fig. A.18.</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_MGRU.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_NL.py">SC_MRU/PlotLoss_NL.py</a> shows the loss evolution for the different non-liner transition layers (quadratic and Leaky ReLU) of the SC-MRU-I cell --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- and for the 120 hidden variables: <ul> <li>Generates Fig. B.19.</li> <li><code>Case=1</code> # 0 for quadratic transition blocks and 1 for Leaky ReLU transition blocks</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_NL.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/SC_MRU/PlotLoss_DiffNL_H120.py">SC_MRU/PlotLoss_DiffNL_H120.py</a> shows the loss evolution for the different non-liner transition layers (hybrid) of the SC-MRU-I cell --<a href="#train-the-neural-network-models">after having trained</a> or using saved loss files-- and for the 120 hidden variables: <ul> <li>Generates Fig. B.20.</li> <li>Command to be run from <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> </li> </ul> <div> <pre><code> python3 PlotLoss_DiffNL_H120.py</code></pre> </div> <h2>Part 3: Multiscale analysis</h2> <h3>Trained surrogate models</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/Model">MultiScale/Model</a>: contains the different rnn <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/Model/Bounds_GS">MultiScale/Model/Bounds_GS</a>: Bounds.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/Model/DInpFullModel.pt">MultiScale/Model/DInpFullModel.pt</a>: trained rnn with <code>SC-MRU-T</code> recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/Model/IncrementModel.pt">MultiScale/Model/IncrementModel.pt</a>: trained rnn with <code>SC-MRU-I</code> recurrent cell.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/Model/FullModel.pt">MultiScale/Model/FullModel.pt</a>: trained rnn with <code>SMRU</code> recurrent cell.</li> </ul> </li> </ul> <h3>Run mutiscale simulations using the surrogates</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/2D_MultiScale/model.geo">MultiScale/2D_MultiScale/model.geo</a>: geometry of the macro-scale model that can be read by gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>).</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/2D_MultiScale/model.msh">MultiScale/2D_MultiScale/model.msh</a>: mesh of the macro-scale model that can be read by gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>).</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/2D_MultiScale/model.py">MultiScale/2D_MultiScale/model.py</a>: is used to run all the multiscale simulation: <ul> <li>This requires cm3Libraries (<a href="http://www.ltas-cm3.ulg.ac.be/openSource.htm" target="_blank" rel="nofollow noreferrer noopener">http://www.ltas-cm3.ulg.ac.be/openSource.htm</a>).</li> <li>Uses the bounds and trained models in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/Model">MultiScale/Model</a>.</li> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells <code>cell=["SC_MRU_T","SC_MRU_I","SMRU"]</code>.</li> <li><code>factorStep= 100</code> # is the number of steps x 20 during the reloading stage between points B and C.</li> <li>The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/2D_MultiScale">MultiScale/2D_MultiScale/</a> is</li> </ul> </li> </ul> <div> <pre><code>python3 model.py</code></pre> </div> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/FE2">MultiScale/FE2</a>: <ul> <li>Contains the reference displacement-force results of the FE2 simulation.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/FE2/Distributions">MultiScale/FE2/Distributions</a>: contains the macro-scale displacement and stress fields. They can be vizualized with gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>) using the mesh file <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/FE2/Distributions/model.msh">model.msh</a>.</li> </ul> </li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale">MultiScale/S<code>CELL</code>_120_<code>STEPS</code></a>: <ul> <li>Contain the reference displacement-force results of the rnn-based multiscale simulations for the different recurrent cells <code>CELL</code> and steps number <code>STEPS</code> during the reloading stage between points B and C.</li> <li>For the cases <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale">MultiScale/S<code>CELL</code>_120_20</a>, the macro-scale displacement and stress fields are also available and can be vizualized with gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>) using the mesh file <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/FE2/Distributions/model.msh">model.msh</a>.</li> </ul> </li> </ul> <h3>Vizualize mutiscale simulations results</h3> <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/2D_MultiScale/plot_force.py">MultiScale/2D_MultiScale/plot_force.py</a>: is used to plot the multiscale simulations results: <ul> <li><code>InpType = cell[0]</code> #choose the recurrent cell typeAmong the different available cells <code>cell=["SC_MRU_T","SC_MRU_I","SMRU"]</code>.</li> <li>The multiscale simulations results to be plotted are saved in the directories <code>CELL_120_Step</code>, where <code>Step</code> # is the number of steps during the reloading stage between points B and C.</li> <li>The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/2D_MultiScale">MultiScale/2D_MultiScale/</a> is</li> </ul> </li> </ul> <div> <pre><code>python3 plot_force.py</code></pre> </div> <ul> <li>To vizualize the macro-scale displacement and stress fields distributions: <ul> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/FE2/Distributions">MultiScale/FE2/Distributions</a>: contains the macro-scale displacement and stress fields. They can be vizualized with gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>) using the mesh file <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/FE2/Distributions/model.msh">model.msh</a>.</li> <li><a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale">MultiScale/S<code>CELL</code>_120_20</a>, the macro-scale displacement and stress fields are also available and can be vizualized with gmsh (<a href="http://www.gmsh.info" target="_blank" rel="nofollow noreferrer noopener">www.gmsh.info</a>) using the mesh file <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/blob/main/MultiScale/FE2/Distributions/model.msh">model.msh</a>.</li> </ul> </li> </ul> <h2>Part 4: Reproduce paper<sup><a href="#fn-1">1</a></sup> figures</h2> <ul> <li>Fig. 7: The command to be run from the diretory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/TrainingPaths">TrainingPaths</a> is</li> </ul> <div> <pre><code> python3 countPathLength.py '../ConstRVE/PathsExamples'</code></pre> </div> <ul> <li>Fig. 9: The command to be run from the diretory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> <div> <pre><code> python3 PlotLoss_HiddenV.py</code></pre> </div> <ul> <li>Fig. 10: The command to be run from the diretory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> <div> <pre><code> python3 PlotLoss_3MRU.py</code></pre> </div> <ul> <li>Fig. 11: The command to be run from the diretory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU">SC_MRU/</a> is</li> </ul> <div> <pre><code> python3 PlotLoss_DiffNL_H120.py</code></pre> </div> <ul> <li>Figs. 12 and 13: The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is, see <a href="#vizualize-loss-evolution-and-testing-results">details</a></li> </ul> <div> <pre><code> python3 LossVS_insertN.py</code></pre> </div> <ul> <li>Figs. 14, 15 and 16: The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a></li> </ul> <div> <pre><code> python3 Plot_GS.py</code></pre> </div> <ul> <li>Figs. 17(b)(c)(d): The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/2D_MultiScale">MultiScale/2D_MultiScale/</a> is, see <a href="#vizualize-mutiscale-simulations-results">details</a>:</li> </ul> <div> <pre><code>python3 plot_force.py</code></pre> </div> <ul> <li>Figs. 18-23: Need gmsh to vizualize the results stored in <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale/FE2/Distributions">MultiScale/FE2/Distributions</a> and <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/MultiScale">MultiScale/S<code>CELL</code>_120_20</a>, see <a href="#vizualize-mutiscale-simulations-results">details</a></li> <li>Fig. A.24: The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is, see <a href="#vizualize-loss-evolution-and-testing-results">details</a></li> </ul> <div> <pre><code> python3 PlotLoss_MGRU.py.py</code></pre> </div> <ul> <li>Fig. B.25: The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is, see <a href="#vizualize-loss-evolution-and-testing-results">details</a></li> </ul> <div> <pre><code> python3 PlotLoss_NL.py</code></pre> </div> <ul> <li>Fig. B.26: The command to be run from the directory <a href="../didearot/didearotPublic/publicationsData/2024_scmru/-/tree/main/SC_MRU/CheckLoss">SC_MRU/CheckLoss/</a> is, see <a href="#vizualize-loss-evolution-and-testing-results">details</a></li> </ul> <div> <pre><code> python3 PlotLoss_DiffNL_H120.py</code></pre> </div> <h2>Disclaimer</h2> <p>This project has received funding from the European Union&rsquo;s Horizon Europe Framework Programme under grant agreement No. 101056682 for the project &ldquo;DIgital DEsign strategies to certify and mAnufacture Robust cOmposite sTructures (DIDEAROT)&rdquo;. The contents of this publication are the sole responsibility of ULiege and do not necessarily reflect the opinion of the European Union. Neither the European Union nor the granting authority can be held responsible for them.</p> <ol> <li> <p>The work is described in:<br>"<em>Wu, L. and Noels, L. (2024).</em> <strong>Self-consistency Reinforced minimal Gated Recurrent Unit for surrogate modeling of history-dependent non-linear problems: application to history-dependent homogenized response of heterogeneous materials</strong> 424: 116881, <a href="https://doi.org/10.1016/j.cma.2024.116881" target="_blank" rel="nofollow noreferrer noopener">doi: 10.1016/j.cma.2024.116881</a>" which can be downloaded. We would be grateful if you could cite this publication in case you use the files. <a href="#fnref-1-5292">↩</a> <a href="#fnref-1-2">↩<sup>2</sup></a> <a href="#fnref-1-3">↩<sup>3</sup></a></p> </li> </ol>

ShareScore

36/100

Overall dataset sharing score

Score breakdown

These five areas show where the dataset supports — or may limit — practical reuse.

Stewardship
4
Harmonization
4
Access
16
Reuse readiness
8
Engagement
4