Skip to content

Commit

Permalink
remove hard coded paths to WISDEM file structure in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Dec 7, 2023
1 parent 70f637e commit ccb2e1d
Show file tree
Hide file tree
Showing 23 changed files with 4,164 additions and 49 deletions.
7 changes: 4 additions & 3 deletions examples/02_control_opt/weis_driver.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = run_dir + os.sep + 'IEA-15-240-RWT.yaml'
fname_modeling_options = run_dir + os.sep + 'modeling_options.yaml'
fname_analysis_options = run_dir + os.sep + 'analysis_options.yaml'
Expand All @@ -20,4 +21,4 @@
rank = 0
if rank == 0:
print("Run time: %f"%(time.time()-tt))
sys.stdout.flush()
sys.stdout.flush()
7 changes: 4 additions & 3 deletions examples/02_control_opt/weis_driver_loads.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = run_dir + os.sep + 'IEA-15-240-RWT.yaml'
fname_modeling_options = run_dir + os.sep + 'modeling_options_loads.yaml'
fname_analysis_options = run_dir + os.sep + 'analysis_options_loads.yaml'
Expand All @@ -20,4 +21,4 @@
rank = 0
if rank == 0:
print("Run time: %f"%(time.time()-tt))
sys.stdout.flush()
sys.stdout.flush()
6 changes: 4 additions & 2 deletions examples/02_control_opt/weis_driver_sm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

def run():
## File management
Expand All @@ -23,4 +25,4 @@ def run():
sys.stdout.flush()

if __name__ == '__main__':
run()
run()
853 changes: 853 additions & 0 deletions examples/03_NREL5MW_OC3_spar/nrel5mw-spar_oc3.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions examples/03_NREL5MW_OC3_spar/weis_driver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples", "09_floating")
fname_wt_input = wisdem_examples + os.sep + 'nrel5mw-spar_oc3.yaml'
fname_wt_input = run_dir + os.sep + "nrel5mw-spar_oc3.yaml"
fname_modeling_options = run_dir + os.sep + 'modeling_options.yaml'
fname_analysis_options = run_dir + os.sep + 'analysis_options_noopt.yaml'

Expand Down
7 changes: 4 additions & 3 deletions examples/03_NREL5MW_OC3_spar/weis_freq_driver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = os.path.join(wisdem_examples, "09_floating", "nrel5mw-spar_oc3.yaml")
fname_wt_input = run_dir + os.sep + "nrel5mw-spar_oc3.yaml"
fname_modeling_options = run_dir + os.sep + "modeling_options_freq.yaml"
fname_analysis_options = run_dir + os.sep + "analysis_options_noopt.yaml"

Expand Down
1,026 changes: 1,026 additions & 0 deletions examples/04_NREL5MW_OC4_semi/nrel5mw-semi_oc4.yaml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions examples/04_NREL5MW_OC4_semi/weis_driver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = os.path.join(wisdem_examples, "09_floating", "nrel5mw-semi_oc4.yaml")
fname_wt_input = run_dir + os.sep + "nrel5mw-semi_oc4.yaml")
fname_modeling_options = run_dir + os.sep + "modeling_options.yaml"
fname_analysis_options = run_dir + os.sep + "analysis_options.yaml"

Expand Down
7 changes: 4 additions & 3 deletions examples/04_NREL5MW_OC4_semi/weis_freq_driver.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) )
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = os.path.join(wisdem_examples, "09_floating", "nrel5mw-semi_oc4.yaml")
fname_wt_input = run_dir + os.sep + "nrel5mw-semi_oc4.yaml")
fname_modeling_options = run_dir + os.sep + "modeling_options_freq.yaml"
fname_analysis_options = run_dir + os.sep + "analysis_options.yaml"

Expand Down
1,323 changes: 1,323 additions & 0 deletions examples/06_IEA-15-240-RWT/IEA-15-240-RWT_VolturnUS-S.yaml

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions examples/06_IEA-15-240-RWT/postprocess_doe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import glob
import os
import sys
import time

import numpy as np

Expand Down Expand Up @@ -37,4 +35,4 @@
n_cases = len(optimization_logs)

tower_mass = all_data['floatingse.tower_mass']
print(tower_mass)
print(tower_mass)
4 changes: 3 additions & 1 deletion examples/06_IEA-15-240-RWT/weis_driver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) ) + os.sep
Expand Down
5 changes: 3 additions & 2 deletions examples/06_IEA-15-240-RWT/weis_driver_TMDs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) ) + os.sep
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = os.path.realpath(os.path.join(run_dir,"IEA-15-floating_wTMDs.yaml"))
fname_modeling_options = run_dir + "modeling_options_umaine_semi.yaml"
fname_analysis_options = run_dir + "analysis_options_TMDs.yaml"
Expand Down
7 changes: 4 additions & 3 deletions examples/06_IEA-15-240-RWT/weis_driver_umaine_semi.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import time
import sys

from weis.glue_code.runWEIS import run_weis
from wisdem.commonse.mpi_tools import MPI
import os, time, sys

## File management
run_dir = os.path.dirname( os.path.realpath(__file__) ) + os.sep
wisdem_examples = os.path.join(os.path.dirname( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) ), "WISDEM", "examples")
fname_wt_input = os.path.realpath(os.path.join(wisdem_examples,"09_floating/IEA-15-240-RWT_VolturnUS-S.yaml"))
fname_wt_input = os.path.join(os.path.dirname(run_dir), '06_IEA-15-240-RWT', 'IEA-15-240-RWT_VolturnUS-S.yaml')
fname_modeling_options = run_dir + "modeling_options_umaine_semi.yaml"
fname_analysis_options = run_dir + "analysis_options.yaml"

Expand Down
Loading

0 comments on commit ccb2e1d

Please sign in to comment.