Skip to content

Commit b395993

Browse files
uekermanMakisH
andauthored
Fix inconsistencies in structure of some tutorials (#490)
Co-authored-by: Gerasimos Chourdakis <[email protected]>
1 parent 2ae74fe commit b395993

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+73
-11
lines changed

oscillator/README.md

+7-7
File renamed without changes.

oscillator/fmi/MassLeft/fmi-settings.json renamed to oscillator/mass-left-fmi/fmi-settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"mass.a": -197.392088022
1111
},
1212
"simulation_params": {
13-
"fmu_file_name": "./Oscillator.fmu",
13+
"fmu_file_name": "../solver-fmi/Oscillator.fmu",
1414
"output_file_name": "./output/trajectory-Mass-Left.csv",
1515
"output": ["mass.u", "mass.v"],
1616
"fmu_read_data_names": ["force_in"],

oscillator/mass-left-fmi/run.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
5+
if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
6+
cd ../solver-fmi/fmu
7+
rm -rf build
8+
mkdir build
9+
cd build
10+
# Both FMI_VERSION=3 and FMI_VERSION=2 are supported
11+
cmake -DFMI_TYPE=CS -DFMI_VERSION=3 ..
12+
make
13+
cp ./Oscillator.fmu ../..
14+
cd ../../../mass-left-fmi
15+
fi
16+
17+
fmiprecice fmi-settings.json precice-settings.json
18+
python3 ../solver-fmi/calculate-error.py ../mass-left-fmi/fmi-settings.json ../mass-left-fmi/precice-settings.json ../mass-right-fmi/fmi-settings.json ../mass-right-fmi/precice-settings.json Mass-Left
File renamed without changes.

oscillator/mass-left-python/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
python3 ../solver-python/oscillator.py Mass-Left

oscillator/mass-right-fmi/clean.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
. ../../tools/cleaning-tools.sh
5+
6+
rm -rfv ./output/
7+
8+
clean_precice_logs .

oscillator/fmi/MassRight/fmi-settings.json renamed to oscillator/mass-right-fmi/fmi-settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"mass.a": 157.913670417
1111
},
1212
"simulation_params": {
13-
"fmu_file_name": "./Oscillator.fmu",
13+
"fmu_file_name": "../solver-fmi/Oscillator.fmu",
1414
"output_file_name": "./output/trajectory-Mass-Right.csv",
1515
"output": ["mass.u", "mass.v"],
1616
"fmu_read_data_names": ["force_in"],

oscillator/mass-right-fmi/run.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
5+
if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
6+
cd ../solver-fmi/fmu
7+
rm -rf build
8+
mkdir build
9+
cd build
10+
# Both FMI_VERSION=3 and FMI_VERSION=2 are supported
11+
cmake -DFMI_TYPE=CS -DFMI_VERSION=3 ..
12+
make
13+
cp ./Oscillator.fmu ../..
14+
cd ../../../mass-right-fmi
15+
fi
16+
17+
fmiprecice fmi-settings.json precice-settings.json
18+
python3 ../solver-fmi/calculate-error.py ../mass-left-fmi/fmi-settings.json ../mass-left-fmi/precice-settings.json ../mass-right-fmi/fmi-settings.json ../mass-right-fmi/precice-settings.json Mass-Right

oscillator/mass-right-python/clean.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
. ../../tools/cleaning-tools.sh
5+
6+
rm -rfv ./output/
7+
8+
clean_precice_logs .

oscillator/mass-right-python/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
set -e -u
3+
4+
python3 ../solver-python/oscillator.py Mass-Right

oscillator/plot-trajectory.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ class PlotType(Enum):
1616
args = parser.parse_args()
1717

1818
filename = args.csvFile
19-
split_filename = filename.split('/')
20-
solver = split_filename[0]
19+
split_foldername = filename.split('/')
20+
casename = split_foldername[0]
21+
split_casename = casename.split('-')
22+
solver = split_casename[-1]
2123

2224
if solver == 'python':
2325
df = pd.read_csv(filename, delimiter=';')
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)