From 231afd9ac9e44ca31e0588c56ebea5ece528b391 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 14 Feb 2024 17:05:56 -0700 Subject: [PATCH 001/190] Add 3 linearization regression tests: - 5MW_Land_BD_Linear_Aero: BD + AD15 (based on 5MW_Land_BD_Linear, but with aero) - 5MW_Land_Linear_Aero: ED + AD15 (based on 5MW_Land_BD_Linear_Aero, but with ED) - 5MW_OC4Semi_MD_Linear: MD equivalent of 5MW_OC4Semi_Linear --- reg_tests/CTestList.cmake | 5 ++++- reg_tests/r-test | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 7fda42b586..ba662a8fa1 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -314,8 +314,11 @@ of_regression_linear("Fake5MW_AeroLin_B3_UA6" "openfast;linear;elastodyn" of_regression_linear("WP_Stationary_Linear" "openfast;linear;elastodyn") of_regression_linear("Ideal_Beam_Fixed_Free_Linear" "openfast;linear;beamdyn") of_regression_linear("Ideal_Beam_Free_Free_Linear" "openfast;linear;beamdyn") +of_regression_linear("5MW_Land_Linear_Aero" "openfast;linear;elastodyn;servodyn;aerodyn") of_regression_linear("5MW_Land_BD_Linear" "openfast;linear;beamdyn;servodyn") -of_regression_linear("5MW_OC4Semi_Linear" "openfast;linear;hydrodyn;servodyn") +of_regression_linear("5MW_Land_BD_Linear_Aero" "openfast;linear;beamdyn;servodyn;aerodyn") +of_regression_linear("5MW_OC4Semi_Linear" "openfast;linear;hydrodyn;servodyn;map") +of_regression_linear("5MW_OC4Semi_MD_Linear" "openfast;linear;hydrodyn;servodyn;moordyn") of_regression_linear("StC_test_OC4Semi_Linear_Nac" "openfast;linear;servodyn;stc") of_regression_linear("StC_test_OC4Semi_Linear_Tow" "openfast;linear;servodyn;stc") diff --git a/reg_tests/r-test b/reg_tests/r-test index b63e928023..f4d94ce8d9 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit b63e9280234c2fb5695a37931d2329f3011e97ec +Subproject commit f4d94ce8d9685ff1b83d23008470a83c1842c381 From 7fee687722d5bffd79bd74b521ece00bd6cb806d Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 15 Feb 2024 13:27:38 -0700 Subject: [PATCH 002/190] Add linearization of OC3Spar case --- reg_tests/CTestList.cmake | 1 + reg_tests/r-test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index ba662a8fa1..00d14710d8 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -321,6 +321,7 @@ of_regression_linear("5MW_OC4Semi_Linear" "openfast;linear;hydrodyn;se of_regression_linear("5MW_OC4Semi_MD_Linear" "openfast;linear;hydrodyn;servodyn;moordyn") of_regression_linear("StC_test_OC4Semi_Linear_Nac" "openfast;linear;servodyn;stc") of_regression_linear("StC_test_OC4Semi_Linear_Tow" "openfast;linear;servodyn;stc") +of_regression_linear("5MW_OC3Spar_Linear" "openfast;linear;map;hydrodyn") # FAST Farm regression tests if(BUILD_FASTFARM) diff --git a/reg_tests/r-test b/reg_tests/r-test index f4d94ce8d9..ad32005c11 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit f4d94ce8d9685ff1b83d23008470a83c1842c381 +Subproject commit ad32005c1176776a0d16cb10addd53744234b9b1 From 423ed815b49e9eaf324d7960855f3b86e2812741 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 16 Feb 2024 11:24:38 -0700 Subject: [PATCH 003/190] Upgrade to setup-python@v5 and cache@v4 for GH actions --- .github/workflows/automated-dev-tests.yml | 76 +++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 8c139019ab..5e0ca58038 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -39,7 +39,7 @@ jobs: with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -74,7 +74,7 @@ jobs: run: | cmake --build . --target all - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-all-debug-${{ github.sha }} @@ -125,7 +125,7 @@ jobs: with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -157,7 +157,7 @@ jobs: run: | cmake --build . --target regression_test_module_drivers - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-drivers-release-${{ github.sha }} @@ -171,7 +171,7 @@ jobs: with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -209,7 +209,7 @@ jobs: working-directory: ${{runner.workspace}}/openfast/build run: cmake --build . --target openfast_postlib - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} @@ -220,12 +220,12 @@ jobs: needs: build-postlib-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -247,7 +247,7 @@ jobs: run: | cmake --build . --target openfastlib openfast_cpp_driver openfastcpp aerodyn_inflow_c_binding moordyn_c_binding ifw_c_binding hydrodyn_c_binding regression_test_controllers - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-interfaces-release-${{ github.sha }} @@ -258,12 +258,12 @@ jobs: needs: build-postlib-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -285,7 +285,7 @@ jobs: run: | cmake --build . --target openfast - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} @@ -296,12 +296,12 @@ jobs: needs: build-postlib-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -323,7 +323,7 @@ jobs: run: | cmake --build . --target FAST.Farm - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-fastfarm-release-${{ github.sha }} @@ -341,7 +341,7 @@ jobs: with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -398,12 +398,12 @@ jobs: needs: build-drivers-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-drivers-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -454,12 +454,12 @@ jobs: needs: build-all-debug steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-all-debug-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -513,12 +513,12 @@ jobs: needs: build-interfaces-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-interfaces-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -561,12 +561,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -614,12 +614,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -664,12 +664,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -714,12 +714,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -764,12 +764,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -814,12 +814,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -864,12 +864,12 @@ jobs: needs: build-openfast-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -914,12 +914,12 @@ jobs: needs: build-fastfarm-release steps: - name: Cache the workspace - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{runner.workspace}} key: build-fastfarm-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' From fdf86428c9242a45bb5e93f7590e6e52f2f15b32 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 14:51:04 +0000 Subject: [PATCH 004/190] Update fast_linearization_file.py to use less memory Specify using np.float32 where possible in reading the linearization file. Also use np.float64 instead of float for matrices. Read matrices with genfromtxt instead of line by line --- reg_tests/lib/fast_linearization_file.py | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/reg_tests/lib/fast_linearization_file.py b/reg_tests/lib/fast_linearization_file.py index 3606e6699f..bda25b1ba2 100644 --- a/reg_tests/lib/fast_linearization_file.py +++ b/reg_tests/lib/fast_linearization_file.py @@ -84,17 +84,17 @@ def readOP(fid, n, name=''): OP=[] Var = {'RotatingFrame': [], 'DerivativeOrder': [], 'Description': []} colNames=fid.readline().strip() - dummy= fid.readline().strip() + fid.readline().strip() bHasDeriv= colNames.find('Derivative Order')>=0 for i, line in enumerate(fid): - sp=line.strip().split() - if sp[1].find(',')>=0: + sp = line.strip().split() + if sp[1].find(',') >= 0: # Most likely this OP has three values (e.g. orientation angles) # For now we discard the two other values - OP.append(float(sp[1][:-1])) + OP.append(np.float32(sp[1][:-1])) iRot=4 else: - OP.append(float(sp[1])) + OP.append(np.float32(sp[1])) iRot=2 Var['RotatingFrame'].append(sp[iRot]) if bHasDeriv: @@ -109,23 +109,23 @@ def readOP(fid, n, name=''): return OP, Var def readMat(fid, n, m, name=''): - pattern = re.compile(r"[\*]+") - vals=[pattern.sub(' inf ', fid.readline().strip() ).split() for i in np.arange(n)] - vals = np.array(vals) + + # Read rows from file, raise exception on failure try: - vals = np.array(vals).astype(float) # This could potentially fail + vals = np.genfromtxt(fid, dtype=np.float64, max_rows=n) except: raise Exception('Failed to convert into an array of float the matrix `{}`\n\tin linfile: {}'.format(name, self.filename)) + + # Raise exception if actual matrix shape does not match expected shape if vals.shape[0]!=n or vals.shape[1]!=m: shape1 = vals.shape shape2 = (n,m) raise Exception('Shape of matrix `{}` has wrong dimension ({} instead of {})\n\tin linfile: {}'.format(name, shape1, shape2, name, self.filename)) - nNaN = sum(np.isnan(vals.ravel())) - nInf = sum(np.isinf(vals.ravel())) - if nInf>0: + # Raise exceptions if any elements are NaN or infinity + if np.any(np.isnan(vals.ravel())): raise Exception('Some ill-formated/infinite values (e.g. `*******`) were found in the matrix `{}`\n\tin linflile: {}'.format(name, self.filename)) - if nNaN>0: + if np.any(np.isinf(vals.ravel())): raise Exception('Some NaN values were found in the matrix `{}`\n\tin linfile: `{}`.'.format(name, self.filename)) return vals @@ -142,15 +142,15 @@ def readMat(fid, n, m, name=''): ny = int(extractVal(self['header'],'Number of outputs:' )) bJac = extractVal(self['header'],'Jacobians included in this file?') try: - self['Azimuth'] = float(extractVal(self['header'],'Azimuth:')) + self['Azimuth'] = np.float32(extractVal(self['header'],'Azimuth:')) except: self['Azimuth'] = None try: - self['RotSpeed'] = float(extractVal(self['header'],'Rotor Speed:')) # rad/s + self['RotSpeed'] = np.float32(extractVal(self['header'],'Rotor Speed:')) # rad/s except: self['RotSpeed'] = None try: - self['WindSpeed'] = float(extractVal(self['header'],'Wind Speed:')) + self['WindSpeed'] = np.float32(extractVal(self['header'],'Wind Speed:')) except: self['WindSpeed'] = None From 73e66a90c537e5f6423b4adaa99e148e7fa0f091 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 14:52:42 +0000 Subject: [PATCH 005/190] Use env var to set CTest parallel runs, reduce to 2 Previously the number of parallel threads in CTest was set via the -j flag. This changes it to use an environment variable set at the top of the file. The number of parallel tests was reduced from 4 to 2 as the linearization tests were failing from lack of memory. This may need to be adjusted. --- .github/workflows/automated-dev-tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 8c139019ab..1e2c595024 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -21,6 +21,7 @@ env: C_COMPILER: gcc-12 GCOV_EXE: gcov-12 CMAKE_BUILD_PARALLEL_LEVEL: 8 + CTEST_PARALLEL_LEVEL: 2 jobs: @@ -589,7 +590,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -j4 \ + ctest -VV \ -L openfast \ -LE "cpp|linear|python|fastlib" \ -E "5MW_OC4Semi_WSt_WavesWN|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_Land_BD_DLL_WTurb" @@ -892,7 +893,7 @@ jobs: - name: Run OpenFAST linearization tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -j4 -L linear + ctest -VV -L linear - name: Failing test artifacts uses: actions/upload-artifact@v3 if: failure() From 577aded77fe0b0193a8e2f7f50ec720bdc3f3cfd Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 14:55:00 +0000 Subject: [PATCH 006/190] Use more efficient method to compare linearization matrices in regression tests. The previous method looped over each element and checked to see if it was within tolerance of the reference. This does the compare for the full matrices and then iterates over the element indices which were not within tolerance. This should significantly reduce the time to do the comparison for large matrices. Also prints out the row/column variables which correspond to that element. --- .../executeOpenfastLinearRegressionCase.py | 72 +++++++++++-------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/reg_tests/executeOpenfastLinearRegressionCase.py b/reg_tests/executeOpenfastLinearRegressionCase.py index 2e88bd67e4..e681c0d264 100644 --- a/reg_tests/executeOpenfastLinearRegressionCase.py +++ b/reg_tests/executeOpenfastLinearRegressionCase.py @@ -263,40 +263,50 @@ def indent(msg, sindent='\t'): # --- Compare individual matrices/vectors - KEYS= ['A','B','C','D','dUdu','dUdy'] - KEYS+=['x','y','u','xdot'] + KEYS = ['A','B','C','D','dUdu','dUdy', 'x','y','u','xdot'] for k,v in fbas.items(): - if k in KEYS and v is not None: - if verbose: - print(CasePrefix+'key:', k) - # Arrays - Mloc=np.atleast_2d(floc[k]) - Mbas=np.atleast_2d(fbas[k]) - - # --- Compare dimensions + if k not in KEYS or v is None: + continue + if verbose: + print(CasePrefix+'key:', k) + # Arrays + Mloc=np.atleast_2d(floc[k]) + Mbas=np.atleast_2d(fbas[k]) + + # --- Compare dimensions + try: + np.testing.assert_equal(Mloc.shape, Mbas.shape) + except Exception as e: + Err = 'Different dimensions for variable `{k}`.\n' + Err += f'\tNew:{Mloc.shape}\n' + Err += f'\tRef:{Mbas.shape}\n' + Err += f'\tLinfile: {local_file}.\n' + raise Exception(Err) + + # Get boolean matrix where Mloc is within tolerance of Mbas + M_in_tol = np.isclose(Mloc, Mbas, rtol=rtol, atol=atol) + + # Loop through elements where Mloc is not within tolerance of Mbas + # Retest to get error message + for n, (i,j) in enumerate(zip(*np.where(M_in_tol == False)), 1): try: - np.testing.assert_equal(Mloc.shape, Mbas.shape) + np.testing.assert_allclose(Mloc[i,j], Mbas[i,j], rtol=rtol, atol=atol) except Exception as e: - Err = 'Different dimensions for variable `{}`.\n'.format(k) - Err+= '\tNew:{}\n'.format(Mloc.shape) - Err+= '\tRef:{}\n'.format(Mbas.shape) - Err+= '\tLinfile: {}.\n'.format(local_file) - raise Exception(Err) - - - # We for loop below to get the first element that mismatch - # Otherwise, do: np.testing.assert_allclose(floc[k], fbas[k], rtol=rtol, atol=atol) - for i in range(Mbas.shape[0]): - for j in range(Mbas.shape[1]): - # Old method: - #if not isclose(Mloc[i,j], Mbas[i,j], rtol=rtol, atol=atol): - # sElem = 'Element [{},{}], new : {}, baseline: {}'.format(i+1,j+1,Mloc[i,j], Mbas[i,j]) - # raise Exception('Failed to compare variable `{}`, {} \n\tLinfile: {}.'.format(k, sElem, local_file)) #, e.args[0])) - try: - np.testing.assert_allclose(Mloc[i,j], Mbas[i,j], rtol=rtol, atol=atol) - except Exception as e: - sElem = 'Element [{},{}], new : {}, baseline: {}'.format(i+1,j+1,Mloc[i,j], Mbas[i,j]) - raise Exception('Failed to compare variable `{}`, {} \n\tLinfile: {}.\n\tException: {}'.format(k, sElem, local_file, indent(e.args[0]))) + sElem = f'Element [{i+1},{j+1}], new: {Mloc[i,j]}, baseline: {Mbas[i,j]}' + if k in ['dXdx', 'A', 'dXdu', 'B']: + sElem += '\n row:', fbas['x_info']['Description'][i] + if k in ['dYdx', 'C', 'dYdu', 'D']: + sElem += '\n row:', fbas['y_info']['Description'][i] + if k in ['dUdu', 'dUdy']: + sElem += '\n row:', fbas['u_info']['Description'][i] + if k in ['dXdx', 'A', 'dYdx', 'C']: + sElem += '\n col:', fbas['x_info']['Description'][j] + if k in ['dXdu', 'B', 'dYdu', 'D', 'dUdu']: + sElem += '\n col:', fbas['u_info']['Description'][j] + if k in ['dUdy']: + sElem += '\n col:', fbas['y_info']['Description'][j] + raise Exception('Failed to compare matrix `{}`, {} \n\tLinfile: {}.\n\tException: {}'.format(k, sElem, local_file, indent(e.args[0]))) + except Exception as e: exitWithError(e.args[0]) From 7f49d462d98b2955a85e88886432cab82fc1cd1d Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 16:00:34 +0000 Subject: [PATCH 007/190] Fix printing bug in Python Linear Regression test script --- .../executeOpenfastLinearRegressionCase.py | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/reg_tests/executeOpenfastLinearRegressionCase.py b/reg_tests/executeOpenfastLinearRegressionCase.py index e681c0d264..289abe292c 100644 --- a/reg_tests/executeOpenfastLinearRegressionCase.py +++ b/reg_tests/executeOpenfastLinearRegressionCase.py @@ -237,22 +237,20 @@ def indent(msg, sindent='\t'): else: #if verbose: - print(CasePrefix+'freq_ref:', np.around(freq_bas[:8] ,5), '[Hz]') - print(CasePrefix+'freq_new:', np.around(freq_loc[:8] ,5),'[Hz]') - print(CasePrefix+'damp_ref:', np.around(zeta_bas[:8]*100,5), '[%]') - print(CasePrefix+'damp_new:', np.around(zeta_loc[:8]*100,5), '[%]') + print(CasePrefix+'freq_ref:', np.around(freq_bas[:10] ,5), '[Hz]') + print(CasePrefix+'freq_new:', np.around(freq_loc[:10] ,5), '[Hz]') + print(CasePrefix+'damp_ref:', np.around(zeta_bas[:10]*100,5), '[%]') + print(CasePrefix+'damp_new:', np.around(zeta_loc[:10]*100,5), '[%]') try: np.testing.assert_allclose(freq_loc[:10], freq_bas[:10], rtol=rtol_f, atol=atol_f) except Exception as e: raise Exception('Failed to compare A-matrix frequencies\n\tLinfile: {}.\n\tException: {}'.format(local_file, indent(e.args[0]))) - if caseName=='Ideal_Beam_Free_Free_Linear': - # The free-free case is a bit weird, smae frequencies but dampings are +/- a value - zeta_loc=np.abs(zeta_loc) - zeta_bas=np.abs(zeta_bas) - + # The free-free case is a bit weird, same frequencies but damping values are +/- a value + zeta_loc = np.abs(zeta_loc) + zeta_bas = np.abs(zeta_bas) try: # Note: damping ratios in [%] @@ -294,17 +292,17 @@ def indent(msg, sindent='\t'): except Exception as e: sElem = f'Element [{i+1},{j+1}], new: {Mloc[i,j]}, baseline: {Mbas[i,j]}' if k in ['dXdx', 'A', 'dXdu', 'B']: - sElem += '\n row:', fbas['x_info']['Description'][i] + sElem += '\n\t\t row: ' + fbas['x_info']['Description'][i] if k in ['dYdx', 'C', 'dYdu', 'D']: - sElem += '\n row:', fbas['y_info']['Description'][i] + sElem += '\n\t\t row: ' + fbas['y_info']['Description'][i] if k in ['dUdu', 'dUdy']: - sElem += '\n row:', fbas['u_info']['Description'][i] + sElem += '\n\t\t row: ' + fbas['u_info']['Description'][i] if k in ['dXdx', 'A', 'dYdx', 'C']: - sElem += '\n col:', fbas['x_info']['Description'][j] + sElem += '\n\t\t col: ' + fbas['x_info']['Description'][j] if k in ['dXdu', 'B', 'dYdu', 'D', 'dUdu']: - sElem += '\n col:', fbas['u_info']['Description'][j] + sElem += '\n\t\t col: ' + fbas['u_info']['Description'][j] if k in ['dUdy']: - sElem += '\n col:', fbas['y_info']['Description'][j] + sElem += '\n\t\t col: ' + fbas['y_info']['Description'][j] raise Exception('Failed to compare matrix `{}`, {} \n\tLinfile: {}.\n\tException: {}'.format(k, sElem, local_file, indent(e.args[0]))) From 7fdf58017f7b94af7b83864093a3dce59d4e39bb Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 19 Feb 2024 09:32:19 -0700 Subject: [PATCH 008/190] GH actions: upgrade upload-artifact to v4 This will prevent warnings about node 16 deprecation --- .github/workflows/automated-dev-tests.yml | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 1e2c595024..68c9c3ec96 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -383,7 +383,7 @@ jobs: ctest -VV -R "^ua_" - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-uadriver @@ -442,7 +442,7 @@ jobs: - name: Run SubDyn tests uses: ./.github/actions/tests-module-subdyn - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-module-drivers @@ -500,7 +500,7 @@ jobs: - name: Run VersionInfo tests uses: ./.github/actions/tests-module-version - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-modules-debug @@ -543,7 +543,7 @@ jobs: run: | ctest -VV -L "cpp|python|fastlib" - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-interfaces @@ -595,7 +595,7 @@ jobs: -LE "cpp|linear|python|fastlib" \ -E "5MW_OC4Semi_WSt_WavesWN|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_Land_BD_DLL_WTurb" - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF @@ -645,7 +645,7 @@ jobs: run: | ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Semi_WSt_WavesWN - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-5MW_OC4Semi_WSt_WavesWN @@ -695,7 +695,7 @@ jobs: run: | ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-5MW_OC3Mnpl_DLL_WTurb_WavesIrr @@ -745,7 +745,7 @@ jobs: run: | ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth @@ -795,7 +795,7 @@ jobs: run: | ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-5MW_OC3Trpd_DLL_WSt_WavesReg @@ -845,7 +845,7 @@ jobs: run: | ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_Land_BD_DLL_WTurb - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-5MW_Land_BD_DLL_WTurb @@ -895,7 +895,7 @@ jobs: run: | ctest -VV -L linear - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-OF-linearization @@ -947,7 +947,7 @@ jobs: set OMP_NUM_THREADS=2 ctest -VV -L fastfarm --verbose - name: Failing test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: rtest-FF From 44146020d1eaf7f60b6267c7e0e3f839be456747 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 16:38:16 +0000 Subject: [PATCH 009/190] Fix bug in HD_Perturb_x where SS_Exctn%numStates was used instead of SS_Rdtn%numStates This also moves to a simpler scheme that just checks if the perturbation index 'n' is equal to the current value index 'k' --- modules/hydrodyn/src/HydroDyn.f90 | 42 ++++++++++++++----------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/modules/hydrodyn/src/HydroDyn.f90 b/modules/hydrodyn/src/HydroDyn.f90 index 86d5b0927c..65c012d0a9 100644 --- a/modules/hydrodyn/src/HydroDyn.f90 +++ b/modules/hydrodyn/src/HydroDyn.f90 @@ -3567,39 +3567,35 @@ SUBROUTINE HD_Perturb_x( p, n, perturb_sign, x, dx ) ! local variables - integer(intKi) :: i, offset1, offset2, n2 + integer(intKi) :: i, j, k if ( p%totalStates == 0 ) return !Note: All excitation states for all bodies are stored 1st, then all radiation states dx = p%dx(n) - offset1 = 1 - if ( n <= p%totalExctnStates ) then - - ! Find body index for exctn states - do i=1,p%nWAMITObj - offset2 = offset1 + p%WAMIT(i)%SS_Exctn%numStates - if ( n >= offset1 .and. n < offset2) then - n2 = n - offset1 + 1 - x%WAMIT(i)%SS_Exctn%x( n2 ) = x%WAMIT(i)%SS_Exctn%x( n2 ) + dx * perturb_sign - exit + k = 1 + + ! Find body index for exctn states + do i = 1, p%nWAMITObj + do j = 1, p%WAMIT(i)%SS_Exctn%numStates + if (n == k) then + x%WAMIT(i)%SS_Exctn%x(j) = x%WAMIT(i)%SS_Exctn%x(j) + dx * perturb_sign + return end if - offset1 = offset2 + k = k + 1 end do + end do - else - offset1 = p%totalExctnStates + 1 - ! Find body index for rdtn states - do i=1,p%nWAMITObj - offset2 = offset1 + p%WAMIT(i)%SS_Exctn%numStates - if ( n >= offset1 .and. n < offset2) then - n2 = n - offset1 + 1 - x%WAMIT(i)%SS_Rdtn%x( n2 ) = x%WAMIT(i)%SS_Rdtn%x( n2 ) + dx * perturb_sign - exit + ! Find body index for rdtn states + do i = 1, p%nWAMITObj + do j = 1, p%WAMIT(i)%SS_Rdtn%numStates + if (n == k) then + x%WAMIT(i)%SS_Rdtn%x(j) = x%WAMIT(i)%SS_Rdtn%x(j) + dx * perturb_sign + return end if - offset1 = offset2 + k = k + 1 end do - end if + end do END SUBROUTINE HD_Perturb_x From 07d608a1f61d24fcd0c05778e395e7a79275cc6f Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 17:36:07 +0000 Subject: [PATCH 010/190] GH actions: upgrade checkout to v4 and setup-python to v5 --- .github/workflows/automated-dev-tests.yml | 46 +++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 68c9c3ec96..fad27ad793 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -36,11 +36,11 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 with: submodules: recursive - name: Install dependencies @@ -122,11 +122,11 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -168,11 +168,11 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -226,7 +226,7 @@ jobs: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -264,7 +264,7 @@ jobs: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -302,7 +302,7 @@ jobs: path: ${{runner.workspace}} key: build-postlib-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -338,11 +338,11 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@main + uses: actions/checkout@v4 with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -404,7 +404,7 @@ jobs: path: ${{runner.workspace}} key: build-drivers-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -460,7 +460,7 @@ jobs: path: ${{runner.workspace}} key: build-all-debug-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -519,7 +519,7 @@ jobs: path: ${{runner.workspace}} key: build-interfaces-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -567,7 +567,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -620,7 +620,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -670,7 +670,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -720,7 +720,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -770,7 +770,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -820,7 +820,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -870,7 +870,7 @@ jobs: path: ${{runner.workspace}} key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' @@ -920,7 +920,7 @@ jobs: path: ${{runner.workspace}} key: build-fastfarm-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' From 158459facb18dd1acdeb3821bbfd4a81c2cb2d62 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 19 Feb 2024 17:59:51 +0000 Subject: [PATCH 011/190] Update regression test pointer --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index ad32005c11..e281d0529e 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit ad32005c1176776a0d16cb10addd53744234b9b1 +Subproject commit e281d0529e10086f1ad3a2a7da8514d56bf8be84 From 5f1760fbba9fddddf38cecd29fd08b5cbf886df6 Mon Sep 17 00:00:00 2001 From: RyanDavies19 Date: Fri, 26 Jan 2024 12:17:02 -0700 Subject: [PATCH 012/190] Remove typo in warning, retains c/con option for output flags for backwards compatibility --- modules/moordyn/src/MoorDyn_IO.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/moordyn/src/MoorDyn_IO.f90 b/modules/moordyn/src/MoorDyn_IO.f90 index 144a355ff6..c13a65003b 100644 --- a/modules/moordyn/src/MoorDyn_IO.f90 +++ b/modules/moordyn/src/MoorDyn_IO.f90 @@ -563,7 +563,7 @@ SUBROUTINE MDIO_ProcessOutList(OutList, p, m, y, InitOut, ErrStat, ErrMsg ) END IF ! Point case - ELSE IF (let1(1:1) == 'P') THEN ! Look for P?xxx or Point?xxx + ELSE IF (let1(1:1) == 'P' .OR. let1(1:1) == 'C') THEN ! Look for P?xxx or Point?xxx (C?xxx and Con?xxx for backwards compatability) p%OutParam(I)%OType = 2 ! Point object type qVal = let2 ! quantity type string @@ -601,7 +601,7 @@ SUBROUTINE MDIO_ProcessOutList(OutList, p, m, y, InitOut, ErrStat, ErrMsg ) ! error ELSE CALL DenoteInvalidOutput(p%OutParam(I)) ! flag as invalid - CALL WrScr('Warning: invalid output specifier '//trim(OutListTmp)//'. Must start with L, C, R, or B') + CALL WrScr('Warning: invalid output specifier '//trim(OutListTmp)//'. Must start with L, R, or B') CYCLE END IF From 4c664a09d36b8a6a92aa647b34a7de800f2e0a67 Mon Sep 17 00:00:00 2001 From: RyanDavies19 Date: Mon, 29 Jan 2024 09:37:09 -0700 Subject: [PATCH 013/190] Bathymetry grid bug fix --- modules/moordyn/src/MoorDyn_IO.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/moordyn/src/MoorDyn_IO.f90 b/modules/moordyn/src/MoorDyn_IO.f90 index c13a65003b..b03c24bb9e 100644 --- a/modules/moordyn/src/MoorDyn_IO.f90 +++ b/modules/moordyn/src/MoorDyn_IO.f90 @@ -182,7 +182,7 @@ SUBROUTINE setupBathymetry(inputString, defaultDepth, BathGrid, BathGrid_Xs, Bat READ(UnCoef,*,IOSTAT=ErrStat4) nGridY_string, nGridY ! read in the third line as the number of y values in the BathGrid ! Allocate the bathymetry matrix and associated grid x and y values - ALLOCATE(BathGrid(nGridX, nGridY), STAT=ErrStat4) + ALLOCATE(BathGrid(nGridY, nGridX), STAT=ErrStat4) ALLOCATE(BathGrid_Xs(nGridX), STAT=ErrStat4) ALLOCATE(BathGrid_Ys(nGridY), STAT=ErrStat4) From ad169900542f15b9541f00f6fa0d170cef07a599 Mon Sep 17 00:00:00 2001 From: RyanDavies19 Date: Mon, 29 Jan 2024 12:42:27 -0700 Subject: [PATCH 014/190] Bathymetry grid slope normal vector bug fix --- modules/moordyn/src/MoorDyn_Misc.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/moordyn/src/MoorDyn_Misc.f90 b/modules/moordyn/src/MoorDyn_Misc.f90 index 3f52dfc16e..b3a652a3a3 100644 --- a/modules/moordyn/src/MoorDyn_Misc.f90 +++ b/modules/moordyn/src/MoorDyn_Misc.f90 @@ -883,7 +883,7 @@ SUBROUTINE getDepthFromBathymetry(BathymetryGrid, BathGrid_Xs, BathGrid_Ys, Line else dc_dx = 0.0_DbKi ! maybe this should raise an error end if - if ( dx > 0.0 ) then + if ( dy > 0.0 ) then dc_dy = (cx1-cx0)/dy else dc_dy = 0.0_DbKi ! maybe this should raise an error From 26f5a490faad3acb9ca34832ea349c7d350d8a2e Mon Sep 17 00:00:00 2001 From: RyanDavies19 Date: Tue, 30 Jan 2024 16:03:13 -0700 Subject: [PATCH 015/190] Change input string size for bathgrid and waterkin --- modules/moordyn/src/MoorDyn_IO.f90 | 2 +- modules/moordyn/src/MoorDyn_Misc.f90 | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/moordyn/src/MoorDyn_IO.f90 b/modules/moordyn/src/MoorDyn_IO.f90 index b03c24bb9e..caad8b3b15 100644 --- a/modules/moordyn/src/MoorDyn_IO.f90 +++ b/modules/moordyn/src/MoorDyn_IO.f90 @@ -139,7 +139,7 @@ SUBROUTINE setupBathymetry(inputString, defaultDepth, BathGrid, BathGrid_Xs, Bat INTEGER(IntKi) :: ErrStat4 CHARACTER(120) :: ErrMsg4 - CHARACTER(120) :: Line2 + CHARACTER(4096) :: Line2 CHARACTER(20) :: nGridX_string ! string to temporarily hold the nGridX string from Line2 CHARACTER(20) :: nGridY_string ! string to temporarily hold the nGridY string from Line3 diff --git a/modules/moordyn/src/MoorDyn_Misc.f90 b/modules/moordyn/src/MoorDyn_Misc.f90 index b3a652a3a3..82252d1258 100644 --- a/modules/moordyn/src/MoorDyn_Misc.f90 +++ b/modules/moordyn/src/MoorDyn_Misc.f90 @@ -1297,8 +1297,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg) REAL(SiKi) :: t, Frac CHARACTER(1024) :: FileName ! Name of MoorDyn input file CHARACTER(120) :: Line - CHARACTER(120) :: Line2 - CHARACTER(120) :: entries2 + CHARACTER(4096) :: entries2 INTEGER(IntKi) :: coordtype INTEGER(IntKi) :: NStepWave ! From f8e481313e3f8d2396c639029cd0f686e5c1d794 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 26 Feb 2024 14:31:55 -0700 Subject: [PATCH 016/190] Lin tests: increase out precision, error printing full filename --- .../executeOpenfastLinearRegressionCase.py | 23 +++++++++++-------- reg_tests/r-test | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/reg_tests/executeOpenfastLinearRegressionCase.py b/reg_tests/executeOpenfastLinearRegressionCase.py index 289abe292c..fbdbe635e3 100644 --- a/reg_tests/executeOpenfastLinearRegressionCase.py +++ b/reg_tests/executeOpenfastLinearRegressionCase.py @@ -182,9 +182,14 @@ def indent(msg, sindent='\t'): for i, f in enumerate(localOutFiles): local_file = os.path.join(testBuildDirectory, f) baseline_file = os.path.join(targetOutputDirectory, f) + # Set a prefix for all errors to identify where it comes from + basename = os.path.splitext(os.path.basename(local_file))[0] + ext2 = os.path.splitext(basename)[1][1:] #+'.lin' # '.1' or '.AD' '.BD' + errPrefix = CasePrefix[:-1]+ext2+': ' + if verbose: - print(CasePrefix+'ref:', baseline_file) - print(CasePrefix+'new:', local_file) + print(errPrefix+'ref:', baseline_file) + print(errPrefix+'new:', local_file) # verify both files have the same number of lines local_file_line_count = file_line_count(local_file) @@ -228,8 +233,8 @@ def indent(msg, sindent='\t'): v_loc = np.diag(Lambda) if verbose: - print(CasePrefix+'val_ref:', v_bas[:7]) - print(CasePrefix+'val_new:', v_loc[:7]) + print(errPrefix+'val_ref:', v_bas[:7]) + print(errPrefix+'val_new:', v_loc[:7]) try: np.testing.assert_allclose(v_bas[:10], v_loc[:10], rtol=rtol_f, atol=atol_f) except Exception as e: @@ -237,10 +242,10 @@ def indent(msg, sindent='\t'): else: #if verbose: - print(CasePrefix+'freq_ref:', np.around(freq_bas[:10] ,5), '[Hz]') - print(CasePrefix+'freq_new:', np.around(freq_loc[:10] ,5), '[Hz]') - print(CasePrefix+'damp_ref:', np.around(zeta_bas[:10]*100,5), '[%]') - print(CasePrefix+'damp_new:', np.around(zeta_loc[:10]*100,5), '[%]') + print(errPrefix+'freq_ref:', np.around(freq_bas[:10] ,5), '[Hz]') + print(errPrefix+'freq_new:', np.around(freq_loc[:10] ,5), '[Hz]') + print(errPrefix+'damp_ref:', np.around(zeta_bas[:10]*100,5), '[%]') + print(errPrefix+'damp_new:', np.around(zeta_loc[:10]*100,5), '[%]') try: np.testing.assert_allclose(freq_loc[:10], freq_bas[:10], rtol=rtol_f, atol=atol_f) @@ -266,7 +271,7 @@ def indent(msg, sindent='\t'): if k not in KEYS or v is None: continue if verbose: - print(CasePrefix+'key:', k) + print(errPrefix+'key:', k) # Arrays Mloc=np.atleast_2d(floc[k]) Mbas=np.atleast_2d(fbas[k]) diff --git a/reg_tests/r-test b/reg_tests/r-test index e281d0529e..7bcb24f5f1 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit e281d0529e10086f1ad3a2a7da8514d56bf8be84 +Subproject commit 7bcb24f5f1047b4685e364f49fbcb0822e2d474d From 14f20d736d5a3ac8204fe8fed4cd45bef2570ef0 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 26 Feb 2024 22:32:03 +0000 Subject: [PATCH 017/190] Add SubDyn Linearization test case --- reg_tests/CTestList.cmake | 1 + reg_tests/r-test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 00d14710d8..42f991f28e 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -319,6 +319,7 @@ of_regression_linear("5MW_Land_BD_Linear" "openfast;linear;beamdyn;ser of_regression_linear("5MW_Land_BD_Linear_Aero" "openfast;linear;beamdyn;servodyn;aerodyn") of_regression_linear("5MW_OC4Semi_Linear" "openfast;linear;hydrodyn;servodyn;map") of_regression_linear("5MW_OC4Semi_MD_Linear" "openfast;linear;hydrodyn;servodyn;moordyn") +of_regression_linear("5MW_OC3Mnpl_Linear" "openfast;linear;hydrodyn;servodyn;moordyn") of_regression_linear("StC_test_OC4Semi_Linear_Nac" "openfast;linear;servodyn;stc") of_regression_linear("StC_test_OC4Semi_Linear_Tow" "openfast;linear;servodyn;stc") of_regression_linear("5MW_OC3Spar_Linear" "openfast;linear;map;hydrodyn") diff --git a/reg_tests/r-test b/reg_tests/r-test index 7bcb24f5f1..204f856a6a 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 7bcb24f5f1047b4685e364f49fbcb0822e2d474d +Subproject commit 204f856a6a778a41641b0da1ddf39a7e3fc1d92f From 334072689418f554535c210c67014f5b7466a588 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 26 Feb 2024 22:47:22 +0000 Subject: [PATCH 018/190] Updated r-test pointer --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 204f856a6a..39123bd8b5 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 204f856a6a778a41641b0da1ddf39a7e3fc1d92f +Subproject commit 39123bd8b52e37de3392da51b53fb888e316c275 From 8e140b97e5eb18669f30459caac573c9b726e4b8 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 28 Feb 2024 11:01:18 -0700 Subject: [PATCH 019/190] Lin: incorrect BD index in dUdy for AD motion The motions in dUdy from BD were starting at the incorrect index. Instead of starting at the motion, the index started at the root load output. This resulted in a shift of all the dUdy terms coupling y_BD motion to u_AD blade motion. This error has existed since at least commit 315bb29 on April 13, 2018 Co-authored-by: Derek Slaughter --- modules/openfast-library/src/FAST_Lin.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openfast-library/src/FAST_Lin.f90 b/modules/openfast-library/src/FAST_Lin.f90 index c412b5f1f3..de24bd1b19 100644 --- a/modules/openfast-library/src/FAST_Lin.f90 +++ b/modules/openfast-library/src/FAST_Lin.f90 @@ -3733,8 +3733,8 @@ SUBROUTINE Linear_AD_InputSolve_NoIfW_dy( p_FAST, y_FAST, u_AD, y_ED, BD, MeshMa DO k=1,p_FAST%nBeams AD_Start = Indx_u_AD_Blade_Start(u_AD, y_FAST, k) ! start of u_AD%BladeMotion(k)%TranslationDisp field - BD_Out_Start = y_FAST%Lin%Modules(Module_BD)%Instance(k)%LinStartIndx(LIN_OUTPUT_COL) - + BD_Out_Start = y_FAST%Lin%Modules(Module_BD)%Instance(k)%LinStartIndx(LIN_OUTPUT_COL) + 6 ! skip the reaction forces + CALL Assemble_dUdy_Motions(BD%y(k)%BldMotion, u_AD%rotors(1)%BladeMotion(k), MeshMapData%BDED_L_2_AD_L_B(k), AD_Start, BD_Out_Start, dUdy, skipRotAcc=.true.) END DO From db8d7951c88cad39d85d87a6d57c0cfc8f881358 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 28 Feb 2024 13:20:06 -0700 Subject: [PATCH 020/190] Lin: sum BD blade root motion to hub moment m_ud term (consistent with documentation) This results in some differences in the dUdy, A, and C matrices, but basically the same frequencies Co-authored-by: Derek Slaughter --- modules/openfast-library/src/FAST_Lin.f90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openfast-library/src/FAST_Lin.f90 b/modules/openfast-library/src/FAST_Lin.f90 index de24bd1b19..f8414a36df 100644 --- a/modules/openfast-library/src/FAST_Lin.f90 +++ b/modules/openfast-library/src/FAST_Lin.f90 @@ -3331,8 +3331,8 @@ SUBROUTINE Linear_ED_InputSolve_dy( p_FAST, y_FAST, SrvD, u_ED, y_ED, y_AD, u_AD ! ED translation displacement-to-ED moment transfer (dU^{ED}/dy^{ED}) from BD root-to-ED hub load transfer: ED_Start = Indx_u_ED_Hub_Start(u_ED, y_FAST) + u_ED%HubPtLoad%NNodes*3 ! start of u_ED%HubPtLoad%Moment field (skip forces) + ED_Out_Start = Indx_y_ED_Hub_Start(y_ED, y_FAST) ! start of y_ED%HubMotion%TranslationDisp field DO k=1,p_FAST%nBeams - ED_Out_Start = Indx_y_ED_BladeRoot_Start(y_ED, y_FAST, k) ! start of y_ED%BladeRootMotion(k)%TranslationDisp field call SumBlockMatrix( dUdy, MeshMapData%BD_P_2_ED_P(k)%dM%m_ud, ED_Start, ED_Out_Start) END DO @@ -3733,7 +3733,8 @@ SUBROUTINE Linear_AD_InputSolve_NoIfW_dy( p_FAST, y_FAST, u_AD, y_ED, BD, MeshMa DO k=1,p_FAST%nBeams AD_Start = Indx_u_AD_Blade_Start(u_AD, y_FAST, k) ! start of u_AD%BladeMotion(k)%TranslationDisp field - BD_Out_Start = y_FAST%Lin%Modules(Module_BD)%Instance(k)%LinStartIndx(LIN_OUTPUT_COL) + 6 ! skip the reaction forces + BD_Out_Start = y_FAST%Lin%Modules(MODULE_BD)%Instance(k)%LinStartIndx(LIN_OUTPUT_COL) & ! start of BD%y(k)%BldMotion%TranslationDisp field + + BD%y(k)%ReactionForce%NNodes * 6 ! 2 fields with 3 components CALL Assemble_dUdy_Motions(BD%y(k)%BldMotion, u_AD%rotors(1)%BladeMotion(k), MeshMapData%BDED_L_2_AD_L_B(k), AD_Start, BD_Out_Start, dUdy, skipRotAcc=.true.) END DO From 8269984a73f357138fcf60a81367caed9c1c79eb Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 28 Feb 2024 16:00:30 -0700 Subject: [PATCH 021/190] Update reg test 5MW_Land_BD_Linear_Aero --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 39123bd8b5..6c4df34a19 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 39123bd8b52e37de3392da51b53fb888e316c275 +Subproject commit 6c4df34a19ceaeecc901e886aa56c27bbf914285 From b6ce4b142e9ecb9ce1429bcdfc58078e64fa8707 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Fri, 1 Mar 2024 15:09:12 +0000 Subject: [PATCH 022/190] Fix bug in BD linearization resulting from reference rotation change When the change in reference rotation was implemented in v3.5.0, it effectively changed the states to be in the rotating frame. The existing method for putting the state Jacobians into the rotating frame involved calculating the difference in rotation between the root mesh reference orientation and the root mesh current orientation. Originally, the reference orientation always aligned with the blade root reference orientation inside BeamDyn. However, this is not a valid assumption when ChangeRefFrame = .true. as the blade root reference is updated by UpdateStates at every step. This commit changes two things: first, if ChangeRefFrame is true, then p%RotStates is also set to true because the states are in the rotating frame; second, the Jacobian is now rotated by the difference between the root mesh current orientation and BeamDyn's root reference orientation. These orientations will be the same after UpdateStates, but the correction is still applied in case the Jacobian routines are called with a different root mesh orientation. --- modules/beamdyn/src/BeamDyn.f90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index 7a599f650c..e878877ab5 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -932,6 +932,7 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) p%RotStates = InputFileData%RotStates ! Rotate states in linearization? + if (ChangeRefFrame) p%RotStates = .true. p%RelStates = InputFileData%RelStates ! Define states relative to root motion in linearization? p%rhoinf = InputFileData%rhoinf ! Numerical damping coefficient: [0,1]. No numerical damping if rhoinf = 1; maximum numerical damping if rhoinf = 0. @@ -6025,7 +6026,8 @@ SUBROUTINE BD_JacobianPInput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrM end if if (p%RotStates) then - RotateStates = matmul( u%RootMotion%Orientation(:,:,1), transpose( u%RootMotion%RefOrientation(:,:,1) ) ) + ! Calculate difference between input root orientation and root reference orientation + RotateStates = matmul( u%RootMotion%Orientation(:,:,1), OtherState%GlbRot ) do i=1,size(dXdu,1),3 dXdu(i:i+2, :) = matmul( RotateStates, dXdu(i:i+2, :) ) end do @@ -6121,7 +6123,8 @@ SUBROUTINE BD_JacobianPContState( t, u, p, x, xd, z, OtherState, y, m, ErrStat, call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) if (p%RotStates) then - RotateStates = matmul( u%RootMotion%Orientation(:,:,1), transpose( u%RootMotion%RefOrientation(:,:,1) ) ) + ! Calculate difference between input root orientation and root reference orientation + RotateStates = matmul( u%RootMotion%Orientation(:,:,1), OtherState%GlbRot ) RotateStatesTranspose = transpose( RotateStates ) if ( present(StateRotation) ) then From a37aaaf6e7f837bf90e71fe756552e345602a276 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Fri, 1 Mar 2024 18:53:34 +0000 Subject: [PATCH 023/190] Update r-test pointer to revisions to 5MW_Land_BD_Linear and 5MW_Land_BD_Linear_Aero due to fixing this bug --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 6c4df34a19..6c98227095 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 6c4df34a19ceaeecc901e886aa56c27bbf914285 +Subproject commit 6c982270954a76db75a3edb6fc6400aca4f03103 From 6dac6a0c67823215aa5e30219186599989a25425 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Fri, 1 Mar 2024 19:15:33 +0000 Subject: [PATCH 024/190] Updated r-test pointer with new baseline for 5MW_Land_BD_Linear run at 1 second --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 6c98227095..f5219cdd25 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 6c982270954a76db75a3edb6fc6400aca4f03103 +Subproject commit f5219cdd25b3b14e1a8dc58b41d7316e88a7a6bd From c6f9788b75bb8507b20a219912e512fcf78024ce Mon Sep 17 00:00:00 2001 From: rdamiani Date: Thu, 7 Mar 2024 17:20:22 -0700 Subject: [PATCH 025/190] Handling of Paths for SrvD UserSubs Input Files @rdamiani pointed out in issue #2059 that the existing method for handling file paths with `UserSubs` is difficult as it requires putting all the user input files in the same location as the ServoDyn file. This commit is from recomendations from @rdamiani for a method he has had good success with. Co-authored-by:rdamiani --- modules/servodyn/src/ServoDyn.f90 | 14 ++++++++------ modules/servodyn/src/ServoDyn_Registry.txt | 1 + modules/servodyn/src/ServoDyn_Types.f90 | 11 +++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/modules/servodyn/src/ServoDyn.f90 b/modules/servodyn/src/ServoDyn.f90 index a5e683526f..6f48338bff 100644 --- a/modules/servodyn/src/ServoDyn.f90 +++ b/modules/servodyn/src/ServoDyn.f90 @@ -158,6 +158,8 @@ SUBROUTINE SrvD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO CALL DispNVD( SrvD_Ver ) CALL GetPath( InitInp%InputFile, PriPath ) ! Input files will be relative to the path where the primary input file is located. + p%PriPath = PriPath + !............................................................................................ ! Read the input file and validate the data ! (note p%NumBl and p%RootName must be set first!) @@ -5241,7 +5243,7 @@ SUBROUTINE CalculateStandardYaw(t, u, p, m, YawPosCom, YawRateCom, YawPosComInt, CASE ( ControlMode_USER ) ! User-defined from routine UserYawCont(). - CALL UserYawCont ( u%Yaw, u%YawRate, u%WindDir, u%YawErr, p%NumBl, t, p%DT, p%RootName, YawPosCom, YawRateCom ) + CALL UserYawCont ( u%Yaw, u%YawRate, u%WindDir, u%YawErr, p%NumBl, t, p%DT, p%PriPath, YawPosCom, YawRateCom ) CASE ( ControlMode_EXTERN ) ! User-defined from Simulink or LabVIEW @@ -5380,7 +5382,7 @@ SUBROUTINE Pitch_CalcOutput( t, u, p, x, xd, z, OtherState, BlPitchCom, ElecPwr, CASE ( ControlMode_USER ) ! User-defined from routine PitchCntrl(). - CALL PitchCntrl ( u%BlPitch, ElecPwr, u%LSS_Spd, u%TwrAccel, p%NumBl, t, p%DT, p%RootName, BlPitchCom ) + CALL PitchCntrl ( u%BlPitch, ElecPwr, u%LSS_Spd, u%TwrAccel, p%NumBl, t, p%DT, p%PriPath, BlPitchCom ) CASE ( ControlMode_EXTERN ) ! User-defined from Simulink or LabVIEW. @@ -5733,7 +5735,7 @@ SUBROUTINE Torque_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrM CASE ( ControlMode_USER ) ! User-defined HSS brake model. - CALL UserHSSBr ( y%GenTrq, y%ElecPwr, u%HSS_Spd, p%NumBl, t, p%DT, p%RootName, HSSBrFrac ) + CALL UserHSSBr ( y%GenTrq, y%ElecPwr, u%HSS_Spd, p%NumBl, t, p%DT, p%PriPath, HSSBrFrac ) IF ( ( HSSBrFrac < 0.0_ReKi ) .OR. ( HSSBrFrac > 1.0_ReKi ) ) THEN ! 0 (off) <= HSSBrFrac <= 1 (full); else Abort. ErrStat = ErrID_Fatal @@ -5938,8 +5940,8 @@ SUBROUTINE CalculateTorque( t, u, p, m, GenTrq, ElecPwr, ErrStat, ErrMsg ) CASE ( ControlMode_USER ) ! User-defined generator model. - ! CALL UserGen ( u%HSS_Spd, u%LSS_Spd, p%NumBl, t, DT, p%GenEff, DelGenTrq, DirRoot, GenTrq, ElecPwr ) - CALL UserGen ( u%HSS_Spd, u%LSS_Spd, p%NumBl, t, p%DT, p%GenEff, 0.0_ReKi, p%RootName, GenTrq, ElecPwr ) + CALL UserGen ( u%HSS_Spd, u%LSS_Spd, p%NumBl, t, p%DT, p%GenEff, 0.0_ReKi, p%PriPath, GenTrq, ElecPwr ) + END SELECT @@ -5974,7 +5976,7 @@ SUBROUTINE CalculateTorque( t, u, p, m, GenTrq, ElecPwr, ErrStat, ErrMsg ) CASE ( ControlMode_USER ) ! User-defined variable-speed control for routine UserVSCont(). - CALL UserVSCont ( u%HSS_Spd, u%LSS_Spd, p%NumBl, t, p%DT, p%GenEff, 0.0_ReKi, p%RootName, GenTrq, ElecPwr ) + CALL UserVSCont ( u%HSS_Spd, u%LSS_Spd, p%NumBl, t, p%DT, p%GenEff, 0.0_ReKi, p%PriPath, GenTrq, ElecPwr ) CASE ( ControlMode_DLL ) ! User-defined variable-speed control from Bladed-style DLL diff --git a/modules/servodyn/src/ServoDyn_Registry.txt b/modules/servodyn/src/ServoDyn_Registry.txt index 4f3ab877c7..26503b348c 100644 --- a/modules/servodyn/src/ServoDyn_Registry.txt +++ b/modules/servodyn/src/ServoDyn_Registry.txt @@ -439,6 +439,7 @@ typedef ^ ParameterType IntKi StCCmode - - - "Structural control control mode {0 typedef ^ ParameterType IntKi NumOuts - - - "Number of parameters in the output list (number of outputs requested)" - typedef ^ ParameterType IntKi NumOuts_DLL - - - "Number of logging channels output from the DLL (set at initialization)" - typedef ^ ParameterType CHARACTER(1024) RootName - - - "RootName for writing output files" - +typedef ^ ParameterType CHARACTER(1024) PriPath - - - "Path of the primary SD input file " - typedef ^ ParameterType OutParmType OutParam {:} - - "Names and units (and other characteristics) of all requested output parameters" - typedef ^ ParameterType CHARACTER(1) Delim - - - "Column delimiter for output text files" - # parameters for Bladed Interface (dynamic-link library) diff --git a/modules/servodyn/src/ServoDyn_Types.f90 b/modules/servodyn/src/ServoDyn_Types.f90 index 71219287fe..7f3394dc15 100644 --- a/modules/servodyn/src/ServoDyn_Types.f90 +++ b/modules/servodyn/src/ServoDyn_Types.f90 @@ -450,6 +450,7 @@ MODULE ServoDyn_Types INTEGER(IntKi) :: NumOuts !< Number of parameters in the output list (number of outputs requested) [-] INTEGER(IntKi) :: NumOuts_DLL !< Number of logging channels output from the DLL (set at initialization) [-] CHARACTER(1024) :: RootName !< RootName for writing output files [-] + CHARACTER(1024) :: PriPath !< Path of the primary SD input file [-] TYPE(OutParmType) , DIMENSION(:), ALLOCATABLE :: OutParam !< Names and units (and other characteristics) of all requested output parameters [-] CHARACTER(1) :: Delim !< Column delimiter for output text files [-] LOGICAL :: UseBladedInterface !< Flag that determines if BladedInterface was used [-] @@ -12645,6 +12646,7 @@ SUBROUTINE SrvD_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg DstParamData%NumOuts = SrcParamData%NumOuts DstParamData%NumOuts_DLL = SrcParamData%NumOuts_DLL DstParamData%RootName = SrcParamData%RootName + DstParamData%PriPath = SrcParamData%PriPath IF (ALLOCATED(SrcParamData%OutParam)) THEN i1_l = LBOUND(SrcParamData%OutParam,1) i1_u = UBOUND(SrcParamData%OutParam,1) @@ -13247,6 +13249,7 @@ SUBROUTINE SrvD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Int_BufSz = Int_BufSz + 1 ! NumOuts Int_BufSz = Int_BufSz + 1 ! NumOuts_DLL Int_BufSz = Int_BufSz + 1*LEN(InData%RootName) ! RootName + Int_BufSz = Int_BufSz + 1*LEN(InData%PriPath) ! PriPath Int_BufSz = Int_BufSz + 1 ! OutParam allocated yes/no IF ( ALLOCATED(InData%OutParam) ) THEN Int_BufSz = Int_BufSz + 2*1 ! OutParam upper/lower bounds for each dimension @@ -13733,6 +13736,10 @@ SUBROUTINE SrvD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, IntKiBuf(Int_Xferred) = ICHAR(InData%RootName(I:I), IntKi) Int_Xferred = Int_Xferred + 1 END DO ! I + DO I = 1, LEN(InData%PriPath) + IntKiBuf(Int_Xferred) = ICHAR(InData%PriPath(I:I), IntKi) + Int_Xferred = Int_Xferred + 1 + END DO ! I IF ( .NOT. ALLOCATED(InData%OutParam) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -14621,6 +14628,10 @@ SUBROUTINE SrvD_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMs OutData%RootName(I:I) = CHAR(IntKiBuf(Int_Xferred)) Int_Xferred = Int_Xferred + 1 END DO ! I + DO I = 1, LEN(OutData%PriPath) + OutData%PriPath(I:I) = CHAR(IntKiBuf(Int_Xferred)) + Int_Xferred = Int_Xferred + 1 + END DO ! I IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! OutParam not allocated Int_Xferred = Int_Xferred + 1 ELSE From 334c70270b4c5ffd2cc59085422507421b2408f9 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 11 Mar 2024 14:06:13 +0000 Subject: [PATCH 026/190] Revert " Resolve BeamDyn initial strain for rotated blade" This reverts commit ab42564949f43d9224827b4fc88adbfb47d5eb10. --- modules/beamdyn/src/BeamDyn.f90 | 215 ++++++++++-------- modules/beamdyn/src/BeamDyn_Types.f90 | 146 ++++++------ modules/beamdyn/src/Registry_BeamDyn.txt | 4 +- .../tests/test_BD_QuadraturePointData.F90 | 52 +++-- modules/beamdyn/tests/test_tools.F90 | 2 +- 5 files changed, 230 insertions(+), 189 deletions(-) diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index e878877ab5..32ecaff571 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -153,7 +153,7 @@ SUBROUTINE BD_Init( InitInp, u, p, x, xd, z, OtherState, y, MiscVar, Interval, I ! set mass and stiffness matrices: p%Stif0_QP and p%Mass0_QP call InitializeMassStiffnessMatrices(InputFileData, p, ErrStat2,ErrMsg2); if (Failed()) return - ! Set the initial displacements: p%uu0, p%E10 + ! Set the initial displacements: p%uu0, p%rrN0, p%E10 CALL BD_QuadraturePointDataAt0(p) @@ -164,9 +164,29 @@ SUBROUTINE BD_Init( InitInp, u, p, x, xd, z, OtherState, y, MiscVar, Interval, I ! Actuator + p%UsePitchAct = InputFileData%UsePitchAct if (p%UsePitchAct) then + p%pitchK = InputFileData%pitchK + p%pitchC = InputFileData%pitchC + p%pitchJ = InputFileData%pitchJ + + ! calculate (I-hA)^-1 + + p%torqM(1,1) = p%pitchJ + p%pitchC*p%dt + p%torqM(2,1) = -p%pitchK * p%dt + p%torqM(1,2) = p%pitchJ * p%dt + p%torqM(2,2) = p%pitchJ + denom = p%pitchJ + p%pitchC*p%dt + p%pitchK*p%dt**2 + if (EqualRealNos(denom,0.0_BDKi)) then + call SetErrStat(ErrID_Fatal,"Cannot invert matrix for pitch actuator: J+c*dt+k*dt^2 is zero.",ErrStat,ErrMsg,RoutineName) + call Cleanup() + return + else + p%torqM(:,:) = p%torqM / denom + end if + ! Calculate the pitch angle TmpDCM(:,:) = MATMUL(u%RootMotion%Orientation(:,:,1),TRANSPOSE(u%HubMotion%Orientation(:,:,1))) temp_CRV(:) = EulerExtract(TmpDCM) @@ -594,12 +614,8 @@ subroutine InitializeNodalLocations(member_total,kp_member,kp_coordinate,p,GLL_n tangent = tangent / TwoNorm(tangent) - ! Calculate the node initial rotation CALL BD_ComputeIniNodalCrv(tangent, twist, temp_CRV, ErrStat, ErrMsg) - - ! Store rotation in node initial position vector and save node twist p%uuN0(4:6,i,elem) = temp_CRV - p%twN0(i,elem) = twist enddo @@ -736,11 +752,11 @@ SUBROUTINE BD_InitShpDerJaco( GLL_Nodes, p ) CALL BD_diffmtc(p%nodes_per_elem,GLL_nodes,p%QPtN,p%nqp,p%Shp,p%ShpDer) - ! Calculate the Jacobian relating element axial length to real coordinates DO nelem = 1,p%elem_total DO idx_qp = 1, p%nqp - DO i=1,3 - Gup0(i) = dot_product(p%ShpDer(:,idx_qp), p%uuN0(i,:,nelem)) + Gup0(:) = 0.0_BDKi + DO i=1,p%nodes_per_elem + Gup0(:) = Gup0(:) + p%ShpDer(i,idx_qp)*p%uuN0(1:3,i,nelem) ENDDO p%Jacobian(idx_qp,nelem) = TwoNorm(Gup0) ENDDO @@ -902,7 +918,6 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) integer(intKi) :: ErrStat2 ! temporary Error status character(ErrMsgLen) :: ErrMsg2 ! temporary Error message character(*), parameter :: RoutineName = 'SetParameters' - real(DbKi) :: denom @@ -973,25 +988,7 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) p%dof_elem = p%dof_node * p%nodes_per_elem p%rot_elem = (p%dof_node/2) * p%nodes_per_elem - ! Actuator - p%UsePitchAct = InputFileData%UsePitchAct - if (p%UsePitchAct) then - p%pitchK = InputFileData%pitchK - p%pitchC = InputFileData%pitchC - p%pitchJ = InputFileData%pitchJ - ! calculate (I-hA)^-1 - p%torqM(1,1) = p%pitchJ + p%pitchC*p%dt - p%torqM(2,1) = -p%pitchK * p%dt - p%torqM(1,2) = p%pitchJ * p%dt - p%torqM(2,2) = p%pitchJ - denom = p%pitchJ + p%pitchC*p%dt + p%pitchK*p%dt**2 - if (EqualRealNos(denom,0.0_BDKi)) then - call SetErrStat(ErrID_Fatal,"Cannot invert matrix for pitch actuator: J+c*dt+k*dt^2 is zero.",ErrStat,ErrMsg,RoutineName) - else - p%torqM(:,:) = p%torqM / denom - end if - end if !................................ ! allocate some parameter arrays @@ -1013,7 +1010,7 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) CALL AllocAry(p%uuN0, p%dof_node,p%nodes_per_elem, p%elem_total,'uuN0 (initial position) array',ErrStat2,ErrMsg2); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL AllocAry(p%twN0, p%nodes_per_elem, p%elem_total,'twN0 (initial twist) array',ErrStat2,ErrMsg2); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL AllocAry(p%rrN0, (p%dof_node/2),p%nodes_per_elem, p%elem_total,'p%rrN0',ErrStat2,ErrMsg2); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) CALL AllocAry(p%uu0, p%dof_node, p%nqp, p%elem_total,'p%uu0', ErrStat2,ErrMsg2); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) CALL AllocAry(p%E10, (p%dof_node/2),p%nqp, p%elem_total,'p%E10', ErrStat2,ErrMsg2); CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) @@ -2252,58 +2249,73 @@ SUBROUTINE BD_QuadraturePointDataAt0( p ) TYPE(BD_ParameterType), INTENT(INOUT) :: p !< Parameters - CHARACTER(*), PARAMETER :: RoutineName = 'BD_QuadraturePointDataAt0' - INTEGER(IntKi) :: ErrStat2 ! The error status code - CHARACTER(ErrMsgLen) :: ErrMsg2 ! The error message, if an error occurred + REAL(BDKi) :: rot0_temp(3) + REAL(BDKi) :: rotu_temp(3) + REAL(BDKi) :: rot_temp(3) + REAL(BDKi) :: R0_temp(3,3) + INTEGER(IntKi) :: nelem ! number of current element INTEGER(IntKi) :: idx_qp ! index of current quadrature point - INTEGER(IntKi) :: i - REAL(BDKi) :: twist, tan_vect(3), R0(3), u0(3) + INTEGER(IntKi) :: idx_node ! index of current GLL node + + CHARACTER(*), PARAMETER :: RoutineName = 'BD_QuadraturePointDataAt0' - ! Loop through elements - DO nelem = 1,p%elem_total - ! Loop through quadrature points - do idx_qp = 1, p%nqp + ! Initialize to zero for the summation + p%uu0(:,:,:) = 0.0_BDKi + p%rrN0(:,:,:) = 0.0_BDKi + p%E10(:,:,:) = 0.0_BDKi - ! Loop through displacement DOFs - do i = 1,3 - ! Calculate the quadrature point initial positions by using the - ! shape functions to interpolate from the node initial positions - ! Initial displacement field \n - ! \f$ \underline{u_0}\left( \xi \right) = - ! \sum_{k=1}^{p+1} h^k\left( \xi \right) \underline{\hat{u}_0}^k - ! \f$ - u0(i) = dot_product(p%Shp(:,idx_qp), p%uuN0(i,:,nelem)) + ! calculate rrN0 (Initial relative rotation array) + DO nelem = 1,p%elem_total + p%rrN0(1:3,1,nelem) = (/ 0.0_BDKi, 0.0_BDKi, 0.0_BDKi /) ! first node has no rotation relative to itself. + DO idx_node=2,p%nodes_per_elem + ! Find resulting rotation parameters R(Nr) = Ri^T(Nu(1)) R(Nu(:)) + ! where R(Nu(1))^T is the transpose rotation parameters for the root node + CALL BD_CrvCompose(p%rrN0(1:3,idx_node,nelem),p%uuN0(4:6,1,nelem),p%uuN0(4:6,idx_node,nelem),FLAG_R1TR2) ! rrN0 = node composed with root + ENDDO + ENDDO - ! Calculate \f$ x_0^\prime \f$, the derivative with respect to \f$ \hat{x} \f$-direction - ! (tangent to curve through this GLL point) - ! This uses the shape function derivative to calculate the tangent at the quadrature points - ! with respect to the element axis from the node positions. - ! Note: this is a unit vector after scaling by the Jacobian - tan_vect(i) = dot_product(p%ShpDer(:,idx_qp), p%uuN0(i,:,nelem)) / p%Jacobian(idx_qp,nelem) - end do + DO nelem = 1,p%elem_total + DO idx_qp = 1,p%nqp + !> ### Calculate the the initial displacement fields in an element + !! Initial displacement field \n + !! \f$ \underline{u_0}\left( \xi \right) = + !! \sum_{k=1}^{p+1} h^k\left( \xi \right) \underline{\hat{u}_0}^k + !! \f$ \n + !! and curvature \n + !! \f$ \underline{c_0}\left( \xi \right) = + !! \sum_{k=1}^{p+1} h^k\left( \xi \right) \underline{\hat{c}_0}^k + !! \f$ - ! Interpolate the twist to QP from the shape function and node values - twist = dot_product(p%Shp(:,idx_qp), p%twN0(:,nelem)) + ! Note that p%uu0 was set to zero prior to this routine call, so the following is the summation. - ! Calculate quadrature point initial rotation, R0 - ! The nodal rotation function is used to avoid errors that occur when - ! when interpolating the QP rotations from the node rotations. - call BD_ComputeIniNodalCrv(tan_vect, twist, R0, ErrStat2, ErrMsg2) + DO idx_node=1,p%nodes_per_elem + p%uu0(1:3,idx_qp,nelem) = p%uu0(1:3,idx_qp,nelem) + p%Shp(idx_node,idx_qp)*p%uuN0(1:3,idx_node,nelem) + p%uu0(4:6,idx_qp,nelem) = p%uu0(4:6,idx_qp,nelem) + p%Shp(idx_node,idx_qp)*p%rrN0(1:3,idx_node,nelem) + ENDDO - ! Save initial position and rotation - p%uu0(1:3,idx_qp,nelem) = u0 - p%uu0(4:6,idx_qp,nelem) = R0 - ! Save initial tangent vector for calculating strain - p%E10(1:3,idx_qp,nelem) = tan_vect + !> Add the blade root rotation parameters. That is, + !! compose the rotation parameters calculated with the shape functions with the rotation parameters + !! for the blade root. + rot0_temp(:) = p%uuN0(4:6,1,nelem) ! Rotation at root + rotu_temp(:) = p%uu0( 4:6,idx_qp,nelem) ! Rotation at current GLL point without root rotation - end do + CALL BD_CrvCompose(rot_temp,rot0_temp,rotu_temp,FLAG_R1R2) ! rot_temp = rot0_temp composed with rotu_temp + p%uu0(4:6,idx_qp,nelem) = rot_temp(:) ! Rotation parameters at current GLL point with the root orientation + + + !> Set the initial value of \f$ x_0^\prime \f$, the derivative with respect to \f$ \hat{x} \f$-direction + !! (tangent to curve through this GLL point). This is simply the + CALL BD_CrvMatrixR(p%uu0(4:6,idx_qp,nelem),R0_temp) ! returns R0_temp (the transpose of the DCM orientation matrix) + p%E10(:,idx_qp,nelem) = R0_temp(:,3) ! unit vector tangent to curve through this GLL point (derivative with respect to z in IEC coords). + ENDDO ENDDO + END SUBROUTINE BD_QuadraturePointDataAt0 @@ -2351,43 +2363,48 @@ SUBROUTINE BD_DisplacementQP( nelem, p, x, m ) TYPE(BD_ContinuousStateType), INTENT(IN ) :: x !< Continuous states at t TYPE(BD_MiscVarType), INTENT(INOUT) :: m !< misc/optimization variables - INTEGER(IntKi) :: node_start !< Node point of first node in current element - INTEGER(IntKi) :: node_end !< Node point of last node in current element - INTEGER(IntKi) :: i, idx_qp + INTEGER(IntKi) :: idx_qp !< index to the current quadrature point + INTEGER(IntKi) :: elem_start !< Node point of first node in current element + INTEGER(IntKi) :: idx_node CHARACTER(*), PARAMETER :: RoutineName = 'BD_DisplacementQP' - ! Node at start and end of element - node_start = p%node_elem_idx(nelem,1) - node_end = node_start + p%nodes_per_elem - 1 - - !> ### Calculate the the displacement fields in an element - !! Using equations (27) and (28) \n - !! \f$ \underline{u}\left( \xi \right) = - !! \sum_{i=1}^{p+1} h^i\left( \xi \right) \underline{\hat{u}}^i - !! \f$ \n - !! and \n - !! \f$ \underline{u}^\prime \left( \xi \right) = - !! \sum_{k=1}^{p+1} h^{k\prime} \left( \xi \right) \underline{\hat{u}}^i - !! \f$ - !! - !! | Variable | Value | - !! | :---------: | :------------------------------------------------------------------------- | - !! | \f$ \xi \f$ | Element natural coordinate \f$ \in [-1,1] \f$ | - !! | \f$ k \f$ | Node number of a \f$ p^\text{th} \f$ order Langrangian-interpolant | - !! | \f$ h^i \left( \xi \right ) \f$ | Component of the shape function matrix, \f$ \underline{\underline{N}} \f$ | - !! | \f$ h^{k\prime} \left( \xi \right ) \f$ | \f$ \frac{\mathrm{d}}{\mathrm{d}x_1} h^i \left( \xi \right) \f$ | - !! | \f$ \underline{\hat{u}}^i \f$ | \f$ k^\text{th} \f$ nodal value - - ! Loop through all quadrature points and displacement DOFs - ! dot_product appears to be more exact that matmul - forall (idx_qp = 1:p%nqp, i = 1:3) - m%qp%uuu(i,idx_qp,nelem) = dot_product(p%Shp(:,idx_qp), x%q(i,node_start:node_end)) - m%qp%uup(i,idx_qp,nelem) = dot_product(p%ShpDer(:,idx_qp), x%q(i,node_start:node_end)) / p%Jacobian(idx_qp,nelem) - end forall - - !> Calculate \f$ \underline{E}_1 = x_0^\prime + u^\prime \f$ (equation 23). Note E_1 is along the z direction. - m%qp%E1(1:3,:,nelem) = p%E10(1:3,:,nelem) + m%qp%uup(1:3,:,nelem) + DO idx_qp=1,p%nqp + ! Node point before start of this element + elem_start = p%node_elem_idx( nelem,1 ) + + + !> ### Calculate the the displacement fields in an element + !! Using equations (27) and (28) \n + !! \f$ \underline{u}\left( \xi \right) = + !! \sum_{i=1}^{p+1} h^i\left( \xi \right) \underline{\hat{u}}^i + !! \f$ \n + !! and \n + !! \f$ \underline{u}^\prime \left( \xi \right) = + !! \sum_{k=1}^{p+1} h^{k\prime} \left( \xi \right) \underline{\hat{u}}^i + !! \f$ + !! + !! | Variable | Value | + !! | :---------: | :------------------------------------------------------------------------- | + !! | \f$ \xi \f$ | Element natural coordinate \f$ \in [-1,1] \f$ | + !! | \f$ k \f$ | Node number of a \f$ p^\text{th} \f$ order Langrangian-interpolant | + !! | \f$ h^i \left( \xi \right ) \f$ | Component of the shape function matrix, \f$ \underline{\underline{N}} \f$ | + !! | \f$ h^{k\prime} \left( \xi \right ) \f$ | \f$ \frac{\mathrm{d}}{\mathrm{d}x_1} h^i \left( \xi \right) \f$ | + !! | \f$ \underline{\hat{u}}^i \f$ | \f$ k^\text{th} \f$ nodal value | + + ! Initialize values for summation + m%qp%uuu(:,idx_qp,nelem) = 0.0_BDKi ! displacement field \f$ \underline{u} \left( \xi \right) \f$ + m%qp%uup(:,idx_qp,nelem) = 0.0_BDKi ! displacement field \f$ \underline{u}^\prime \left( \xi \right) \f$ + + DO idx_node=1,p%nodes_per_elem + m%qp%uuu(1:3,idx_qp,nelem) = m%qp%uuu(1:3,idx_qp,nelem) + p%Shp(idx_node,idx_qp) *x%q(1:3,elem_start - 1 + idx_node) + m%qp%uup(1:3,idx_qp,nelem) = m%qp%uup(1:3,idx_qp,nelem) + p%ShpDer(idx_node,idx_qp)/p%Jacobian(idx_qp,nelem)*x%q(1:3,elem_start - 1 + idx_node) + ENDDO + + !> Calculate \f$ \underline{E}_1 = x_0^\prime + u^\prime \f$ (equation 23). Note E_1 is along the z direction. + m%qp%E1(1:3,idx_qp,nelem) = p%E10(1:3,idx_qp,nelem) + m%qp%uup(1:3,idx_qp,nelem) + + ENDDO END SUBROUTINE BD_DisplacementQP diff --git a/modules/beamdyn/src/BeamDyn_Types.f90 b/modules/beamdyn/src/BeamDyn_Types.f90 index 8635660ef4..91df93f3ef 100644 --- a/modules/beamdyn/src/BeamDyn_Types.f90 +++ b/modules/beamdyn/src/BeamDyn_Types.f90 @@ -163,8 +163,7 @@ MODULE BeamDyn_Types REAL(DbKi) :: dt !< module dt [s] REAL(DbKi) , DIMENSION(1:9) :: coef !< GA2 Coefficient [-] REAL(DbKi) :: rhoinf !< Numerical Damping Coefficient for GA2 [-] - REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: uuN0 !< Initial Position Vector of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element) [-] - REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: twN0 !< Initial Twist of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element) [-] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: uuN0 !< Initial Postion Vector of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element) [-] REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: Stif0_QP !< Sectional Stiffness Properties at quadrature points (6x6xqp) [-] REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: Mass0_QP !< Sectional Mass Properties at quadrature points (6x6xqp) [-] REAL(R8Ki) , DIMENSION(1:3) :: gravity !< Gravitational acceleration -- intertial frame!!! [m/s^2] @@ -182,6 +181,7 @@ MODULE BeamDyn_Types REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: ShpDer !< Derivative of shape function matrix (index 1 = FE nodes; index 2=quadrature points) [-] REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: Jacobian !< Jacobian value at each quadrature point [-] REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: uu0 !< Initial Disp/Rot value at quadrature point (at T=0) [-] + REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: rrN0 !< Initial relative rotation array, relative to root (at T=0) (index 1=rot DOF; index 2=FE nodes; index 3=element) [-] REAL(R8Ki) , DIMENSION(:,:,:), ALLOCATABLE :: E10 !< Initial E10 at quadrature point [-] INTEGER(IntKi) :: nodes_per_elem !< Finite element (GLL) nodes per element [-] INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: node_elem_idx !< Index to first and last nodes of element in p%node_total sized arrays [-] @@ -3735,20 +3735,6 @@ SUBROUTINE BD_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%uuN0 = SrcParamData%uuN0 ENDIF -IF (ALLOCATED(SrcParamData%twN0)) THEN - i1_l = LBOUND(SrcParamData%twN0,1) - i1_u = UBOUND(SrcParamData%twN0,1) - i2_l = LBOUND(SrcParamData%twN0,2) - i2_u = UBOUND(SrcParamData%twN0,2) - IF (.NOT. ALLOCATED(DstParamData%twN0)) THEN - ALLOCATE(DstParamData%twN0(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%twN0.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%twN0 = SrcParamData%twN0 -ENDIF IF (ALLOCATED(SrcParamData%Stif0_QP)) THEN i1_l = LBOUND(SrcParamData%Stif0_QP,1) i1_u = UBOUND(SrcParamData%Stif0_QP,1) @@ -3894,6 +3880,22 @@ SUBROUTINE BD_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%uu0 = SrcParamData%uu0 ENDIF +IF (ALLOCATED(SrcParamData%rrN0)) THEN + i1_l = LBOUND(SrcParamData%rrN0,1) + i1_u = UBOUND(SrcParamData%rrN0,1) + i2_l = LBOUND(SrcParamData%rrN0,2) + i2_u = UBOUND(SrcParamData%rrN0,2) + i3_l = LBOUND(SrcParamData%rrN0,3) + i3_u = UBOUND(SrcParamData%rrN0,3) + IF (.NOT. ALLOCATED(DstParamData%rrN0)) THEN + ALLOCATE(DstParamData%rrN0(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%rrN0.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstParamData%rrN0 = SrcParamData%rrN0 +ENDIF IF (ALLOCATED(SrcParamData%E10)) THEN i1_l = LBOUND(SrcParamData%E10,1) i1_u = UBOUND(SrcParamData%E10,1) @@ -4195,9 +4197,6 @@ SUBROUTINE BD_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%uuN0)) THEN DEALLOCATE(ParamData%uuN0) ENDIF -IF (ALLOCATED(ParamData%twN0)) THEN - DEALLOCATE(ParamData%twN0) -ENDIF IF (ALLOCATED(ParamData%Stif0_QP)) THEN DEALLOCATE(ParamData%Stif0_QP) ENDIF @@ -4228,6 +4227,9 @@ SUBROUTINE BD_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%uu0)) THEN DEALLOCATE(ParamData%uu0) ENDIF +IF (ALLOCATED(ParamData%rrN0)) THEN + DEALLOCATE(ParamData%rrN0) +ENDIF IF (ALLOCATED(ParamData%E10)) THEN DEALLOCATE(ParamData%E10) ENDIF @@ -4331,11 +4333,6 @@ SUBROUTINE BD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*3 ! uuN0 upper/lower bounds for each dimension Db_BufSz = Db_BufSz + SIZE(InData%uuN0) ! uuN0 END IF - Int_BufSz = Int_BufSz + 1 ! twN0 allocated yes/no - IF ( ALLOCATED(InData%twN0) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! twN0 upper/lower bounds for each dimension - Db_BufSz = Db_BufSz + SIZE(InData%twN0) ! twN0 - END IF Int_BufSz = Int_BufSz + 1 ! Stif0_QP allocated yes/no IF ( ALLOCATED(InData%Stif0_QP) ) THEN Int_BufSz = Int_BufSz + 2*3 ! Stif0_QP upper/lower bounds for each dimension @@ -4393,6 +4390,11 @@ SUBROUTINE BD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*3 ! uu0 upper/lower bounds for each dimension Db_BufSz = Db_BufSz + SIZE(InData%uu0) ! uu0 END IF + Int_BufSz = Int_BufSz + 1 ! rrN0 allocated yes/no + IF ( ALLOCATED(InData%rrN0) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! rrN0 upper/lower bounds for each dimension + Db_BufSz = Db_BufSz + SIZE(InData%rrN0) ! rrN0 + END IF Int_BufSz = Int_BufSz + 1 ! E10 allocated yes/no IF ( ALLOCATED(InData%E10) ) THEN Int_BufSz = Int_BufSz + 2*3 ! E10 upper/lower bounds for each dimension @@ -4625,26 +4627,6 @@ SUBROUTINE BD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%twN0) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%twN0,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%twN0,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%twN0,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%twN0,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%twN0,2), UBOUND(InData%twN0,2) - DO i1 = LBOUND(InData%twN0,1), UBOUND(InData%twN0,1) - DbKiBuf(Db_Xferred) = InData%twN0(i1,i2) - Db_Xferred = Db_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%Stif0_QP) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -4864,6 +4846,31 @@ SUBROUTINE BD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF + IF ( .NOT. ALLOCATED(InData%rrN0) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%rrN0,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%rrN0,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%rrN0,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%rrN0,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%rrN0,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%rrN0,3) + Int_Xferred = Int_Xferred + 2 + + DO i3 = LBOUND(InData%rrN0,3), UBOUND(InData%rrN0,3) + DO i2 = LBOUND(InData%rrN0,2), UBOUND(InData%rrN0,2) + DO i1 = LBOUND(InData%rrN0,1), UBOUND(InData%rrN0,1) + DbKiBuf(Db_Xferred) = InData%rrN0(i1,i2,i3) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF IF ( .NOT. ALLOCATED(InData%E10) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -5425,29 +5432,6 @@ SUBROUTINE BD_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! twN0 not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%twN0)) DEALLOCATE(OutData%twN0) - ALLOCATE(OutData%twN0(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%twN0.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%twN0,2), UBOUND(OutData%twN0,2) - DO i1 = LBOUND(OutData%twN0,1), UBOUND(OutData%twN0,1) - OutData%twN0(i1,i2) = REAL(DbKiBuf(Db_Xferred), R8Ki) - Db_Xferred = Db_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! Stif0_QP not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -5707,6 +5691,34 @@ SUBROUTINE BD_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! rrN0 not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i3_l = IntKiBuf( Int_Xferred ) + i3_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%rrN0)) DEALLOCATE(OutData%rrN0) + ALLOCATE(OutData%rrN0(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%rrN0.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i3 = LBOUND(OutData%rrN0,3), UBOUND(OutData%rrN0,3) + DO i2 = LBOUND(OutData%rrN0,2), UBOUND(OutData%rrN0,2) + DO i1 = LBOUND(OutData%rrN0,1), UBOUND(OutData%rrN0,1) + OutData%rrN0(i1,i2,i3) = REAL(DbKiBuf(Db_Xferred), R8Ki) + Db_Xferred = Db_Xferred + 1 + END DO + END DO + END DO + END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! E10 not allocated Int_Xferred = Int_Xferred + 1 ELSE diff --git a/modules/beamdyn/src/Registry_BeamDyn.txt b/modules/beamdyn/src/Registry_BeamDyn.txt index 68f761400c..b4b97fef24 100644 --- a/modules/beamdyn/src/Registry_BeamDyn.txt +++ b/modules/beamdyn/src/Registry_BeamDyn.txt @@ -171,8 +171,7 @@ typedef ^ ParameterType DbKi coef {9} - - typedef ^ ParameterType DbKi rhoinf - - - "Numerical Damping Coefficient for GA2" #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #the following are BDKi = R8Ki -typedef ^ ParameterType R8Ki uuN0 {:}{:}{:} - - "Initial Position Vector of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element)" - -typedef ^ ParameterType ^ twN0 {:}{:} - - "Initial Twist of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element)" - +typedef ^ ParameterType R8Ki uuN0 {:}{:}{:} - - "Initial Postion Vector of GLL (FE) nodes (index 1=DOF; index 2=FE nodes; index 3=element)" - typedef ^ ParameterType ^ Stif0_QP {:}{:}{:} - - "Sectional Stiffness Properties at quadrature points (6x6xqp)" - typedef ^ ParameterType ^ Mass0_QP {:}{:}{:} - - "Sectional Mass Properties at quadrature points (6x6xqp)" - typedef ^ ParameterType ^ gravity {3} - - "Gravitational acceleration -- intertial frame!!!" m/s^2 @@ -190,6 +189,7 @@ typedef ^ ParameterType ^ Shp {:}{:} - - typedef ^ ParameterType ^ ShpDer {:}{:} - - "Derivative of shape function matrix (index 1 = FE nodes; index 2=quadrature points)" - typedef ^ ParameterType ^ Jacobian {:}{:} - - "Jacobian value at each quadrature point" - typedef ^ ParameterType ^ uu0 {:}{:}{:} - - "Initial Disp/Rot value at quadrature point (at T=0)" - +typedef ^ ParameterType ^ rrN0 {:}{:}{:} - - "Initial relative rotation array, relative to root (at T=0) (index 1=rot DOF; index 2=FE nodes; index 3=element)" - typedef ^ ParameterType ^ E10 {:}{:}{:} - - "Initial E10 at quadrature point" - #end of BDKi-type variables #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/modules/beamdyn/tests/test_BD_QuadraturePointData.F90 b/modules/beamdyn/tests/test_BD_QuadraturePointData.F90 index 6101e47b92..fcf4f75a4f 100644 --- a/modules/beamdyn/tests/test_BD_QuadraturePointData.F90 +++ b/modules/beamdyn/tests/test_BD_QuadraturePointData.F90 @@ -27,6 +27,7 @@ module test_BD_QuadraturePointData real(BDKi), allocatable :: gll_nodes(:) real(BDKi), allocatable :: baseline_uu0(:,:,:) + real(BDKi), allocatable :: baseline_rrN0(:,:,:) real(BDKi), allocatable :: baseline_E10(:,:,:) real(BDKi), allocatable :: baseline_uuu(:,:,:) @@ -90,6 +91,7 @@ subroutine test_BD_QuadraturePointData_5node() call AllocAry(baseline_uu0 , p%dof_node, p%nqp, p%elem_total, 'baseline_uu0' , ErrStat, ErrMsg) call AllocAry(baseline_E10 , p%dof_node/2, p%nqp, p%elem_total, 'baseline_E10' , ErrStat, ErrMsg) + call AllocAry(baseline_rrN0 , p%dof_node/2, p%nodes_per_elem, p%elem_total, 'baseline_rrN0' , ErrStat, ErrMsg) call AllocAry(baseline_uuu , p%dof_node, p%nqp, p%elem_total, 'baseline_uuu' , ErrStat, ErrMsg) call AllocAry(baseline_uup , p%dof_node/2, p%nqp, p%elem_total, 'baseline_uup' , ErrStat, ErrMsg) @@ -102,10 +104,6 @@ subroutine test_BD_QuadraturePointData_5node() call AllocAry(baseline_Stif , 6, 6, p%nqp, p%elem_total, 'baseline_Stif' , ErrStat, ErrMsg) - ! Allocate memory for GLL node positions in 1D parametric space - call AllocAry(gll_nodes, nodes_per_elem, "GLL points array", ErrStat, ErrMsg) - gll_nodes = (/ -1., -0.6546536707079771, 0., 0.6546536707079771, 1. /) - ! assign baseline results ! uuN0 is of dimension (6 dof, nodes_per_elem, elem_total) @@ -125,19 +123,27 @@ subroutine test_BD_QuadraturePointData_5node() p%uuN0(1:3,5,1) = (/ -1., 1., 5. /) p%uuN0(4:6,5,1) = (/ -1.0730193445455083,-0.42803085368057275,1.292451050059679 /) + + ! the following is uuN0(4:6) with rotation of first node removed + baseline_rrN0(1:3,1,1) = (/ 0., 0., 0. /) + baseline_rrN0(1:3,2,1) = (/ -0.18695562365337798,-0.0032641497706398077,0.048935661676787534 /) + baseline_rrN0(1:3,3,1) = (/ -0.6080640291857297,-0.08595023366039768,0.4027112581652146 /) + baseline_rrN0(1:3,4,1) = (/ -1.1980591841054526,-0.3478409509012645,0.9658032687192992 /) + baseline_rrN0(1:3,5,1) = (/ -1.5856082606694464,-0.3853274394272689,1.3714709059387975 /) + ! We are just looking at one randomly selected point in the domain to test interpolation; can be expanded p%QptN(1) = 0.3 - ! Twist at nodes (nodes_per_elem, elem_total) - p%twN0(:,1) = 90.0*((gll_nodes+1)/2)**2 - ! Input baseline/reference quantities; uu0 and E10 are only for at quadrature points, so just 1 point here ! uu0 is reference line evaluated at quadrature point ! E10 is tangent evaluated at qudrature point baseline_uu0(1:3,1,1) = (/ 0.29298750000000007,-0.03250000000000007,3.2499999999999996 /) - baseline_uu0(4:6,1,1) = (/ -0.42032456079463276,-0.10798264336200536,0.61929246125947701 /) - baseline_E10(1:3,1,1) = (/ -0.21838554154630824,0.34664371674017153,0.91222030721097547 /) - + baseline_uu0(4:6,1,1) = (/ -0.419497643454797,-0.1153574679103733,0.610107968645409 /) + baseline_E10(1:3,1,1) = (/ -0.22332806017852783,0.3449485111415417,0.9116661133321399 /) + + ! Allocate memory for GLL node positions in 1D parametric space + call AllocAry(gll_nodes, nodes_per_elem, "GLL points array", ErrStat, ErrMsg) + gll_nodes = (/ -1., -0.6546536707079771, 0., 0.6546536707079771, 1. /) ! Build the shape functions and derivative of shape functions evaluated at QP points; this is tested elsewhere call BD_InitShpDerJaco(gll_nodes, p) @@ -145,6 +151,9 @@ subroutine test_BD_QuadraturePointData_5node() ! **** primary function being tested ***** call BD_QuadraturePointDataAt0( p ) + testname = "5 node, 1 element, 1 qp, curved: BD_DisplacementQPAt0: rrN0" + @assertEqual(baseline_rrN0(:,:,1), p%rrN0(:,:,1), tolerance, testname) + ! Test uu0; only one quadrature point for now testname = "5 node, 1 element, 1 qp, curved: BD_DisplacementQPAt0: uu0" do idx_qp = 1, p%nqp @@ -183,7 +192,7 @@ subroutine test_BD_QuadraturePointData_5node() baseline_uuu(1:3,idx_qp,nelem) = (/ 0.42250000000000015,-0.14787500000000003,0.4774250000000001 /) baseline_uuu(4:6,idx_qp,nelem) = (/ 0.042250000000000024,0.1300000000000001,0.02746250000000002 /) baseline_uup(1:3,idx_qp,nelem) = (/ 0.23717727987485349,-0.005929431996871376,0.2834268494504499 /) - baseline_E1(1:3, idx_qp,nelem) = (/ 0.018791738328546054, 0.34071428474330018, 1.1956471566614264 /) + baseline_E1(1:3, idx_qp,nelem) = (/ 0.01384921969632566, 0.33901907914467033, 1.1950929627825897 /) call BD_DisplacementQP( nelem, p, x, m ) @@ -205,9 +214,9 @@ subroutine test_BD_QuadraturePointData_5node() baseline_kappa(1:3,1,1) = (/ 0.024664714695954715,0.036297077098213545,0.02229356260962948 /) - baseline_RR0(1,1:3,1,nelem) = (/0.79124185715259476, -0.60219094249350502, -0.1063127098163618/) - baseline_RR0(2,1:3,1,nelem) = (/0.60261503127580685, 0.7383322551011402, 0.30285409879630898/) - baseline_RR0(3,1:3,1,nelem) = (/-0.10388189240754285, -0.30369647652886939, 0.94708869836662024/) + baseline_RR0(1,1:3,1,nelem) = (/0.7967507798136657,-0.5939809735620473,-0.11124206898740374/) + baseline_RR0(2,1:3,1,nelem) = (/0.5966254150993577,0.7439195402109748,0.3010346022466711 /) + baseline_RR0(3,1:3,1,nelem) = (/-0.09605367730511442,-0.30621939967705303,0.9471026186942948 /) CALL BD_RotationalInterpQP( nelem, p, x, m ) @@ -233,12 +242,12 @@ subroutine test_BD_QuadraturePointData_5node() enddo enddo ! the following should be the result from MATMUL(tempR6,MATMUL(p%Stif0_QP(1:6,1:6,temp_id2+idx_qp),TRANSPOSE(tempR6))) - baseline_Stif(1,1:6,idx_qp,nelem) = (/4.7536759583339689, -33.907248359179356, -19.542837968671446, 2.9365509821876983, -70.008981029110458, -31.39174980281188/) - baseline_Stif(2,1:6,idx_qp,nelem) = (/-19.401250769011185, 138.38617399872942, 79.760485041818299, -11.984990668437774, 285.72873055166156, 128.11963106880802/) - baseline_Stif(3,1:6,idx_qp,nelem) = (/-13.830884167369799, 98.653595365050748, 56.86015004293688, -8.5439345976052863, 203.69207236173781, 91.33471846615123/) - baseline_Stif(4,1:6,idx_qp,nelem) = (/3.141919298405611, -22.410832986789217, -12.916744914371989, 1.9408992709130821, -46.272099841270119, -20.748226294907653/) - baseline_Stif(5,1:6,idx_qp,nelem) = (/-51.422828167125537, 366.79122036858701, 211.40439684348502, -31.766102251101898, 757.32124637229549, 339.57984728541373/) - baseline_Stif(6,1:6,idx_qp,nelem) = (/-24.340652516975311, 173.61817619702015, 100.06686033300799, -15.036272493606024, 358.4729576086462, 160.73785435679258/) + baseline_Stif(1,1:6,idx_qp,nelem) = (/4.5918231909187375, -33.558422946165074, -19.41124878362651, 2.60126686515566, -69.25969416961556, -31.26026770547517 /) + baseline_Stif(2,1:6,idx_qp,nelem) = (/-18.923545538732206, 138.2989541247406, 79.99647091096304, -10.720184539884109, 285.4288856786646, 128.8279349796045 /) + baseline_Stif(3,1:6,idx_qp,nelem) = (/ -13.509458152867301, 98.7311774904666, 57.109222684340786, -7.65310518243836, 203.76676129761876, 91.96984745617996 /) + baseline_Stif(4,1:6,idx_qp,nelem) = (/ 2.852586665816869, -20.847560074045475, -12.058885358769254, 1.6159897420374438, -43.026325677681456, -19.419872917332995 /) + baseline_Stif(5,1:6,idx_qp,nelem) = (/-50.11731488891121, 366.27238899233606, 211.8634858589486, -28.39144827024861, 755.9328304872744, 341.18924335009 /) + baseline_Stif(6,1:6,idx_qp,nelem) = (/-23.86246662028767, 174.39407269994138, 100.87502434184734, -13.518082286573822, 359.9239499295936, 162.45117977068867 /) CALL BD_StifAtDeformedQP( nelem, p, m ) @@ -251,6 +260,9 @@ subroutine test_BD_QuadraturePointData_5node() if (allocated(gll_nodes)) deallocate(gll_nodes) if (allocated(baseline_uu0)) deallocate(baseline_uu0) if (allocated(baseline_E10)) deallocate(baseline_E10) + if (allocated(baseline_rrN0)) deallocate(baseline_rrN0) + if (allocated(baseline_rrN0)) deallocate(baseline_rrN0) + if (allocated(baseline_E10)) deallocate(baseline_E10) if (allocated(baseline_uuu)) deallocate(baseline_uuu) if (allocated(baseline_uup)) deallocate(baseline_uup) if (allocated(baseline_E1)) deallocate(baseline_E1) diff --git a/modules/beamdyn/tests/test_tools.F90 b/modules/beamdyn/tests/test_tools.F90 index b936d3bffa..1f64ec584e 100644 --- a/modules/beamdyn/tests/test_tools.F90 +++ b/modules/beamdyn/tests/test_tools.F90 @@ -132,10 +132,10 @@ type(BD_ParameterType) function simpleParameterType(elem_total, nodes_per_elem, call AllocAry(p%QPtw_ShpDer, p%nqp, p%nodes_per_elem, 'QPtw_ShpDer', ErrStat, ErrMsg) call AllocAry(p%Jacobian, p%nqp, p%elem_total, 'Jacobian', ErrStat, ErrMsg) call AllocAry(p%uuN0, p%dof_node, p%nodes_per_elem, p%elem_total,'uuN0', ErrStat, ErrMsg) - call AllocAry(p%twN0, p%nodes_per_elem, p%elem_total,'twN0', ErrStat, ErrMsg) call AllocAry(p%uu0, p%dof_node, p%nqp, p%elem_total,'uu0', ErrStat, ErrMsg) call AllocAry(p%E10, p%dof_node/2, p%nqp, p%elem_total,'E10', ErrStat, ErrMsg) + call AllocAry(p%rrN0, p%dof_node/2, p%nodes_per_elem, p%elem_total,'rrN0', ErrStat, ErrMsg) CALL AllocAry(p%node_elem_idx,p%elem_total,2,'start and end node numbers of elements in p%node_total sized arrays',ErrStat,ErrMsg) From f588ef55b1daca2bf7b77b3472a96b6e4ddea3c3 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 11 Mar 2024 14:51:56 +0000 Subject: [PATCH 027/190] Disable changing the reference frame --- modules/beamdyn/src/BeamDyn.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index 32ecaff571..1082fef8f5 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -59,7 +59,7 @@ MODULE BeamDyn ! follow the moving BladeRootMotion mesh. This requires changing the states after an UpdateStates call to be relative to ! the new BladeRootMotion mesh orientation and position. ! Upadate the reference frame after each State update (or use the old method)? - LOGICAL, PARAMETER :: ChangeRefFrame = .true. + LOGICAL, PARAMETER :: ChangeRefFrame = .false. CONTAINS From 9de47880226a33161cf5e24d3cbe149a97b680db Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 11 Mar 2024 16:12:50 +0000 Subject: [PATCH 028/190] Implement new initial strain fix based on OpenTurbine documentation The previous initial strain fix caused bad linearization results (and likely didn't fix the issue in the correct way). The new one replaces RR0 with R*x0' which is what OpenTurbine is using to avoid the mismatch that caused initial strain. --- modules/beamdyn/src/BeamDyn.f90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index 1082fef8f5..ec86d8fc12 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -2755,6 +2755,8 @@ subroutine Calc_Fc_Fd() REAL(BDKi) :: e1s REAL(BDKi) :: eee(6) !< intermediate array for calculation Strain and curvature terms of Fc REAL(BDKi) :: fff(6) !< intermediate array for calculation of the elastic force, Fc + REAL(BDKi) :: R(3,3) !< rotation matrix at quatrature point + REAL(BDKi) :: Rx0p(3) !< \f$ \underline{R} \underline{x}^\prime_0 \f$ !REAL(BDKi) :: Wrk(3) @@ -2768,8 +2770,10 @@ subroutine Calc_Fc_Fd() !! !! Note: \f$ \underline{\underline{R}}\underline{\underline{R}}_0 \f$ is used to go from the material basis into the inertial basis !! and the transpose for the other direction. - eee(1:3) = m%qp%E1(1:3,idx_qp,nelem) - m%qp%RR0(1:3,3,idx_qp,nelem) ! Using RR0 z direction in IEC coords - + ! eee(1:3) = m%qp%E1(1:3,idx_qp,nelem) - m%qp%RR0(1:3,3,idx_qp,nelem) ! Using RR0 z direction in IEC coords + call BD_CrvMatrixR(m%qp%uuu(4:6,idx_qp,nelem), R) ! Get rotation at QP as a matrix + Rx0p = matmul(R,p%E10(:,idx_qp,nelem)) ! Calculate rotated initial tangent + eee(1:3) = m%qp%E1(1:3,idx_qp,nelem) - Rx0p ! Use rotated initial tangent in place of RR0*i1 to eliminate likely mismatch between R0*i1 and x0' !> ### Set the 1D sectional curvature, \f$ \underline{\kappa} \f$, equation (5) !! \f$ \underline{\kappa} = \underline{k} + \underline{\underline{R}}\underline{k}_i \f$ From 7a2c43e8b7402f09f60cd764d3d394a48e4c017f Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 11 Mar 2024 12:19:29 -0600 Subject: [PATCH 029/190] SrvD: fix typo in registry from PR #2079 --- modules/servodyn/src/ServoDyn_Registry.txt | 2 +- modules/servodyn/src/ServoDyn_Types.f90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/servodyn/src/ServoDyn_Registry.txt b/modules/servodyn/src/ServoDyn_Registry.txt index 26503b348c..30013c593f 100644 --- a/modules/servodyn/src/ServoDyn_Registry.txt +++ b/modules/servodyn/src/ServoDyn_Registry.txt @@ -439,7 +439,7 @@ typedef ^ ParameterType IntKi StCCmode - - - "Structural control control mode {0 typedef ^ ParameterType IntKi NumOuts - - - "Number of parameters in the output list (number of outputs requested)" - typedef ^ ParameterType IntKi NumOuts_DLL - - - "Number of logging channels output from the DLL (set at initialization)" - typedef ^ ParameterType CHARACTER(1024) RootName - - - "RootName for writing output files" - -typedef ^ ParameterType CHARACTER(1024) PriPath - - - "Path of the primary SD input file " - +typedef ^ ParameterType CHARACTER(1024) PriPath - - - "Path of the primary SrvD input file " - typedef ^ ParameterType OutParmType OutParam {:} - - "Names and units (and other characteristics) of all requested output parameters" - typedef ^ ParameterType CHARACTER(1) Delim - - - "Column delimiter for output text files" - # parameters for Bladed Interface (dynamic-link library) diff --git a/modules/servodyn/src/ServoDyn_Types.f90 b/modules/servodyn/src/ServoDyn_Types.f90 index 7f3394dc15..e070fe77d7 100644 --- a/modules/servodyn/src/ServoDyn_Types.f90 +++ b/modules/servodyn/src/ServoDyn_Types.f90 @@ -450,7 +450,7 @@ MODULE ServoDyn_Types INTEGER(IntKi) :: NumOuts !< Number of parameters in the output list (number of outputs requested) [-] INTEGER(IntKi) :: NumOuts_DLL !< Number of logging channels output from the DLL (set at initialization) [-] CHARACTER(1024) :: RootName !< RootName for writing output files [-] - CHARACTER(1024) :: PriPath !< Path of the primary SD input file [-] + CHARACTER(1024) :: PriPath !< Path of the primary SrvD input file [-] TYPE(OutParmType) , DIMENSION(:), ALLOCATABLE :: OutParam !< Names and units (and other characteristics) of all requested output parameters [-] CHARACTER(1) :: Delim !< Column delimiter for output text files [-] LOGICAL :: UseBladedInterface !< Flag that determines if BladedInterface was used [-] From 70f32cc1e2179a7b324e3af94c6fb9cbeecb51c5 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Tue, 12 Mar 2024 18:15:01 +0000 Subject: [PATCH 030/190] Update r-test pointer for changes to 5MW_Land_BD_Linear tests --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index f5219cdd25..dbe3e57873 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit f5219cdd25b3b14e1a8dc58b41d7316e88a7a6bd +Subproject commit dbe3e578733f1e9f0378b467c654046f9a54bf83 From 37b63c02856ec7dde70fd67baa4c921a2411fc71 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Tue, 12 Mar 2024 20:03:28 +0000 Subject: [PATCH 031/190] Restore previous fix to pitch actuator logic in SetParameters This fix was unintentionally removed when reverting the initial strain fix. --- modules/beamdyn/src/BeamDyn.f90 | 45 +++++++++++++++------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index ec86d8fc12..2f8dbfd1e5 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -94,7 +94,6 @@ SUBROUTINE BD_Init( InitInp, u, p, x, xd, z, OtherState, y, MiscVar, Interval, I REAL(BDKi) :: temp_CRV(3) REAL(BDKi),ALLOCATABLE :: GLL_nodes(:) REAL(BDKi) :: TmpDCM(3,3) - REAL(BDKi) :: denom LOGICAL :: QuasiStaticInitialized !< True if quasi-static solution was found @@ -163,30 +162,8 @@ SUBROUTINE BD_Init( InitInp, u, p, x, xd, z, OtherState, y, MiscVar, Interval, I CALL BD_ComputeBladeMassNew( p, ErrStat2, ErrMsg2 ); if (Failed()) return !computes p%blade_mass,p%blade_CG,p%blade_IN - ! Actuator - p%UsePitchAct = InputFileData%UsePitchAct - if (p%UsePitchAct) then - p%pitchK = InputFileData%pitchK - p%pitchC = InputFileData%pitchC - p%pitchJ = InputFileData%pitchJ - - ! calculate (I-hA)^-1 - - p%torqM(1,1) = p%pitchJ + p%pitchC*p%dt - p%torqM(2,1) = -p%pitchK * p%dt - p%torqM(1,2) = p%pitchJ * p%dt - p%torqM(2,2) = p%pitchJ - denom = p%pitchJ + p%pitchC*p%dt + p%pitchK*p%dt**2 - if (EqualRealNos(denom,0.0_BDKi)) then - call SetErrStat(ErrID_Fatal,"Cannot invert matrix for pitch actuator: J+c*dt+k*dt^2 is zero.",ErrStat,ErrMsg,RoutineName) - call Cleanup() - return - else - p%torqM(:,:) = p%torqM / denom - end if - ! Calculate the pitch angle TmpDCM(:,:) = MATMUL(u%RootMotion%Orientation(:,:,1),TRANSPOSE(u%HubMotion%Orientation(:,:,1))) temp_CRV(:) = EulerExtract(TmpDCM) @@ -914,7 +891,7 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) INTEGER(IntKi) :: i, j ! generic counter index INTEGER(IntKi) :: indx ! counter into index array (p%NdIndx) INTEGER(IntKi) :: nUniqueQP ! number of unique quadrature points (not double-counting nodes at element boundaries) - + REAL(BDKi) :: denom integer(intKi) :: ErrStat2 ! temporary Error status character(ErrMsgLen) :: ErrMsg2 ! temporary Error message character(*), parameter :: RoutineName = 'SetParameters' @@ -1140,6 +1117,26 @@ subroutine SetParameters(InitInp, InputFileData, p, OtherState, ErrStat, ErrMsg) ! set parameters for pitch actuator: !............................................... + ! Actuator + p%UsePitchAct = InputFileData%UsePitchAct + if (p%UsePitchAct) then + p%pitchK = InputFileData%pitchK + p%pitchC = InputFileData%pitchC + p%pitchJ = InputFileData%pitchJ + + ! calculate (I-hA)^-1 + p%torqM(1,1) = p%pitchJ + p%pitchC*p%dt + p%torqM(2,1) = -p%pitchK * p%dt + p%torqM(1,2) = p%pitchJ * p%dt + p%torqM(2,2) = p%pitchJ + denom = p%pitchJ + p%pitchC*p%dt + p%pitchK*p%dt**2 + if (EqualRealNos(denom,0.0_BDKi)) then + call SetErrStat(ErrID_Fatal, "Cannot invert matrix for pitch actuator: J+c*dt+k*dt^2 is zero.", ErrStat, ErrMsg, RoutineName) + return + else + p%torqM(:,:) = p%torqM / denom + end if + end if !............................................... ! set parameters for File I/O data: From 294b261f8613c5545ad38998fec58b63531717c5 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 15 Mar 2024 11:33:54 -0600 Subject: [PATCH 032/190] FASTlib: Turbine(:) array must use Fortran index 1 start All code in FAST_Subs.f90 and other modules assumes Fortran style indexing (index start at 1) to the Turbine data structure. --- modules/openfast-library/src/FAST_Library.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openfast-library/src/FAST_Library.f90 b/modules/openfast-library/src/FAST_Library.f90 index e962337d3a..fa06f3eeea 100644 --- a/modules/openfast-library/src/FAST_Library.f90 +++ b/modules/openfast-library/src/FAST_Library.f90 @@ -53,7 +53,7 @@ subroutine FAST_AllocateTurbines(nTurbines, ErrStat_c, ErrMsg_c) BIND (C, NAME=' call wrscr1('Proceeding anyway.') end if - allocate(Turbine(0:NumTurbines-1),Stat=ErrStat) !Allocate in C style because most of the other Turbine properties from the input file are in C style inside the C++ driver + allocate(Turbine(1:NumTurbines),Stat=ErrStat) !Allocate in F style -- all logic inside FAST_Subs is based on index 1 start, not C style index 0 if (ErrStat /= 0) then ErrStat_c = ErrID_Fatal From 385c6bb434b9f581fc49428ca76324265fd09323 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 15 Mar 2024 15:13:21 -0600 Subject: [PATCH 033/190] FASTlib: change ExternInitData%TurbineID to %TurbIDforName This more accurately reflects what it is used for. --- glue-codes/fast-farm/src/FASTWrapper.f90 | 2 +- modules/openfast-library/src/FAST_Library.f90 | 17 ++++++++++++----- modules/openfast-library/src/FAST_Library.h | 2 +- modules/openfast-library/src/FAST_Registry.txt | 2 +- modules/openfast-library/src/FAST_Subs.f90 | 6 +++--- modules/openfast-library/src/FAST_Types.f90 | 10 +++++----- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/glue-codes/fast-farm/src/FASTWrapper.f90 b/glue-codes/fast-farm/src/FASTWrapper.f90 index 903666cb48..01301c56b7 100644 --- a/glue-codes/fast-farm/src/FASTWrapper.f90 +++ b/glue-codes/fast-farm/src/FASTWrapper.f90 @@ -139,7 +139,7 @@ SUBROUTINE FWrap_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, Init end if !.... multi-turbine options .... - ExternInitData%TurbineID = InitInp%TurbNum + ExternInitData%TurbIDforName = InitInp%TurbNum ExternInitData%TurbinePos = InitInp%p_ref_Turbine ExternInitData%WaveFieldMod = InitInp%WaveFieldMod diff --git a/modules/openfast-library/src/FAST_Library.f90 b/modules/openfast-library/src/FAST_Library.f90 index fa06f3eeea..29d2d775ef 100644 --- a/modules/openfast-library/src/FAST_Library.f90 +++ b/modules/openfast-library/src/FAST_Library.f90 @@ -126,7 +126,7 @@ subroutine FAST_Sizes(iTurb, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, dt IF (PRESENT(TMax)) THEN ExternInitData%TMax = TMax END IF - ExternInitData%TurbineID = -1 ! we're not going to use this to simulate a wind farm + ExternInitData%TurbIDforName = -1 ! we're not going to use this to simulate a wind farm ExternInitData%TurbinePos = 0.0_ReKi ! turbine position is at the origin ExternInitData%NumCtrl2SC = 0 ExternInitData%NumSC2Ctrl = 0 @@ -506,7 +506,7 @@ subroutine FAST_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, d end subroutine FAST_Restart !================================================================================================================================== -subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbID, NumSC2CtrlGlob, NumSC2Ctrl, NumCtrl2SC, InitSCOutputsGlob, InitSCOutputsTurbine, NumActForcePtsBlade, NumActForcePtsTower, TurbPosn, AbortErrLev_c, dt_c, NumBl_c, NumBlElem_c, NodeClusterType_c, & +subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbIDforName, NumSC2CtrlGlob, NumSC2Ctrl, NumCtrl2SC, InitSCOutputsGlob, InitSCOutputsTurbine, NumActForcePtsBlade, NumActForcePtsTower, TurbPosn, AbortErrLev_c, dt_c, NumBl_c, NumBlElem_c, NodeClusterType_c, & OpFM_Input_from_FAST, OpFM_Output_to_FAST, SC_DX_Input_from_FAST, SC_DX_Output_to_FAST, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Init') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT @@ -516,7 +516,7 @@ subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbID, NumSC2CtrlGlob, INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number REAL(C_DOUBLE), INTENT(IN ) :: TMax CHARACTER(KIND=C_CHAR), INTENT(IN ) :: InputFileName_c(IntfStrLen) - INTEGER(C_INT), INTENT(IN ) :: TurbID ! Need not be same as iTurb + INTEGER(C_INT), INTENT(IN ) :: TurbIDforName ! Need not be same as iTurb -- use numbering from c/cpp INTEGER(C_INT), INTENT(IN ) :: NumSC2CtrlGlob ! Supercontroller global outputs = controller global inputs INTEGER(C_INT), INTENT(IN ) :: NumSC2Ctrl ! Supercontroller outputs = controller inputs INTEGER(C_INT), INTENT(IN ) :: NumCtrl2SC ! controller outputs = Supercontroller inputs @@ -554,9 +554,16 @@ subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbID, NumSC2CtrlGlob, NumBl_c = 0 ! initialize here in case of error NumBlElem_c = 0 ! initialize here in case of error - + + ! Check TurbIDforName -- must be 0 or larger + if (TurbIDforName < 0) then + ErrStat = ErrID_Fatal + ErrMsg = "TurbIDforName cannot be negative" + if (Failed()) return + endif + ExternInitData%TMax = TMax - ExternInitData%TurbineID = TurbID + ExternInitData%TurbIDforName = TurbIDforName ExternInitData%TurbinePos = TurbPosn ExternInitData%SensorType = SensorType_None ExternInitData%NumCtrl2SC = NumCtrl2SC diff --git a/modules/openfast-library/src/FAST_Library.h b/modules/openfast-library/src/FAST_Library.h index 0fcb764f67..54d321ae14 100644 --- a/modules/openfast-library/src/FAST_Library.h +++ b/modules/openfast-library/src/FAST_Library.h @@ -17,7 +17,7 @@ EXTERNAL_ROUTINE void FAST_DeallocateTurbines(int *ErrStat, char *ErrMsg); EXTERNAL_ROUTINE void FAST_OpFM_Restart(int * iTurb, const char *CheckpointRootName, int *AbortErrLev, double * dt, int * NumBl, int * NumBlElem, int * n_t_global, OpFM_InputType_t* OpFM_Input, OpFM_OutputType_t* OpFM_Output, SC_DX_InputType_t* SC_DX_Input, SC_DX_OutputType_t* SC_DX_Output, int *ErrStat, char *ErrMsg); -EXTERNAL_ROUTINE void FAST_OpFM_Init(int * iTurb, double *TMax, const char *InputFileName, int * TurbineID, int * NumSC2CtrlGlob, int * NumSC2Ctrl, int * NumCtrl2SC, float * initSCInputsGlob, float * initSCInputsTurbine, int * NumActForcePtsBlade, int * NumActForcePtsTower, float * TurbinePosition, +EXTERNAL_ROUTINE void FAST_OpFM_Init(int * iTurb, double *TMax, const char *InputFileName, int * TurbIDforName, int * NumSC2CtrlGlob, int * NumSC2Ctrl, int * NumCtrl2SC, float * initSCInputsGlob, float * initSCInputsTurbine, int * NumActForcePtsBlade, int * NumActForcePtsTower, float * TurbinePosition, int *AbortErrLev, double * dt, int * NumBl, int * NumBlElem, int * NodeClusterType, OpFM_InputType_t* OpFM_Input, OpFM_OutputType_t* OpFM_Output, SC_DX_InputType_t* SC_DX_Input, SC_DX_OutputType_t* SC_DX_Output, int *ErrStat, char *ErrMsg); EXTERNAL_ROUTINE void FAST_OpFM_Solution0(int * iTurb, int *ErrStat, char *ErrMsg); diff --git a/modules/openfast-library/src/FAST_Registry.txt b/modules/openfast-library/src/FAST_Registry.txt index 7a3deecc33..d09ea72736 100644 --- a/modules/openfast-library/src/FAST_Registry.txt +++ b/modules/openfast-library/src/FAST_Registry.txt @@ -732,7 +732,7 @@ typedef ^ FAST_InitData IceD_InitOutputType OutData_IceD - - typedef ^ FAST_ExternInitType DbKi Tmax - -1 - "External code specified Tmax" s typedef ^ FAST_ExternInitType IntKi SensorType - SensorType_None - "lidar sensor type, which should not be pulsed at the moment; this input should be replaced with a section in the InflowWind input file" - typedef ^ FAST_ExternInitType LOGICAL LidRadialVel - - - "TRUE => return radial component, FALSE => return 'x' direction estimate" - -typedef ^ FAST_ExternInitType IntKi TurbineID - 0 - "ID number for turbine (used to create output file naming convention)" - +typedef ^ FAST_ExternInitType IntKi TurbIDforName - -1 - "ID number for turbine (used to create output file naming convention)" - typedef ^ FAST_ExternInitType ReKi TurbinePos {3} - - "Initial position of turbine base (origin used for graphics or in FAST.Farm)" m typedef ^ FAST_ExternInitType IntKi WaveFieldMod - - - "Wave field handling (-) (switch) 0: use individual HydroDyn inputs without adjustment, 1: adjust wave phases based on turbine offsets from farm origin" - typedef ^ FAST_ExternInitType IntKi NumSC2CtrlGlob - - - "number of global controller inputs [from supercontroller]" - diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 9129d0555d..7fc3954ec9 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -161,8 +161,8 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, y_FAST%Lin%WindSpeed = 0.0_ReKi if (present(ExternInitData)) then - CallStart = .not. ExternInitData%FarmIntegration ! .and. ExternInitData%TurbineID == 1 - if (ExternInitData%TurbineID > 0) p_FAST%TDesc = 'T'//trim(num2lstr(ExternInitData%TurbineID)) + CallStart = .not. ExternInitData%FarmIntegration + if (ExternInitData%TurbIDforName >= 0) p_FAST%TDesc = 'T'//trim(num2lstr(ExternInitData%TurbIDforName)) else CallStart = .true. end if @@ -205,7 +205,7 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, if (ExternInitData%FarmIntegration) then ! we're integrating with FAST.Farm CALL FAST_Init( p_FAST, m_FAST, y_FAST, t_initial, InputFile, ErrStat2, ErrMsg2, ExternInitData%TMax, OverrideAbortLev=.false., RootName=ExternInitData%RootName ) else - CALL FAST_Init( p_FAST, m_FAST, y_FAST, t_initial, InputFile, ErrStat2, ErrMsg2, ExternInitData%TMax, ExternInitData%TurbineID ) ! We have the name of the input file and the simulation length from somewhere else (e.g. Simulink) + CALL FAST_Init( p_FAST, m_FAST, y_FAST, t_initial, InputFile, ErrStat2, ErrMsg2, ExternInitData%TMax, ExternInitData%TurbIDforName ) ! We have the name of the input file and the simulation length from somewhere else (e.g. Simulink) end if else diff --git a/modules/openfast-library/src/FAST_Types.f90 b/modules/openfast-library/src/FAST_Types.f90 index 91a5d96889..309a826fd1 100644 --- a/modules/openfast-library/src/FAST_Types.f90 +++ b/modules/openfast-library/src/FAST_Types.f90 @@ -748,7 +748,7 @@ MODULE FAST_Types REAL(DbKi) :: Tmax = -1 !< External code specified Tmax [s] INTEGER(IntKi) :: SensorType = SensorType_None !< lidar sensor type, which should not be pulsed at the moment; this input should be replaced with a section in the InflowWind input file [-] LOGICAL :: LidRadialVel !< TRUE => return radial component, FALSE => return 'x' direction estimate [-] - INTEGER(IntKi) :: TurbineID = 0 !< ID number for turbine (used to create output file naming convention) [-] + INTEGER(IntKi) :: TurbIDforName = -1 !< ID number for turbine (used to create output file naming convention) [-] REAL(ReKi) , DIMENSION(1:3) :: TurbinePos !< Initial position of turbine base (origin used for graphics or in FAST.Farm) [m] INTEGER(IntKi) :: WaveFieldMod !< Wave field handling (-) (switch) 0: use individual HydroDyn inputs without adjustment, 1: adjust wave phases based on turbine offsets from farm origin [-] INTEGER(IntKi) :: NumSC2CtrlGlob !< number of global controller inputs [from supercontroller] [-] @@ -48020,7 +48020,7 @@ SUBROUTINE FAST_CopyExternInitType( SrcExternInitTypeData, DstExternInitTypeData DstExternInitTypeData%Tmax = SrcExternInitTypeData%Tmax DstExternInitTypeData%SensorType = SrcExternInitTypeData%SensorType DstExternInitTypeData%LidRadialVel = SrcExternInitTypeData%LidRadialVel - DstExternInitTypeData%TurbineID = SrcExternInitTypeData%TurbineID + DstExternInitTypeData%TurbIDforName = SrcExternInitTypeData%TurbIDforName DstExternInitTypeData%TurbinePos = SrcExternInitTypeData%TurbinePos DstExternInitTypeData%WaveFieldMod = SrcExternInitTypeData%WaveFieldMod DstExternInitTypeData%NumSC2CtrlGlob = SrcExternInitTypeData%NumSC2CtrlGlob @@ -48127,7 +48127,7 @@ SUBROUTINE FAST_PackExternInitType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, Db_BufSz = Db_BufSz + 1 ! Tmax Int_BufSz = Int_BufSz + 1 ! SensorType Int_BufSz = Int_BufSz + 1 ! LidRadialVel - Int_BufSz = Int_BufSz + 1 ! TurbineID + Int_BufSz = Int_BufSz + 1 ! TurbIDforName Re_BufSz = Re_BufSz + SIZE(InData%TurbinePos) ! TurbinePos Int_BufSz = Int_BufSz + 1 ! WaveFieldMod Int_BufSz = Int_BufSz + 1 ! NumSC2CtrlGlob @@ -48184,7 +48184,7 @@ SUBROUTINE FAST_PackExternInitType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, Int_Xferred = Int_Xferred + 1 IntKiBuf(Int_Xferred) = TRANSFER(InData%LidRadialVel, IntKiBuf(1)) Int_Xferred = Int_Xferred + 1 - IntKiBuf(Int_Xferred) = InData%TurbineID + IntKiBuf(Int_Xferred) = InData%TurbIDforName Int_Xferred = Int_Xferred + 1 DO i1 = LBOUND(InData%TurbinePos,1), UBOUND(InData%TurbinePos,1) ReKiBuf(Re_Xferred) = InData%TurbinePos(i1) @@ -48287,7 +48287,7 @@ SUBROUTINE FAST_UnPackExternInitType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrSt Int_Xferred = Int_Xferred + 1 OutData%LidRadialVel = TRANSFER(IntKiBuf(Int_Xferred), OutData%LidRadialVel) Int_Xferred = Int_Xferred + 1 - OutData%TurbineID = IntKiBuf(Int_Xferred) + OutData%TurbIDforName = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 i1_l = LBOUND(OutData%TurbinePos,1) i1_u = UBOUND(OutData%TurbinePos,1) From 31a5b0355a578b17d7388e0ecafea403ab9fe6fc Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 15 Mar 2024 15:44:45 -0600 Subject: [PATCH 034/190] FASTlib: change iTurb inputs to routines with c-bindings to index 0 - `iTurb_c` is the new variable name for the turbine index passed into a FAST_Library.f90 routine. This is assumed to start at 0 for the first turbine. - `iTurb = iTurb_c + 1` shifts this index to the indexing used internally in OpenFAST. --- modules/openfast-library/src/FAST_Library.f90 | 118 +++++++++++------- 1 file changed, 76 insertions(+), 42 deletions(-) diff --git a/modules/openfast-library/src/FAST_Library.f90 b/modules/openfast-library/src/FAST_Library.f90 index 29d2d775ef..491e8931d0 100644 --- a/modules/openfast-library/src/FAST_Library.f90 +++ b/modules/openfast-library/src/FAST_Library.f90 @@ -83,13 +83,13 @@ subroutine FAST_DeallocateTurbines(ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Deal ErrMsg_c = C_NULL_CHAR end subroutine !================================================================================================================================== -subroutine FAST_Sizes(iTurb, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, dt_out_c, tmax_c, ErrStat_c, ErrMsg_c, ChannelNames_c, TMax, InitInpAry) BIND (C, NAME='FAST_Sizes') +subroutine FAST_Sizes(iTurb_c, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, dt_out_c, tmax_c, ErrStat_c, ErrMsg_c, ChannelNames_c, TMax, InitInpAry) BIND (C, NAME='FAST_Sizes') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_Sizes !GCC$ ATTRIBUTES DLLEXPORT :: FAST_Sizes #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) CHARACTER(KIND=C_CHAR), INTENT(IN ) :: InputFileName_c(IntfStrLen) INTEGER(C_INT), INTENT( OUT) :: AbortErrLev_c INTEGER(C_INT), INTENT( OUT) :: NumOuts_c @@ -106,6 +106,10 @@ subroutine FAST_Sizes(iTurb, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, dt CHARACTER(IntfStrLen) :: InputFileName INTEGER :: i, j, k TYPE(FAST_ExternInitType) :: ExternInitData + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 ! transfer the character array from C to a Fortran string: InputFileName = TRANSFER( InputFileName_c, InputFileName ) @@ -179,33 +183,34 @@ subroutine FAST_Sizes(iTurb, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, dt end subroutine FAST_Sizes !================================================================================================================================== -subroutine FAST_Start(iTurb, NumInputs_c, NumOutputs_c, InputAry, OutputAry, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Start') +subroutine FAST_Start(iTurb_c, NumInputs_c, NumOutputs_c, InputAry, OutputAry, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Start') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_Start !GCC$ ATTRIBUTES DLLEXPORT :: FAST_Start #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) INTEGER(C_INT), INTENT(IN ) :: NumInputs_c INTEGER(C_INT), INTENT(IN ) :: NumOutputs_c REAL(C_DOUBLE), INTENT(IN ) :: InputAry(NumInputs_c) REAL(C_DOUBLE), INTENT( OUT) :: OutputAry(NumOutputs_c) INTEGER(C_INT), INTENT( OUT) :: ErrStat_c CHARACTER(KIND=C_CHAR), INTENT( OUT) :: ErrMsg_c(IntfStrLen) - ! local CHARACTER(IntfStrLen) :: InputFileName INTEGER :: i REAL(ReKi) :: Outputs(NumOutputs_c-1) - + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) INTEGER(IntKi) :: ErrStat2 ! Error status CHARACTER(IntfStrLen-1) :: ErrMsg2 ! Error message (this needs to be static so that it will print in Matlab's mex library) + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + ! initialize variables: n_t_global = 0 - !............................................................................................................................... ! Initialization of solver: (calculate outputs based on states at t=t_initial as well as guesses of inputs and constraint states) !............................................................................................................................... @@ -243,13 +248,13 @@ subroutine FAST_Start(iTurb, NumInputs_c, NumOutputs_c, InputAry, OutputAry, Err end subroutine FAST_Start !================================================================================================================================== -subroutine FAST_Update(iTurb, NumInputs_c, NumOutputs_c, InputAry, OutputAry, EndSimulationEarly, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Update') +subroutine FAST_Update(iTurb_c, NumInputs_c, NumOutputs_c, InputAry, OutputAry, EndSimulationEarly, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Update') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_Update !GCC$ ATTRIBUTES DLLEXPORT :: FAST_Update #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) INTEGER(C_INT), INTENT(IN ) :: NumInputs_c INTEGER(C_INT), INTENT(IN ) :: NumOutputs_c REAL(C_DOUBLE), INTENT(IN ) :: InputAry(NumInputs_c) @@ -261,9 +266,13 @@ subroutine FAST_Update(iTurb, NumInputs_c, NumOutputs_c, InputAry, OutputAry, En ! local variables REAL(ReKi) :: Outputs(NumOutputs_c-1) INTEGER(IntKi) :: i + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) INTEGER(IntKi) :: ErrStat2 ! Error status CHARACTER(IntfStrLen-1) :: ErrMsg2 ! Error message (this needs to be static so that it will print in Matlab's mex library) - + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + EndSimulationEarly = .FALSE. IF ( n_t_global > Turbine(iTurb)%p_FAST%n_TMax_m1 ) THEN !finish @@ -325,21 +334,25 @@ subroutine FAST_Update(iTurb, NumInputs_c, NumOutputs_c, InputAry, OutputAry, En end subroutine FAST_Update !================================================================================================================================== ! Get the hub's absolute position, rotation velocity, and orientation DCM for the current time step -subroutine FAST_HubPosition(iTurb, AbsPosition_c, RotationalVel_c, Orientation_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_HubPosition') +subroutine FAST_HubPosition(iTurb_c, AbsPosition_c, RotationalVel_c, Orientation_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_HubPosition') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_HubPosition !GCC$ ATTRIBUTES DLLEXPORT :: FAST_HubPosition #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) REAL(C_FLOAT), INTENT( OUT) :: AbsPosition_c(3), RotationalVel_c(3) REAL(C_DOUBLE), INTENT( OUT) :: Orientation_c(9) INTEGER(C_INT), INTENT( OUT) :: ErrStat_c CHARACTER(KIND=C_CHAR), INTENT( OUT) :: ErrMsg_c(IntfStrLen) + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) ErrStat_c = ErrID_None ErrMsg = C_NULL_CHAR + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + if (iTurb > size(Turbine) ) then ErrStat_c = ErrID_Fatal ErrMsg = "iTurb is greater than the number of turbines in the simulation."//C_NULL_CHAR @@ -364,18 +377,15 @@ end subroutine FAST_HubPosition !! Ideally we would write this summary info from here, but that isn't currently done. So as a workaround so the user has some !! vague idea what went wrong with their simulation, we have ServoDyn include the arrangement set here in the SrvD.sum file. subroutine FAST_SetExternalInputs(iTurb, NumInputs_c, InputAry, m_FAST) - USE, INTRINSIC :: ISO_C_Binding USE FAST_Types -! USE FAST_Data, only: NumFixedInputs - - IMPLICIT NONE - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + IMPLICIT NONE + INTEGER(IntKi), INTENT(IN ) :: iTurb ! Turbine number, Fortran indexing (starts at 1 for first turbine) INTEGER(C_INT), INTENT(IN ) :: NumInputs_c REAL(C_DOUBLE), INTENT(IN ) :: InputAry(NumInputs_c) ! Inputs from Simulink TYPE(FAST_MiscVarType), INTENT(INOUT) :: m_FAST ! Miscellaneous variables - + ! set the inputs from external code here... ! transfer inputs from Simulink to FAST IF ( NumInputs_c < NumFixedInputs ) RETURN ! This is an error @@ -398,26 +408,30 @@ subroutine FAST_SetExternalInputs(iTurb, NumInputs_c, InputAry, m_FAST) end subroutine FAST_SetExternalInputs !================================================================================================================================== -subroutine FAST_End(iTurb, StopTheProgram) BIND (C, NAME='FAST_End') +subroutine FAST_End(iTurb_c, StopTheProgram) BIND (C, NAME='FAST_End') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_End !GCC$ ATTRIBUTES DLLEXPORT :: FAST_End #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) LOGICAL(C_BOOL), INTENT(IN) :: StopTheProgram ! flag indicating if the program should end (false if there are more turbines to end) + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 CALL ExitThisProgram_T( Turbine(iTurb), ErrID_None, LOGICAL(StopTheProgram)) end subroutine FAST_End !================================================================================================================================== -subroutine FAST_CreateCheckpoint(iTurb, CheckpointRootName_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_CreateCheckpoint') +subroutine FAST_CreateCheckpoint(iTurb_c, CheckpointRootName_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_CreateCheckpoint') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_CreateCheckpoint !GCC$ ATTRIBUTES DLLEXPORT :: FAST_CreateCheckpoint #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) CHARACTER(KIND=C_CHAR), INTENT(IN ) :: CheckpointRootName_c(IntfStrLen) INTEGER(C_INT), INTENT( OUT) :: ErrStat_c CHARACTER(KIND=C_CHAR), INTENT( OUT) :: ErrMsg_c(IntfStrLen) @@ -426,8 +440,11 @@ subroutine FAST_CreateCheckpoint(iTurb, CheckpointRootName_c, ErrStat_c, ErrMsg_ CHARACTER(IntfStrLen) :: CheckpointRootName INTEGER(IntKi) :: I INTEGER(IntKi) :: Unit - - + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + ! transfer the character array from C to a Fortran string: CheckpointRootName = TRANSFER( CheckpointRootName_c, CheckpointRootName ) I = INDEX(CheckpointRootName,C_NULL_CHAR) - 1 ! if this has a c null character at the end... @@ -453,13 +470,13 @@ subroutine FAST_CreateCheckpoint(iTurb, CheckpointRootName_c, ErrStat_c, ErrMsg_ end subroutine FAST_CreateCheckpoint !================================================================================================================================== -subroutine FAST_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, dt_c, n_t_global_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Restart') +subroutine FAST_Restart(iTurb_c, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, dt_c, n_t_global_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_Restart') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_Restart !GCC$ ATTRIBUTES DLLEXPORT :: FAST_Restart #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) CHARACTER(KIND=C_CHAR), INTENT(IN ) :: CheckpointRootName_c(IntfStrLen) INTEGER(C_INT), INTENT( OUT) :: AbortErrLev_c INTEGER(C_INT), INTENT( OUT) :: NumOuts_c @@ -474,9 +491,12 @@ subroutine FAST_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, d INTEGER(IntKi) :: Unit REAL(DbKi) :: t_initial_out INTEGER(IntKi) :: NumTurbines_out + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) CHARACTER(*), PARAMETER :: RoutineName = 'FAST_Restart' - - + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + ! transfer the character array from C to a Fortran string: CheckpointRootName = TRANSFER( CheckpointRootName_c, CheckpointRootName ) I = INDEX(CheckpointRootName,C_NULL_CHAR) - 1 ! if this has a c null character at the end... @@ -506,14 +526,14 @@ subroutine FAST_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, NumOuts_c, d end subroutine FAST_Restart !================================================================================================================================== -subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbIDforName, NumSC2CtrlGlob, NumSC2Ctrl, NumCtrl2SC, InitSCOutputsGlob, InitSCOutputsTurbine, NumActForcePtsBlade, NumActForcePtsTower, TurbPosn, AbortErrLev_c, dt_c, NumBl_c, NumBlElem_c, NodeClusterType_c, & +subroutine FAST_OpFM_Init(iTurb_c, TMax, InputFileName_c, TurbIDforName, NumSC2CtrlGlob, NumSC2Ctrl, NumCtrl2SC, InitSCOutputsGlob, InitSCOutputsTurbine, NumActForcePtsBlade, NumActForcePtsTower, TurbPosn, AbortErrLev_c, dt_c, NumBl_c, NumBlElem_c, NodeClusterType_c, & OpFM_Input_from_FAST, OpFM_Output_to_FAST, SC_DX_Input_from_FAST, SC_DX_Output_to_FAST, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Init') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Init !GCC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Init #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) REAL(C_DOUBLE), INTENT(IN ) :: TMax CHARACTER(KIND=C_CHAR), INTENT(IN ) :: InputFileName_c(IntfStrLen) INTEGER(C_INT), INTENT(IN ) :: TurbIDforName ! Need not be same as iTurb -- use numbering from c/cpp @@ -541,7 +561,11 @@ subroutine FAST_OpFM_Init(iTurb, TMax, InputFileName_c, TurbIDforName, NumSC2Ctr CHARACTER(IntfStrLen) :: InputFileName INTEGER(C_INT) :: i TYPE(FAST_ExternInitType) :: ExternInitData - + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + ! transfer the character array from C to a Fortran string: InputFileName = TRANSFER( InputFileName_c, InputFileName ) I = INDEX(InputFileName,C_NULL_CHAR) - 1 ! if this has a c null character at the end... @@ -649,15 +673,19 @@ LOGICAL FUNCTION FAILED() END FUNCTION FAILED end subroutine !================================================================================================================================== -subroutine FAST_OpFM_Solution0(iTurb, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Solution0') +subroutine FAST_OpFM_Solution0(iTurb_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Solution0') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Solution0 !GCC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Solution0 #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) INTEGER(C_INT), INTENT( OUT) :: ErrStat_c CHARACTER(KIND=C_CHAR), INTENT( OUT) :: ErrMsg_c(IntfStrLen) + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 call FAST_Solution0_T(Turbine(iTurb), ErrStat, ErrMsg ) @@ -673,14 +701,14 @@ subroutine FAST_OpFM_Solution0(iTurb, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_O end subroutine FAST_OpFM_Solution0 !================================================================================================================================== -subroutine FAST_OpFM_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_c, numblades_c, numElementsPerBlade_c, n_t_global_c, & +subroutine FAST_OpFM_Restart(iTurb_c, CheckpointRootName_c, AbortErrLev_c, dt_c, numblades_c, numElementsPerBlade_c, n_t_global_c, & OpFM_Input_from_FAST, OpFM_Output_to_FAST, SC_DX_Input_from_FAST, SC_DX_Output_to_FAST, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Restart') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Restart !GCC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Restart #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) CHARACTER(KIND=C_CHAR), INTENT(IN ) :: CheckpointRootName_c(IntfStrLen) INTEGER(C_INT), INTENT( OUT) :: AbortErrLev_c INTEGER(C_INT), INTENT( OUT) :: numblades_c @@ -701,8 +729,12 @@ subroutine FAST_OpFM_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_c, n INTEGER(IntKi) :: Unit REAL(DbKi) :: t_initial_out INTEGER(IntKi) :: NumTurbines_out + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) CHARACTER(*), PARAMETER :: RoutineName = 'FAST_Restart' - + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + CALL NWTC_Init() ! transfer the character array from C to a Fortran string: CheckpointRootName = TRANSFER( CheckpointRootName_c, CheckpointRootName ) @@ -745,9 +777,8 @@ subroutine FAST_OpFM_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_c, n end subroutine FAST_OpFM_Restart !================================================================================================================================== subroutine SetOpenFOAM_pointers(iTurb, OpFM_Input_from_FAST, OpFM_Output_to_FAST, SC_DX_Input_from_FAST, SC_DX_Output_to_FAST) - IMPLICIT NONE - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number, F indexing (starts at 1 for first turbine) TYPE(OpFM_InputType_C), INTENT(INOUT) :: OpFM_Input_from_FAST TYPE(OpFM_OutputType_C), INTENT(INOUT) :: OpFM_Output_to_FAST TYPE(SC_DX_InputType_C), INTENT(INOUT) :: SC_DX_Input_from_FAST @@ -787,17 +818,20 @@ subroutine SetOpenFOAM_pointers(iTurb, OpFM_Input_from_FAST, OpFM_Output_to_FAST end subroutine SetOpenFOAM_pointers !================================================================================================================================== -subroutine FAST_OpFM_Step(iTurb, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Step') +subroutine FAST_OpFM_Step(iTurb_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM_Step') IMPLICIT NONE #ifndef IMPLICIT_DLLEXPORT !DEC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Step !GCC$ ATTRIBUTES DLLEXPORT :: FAST_OpFM_Step #endif - INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number + INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number, c indexing (starts at 0 for first turbine) INTEGER(C_INT), INTENT( OUT) :: ErrStat_c CHARACTER(KIND=C_CHAR), INTENT( OUT) :: ErrMsg_c(IntfStrLen) - - + integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine) + + ! transfer turbine index number from C to Fortran indexing (0 to 1 start) + iTurb = int(iTurb_c,IntKi) + 1 + IF ( n_t_global > Turbine(iTurb)%p_FAST%n_TMax_m1 ) THEN !finish ! we can't continue because we might over-step some arrays that are allocated to the size of the simulation From 7cd73e464b1d125392983cd443e43a9ea2515618 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 15 Mar 2024 17:11:11 -0600 Subject: [PATCH 035/190] Set 5MW_Land_DLL_WTurb_cpp as a CPP_API test, not CPP_DRIVER --- reg_tests/CTestList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 42f991f28e..360133f860 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -285,7 +285,7 @@ of_regression("MHK_RM1_Floating" "openfast;elastodyn;aerod of_regression("Tailfin_FreeYaw1DOF_PolarBased" "openfast;elastodyn;aerodyn15") # OpenFAST C++ API test -if(BUILD_OPENFAST_CPP_DRIVER) +if(BUILD_OPENFAST_CPP_API) of_cpp_interface_regression("5MW_Land_DLL_WTurb_cpp" "openfast;fastlib;cpp") endif() From bcc91c025fcc029dacddb1a23033bfb755f7fffb Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Mon, 18 Mar 2024 19:18:57 +0000 Subject: [PATCH 036/190] Adjust if statements in FAST_OpFM_Step for iTurb being in range 1:NumTurbines. --- modules/openfast-library/src/FAST_Library.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openfast-library/src/FAST_Library.f90 b/modules/openfast-library/src/FAST_Library.f90 index 491e8931d0..a7c60a8722 100644 --- a/modules/openfast-library/src/FAST_Library.f90 +++ b/modules/openfast-library/src/FAST_Library.f90 @@ -836,7 +836,7 @@ subroutine FAST_OpFM_Step(iTurb_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM ! we can't continue because we might over-step some arrays that are allocated to the size of the simulation - if (iTurb .eq. (NumTurbines-1) ) then + if (iTurb == NumTurbines) then IF (n_t_global == Turbine(iTurb)%p_FAST%n_TMax_m1 + 1) THEN ! we call update an extra time in Simulink, which we can ignore until the time shift with outputs is solved n_t_global = n_t_global + 1 ErrStat_c = ErrID_None @@ -852,7 +852,7 @@ subroutine FAST_OpFM_Step(iTurb_c, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_OpFM ELSE CALL FAST_Solution_T( t_initial, n_t_global, Turbine(iTurb), ErrStat, ErrMsg ) - if (iTurb .eq. (NumTurbines-1) ) then + if (iTurb == NumTurbines) then n_t_global = n_t_global + 1 end if From 4c001eb1b6021875e37fb3e1084308d13ccf9dfa Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 18 Mar 2024 15:33:00 -0600 Subject: [PATCH 037/190] CPP testing: fix logic setting exec name in CMakeList.txt --- reg_tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/CMakeLists.txt b/reg_tests/CMakeLists.txt index 70cbf67176..268e188f9d 100644 --- a/reg_tests/CMakeLists.txt +++ b/reg_tests/CMakeLists.txt @@ -42,7 +42,7 @@ option(CTEST_NO_RUN_FLAG "Complete the regression test comparison but do not ex # Set the OpenFAST executable configuration option and default set(CTEST_OPENFAST_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast/openfast${CMAKE_EXECUTABLE_SUFFIX}" CACHE FILEPATH "Specify the OpenFAST executable to use in testing.") -if(BUILD_OPENFAST_CPP_DRIVER) +if(BUILD_OPENFAST_CPP_API) # Set the OpenFAST executable configuration option and default set(CTEST_OPENFASTCPP_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast-cpp/openfastcpp${CMAKE_EXECUTABLE_SUFFIX}" CACHE FILEPATH "Specify the OpenFAST C++ executable to use in testing.") endif() From e0cb005c6dd50ddc0b912df9bd5ee5d19a1c8219 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 18 Mar 2024 15:39:58 -0600 Subject: [PATCH 038/190] TurbSim: increase filename to 1024 characters On some systems, the filepath may take the filename beyond 200 characters. --- modules/turbsim/src/CohStructures.f90 | 2 +- modules/turbsim/src/Profiles.f90 | 2 +- modules/turbsim/src/TS_FileIO.f90 | 2 +- modules/turbsim/src/TurbSim.f90 | 2 +- modules/turbsim/src/TurbSim_Types.f90 | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/turbsim/src/CohStructures.f90 b/modules/turbsim/src/CohStructures.f90 index 9c1ad52141..a20ad42f18 100644 --- a/modules/turbsim/src/CohStructures.f90 +++ b/modules/turbsim/src/CohStructures.f90 @@ -766,7 +766,7 @@ SUBROUTINE CohStr_WriteEvents( RootName, p_CohStr, e_CohStr, y_CohStr, TScale, U CHARACTER(MaxMsgLen) :: ErrMsg2 ! Message describing error (local) - CHARACTER(200) :: InpFile ! Name of the input file + CHARACTER(1024) :: InpFile ! Name of the input file TYPE (Event), POINTER :: PtrCurr => NULL() ! Pointer to the current event TYPE (Event), POINTER :: PtrPrev => NULL() ! Pointer to the previous event (for deallocation purposes) diff --git a/modules/turbsim/src/Profiles.f90 b/modules/turbsim/src/Profiles.f90 index 7135b92856..36ca07fde0 100644 --- a/modules/turbsim/src/Profiles.f90 +++ b/modules/turbsim/src/Profiles.f90 @@ -122,7 +122,7 @@ SUBROUTINE GetChebCoefs(p, UJetMax_IsKnown, ErrStat, ErrMsg) ! valid only for jet WindProfileType -IMPLICIT NONE + IMPLICIT NONE TYPE(TurbSim_ParameterType),INTENT(INOUT) :: p ! TurbSim parameters LOGICAL, INTENT(IN) :: UJetMax_IsKnown diff --git a/modules/turbsim/src/TS_FileIO.f90 b/modules/turbsim/src/TS_FileIO.f90 index 70b5f91a76..d4a5814137 100644 --- a/modules/turbsim/src/TS_FileIO.f90 +++ b/modules/turbsim/src/TS_FileIO.f90 @@ -72,7 +72,7 @@ SUBROUTINE ReadInputFile(InFile, p, OtherSt_RandNum, ErrStat, ErrMsg) LOGICAL :: UseDefault ! Whether or not to use a default value LOGICAL :: IsUnusedParameter ! Whether or not this variable will be ignored - CHARACTER(200) :: Line ! An input line + CHARACTER(1024) :: Line ! An input line CHARACTER(1) :: Line1 ! The first character of an input line INTEGER(IntKi) :: ErrStat2 ! Temporary Error status diff --git a/modules/turbsim/src/TurbSim.f90 b/modules/turbsim/src/TurbSim.f90 index 5aa65491aa..768a43b859 100644 --- a/modules/turbsim/src/TurbSim.f90 +++ b/modules/turbsim/src/TurbSim.f90 @@ -82,7 +82,7 @@ PROGRAM TurbSim INTEGER(IntKi) :: ErrStat ! allocation status CHARACTER(MaxMsgLen) :: ErrMsg ! error message -CHARACTER(200) :: InFile ! Name of the TurbSim input file. +CHARACTER(1024) :: InFile ! Name of the TurbSim input file. CHARACTER(20) :: FlagArg ! flag argument from command line diff --git a/modules/turbsim/src/TurbSim_Types.f90 b/modules/turbsim/src/TurbSim_Types.f90 index c4a6071032..07a7773018 100644 --- a/modules/turbsim/src/TurbSim_Types.f90 +++ b/modules/turbsim/src/TurbSim_Types.f90 @@ -90,8 +90,8 @@ MODULE TurbSim_Types REAL(ReKi) :: DistScl ! Disturbance scale for AeroDyn coherent turbulence events - CHARACTER(200) :: CTEventPath ! String used to store the name of the coherent event definition file - CHARACTER(200) :: CTEventFile ! String used to store the name of the coherent event definition file + CHARACTER(1024) :: CTEventPath ! String used to store the name of the coherent event definition file + CHARACTER(1024) :: CTEventFile ! String used to store the name of the coherent event definition file CHARACTER( 3) :: CTExt ! String used to determine the type of coherent structures ("dns" or "les") END TYPE CohStr_ParameterType @@ -276,8 +276,8 @@ MODULE TurbSim_Types INTEGER :: US = -1 ! I/O unit for summary file. - CHARACTER(200) :: DescStr ! String used to describe the run (and the first line of the summary file) - CHARACTER(197) :: RootName ! Root name of the I/O files. + CHARACTER(1024) :: DescStr ! String used to describe the run (and the first line of the summary file) + CHARACTER(1024) :: RootName ! Root name of the I/O files. TYPE(RandNum_ParameterType) :: RNG ! parameters for random numbers p_RandNum TYPE(Grid_ParameterType) :: grid ! parameters for TurbSim (specify grid/frequency size) TYPE(Meteorology_ParameterType) :: met ! parameters for TurbSim From 51a29029fa7e0ef20ab5cb1d2fb20e71e8173dc3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:03 +0000 Subject: [PATCH 039/190] FIX: Update dockerfile base to get required `cmake` version --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 8470e56230..01a5391cae 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # -FROM ubuntu:bionic +FROM ubuntu:mantic # Install dependencies @@ -34,7 +34,7 @@ RUN apt update -qq && \ apt install -y git && \ apt install -y nano -RUN pip3 install numpy +# RUN pip3 install numpy # Configure the environment ENV FC=/usr/bin/gfortran From 0184e607cba6ca7335207cafa46830a67d3849f9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:53 +0000 Subject: [PATCH 040/190] CHO: Add `.idea` to `.gitignore` --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0b6dd4368e..5cf777ca93 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ vs-build/ varcache *.slxc +# JetBrains IDEs config +.idea From 290039959deaf1609ce729c738714cec5dcc5209 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:35:46 +0000 Subject: [PATCH 041/190] ENH: Make dockerfile base configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 01a5391cae..eb4e48e142 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -FROM ubuntu:mantic +ARG BASE=ubuntu:mantic +FROM ${BASE} # Install dependencies From 8519687472bc26017186ff211b3887fbcd7749fc Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:38:00 +0000 Subject: [PATCH 042/190] ENH: Make dockerfile timezone configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eb4e48e142..66ea123867 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic +ARG TIMEZONE=America/Denver + FROM ${BASE} # Install dependencies @@ -22,7 +24,7 @@ FROM ${BASE} # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=America/Denver +ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 79f5910f3963ceaa4e9b5ba79fe0a19b4ba9e6da Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:01:31 +0000 Subject: [PATCH 043/190] FIX: Fix timezone build arg in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 66ea123867..1ca978f5cd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,17 +14,17 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -ARG TIMEZONE=America/Denver - FROM ${BASE} +ARG TIMEZONE=America/Denver + # Install dependencies # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 5dc82f43d1134cc2847cb571c1f1fd018e25d01a Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:05:40 +0000 Subject: [PATCH 044/190] ENH: Make openfast version configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1ca978f5cd..f359416da4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,6 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=America/Denver +ARG VERSION='v3.5.2' # Install dependencies @@ -42,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --recursive https://github.com/openfast/openfast.git openfast +RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From f6bc0cc12182fc0e852270e02318cb9e58b07198 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:09:05 +0000 Subject: [PATCH 045/190] ENH: Make cores available for building configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f359416da4..c0121a438f 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -53,5 +53,6 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO -RUN make -j4 install +RUN make -j${BUILD_CORES} install From 57a1fbdda09754df258c0825df1d3cfb58f42e64 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:34:52 +0000 Subject: [PATCH 046/190] ENH: Clone openfast with shallow submodules in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c0121a438f..eea305269b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git +RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From 561eb2207546d8997665e03bc854346ea5959e51 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:06:47 +0000 Subject: [PATCH 047/190] REF: Combine apt installation commands into one --- share/docker/openfast_ubuntu/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eea305269b..a72b25dd07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -30,12 +30,17 @@ ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y python3-pip && \ - apt install -y cmake cmake-curses-gui && \ - apt install -y gcc gfortran make && \ - apt install -y libblas-dev liblapack-dev && \ - apt install -y git && \ - apt install -y nano + apt install -y \ + python3-pip \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + make \ + libblas-dev \ + liblapack-dev \ + git \ + nano # RUN pip3 install numpy From 0302ea8f441770a11841b9ffb1c74418b5775da3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:24:45 +0000 Subject: [PATCH 048/190] ENH: Use `apt-get` instead of `apt` and remove cache --- share/docker/openfast_ubuntu/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a72b25dd07..0e8cd2d7d9 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -27,10 +27,10 @@ ARG VERSION='v3.5.2' ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} -RUN apt update -qq && \ - apt install -y software-properties-common build-essential && \ +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y \ + apt-get install -y \ python3-pip \ cmake \ cmake-curses-gui \ @@ -40,7 +40,8 @@ RUN apt update -qq && \ libblas-dev \ liblapack-dev \ git \ - nano + nano \ + && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From 5e63e58cec048464a421c0f6214af37b15a4a740 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:37:37 +0000 Subject: [PATCH 049/190] ENH: Make `openfast` command available in docker image --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0e8cd2d7d9..5c54c114a0 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -62,3 +62,6 @@ WORKDIR /openfast/build ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install + +# Make `openfast` command work. +ENV PATH=/openfast/install/bin:$PATH From 965bfa110e09d4f23804baafb4ec5c049daf02fd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:57:07 +0000 Subject: [PATCH 050/190] ENH: Make building testing tree optional --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 5c54c114a0..0ba4a2dec4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -57,10 +57,11 @@ RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine -# will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an +# will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG BUILD_TESTING=ON +RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install # Make `openfast` command work. From 025f11737357294b9a9ac4e38885152d292c9862 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:12:31 +0000 Subject: [PATCH 051/190] ENH: Avoid cloning submodules if not building test tree --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0ba4a2dec4..4d4616a6f8 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,7 +49,12 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git +ARG BUILD_TESTING=ON + +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ + else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ + fi + WORKDIR /openfast # Build the project @@ -60,7 +65,6 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -ARG BUILD_TESTING=ON RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From bfde52767f6fed5c79f7947da1c4dab17de88e37 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:28:07 +0000 Subject: [PATCH 052/190] REF: Sort `apt-get install` lines --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4d4616a6f8..7f3b6fb918 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -31,16 +31,16 @@ RUN apt-get update -qq && \ apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ - python3-pip \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - make \ + git \ libblas-dev \ liblapack-dev \ - git \ + make \ nano \ + python3-pip \ && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From db0a7e7cde04d322e6f58c9c8bf4e828cc3fa067 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:02 +0000 Subject: [PATCH 053/190] REF: Factor out repository URL --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7f3b6fb918..cac7b0dd4c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,10 +49,11 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project +ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=ON -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ - else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 5eb65aba91080e73dfed00225b05df900e89ec55 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:18 +0000 Subject: [PATCH 054/190] ENH: Remove commented out numpy installation --- share/docker/openfast_ubuntu/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index cac7b0dd4c..1963041c88 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,8 +43,6 @@ RUN apt-get update -qq && \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# RUN pip3 install numpy - # Configure the environment ENV FC=/usr/bin/gfortran From 38af4130a8f0499fb64e429743632708c40894f3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:34:10 +0000 Subject: [PATCH 055/190] ENH: Set timezone to UTC by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1963041c88..b8a332309b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,7 +16,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=America/Denver +ARG TIMEZONE=UTC ARG VERSION='v3.5.2' # Install dependencies From cc8a9c9ff1d66b05e5fc5483ecf29ee202648c14 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:35:26 +0000 Subject: [PATCH 056/190] ENH: Set `BUILD_TESTING` to "OFF" by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b8a332309b..b16162f8bd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -48,7 +48,7 @@ ENV FC=/usr/bin/gfortran # Clone the project ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=ON +ARG BUILD_TESTING=OFF RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ From ce8fa1682208e3e02c80a5f6beefb7906ffe2238 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:36:32 +0000 Subject: [PATCH 057/190] REF: Rename `VERSION` build arg to `OPENFAST_VERSION` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b16162f8bd..4de78daa12 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG VERSION='v3.5.2' +ARG OPENFAST_VERSION='v3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 9822a4c7a04b5389949d79d3520bcc52ee071667 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:44:18 +0000 Subject: [PATCH 058/190] ENH: Remove need to prefix version numbers with `v` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4de78daa12..0b1a9a8d0c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='v3.5.2' +ARG OPENFAST_VERSION='3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 2b976781705c003ba90897eb2f2a88738e1f6c0e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 11:52:41 +0000 Subject: [PATCH 059/190] ENH: Build from local context instead of cloning repository --- .dockerignore | 25 +++++++++++++++++++++++++ share/docker/openfast_ubuntu/Dockerfile | 17 +++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..f4bfc6a972 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +# System, cache and editor files +**/__pycache__ +**/.DS_Store + +.editorconfig +.idea +.git +.github +.gitignore +.pytest_cache +.pre-commit-config.yaml +.readthedocs.yml +.coverage +Procfile +README.md + +# Never bake in environment variables +.env +.env* +google_credentials.json +# See: https://github.com/google-github-actions/auth/issues/123 +gha-creds-*.json +gcp-creds-*.json + +.devcontainer/.zsh_history diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0b1a9a8d0c..27876821e2 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,15 +16,12 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='3.5.2' - # Install dependencies - # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ @@ -46,16 +43,11 @@ RUN apt-get update -qq && \ # Configure the environment ENV FC=/usr/bin/gfortran -# Clone the project -ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=OFF - -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ - fi - WORKDIR /openfast +# Copy in the checked-out code version. +COPY . . + # Build the project RUN mkdir build WORKDIR /openfast/build @@ -63,6 +55,7 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_TESTING=OFF ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From c8814e07fbbd162d334fef23da417acf57a5aab0 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 13:46:33 +0000 Subject: [PATCH 060/190] ENH: Use a multi-stage build to reduce final image size --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 27876821e2..e680264217 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -FROM ${BASE} +FROM ${BASE} AS build # Install dependencies # For gfortran-8 @@ -56,9 +56,13 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_TESTING=OFF -ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO + +ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +FROM ${BASE} as production +COPY --from=build /openfast/install /openfast/install + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From c14609674ee7de09ad5dcd24e5682c91de25f401 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 14:43:53 +0000 Subject: [PATCH 061/190] FIX: Ensure system dependencies are available in final image --- share/docker/openfast_ubuntu/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e680264217..7ce1f685af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -64,5 +64,23 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} + +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ + add-apt-repository ppa:git-core/ppa -y && \ + apt-get install -y \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + git \ + libblas-dev \ + liblapack-dev \ + make \ + nano \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From dc326b3443571e16450cb321a9c982bf8bbe7411 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:03:19 +0000 Subject: [PATCH 062/190] ENH: Reduce docker image size by minimising included packages --- share/docker/openfast_ubuntu/Dockerfile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7ce1f685af..a40f1195af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -67,19 +67,7 @@ COPY --from=build /openfast/install /openfast/install ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ - apt-get install -y \ - cmake \ - cmake-curses-gui \ - gcc \ - gfortran \ - git \ - libblas-dev \ - liblapack-dev \ - make \ - nano \ - python3-pip \ + apt-get install -y libblas-dev liblapack-dev \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From 19e40510fde326c82627f89f7236a5069b888e7b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:06:05 +0000 Subject: [PATCH 063/190] ENH: Remove extra packages from first build stage --- share/docker/openfast_ubuntu/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a40f1195af..c2b5d1706b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,19 +25,14 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - git \ libblas-dev \ liblapack-dev \ make \ - nano \ - python3-pip \ && rm -rf /var/lib/apt/lists/* # Configure the environment From fb67cc3105b8ad059c4b02a902f2f36cb2661f5d Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:08:51 +0000 Subject: [PATCH 064/190] ENH: Allow injection of all `cmake` args --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c2b5d1706b..72b193ad82 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -50,8 +50,8 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" -ARG BUILD_TESTING=OFF -RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install From 367aca04938523bb58780b12122da344572164a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:11:21 +0000 Subject: [PATCH 065/190] REF: Move environment variables and build args to more optimal places --- share/docker/openfast_ubuntu/Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 72b193ad82..f8630b88aa 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -21,8 +21,7 @@ FROM ${BASE} AS build # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ARG TIMEZONE=UTC -ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ @@ -35,21 +34,18 @@ RUN apt-get update -qq && \ make \ && rm -rf /var/lib/apt/lists/* -# Configure the environment -ENV FC=/usr/bin/gfortran - -WORKDIR /openfast - # Copy in the checked-out code version. +WORKDIR /openfast COPY . . -# Build the project +# Build the project. RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" +ENV FC=/usr/bin/gfortran ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" RUN cmake .. ${CMAKE_OPTIONS} @@ -59,6 +55,7 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ From 782041b397706fb4d9eb9ddd72d2d1055a76d432 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:13:02 +0000 Subject: [PATCH 066/190] ENH: Set `CMAKE_BUILD_TYPE` to `RELEASE` by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f8630b88aa..ea28951f07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -46,7 +46,7 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ENV FC=/usr/bin/gfortran -ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 From d994413bc7a56f2d20544d22fa48b2a28b84e5f3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:35:14 +0000 Subject: [PATCH 067/190] FIX: Add essential dependencies back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index ea28951f07..e84ff43629 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,6 +25,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ + software-properties-common \ + build-essential \ cmake \ cmake-curses-gui \ gcc \ From d1c898284cdd26cb40e06b8a9f67b2c7c1f7e555 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:36:36 +0000 Subject: [PATCH 068/190] ENH: Add `nano` back to production image --- share/docker/openfast_ubuntu/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e84ff43629..b41e25822c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -61,7 +61,10 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y libblas-dev liblapack-dev \ + apt-get install -y \ + libblas-dev \ + liblapack-dev \ + nano \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From 60a689bf94fa7b0cccb13d86da2a72bf0a7b5cfc Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:41:40 +0000 Subject: [PATCH 069/190] ENH: Add comments explaining build stages --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b41e25822c..2341120ed7 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic + +# Build stage 1: builds openfast. FROM ${BASE} AS build # Install dependencies @@ -54,6 +56,7 @@ RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +# Build stage 2: provides built openfast in a small image. FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install From 5ae67cc59d85552d6e745c5946c1ebc05e8b7343 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:01 +0000 Subject: [PATCH 070/190] CHO: Add dockerfiles to `.dockerignore` --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index f4bfc6a972..1c757d6d4e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,3 +23,4 @@ gha-creds-*.json gcp-creds-*.json .devcontainer/.zsh_history +share/docker From e07542ea53701479507401473374acc65993c769 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:33 +0000 Subject: [PATCH 071/190] FIX: Add `git` back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2341120ed7..30812a3a33 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update -qq && \ cmake-curses-gui \ gcc \ gfortran \ + git \ libblas-dev \ liblapack-dev \ make \ From 96a33dac3950a2ab69984ac8e2e621ba1b0696a7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:23:10 +0000 Subject: [PATCH 072/190] DOC: Add readme explaining dockerfile --- share/docker/openfast_ubuntu/README.md | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 share/docker/openfast_ubuntu/README.md diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md new file mode 100644 index 0000000000..3f5568f166 --- /dev/null +++ b/share/docker/openfast_ubuntu/README.md @@ -0,0 +1,42 @@ +# OpenFAST docker images + +## Summary +The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and +in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` +and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. + +## Image registry +Production images of OpenFAST for the `linux/amd64` platform are available on the +[NREL docker hub](https://hub.docker.com/r/nrel/openfast). + +## Build arguments +Provide any of the following build arguments to customise the image at build time. + +| Name | Type | Allowed values | Default | Description | +| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| +| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:mantic` | The docker image to base the OpenFAST image on. | +| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | +| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | +| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | + +For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CMAKE_OPTIONS` so the testing tree is built: + +```shell +# Run from the root of this repository. +git checkout v3.5.3 +docker build -f share/docker/openfast_ubuntu/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' . +``` + +**NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier +versions of OpenFAST, check out the code at that version and recreate the `Dockerfile` from v3.5.3 (or above) in the +checked-out repository first. + +## Building development images +Development images can be built from the production image as a base. Simply start a new `Dockerfile` with: + +```dockerfile +FROM nrel/openfast:3.5.3 +``` + +Images can be built for different platforms using the `--platform` option when building the image. From b35146fbabafb528f17b17a10780a0df3ba67a9e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:51:22 +0000 Subject: [PATCH 073/190] OPS: Add `build-docker-image` workflow --- .github/workflows/build-docker-image.yml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-docker-image.yml diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000000..18cc28aa5b --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,42 @@ +name: build-docker-image + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag for Docker image (excluding the "v" prefix e.g. 3.5.3)' + required: true + ref: + description: 'Branch, tag, or commit SHA to build from' + required: true + default: main + +jobs: + build-and-push: + runs-on: ubuntu-latest + timeout-minutes: 300 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v5 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push to registry + uses: docker/build-push-action@v3.1.1 + with: + context: . + file: share/docker/openfast_ubuntu/Dockerfile + platforms: linux/amd64 + tags: nrel/openfast:${{ github.event.inputs.tag }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max From 392492b6ec6233074480a2b8e488aa64754ddc1e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:05:44 +0000 Subject: [PATCH 074/190] CHO: Update copyright year in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 30812a3a33..40e68e1851 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,5 +1,4 @@ -# -# Copyright 2016 National Renewable Energy Laboratory +# Copyright 2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 27a5c66a07a3e6f95a612d1c766e9124d5a56255 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:06:29 +0000 Subject: [PATCH 075/190] ENH: Get dockerfile if running workflow on an older version --- .github/workflows/build-docker-image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 18cc28aa5b..9a8d87be8f 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -15,6 +15,9 @@ jobs: build-and-push: runs-on: ubuntu-latest timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile steps: - name: Checkout uses: actions/checkout@v4 @@ -30,11 +33,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get Dockerfile for versions < 3.5.3 + run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + - name: Build and push to registry uses: docker/build-push-action@v3.1.1 with: context: . - file: share/docker/openfast_ubuntu/Dockerfile + file: $DOCKERFILE_PATH platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From e43e760f4e7f718237964f72e759afa949b516cd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:15:13 +0000 Subject: [PATCH 076/190] OPS: Use correct docker action versions --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 9a8d87be8f..e03ced49d7 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -28,7 +28,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to DockerHub - uses: docker/login-action@v5 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,7 +37,7 @@ jobs: run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi - name: Build and push to registry - uses: docker/build-push-action@v3.1.1 + uses: docker/build-push-action@v5 with: context: . file: $DOCKERFILE_PATH From a51922aae4b9c26931e35b06390c5454b799316c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:24:58 +0000 Subject: [PATCH 077/190] OPS: Use environment context instead of environment variables --- .github/workflows/build-docker-image.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index e03ced49d7..2643483304 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,13 +34,16 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get Dockerfile for versions < 3.5.3 - run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + run: | + if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ + then wget -O ${{ env.DOCKERFILE_PATH }} ${{ env.DOCKERFILE_PERMALINK }}; \ + fi - name: Build and push to registry uses: docker/build-push-action@v5 with: context: . - file: $DOCKERFILE_PATH + file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From 24bd1ff914261c6c8fb01b3ada9a4307c96014cd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:43:36 +0000 Subject: [PATCH 078/190] ENH: Use `--no-install-recommends` in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 40e68e1851..2c991eb2c6 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,7 +25,7 @@ FROM ${BASE} AS build ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ software-properties-common \ build-essential \ cmake \ @@ -64,7 +64,7 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ libblas-dev \ liblapack-dev \ nano \ From 8cbac60679b8d64b184b30b4cde550c5afa58cca Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:44:40 +0000 Subject: [PATCH 079/190] OPS: Factor out and fix docker repository in docker workflow --- .github/workflows/build-docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 2643483304..393ee1daa0 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,6 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile + DOCKER_HUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -45,7 +46,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: nrel/openfast:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From e38e88be5566cd685c2a528c0d02818a11699ae4 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 26 Mar 2024 11:16:18 -0600 Subject: [PATCH 080/190] VSbuild: always build Registry as release x64 Also updated some VS solution versions to 16 from older versions. --- vs-build/AeroDyn/AeroDyn_Driver.sln | 32 ++++++------ .../AeroDyn_Inflow_c_binding.sln | 40 +++++++------- vs-build/BeamDyn/BeamDyn-w-registry.sln | 36 ++++++------- vs-build/FAST-farm/FAST-Farm.sln | 31 ++++++----- vs-build/FAST/FAST.sln | 52 +++++++++---------- .../HydroDyn_c_binding/HydroDyn_c_binding.sln | 37 +++++++------ vs-build/InflowWind/InflowWind_driver.sln | 40 +++++++------- .../InflowWind_c_binding.sln | 39 +++++++------- .../MoorDyn_c_binding/MoorDyn_c_binding.sln | 34 ++++++------ vs-build/Registry/FAST_Registry.sln | 16 +++--- vs-build/SubDyn/SubDyn.sln | 32 ++++++------ vs-build/UnsteadyAero/UnsteadyAero.sln | 36 ++++++------- 12 files changed, 217 insertions(+), 208 deletions(-) diff --git a/vs-build/AeroDyn/AeroDyn_Driver.sln b/vs-build/AeroDyn/AeroDyn_Driver.sln index 2941d4240d..8740ec04d1 100644 --- a/vs-build/AeroDyn/AeroDyn_Driver.sln +++ b/vs-build/AeroDyn/AeroDyn_Driver.sln @@ -44,26 +44,26 @@ Global {97CEFEB9-1DCB-470E-A231-E1DA2F21A9CE}.Release|Win32.Build.0 = Release|Win32 {97CEFEB9-1DCB-470E-A231-E1DA2F21A9CE}.Release|x64.ActiveCfg = Release|x64 {97CEFEB9-1DCB-470E-A231-E1DA2F21A9CE}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln index e9a3790633..afcaf61582 100644 --- a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln +++ b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln @@ -44,26 +44,26 @@ Global {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|Win32.Build.0 = Release|Win32 {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|x64.ActiveCfg = Release|x64 {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/BeamDyn/BeamDyn-w-registry.sln b/vs-build/BeamDyn/BeamDyn-w-registry.sln index 0261cbdc7e..ad771b9736 100644 --- a/vs-build/BeamDyn/BeamDyn-w-registry.sln +++ b/vs-build/BeamDyn/BeamDyn-w-registry.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.902 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "BeamDyn", "BeamDyn.vfproj", "{815C302F-A93D-4C22-9329-7112345113C0}" ProjectSection(ProjectDependencies) = postProject @@ -38,22 +38,22 @@ Global {815C302F-A93D-4C22-9329-7112345113C0}.Release|Win32.Build.0 = Release|Win32 {815C302F-A93D-4C22-9329-7112345113C0}.Release|x64.ActiveCfg = Release|x64 {815C302F-A93D-4C22-9329-7112345113C0}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/FAST-farm/FAST-Farm.sln b/vs-build/FAST-farm/FAST-Farm.sln index b7159f95f0..6e4a35a35b 100644 --- a/vs-build/FAST-farm/FAST-Farm.sln +++ b/vs-build/FAST-farm/FAST-Farm.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "FASTlib", "..\FASTlib\FASTlib.vfproj", "{1A440C5B-CBA6-47D9-9CC2-C1CBA8C00BF9}" ProjectSection(ProjectDependencies) = postProject @@ -55,18 +55,18 @@ Global {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|Win32.Build.0 = Release|Win32 {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|x64.ActiveCfg = Release|x64 {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 {F47C7C94-2A7F-4CBE-B834-1BC7DD3FE692}.Debug|Win32.ActiveCfg = Debug|Win32 {F47C7C94-2A7F-4CBE-B834-1BC7DD3FE692}.Debug|Win32.Build.0 = Debug|Win32 {F47C7C94-2A7F-4CBE-B834-1BC7DD3FE692}.Debug|x64.ActiveCfg = Debug|x64 @@ -83,4 +83,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {13BD9A6C-E2B3-4423-AA37-D06CB518B5B2} + EndGlobalSection EndGlobal diff --git a/vs-build/FAST/FAST.sln b/vs-build/FAST/FAST.sln index ec3d691059..b00e2fd96d 100644 --- a/vs-build/FAST/FAST.sln +++ b/vs-build/FAST/FAST.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "FAST", "FAST.vfproj", "{18AE8067-CCC6-4479-A0DB-C4089EF9FE71}" ProjectSection(ProjectDependencies) = postProject @@ -110,30 +110,30 @@ Global {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|Win32.Build.0 = Release|Win32 {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|x64.ActiveCfg = Release|x64 {BF86702A-CB17-4050-8AE9-078CDC5910D3}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Matlab|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Matlab|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 {C3C93CC0-EDD7-438F-988C-1F917FAEFA67}.Debug_Double|Win32.ActiveCfg = Debug_Matlab|Win32 {C3C93CC0-EDD7-438F-988C-1F917FAEFA67}.Debug_Double|x64.ActiveCfg = Debug_Matlab|x64 {C3C93CC0-EDD7-438F-988C-1F917FAEFA67}.Debug_Matlab|Win32.ActiveCfg = Debug_Matlab|Win32 diff --git a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln index 7d4579ad4f..7cf1c9b185 100644 --- a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln +++ b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30503.244 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{A2215CCC-531E-454C-A1F0-E502FB697697}") = "HydroDyn_c_binding.dll", "HydroDyn_c_binding.vfproj", "{FDA4A02B-B3A7-4D06-847C-941BE44E76FB}" +Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "HydroDyn_c_binding", "HydroDyn_c_binding.vfproj", "{FDA4A02B-B3A7-4D06-847C-941BE44E76FB}" ProjectSection(ProjectDependencies) = postProject {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16} = {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16} EndProjectSection @@ -38,24 +38,27 @@ Global {FDA4A02B-B3A7-4D06-847C-941BE44E76FB}.Release|Win32.Build.0 = Release|Win32 {FDA4A02B-B3A7-4D06-847C-941BE44E76FB}.Release|x64.ActiveCfg = Release|x64 {FDA4A02B-B3A7-4D06-847C-941BE44E76FB}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {49DA4583-1BAB-4459-8F53-EB898075680D} + EndGlobalSection EndGlobal diff --git a/vs-build/InflowWind/InflowWind_driver.sln b/vs-build/InflowWind/InflowWind_driver.sln index c1f9d4753e..34d19df2cc 100644 --- a/vs-build/InflowWind/InflowWind_driver.sln +++ b/vs-build/InflowWind/InflowWind_driver.sln @@ -44,26 +44,26 @@ Global {3BBE2741-5B28-47BC-9E7F-3E1D172838FB}.Release|Win32.Build.0 = Release|Win32 {3BBE2741-5B28-47BC-9E7F-3E1D172838FB}.Release|x64.ActiveCfg = Release|x64 {3BBE2741-5B28-47BC-9E7F-3E1D172838FB}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_OpenMP|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln b/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln index 03d412a05f..0e197cdd45 100644 --- a/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln +++ b/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "InflowWind_c_binding", "InflowWind_c_binding.vfproj", "{5D991B19-D4F1-4F29-8A9D-FC36DFF07290}" ProjectSection(ProjectDependencies) = postProject @@ -38,24 +38,27 @@ Global {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|Win32.Build.0 = Release|Win32 {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|x64.ActiveCfg = Release|x64 {5D991B19-D4F1-4F29-8A9D-FC36DFF07290}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7DBCF286-C404-4F79-A1F2-3A04C4859A09} + EndGlobalSection EndGlobal diff --git a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln index fa41e081d7..2919d0e87f 100644 --- a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln +++ b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31613.86 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{EBD10482-CD70-4409-938D-86A4D2DED606}") = "MoorDyn_c_binding.dll", "MoorDyn_c_binding.vfproj", "{25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}" +Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "MoorDyn_c_binding", "MoorDyn_c_binding.vfproj", "{25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}" ProjectSection(ProjectDependencies) = postProject {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16} = {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16} EndProjectSection @@ -38,22 +38,22 @@ Global {25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}.Release|Win32.Build.0 = Release|Win32 {25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}.Release|x64.ActiveCfg = Release|x64 {25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/Registry/FAST_Registry.sln b/vs-build/Registry/FAST_Registry.sln index 689421c6c9..35916e4a55 100644 --- a/vs-build/Registry/FAST_Registry.sln +++ b/vs-build/Registry/FAST_Registry.sln @@ -1,20 +1,20 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FAST_Registry", "FAST_Registry.vcxproj", "{DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Debug|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Debug|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Debug|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/SubDyn/SubDyn.sln b/vs-build/SubDyn/SubDyn.sln index 817a37d8cd..14d6d2cc76 100644 --- a/vs-build/SubDyn/SubDyn.sln +++ b/vs-build/SubDyn/SubDyn.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.4.33205.214 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "SubDyn", "SubDyn.vfproj", "{815C302F-A93D-4C22-9329-717B085113C0}" ProjectSection(ProjectDependencies) = postProject @@ -38,22 +38,22 @@ Global {815C302F-A93D-4C22-9329-717B085113C0}.Release|Win32.Build.0 = Release|Win32 {815C302F-A93D-4C22-9329-717B085113C0}.Release|x64.ActiveCfg = Release|x64 {815C302F-A93D-4C22-9329-717B085113C0}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Debug|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Debug|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Debug|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Debug|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/vs-build/UnsteadyAero/UnsteadyAero.sln b/vs-build/UnsteadyAero/UnsteadyAero.sln index 4daa940c63..c568390f6e 100644 --- a/vs-build/UnsteadyAero/UnsteadyAero.sln +++ b/vs-build/UnsteadyAero/UnsteadyAero.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.902 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34031.81 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "UnsteadyAero", "UnsteadyAero.vfproj", "{815C302F-A93D-4C22-9329-717B085113C0}" ProjectSection(ProjectDependencies) = postProject @@ -38,22 +38,22 @@ Global {815C302F-A93D-4C22-9329-717B085113C0}.Release|Win32.Build.0 = Release|Win32 {815C302F-A93D-4C22-9329-717B085113C0}.Release|x64.ActiveCfg = Release|x64 {815C302F-A93D-4C22-9329-717B085113C0}.Release|x64.Build.0 = Release|x64 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|Win32 - {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|Win32 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Debug|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release_Double|x64.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|Win32.Build.0 = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.ActiveCfg = Release|x64 + {DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From c53164d76e3646a40028ab2da209383952bca39f Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Tue, 26 Mar 2024 19:00:40 +0000 Subject: [PATCH 081/190] Add initialization of MHK, WtrDpth, MSL2SWL in IfW_InitInp for AWAE module These members of the InflowWind initialization input DDT weren't being initialized and could potentially cause issues in the code when using FAST.Farm. Fixed by initializing values. --- modules/awae/src/AWAE.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/awae/src/AWAE.f90 b/modules/awae/src/AWAE.f90 index 4710c2dcf9..86c882e235 100644 --- a/modules/awae/src/AWAE.f90 +++ b/modules/awae/src/AWAE.f90 @@ -958,6 +958,9 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO IfW_InitInp%lidar%HubPosition = 0.0_ReKi IfW_InitInp%lidar%SensorType = SensorType_None IfW_InitInp%Use4Dext = .false. + IfW_InitInp%MHK = 0 !FIXME: after merge to dev, change this test to use MHK_None + IfW_InitInp%WtrDpth = 0.0_ReKi + IfW_InitInp%MSL2SWL = 0.0_ReKi if ( p%Mod_AmbWind == 2 ) then ! one InflowWind module From 9f5cb77b9a9164b0c6f409f808aab3da40624422 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Tue, 26 Mar 2024 19:02:44 +0000 Subject: [PATCH 082/190] Use of potentially unallocated array in AeroDyn_AllBldNdOuts. The array p_AD%FVW%Bld2Wings was indexed with iRot even if the array hadn't been allocated. This is not valid code, which was fixed by adding an if statement to only use the array if WakeMod is FVW --- modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 b/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 index 1318ab04e2..54b239e4e2 100644 --- a/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 @@ -301,7 +301,7 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, Indx nNd = p%NumBlNds R_li => m%R_li ! inertial to local-polar R_wi => m%orientationAnnulus ! inertial to without-sweep-pitch-twist or orientation annulus (TODO: deprecate me) - W2B => p_AD%FVW%Bld2Wings(iRot, :) ! From Wing index to blade index + if (p_AD%WakeMod == WakeMod_FVW) W2B => p_AD%FVW%Bld2Wings(iRot, :) ! From Wing index to blade index ! Initialize some things ErrMsg = '' From 75f35b672a9f20787a9ea0322696daf4dfcec19f Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 26 Mar 2024 11:45:25 -0600 Subject: [PATCH 083/190] VSbuild: increase stack size for FAST.Farm --- vs-build/FAST-farm/FAST-Farm.vfproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vs-build/FAST-farm/FAST-Farm.vfproj b/vs-build/FAST-farm/FAST-Farm.vfproj index e88a7fab0d..e7c3152f30 100644 --- a/vs-build/FAST-farm/FAST-Farm.vfproj +++ b/vs-build/FAST-farm/FAST-Farm.vfproj @@ -6,7 +6,7 @@ - + From 70c0870859f7302720d0af7f4ab70578d8e4423e Mon Sep 17 00:00:00 2001 From: Andy Platt Date: Tue, 26 Mar 2024 15:37:23 -0600 Subject: [PATCH 084/190] CMake: openmp optional for FF and CPP if not explicitly requested (#2120) If using FAST.Farm or the CPP API, optionally use OpenMP if it can be found Co-authored-by: Derek Slaughter --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f2b48a625..20297c27b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,8 +110,11 @@ include(${CMAKE_SOURCE_DIR}/cmake/set_rpath.cmake) # OpenMP #------------------------------------------------------------------------------- -if (OPENMP OR BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) - FIND_PACKAGE(OpenMP REQUIRED) +if (OPENMP) + FIND_PACKAGE(OpenMP REQUIRED) +endif() +if (BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) + FIND_PACKAGE(OpenMP) if (OpenMP_Fortran_FOUND) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") link_libraries("${OpenMP_Fortran_LIBRARIES}") From db7e686ac4a4c0952a08cf1bd8acaf9872d22f8d Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 26 Mar 2024 16:13:46 -0600 Subject: [PATCH 085/190] Update docs for release 3.5.3 --- docs/changelogs/v3.5.3.md | 109 ++++++++++++++++++++++++++++++++ docs/conf.py | 2 +- docs/source/user/api_change.rst | 6 ++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 docs/changelogs/v3.5.3.md diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md new file mode 100644 index 0000000000..911429a610 --- /dev/null +++ b/docs/changelogs/v3.5.3.md @@ -0,0 +1,109 @@ +**Feature or improvement description** +Pull request to merge `rc-3.5.3` into `main` and create a tagged release for v3.5.3. + +See the milestone and project pages for additional information + + https://github.com/OpenFAST/openfast/milestone/13 + +Test results, if applicable +See GitHub Actions + +### Release checklist: +- [ ] Update the documentation version in docs/conf.py +- [ ] Update the versions in docs/source/user/api_change.rst +- [ ] Verify readthedocs builds correctly +- [ ] Create a tag in OpenFAST +- [ ] Create a merge commit in r-test and add a corresponding annotated tag +- [ ] Compile executables for Windows builds + - [ ] AeroDyn_Driver_x64.exe + - [ ] AeroDyn_Driver_x64_OpenMP.exe + - [ ] AeroDyn_Inflow_C_Binding_x64.dll + - [ ] AeroDyn_Inflow_C_Binding_x64_OpenMP.dll + - [ ] BeamDyn_Driver_x64.exe + - [ ] DISCON.dll (x64) + - [ ] DISCON_ITIBarge.dll (x64) + - [ ] DISCON_OC3Hywind.dll (x64) + - [ ] DISCON_SC.dll (x64) + - [ ] FAST.Farm_x64.exe + - [ ] FAST.Farm_x64_OMP.exe + - [ ] FAST_SFunc.mexw64 + - [ ] HydroDynDriver_x64.exe + - [ ] HydroDyn_C_Binding_x64.dll + - [ ] IfW_C_Binding_x64.dll + - [ ] InflowWind_Driver_x64.exe + - [ ] InflowWind_Driver_x64_OpenMP.exe + - [ ] MoorDyn_Driver_x64.exe + - [ ] MoorDyn_C_Binding_x64.dll + - [ ] OpenFAST-Simulink_x64.dll + - [ ] openfast_x64.exe + +# Changelog + +## General + +### Build systems + +#2116 VSbuild: always build Registry as release x64 (@andrew-platt) +#2120 CMake: openmp optional for FF and CPP if not explicitly requested (@andrew-platt and @deslaughter) + + +### GH actions + +#2041 Upgrade to setup-python@v4 and cache@v4 for GH actions (@andrew-platt) + + +## Solvers + +### OpenFAST + +#2060 Fix BD + AD linearization indexing (negative damping results) (@deslaugher and @andrew-platt) +#2063 Fix bug in BD linearization resulting from reference rotation change (@deslaughter) + + +## Module changes + +### Multiple + +#2118 Fix use of uninitialized variables in FAST.Farm and increase stack size in Visual Studio (@deslaughter and @andrew-platt) + + +### BeamDyn + +#2085 Bug: BeamDyn Initial Strain and Linearization (@deslaughter) + + +### MoorDyn + +#2049 Backport of bathymetry bugfixes in #2013 and #2016 (@RyanDavies19) + + +### OpenFAST library + +#2097 Consistent use of turbine indexing when coupled to c/c++ (@andrew-platt and @deslaughter) + + +### ServoDyn + +#2079 Handling of Paths for SrvD UserSubs Input Files (@rdamiani) + + +### TurbSim + +#2102 TurbSim: increase filename to 1024 characters (@andrew-platt) + + +## Regression tests + +#2038 Add linearization regression tests (@andrew-platt) +#2055 Lin tests: increase out precision, error printing full filename, add SD linearization test (@andrew-platt) + + + +## Input file changes + +No input files change with this release, as this only includes minor bugfixes. + +Full list of changes: https://openfast.readthedocs.io/en/main/source/user/api_change.html + +Full input file sets: https://github.com/OpenFAST/r-test/tree/v3.5.3 (example input files from the regression testing) + diff --git a/docs/conf.py b/docs/conf.py index c917452dac..146fb2b413 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -130,7 +130,7 @@ def runDoxygen(sourcfile, doxyfileIn, doxyfileOut): # The short X.Y version. version = u'3.5' # The full version, including alpha/beta/rc tags. -release = u'v3.5.2' +release = u'v3.5.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/user/api_change.rst b/docs/source/user/api_change.rst index 7a09d05257..07af23f90c 100644 --- a/docs/source/user/api_change.rst +++ b/docs/source/user/api_change.rst @@ -9,6 +9,12 @@ The changes are tabulated according to the module input file, line number, and f The line number corresponds to the resulting line number after all changes are implemented. Thus, be sure to implement each in order so that subsequent line numbers are correct. +OpenFAST v3.5.2 to OpenFAST v3.5.3 +---------------------------------- + +No input file changes were made. + + OpenFAST v3.5.1 to OpenFAST v3.5.2 ---------------------------------- From 8de46aa8fbcdd6b2b87937eb81dc60f2c67f0b1f Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:43:42 +0000 Subject: [PATCH 086/190] OPS: Add comment explaining Dockerfile download step --- .github/workflows/build-docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 393ee1daa0..5dbc379a9c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,6 +34,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build + # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the + # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From c6aee2b4fa73eb05b5f4cc677a8fa7ce6b327ae1 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:44:26 +0000 Subject: [PATCH 087/190] OPS: Rename environment variable for consistency --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 5dbc379a9c..f168e08ba1 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,7 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile - DOCKER_HUB_REPOSITORY: octue/openfast + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 9a121352ca3cb9ae661fba58bf41deb1609e52a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:45:09 +0000 Subject: [PATCH 088/190] CHO: Move `.idea` into correct section of `.gitignore` --- .gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5cf777ca93..8004a8eb5d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,8 @@ vs-build/ .atom .fortls .devcontainer +.idea + # backup files *.asv ~$*.xlsx @@ -54,6 +56,3 @@ vs-build/ #Simulink cache files varcache *.slxc - -# JetBrains IDEs config -.idea From 520931cc001ab3ceea93527f97bc23e2aa472bd7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:05 +0000 Subject: [PATCH 089/190] ENH: Add 2016 to start of copyright notice in Dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2c991eb2c6..89e5b74ba1 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2024 National Renewable Energy Laboratory +# Copyright 2016-2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From aab4a6d66ca92ed81fc0750f41d5091a99424a92 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:21 +0000 Subject: [PATCH 090/190] OPS: Build docker image for `linux/aarch64` too --- .github/workflows/build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index f168e08ba1..0452726552 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -48,7 +48,7 @@ jobs: with: context: . file: ${{ env.DOCKERFILE_PATH }} - platforms: linux/amd64 + platforms: linux/amd64,linux/aarch64 tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha From 14e77db76d68e98bdcf9f2e4bac859d1438229a3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 12:06:49 +0000 Subject: [PATCH 091/190] OPS: Add description to docker workflow --- .github/workflows/build-docker-image.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 0452726552..76a8a20060 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -1,3 +1,6 @@ +# This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for +# the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed +# to the `nrel/openfast` repository. The build cache is stored in GitHub actions. name: build-docker-image on: @@ -34,9 +37,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build - # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the - # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. + # The updated Dockerfile is only available in the repository at the tag v3.5.3 and above. To build versions of + # OpenFAST that are below this version, the updated Dockerfile from that tag of the repository has to be acquired + # before building. For versions >= v3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From 3e06eab46819a2b97fe1f05e58abd12f729ccd7e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:11:36 +0000 Subject: [PATCH 092/190] OPS: Add automatic docker build on merge into `main` from RC branches --- .../build-docker-image-automatic.yml | 48 +++++++++++++++++++ ...mage.yml => build-docker-image-manual.yml} | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docker-image-automatic.yml rename .github/workflows/{build-docker-image.yml => build-docker-image-manual.yml} (98%) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml new file mode 100644 index 0000000000..1eb16128fe --- /dev/null +++ b/.github/workflows/build-docker-image-automatic.yml @@ -0,0 +1,48 @@ +# This workflow builds an OpenFAST docker image for the linux/amd64 and linux/aarch64 architectures on merge into +# `main` from a release candidate branch. The image is tagged both with "latest" and the version extracted from the +# release candidate branch's name (e.g. "rc-3.5.3") before being pushed to the `nrel/openfast` repository. The build +# cache is stored in GitHub actions. +name: build-docker-image-automatic + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + build-and-push: + if: ${{ (github.event.pull_request.merged == true) && startsWith(github.head_ref, 'rc-') }} + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Build and push to registry + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64,linux/aarch64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest + push: true + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image-manual.yml similarity index 98% rename from .github/workflows/build-docker-image.yml rename to .github/workflows/build-docker-image-manual.yml index 76a8a20060..088854ff93 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -1,7 +1,7 @@ # This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for # the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed # to the `nrel/openfast` repository. The build cache is stored in GitHub actions. -name: build-docker-image +name: build-docker-image-manual on: workflow_dispatch: From 0e8a61a5d0c5c2af90f215bb47942343413e0206 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:15:00 +0000 Subject: [PATCH 093/190] OPS: Add `test-build-docker-image` workflow --- .github/workflows/test-build-docker-image.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test-build-docker-image.yml diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml new file mode 100644 index 0000000000..0d4e0b85a6 --- /dev/null +++ b/.github/workflows/test-build-docker-image.yml @@ -0,0 +1,36 @@ +# This workflow tests building an OpenFAST docker image for the linux/amd64 architecture on push to a release candidate +# branch. The build cache is stored in GitHub actions. +name: test-build-docker-image + +on: + pull_request: + branches: + - main + +jobs: + test-build: + if: startsWith(github.head_ref, 'rc-') + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Test building docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64 + push: false + cache-from: type=gha + cache-to: type=gha,mode=max From 7f4b5513e6289298774b78b9f2a364702d0b1bb6 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 27 Mar 2024 14:37:47 -0600 Subject: [PATCH 094/190] CMake: openmp optional for FF and CPP if not explicitly requested (correction) --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20297c27b6..b2dc54651d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,11 +110,13 @@ include(${CMAKE_SOURCE_DIR}/cmake/set_rpath.cmake) # OpenMP #------------------------------------------------------------------------------- -if (OPENMP) +if (OPENMP OR BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) + if (OPENMP) FIND_PACKAGE(OpenMP REQUIRED) -endif() -if (BUILD_FASTFARM OR BUILD_OPENFAST_CPP_API) - FIND_PACKAGE(OpenMP) + else() + # Optional for FF or the CPP interface + FIND_PACKAGE(OpenMP) + endif() if (OpenMP_Fortran_FOUND) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") link_libraries("${OpenMP_Fortran_LIBRARIES}") From 4a04caa749887192e2a904b9a3b393d4cbb1d5af Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 10:22:00 +0000 Subject: [PATCH 095/190] ENH: Use long-term-support ubuntu base by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 89e5b74ba1..e4774eb803 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARG BASE=ubuntu:mantic +ARG BASE=ubuntu:jammy # Build stage 1: builds openfast. FROM ${BASE} AS build From a6d4197bc67b9abc89684e8af592dbe81578950b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:02:23 +0000 Subject: [PATCH 096/190] DOC: Update documentation --- docs/source/install/index.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 9da66481dc..fd06e3b1c6 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -11,8 +11,8 @@ maintained paths for obtaining an OpenFAST executable. Most users of OpenFAST will not require modifying or compiling the source code. **For the simplest installation of OpenFAST without changing the source -code,** refer to the table in the :ref:`download_binaries` section and read -the corresponding documentation for specific instructions. +code,** refer to the table in the :ref:`download_binaries` or :ref:`use_docker` +sections and read the corresponding documentation for specific instructions. For instructions on compiling, see :ref:`compile_from_source`. .. _download_binaries: @@ -154,6 +154,30 @@ containing the executables, and running a simple test command: cd C:\your\path\Desktop\openfast_binaries\ openfast_x64.exe /h + +.. _use_docker: + +Use a docker image +~~~~~~~~~~~~~~~~~~ +Multiple versions of OpenFAST are available as docker images from our `docker registry `_. +To pull and run one with files from your local machine available, run: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 openfast /files/main.fst + +This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same +local directory as the input files. You can also run commands inside the container with: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 /bin/bash + +Build your own images +~~~~~~~~~~~~~~~~~~~~~ +You can also build your own custom images using our `Dockerfile` or base your images on ours. See +`here ` for more information on this. + .. _compile_from_source: Compile from source From 6b2e89000d2d8f46aa5fe7943cc922b3e2c77a89 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:03:16 +0000 Subject: [PATCH 097/190] DOC: Update dockerfile readme --- share/docker/openfast_ubuntu/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md index 3f5568f166..371f1a81f1 100644 --- a/share/docker/openfast_ubuntu/README.md +++ b/share/docker/openfast_ubuntu/README.md @@ -2,7 +2,7 @@ ## Summary The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and -in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +in the cloud without much setup. By default, it's based on Ubuntu Jammy and is optimised in size and performance for production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. @@ -15,7 +15,7 @@ Provide any of the following build arguments to customise the image at build tim | Name | Type | Allowed values | Default | Description | | --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| -| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:mantic` | The docker image to base the OpenFAST image on. | +| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | | `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | | `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | | `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | From 26c48da56fa7fb982df63fd6680bf270aff167da Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:06:55 +0000 Subject: [PATCH 098/190] DOC: Fix link in docs --- docs/source/install/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index fd06e3b1c6..50fbb647a9 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -176,7 +176,7 @@ local directory as the input files. You can also run commands inside the contain Build your own images ~~~~~~~~~~~~~~~~~~~~~ You can also build your own custom images using our `Dockerfile` or base your images on ours. See -`here ` for more information on this. +`here `_ for more information on this. .. _compile_from_source: From 11c8cbf76bef6420d048ec19aca43db23e791cfd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:36:49 +0000 Subject: [PATCH 099/190] OPS: Fix version extraction --- .github/workflows/test-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 0d4e0b85a6..2f4713b0a5 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -23,7 +23,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Test building docker image uses: docker/build-push-action@v5 From 1c3115f7f366530036a134f08756c2b10fc8a77e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:40:33 +0000 Subject: [PATCH 100/190] OPS: Use extracted tag in test workflow --- .github/workflows/test-build-docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 2f4713b0a5..26652ace25 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -14,6 +14,7 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +32,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }} push: false cache-from: type=gha cache-to: type=gha,mode=max From 5e804279025de38990267210cec761b20502f74e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 14:21:54 +0000 Subject: [PATCH 101/190] OPS: Fix tag extraction in automated docker workflow --- .github/workflows/build-docker-image-automatic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 1eb16128fe..507d9183b4 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -34,7 +34,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Build and push to registry uses: docker/build-push-action@v5 From 81357c360ece2bead5a18f0280ce751a61fdf9ee Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 28 Mar 2024 11:03:56 -0600 Subject: [PATCH 102/190] VSbuild: set VS version to VS 2017 Visual Studio 15 VisualStudioVersion = 15.0.28307.902 --- vs-build/AeroDyn/AeroDyn_Driver.sln | 4 ++-- .../AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln | 4 ++-- vs-build/BeamDyn/BeamDyn-w-registry.sln | 4 ++-- vs-build/FAST-farm/FAST-Farm.sln | 4 ++-- vs-build/FAST/FAST.sln | 4 ++-- vs-build/HydroDyn/HydroDynDriver.sln | 4 ++-- vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln | 4 ++-- vs-build/InflowWind/InflowWind_driver.sln | 4 ++-- vs-build/InflowWind_c_binding/InflowWind_c_binding.sln | 4 ++-- vs-build/MoorDyn/MoorDynDriver.sln | 4 ++-- vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln | 4 ++-- vs-build/Registry/FAST_Registry.sln | 4 ++-- vs-build/SC_DLL/SC_DLL.sln | 4 ++-- vs-build/SubDyn/SubDyn.sln | 4 ++-- vs-build/UnsteadyAero/UnsteadyAero.sln | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/vs-build/AeroDyn/AeroDyn_Driver.sln b/vs-build/AeroDyn/AeroDyn_Driver.sln index 8740ec04d1..f9a1f191eb 100644 --- a/vs-build/AeroDyn/AeroDyn_Driver.sln +++ b/vs-build/AeroDyn/AeroDyn_Driver.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.33529.622 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "AeroDyn_Driver", "AeroDyn_Driver.vfproj", "{97CEFEB9-1DCB-470E-A231-E1DA2F21A9CE}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln index afcaf61582..295a6d1e8d 100644 --- a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln +++ b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.33529.622 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "AeroDyn_Inflow_c_binding", "AeroDyn_Inflow_c_binding.vfproj", "{5D991B19-D4F1-4F29-8A9D-FC36DFF07290}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/BeamDyn/BeamDyn-w-registry.sln b/vs-build/BeamDyn/BeamDyn-w-registry.sln index ad771b9736..573fd9f26f 100644 --- a/vs-build/BeamDyn/BeamDyn-w-registry.sln +++ b/vs-build/BeamDyn/BeamDyn-w-registry.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "BeamDyn", "BeamDyn.vfproj", "{815C302F-A93D-4C22-9329-7112345113C0}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/FAST-farm/FAST-Farm.sln b/vs-build/FAST-farm/FAST-Farm.sln index 6e4a35a35b..bab76b0d32 100644 --- a/vs-build/FAST-farm/FAST-Farm.sln +++ b/vs-build/FAST-farm/FAST-Farm.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "FASTlib", "..\FASTlib\FASTlib.vfproj", "{1A440C5B-CBA6-47D9-9CC2-C1CBA8C00BF9}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/FAST/FAST.sln b/vs-build/FAST/FAST.sln index b00e2fd96d..f1f08b2b9d 100644 --- a/vs-build/FAST/FAST.sln +++ b/vs-build/FAST/FAST.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "FAST", "FAST.vfproj", "{18AE8067-CCC6-4479-A0DB-C4089EF9FE71}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/HydroDyn/HydroDynDriver.sln b/vs-build/HydroDyn/HydroDynDriver.sln index cc5662783c..b4743e108f 100644 --- a/vs-build/HydroDyn/HydroDynDriver.sln +++ b/vs-build/HydroDyn/HydroDynDriver.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30503.244 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "HydroDynDriver", "HydroDynDriver.vfproj", "{815C302F-A93D-4C22-9329-717B085113C0}" EndProject diff --git a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln index 7cf1c9b185..753bece4fc 100644 --- a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln +++ b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30503.244 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "HydroDyn_c_binding", "HydroDyn_c_binding.vfproj", "{FDA4A02B-B3A7-4D06-847C-941BE44E76FB}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/InflowWind/InflowWind_driver.sln b/vs-build/InflowWind/InflowWind_driver.sln index 34d19df2cc..6bc82e29a1 100644 --- a/vs-build/InflowWind/InflowWind_driver.sln +++ b/vs-build/InflowWind/InflowWind_driver.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.33529.622 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "InflowWind_driver", "InflowWind_driver.vfproj", "{3BBE2741-5B28-47BC-9E7F-3E1D172838FB}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln b/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln index 0e197cdd45..24fde71ef9 100644 --- a/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln +++ b/vs-build/InflowWind_c_binding/InflowWind_c_binding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "InflowWind_c_binding", "InflowWind_c_binding.vfproj", "{5D991B19-D4F1-4F29-8A9D-FC36DFF07290}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/MoorDyn/MoorDynDriver.sln b/vs-build/MoorDyn/MoorDynDriver.sln index 26252cc2de..29001b4108 100644 --- a/vs-build/MoorDyn/MoorDynDriver.sln +++ b/vs-build/MoorDyn/MoorDynDriver.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31613.86 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{A1373E92-2C9A-4B4D-BE47-0B46E317E1A8}") = "MoorDynDriver", "MoorDynDriver.vfproj", "{E91DED35-18F8-415F-9719-59DFBA79CB2C}" EndProject diff --git a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln index 2919d0e87f..d9d928b345 100644 --- a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln +++ b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31613.86 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "MoorDyn_c_binding", "MoorDyn_c_binding.vfproj", "{25689C95-9A3C-41A1-B0E6-5B292B6EFBE9}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/Registry/FAST_Registry.sln b/vs-build/Registry/FAST_Registry.sln index 35916e4a55..c79ad0bab2 100644 --- a/vs-build/Registry/FAST_Registry.sln +++ b/vs-build/Registry/FAST_Registry.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FAST_Registry", "FAST_Registry.vcxproj", "{DA16A3A6-3297-4628-9E46-C6FA0E3C4D16}" EndProject diff --git a/vs-build/SC_DLL/SC_DLL.sln b/vs-build/SC_DLL/SC_DLL.sln index 54daab58ef..ce221a58ed 100644 --- a/vs-build/SC_DLL/SC_DLL.sln +++ b/vs-build/SC_DLL/SC_DLL.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.40629.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "SC_DLL", "SC_DLL.vfproj", "{183CC593-AD4C-9643-81C1-7D6085A9A5ED}" EndProject diff --git a/vs-build/SubDyn/SubDyn.sln b/vs-build/SubDyn/SubDyn.sln index 14d6d2cc76..fc06af462c 100644 --- a/vs-build/SubDyn/SubDyn.sln +++ b/vs-build/SubDyn/SubDyn.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "SubDyn", "SubDyn.vfproj", "{815C302F-A93D-4C22-9329-717B085113C0}" ProjectSection(ProjectDependencies) = postProject diff --git a/vs-build/UnsteadyAero/UnsteadyAero.sln b/vs-build/UnsteadyAero/UnsteadyAero.sln index c568390f6e..9fbf677f9f 100644 --- a/vs-build/UnsteadyAero/UnsteadyAero.sln +++ b/vs-build/UnsteadyAero/UnsteadyAero.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.34031.81 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.902 MinimumVisualStudioVersion = 10.0.40219.1 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "UnsteadyAero", "UnsteadyAero.vfproj", "{815C302F-A93D-4C22-9329-717B085113C0}" ProjectSection(ProjectDependencies) = postProject From e45a51852f42f3a32c315f22f4d70fbe510ee185 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Thu, 28 Mar 2024 19:58:12 +0000 Subject: [PATCH 103/190] Add empty requirements.txt in repo root to work around setup-python issue on GH actions --- requirements.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..d01907317d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,15 @@ +# This file was added to work around an issue with setup-python for non-Python projects, +# which fails with this error: +# +# Run actions/setup-python@v5.0.0 +# with: +# python-version: 3.12 +# cache: pip +# Installed versions +# Successfully set up CPython (3.12.1) +# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to +# [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository +# +# This has been reported at: https://github.com/actions/setup-python/issues/807 +# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762 +# or https://github.com/actions/setup-python/issues/751 \ No newline at end of file From b55f2e9e56a9df0c2c6a3e6e677ef8d729f266a9 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Thu, 28 Mar 2024 20:32:39 +0000 Subject: [PATCH 104/190] Attempt using requirements.txt to install testing dependencies --- .github/workflows/automated-dev-tests.yml | 54 ++++++++--------------- requirements.txt | 18 ++------ 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 8c5b14327f..49e6882213 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -46,8 +46,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev - name: Setup workspace @@ -132,8 +131,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev - name: Setup workspace @@ -178,8 +176,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev # gcovr @@ -232,8 +229,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -270,8 +266,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -308,8 +303,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -348,8 +342,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev - name: Setup workspace @@ -410,8 +403,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -466,8 +458,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -525,8 +516,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" vtk + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -573,8 +563,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -626,8 +615,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -676,8 +664,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -726,8 +713,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -776,8 +762,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -826,8 +811,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -876,8 +860,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev @@ -926,8 +909,7 @@ jobs: cache: 'pip' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install numpy "Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3" + pip install -r requirements.txt sudo apt-get update -y sudo apt-get install -y libopenblas-dev libopenblas-openmp-dev sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev diff --git a/requirements.txt b/requirements.txt index d01907317d..d1cf944c46 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,3 @@ -# This file was added to work around an issue with setup-python for non-Python projects, -# which fails with this error: -# -# Run actions/setup-python@v5.0.0 -# with: -# python-version: 3.12 -# cache: pip -# Installed versions -# Successfully set up CPython (3.12.1) -# Error: No file in /home/runner/work/awesome-iam/awesome-iam matched to -# [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository -# -# This has been reported at: https://github.com/actions/setup-python/issues/807 -# In the future this might be addressed by: https://github.com/actions/setup-python/pull/762 -# or https://github.com/actions/setup-python/issues/751 \ No newline at end of file +# Python dependencies used for testing +numpy +Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3 \ No newline at end of file From cbee1cc99163c0e947c0df218882648dc6233238 Mon Sep 17 00:00:00 2001 From: Derek Slaughter Date: Thu, 28 Mar 2024 21:08:01 +0000 Subject: [PATCH 105/190] Add vtk package to requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index d1cf944c46..21752feaf4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ # Python dependencies used for testing numpy +vtk Bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3 \ No newline at end of file From b6849ce8c621a37eb6301c2ba08fe6f2206a7174 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 28 Mar 2024 15:15:01 -0600 Subject: [PATCH 106/190] Docs: update python modules for regression testing --- docs/source/testing/regression_test.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/source/testing/regression_test.rst b/docs/source/testing/regression_test.rst index 491fd05659..8af9408a97 100644 --- a/docs/source/testing/regression_test.rst +++ b/docs/source/testing/regression_test.rst @@ -63,12 +63,14 @@ reported as failed. The failure criteria is outlined below. Dependencies ------------ -The following packages are required for regression testing: +The following packages are required for regression testing (see also the +``requirements.txt`` file in the root directory for the python modules): -- Python 3.7+ -- Numpy - CMake and CTest (Optional) -- Bokeh 2.4+ (Optional) +- Python >=3.7,<=3.11 +- numpy +- vtk +- bokeh>=2.4,!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3 (Optional) .. _python_driver: From 6184f95f5a24ca3899d738faa4c344e994eac18f Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:03 +0000 Subject: [PATCH 107/190] FIX: Update dockerfile base to get required `cmake` version --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 8470e56230..01a5391cae 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # -FROM ubuntu:bionic +FROM ubuntu:mantic # Install dependencies @@ -34,7 +34,7 @@ RUN apt update -qq && \ apt install -y git && \ apt install -y nano -RUN pip3 install numpy +# RUN pip3 install numpy # Configure the environment ENV FC=/usr/bin/gfortran From e1bcb8cf87c5e990b87c597140d0cf0d6c10af23 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:34:53 +0000 Subject: [PATCH 108/190] CHO: Add `.idea` to `.gitignore` --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0b6dd4368e..5cf777ca93 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,5 @@ vs-build/ varcache *.slxc +# JetBrains IDEs config +.idea From cd05a114ab94a8d5c0e9f763e35e8617e59be14a Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:35:46 +0000 Subject: [PATCH 109/190] ENH: Make dockerfile base configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 01a5391cae..eb4e48e142 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -FROM ubuntu:mantic +ARG BASE=ubuntu:mantic +FROM ${BASE} # Install dependencies From de581299cd19db3ccec463bd8293910025f03e50 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 14:38:00 +0000 Subject: [PATCH 110/190] ENH: Make dockerfile timezone configurable --- share/docker/openfast_ubuntu/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eb4e48e142..66ea123867 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic +ARG TIMEZONE=America/Denver + FROM ${BASE} # Install dependencies @@ -22,7 +24,7 @@ FROM ${BASE} # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=America/Denver +ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 5f9e3ae908ff5731359ced3985473a3c42f17e33 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:01:31 +0000 Subject: [PATCH 111/190] FIX: Fix timezone build arg in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 66ea123867..1ca978f5cd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,17 +14,17 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -ARG TIMEZONE=America/Denver - FROM ${BASE} +ARG TIMEZONE=America/Denver + # Install dependencies # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ENV DEBIAN_FRONTEND=noninteractive TZ=TIMEZONE +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ From 5fc6f7903f62e447bc35690ecdd75f38abeefbb5 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:05:40 +0000 Subject: [PATCH 112/190] ENH: Make openfast version configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1ca978f5cd..f359416da4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,6 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=America/Denver +ARG VERSION='v3.5.2' # Install dependencies @@ -42,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --recursive https://github.com/openfast/openfast.git openfast +RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From 5a97da4223defd20cdb6396fc5201f74cd24536e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:09:05 +0000 Subject: [PATCH 113/190] ENH: Make cores available for building configurable in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f359416da4..c0121a438f 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -53,5 +53,6 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO -RUN make -j4 install +RUN make -j${BUILD_CORES} install From 5e2ca6b6f9db902d155e325edaf90d6c89158bca Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 15:34:52 +0000 Subject: [PATCH 114/190] ENH: Clone openfast with shallow submodules in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c0121a438f..eea305269b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,7 +43,7 @@ RUN apt update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive https://github.com/openfast/openfast.git +RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git WORKDIR /openfast # Build the project From c8b817f8b001571e08d34d3d9bd138a96f2715c3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:06:47 +0000 Subject: [PATCH 115/190] REF: Combine apt installation commands into one --- share/docker/openfast_ubuntu/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index eea305269b..a72b25dd07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -30,12 +30,17 @@ ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt update -qq && \ apt install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y python3-pip && \ - apt install -y cmake cmake-curses-gui && \ - apt install -y gcc gfortran make && \ - apt install -y libblas-dev liblapack-dev && \ - apt install -y git && \ - apt install -y nano + apt install -y \ + python3-pip \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + make \ + libblas-dev \ + liblapack-dev \ + git \ + nano # RUN pip3 install numpy From df21818a4706772b23ed4c530c98c8e5bc382e5f Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:24:45 +0000 Subject: [PATCH 116/190] ENH: Use `apt-get` instead of `apt` and remove cache --- share/docker/openfast_ubuntu/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a72b25dd07..0e8cd2d7d9 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -27,10 +27,10 @@ ARG VERSION='v3.5.2' ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} -RUN apt update -qq && \ - apt install -y software-properties-common build-essential && \ +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ - apt install -y \ + apt-get install -y \ python3-pip \ cmake \ cmake-curses-gui \ @@ -40,7 +40,8 @@ RUN apt update -qq && \ libblas-dev \ liblapack-dev \ git \ - nano + nano \ + && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From 1fd00514cdcdb2fbe1f218250be199e7243689e9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:37:37 +0000 Subject: [PATCH 117/190] ENH: Make `openfast` command available in docker image --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0e8cd2d7d9..5c54c114a0 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -62,3 +62,6 @@ WORKDIR /openfast/build ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install + +# Make `openfast` command work. +ENV PATH=/openfast/install/bin:$PATH From 02d9deadae97c05134185e814b5d83ed001602c7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 16:57:07 +0000 Subject: [PATCH 118/190] ENH: Make building testing tree optional --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 5c54c114a0..0ba4a2dec4 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -57,10 +57,11 @@ RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine -# will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an +# will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG BUILD_TESTING=ON +RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install # Make `openfast` command work. From 74753f6419e808f72b94c665dde3d00cc3740d64 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:12:31 +0000 Subject: [PATCH 119/190] ENH: Avoid cloning submodules if not building test tree --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0ba4a2dec4..4d4616a6f8 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,7 +49,12 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project -RUN git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git +ARG BUILD_TESTING=ON + +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ + else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ + fi + WORKDIR /openfast # Build the project @@ -60,7 +65,6 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_CORES=4 -ARG BUILD_TESTING=ON RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From dadbf1e14dda913db1ea5c7249e0ea94f7217ceb Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Fri, 22 Mar 2024 17:28:07 +0000 Subject: [PATCH 120/190] REF: Sort `apt-get install` lines --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4d4616a6f8..7f3b6fb918 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -31,16 +31,16 @@ RUN apt-get update -qq && \ apt-get install -y software-properties-common build-essential && \ add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ - python3-pip \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - make \ + git \ libblas-dev \ liblapack-dev \ - git \ + make \ nano \ + python3-pip \ && rm -rf /var/lib/apt/lists/* # RUN pip3 install numpy From 14d08b6dbfec4732c5184eda7afc28f9a534362e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:02 +0000 Subject: [PATCH 121/190] REF: Factor out repository URL --- share/docker/openfast_ubuntu/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7f3b6fb918..cac7b0dd4c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -49,10 +49,11 @@ RUN apt-get update -qq && \ ENV FC=/usr/bin/gfortran # Clone the project +ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=ON -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules https://github.com/openfast/openfast.git; \ - else git clone --depth 1 --branch=${VERSION} https://github.com/openfast/openfast.git; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 971053ce1952c65ef3adc5b68f0392672b8a8ec0 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:31:18 +0000 Subject: [PATCH 122/190] ENH: Remove commented out numpy installation --- share/docker/openfast_ubuntu/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index cac7b0dd4c..1963041c88 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -43,8 +43,6 @@ RUN apt-get update -qq && \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# RUN pip3 install numpy - # Configure the environment ENV FC=/usr/bin/gfortran From baa996905ec8c0045870128e859ab3223a2eea32 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:34:10 +0000 Subject: [PATCH 123/190] ENH: Set timezone to UTC by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 1963041c88..b8a332309b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,7 +16,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=America/Denver +ARG TIMEZONE=UTC ARG VERSION='v3.5.2' # Install dependencies From 47bf090d328a4cfec0eac0cc6003a3117155281e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:35:26 +0000 Subject: [PATCH 124/190] ENH: Set `BUILD_TESTING` to "OFF" by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b8a332309b..b16162f8bd 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -48,7 +48,7 @@ ENV FC=/usr/bin/gfortran # Clone the project ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=ON +ARG BUILD_TESTING=OFF RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ From ee1c2ae6591338cf026ef4265ddc3e496064db64 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:36:32 +0000 Subject: [PATCH 125/190] REF: Rename `VERSION` build arg to `OPENFAST_VERSION` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b16162f8bd..4de78daa12 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG VERSION='v3.5.2' +ARG OPENFAST_VERSION='v3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 59cca57354cb654302c0d4592632097e6e1bad0e Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 10:44:18 +0000 Subject: [PATCH 126/190] ENH: Remove need to prefix version numbers with `v` --- share/docker/openfast_ubuntu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 4de78daa12..0b1a9a8d0c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -17,7 +17,7 @@ ARG BASE=ubuntu:mantic FROM ${BASE} ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='v3.5.2' +ARG OPENFAST_VERSION='3.5.2' # Install dependencies @@ -50,8 +50,8 @@ ENV FC=/usr/bin/gfortran ENV REPOSITORY_URL=https://github.com/openfast/openfast.git ARG BUILD_TESTING=OFF -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=${OPENFAST_VERSION} $REPOSITORY_URL; \ +RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ + else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ fi WORKDIR /openfast From 81a19d1627adfbfd42fc14810dee3bdc2a14076c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 11:52:41 +0000 Subject: [PATCH 127/190] ENH: Build from local context instead of cloning repository --- .dockerignore | 25 +++++++++++++++++++++++++ share/docker/openfast_ubuntu/Dockerfile | 17 +++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..f4bfc6a972 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +# System, cache and editor files +**/__pycache__ +**/.DS_Store + +.editorconfig +.idea +.git +.github +.gitignore +.pytest_cache +.pre-commit-config.yaml +.readthedocs.yml +.coverage +Procfile +README.md + +# Never bake in environment variables +.env +.env* +google_credentials.json +# See: https://github.com/google-github-actions/auth/issues/123 +gha-creds-*.json +gcp-creds-*.json + +.devcontainer/.zsh_history diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 0b1a9a8d0c..27876821e2 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -16,15 +16,12 @@ ARG BASE=ubuntu:mantic FROM ${BASE} -ARG TIMEZONE=UTC -ARG OPENFAST_VERSION='3.5.2' - # Install dependencies - # For gfortran-8 # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ @@ -46,16 +43,11 @@ RUN apt-get update -qq && \ # Configure the environment ENV FC=/usr/bin/gfortran -# Clone the project -ENV REPOSITORY_URL=https://github.com/openfast/openfast.git -ARG BUILD_TESTING=OFF - -RUN if [ "${BUILD_TESTING}" = "ON" ]; then git clone --depth 1 --branch=v${OPENFAST_VERSION} --recursive --shallow-submodules $REPOSITORY_URL; \ - else git clone --depth 1 --branch=v${OPENFAST_VERSION} $REPOSITORY_URL; \ - fi - WORKDIR /openfast +# Copy in the checked-out code version. +COPY . . + # Build the project RUN mkdir build WORKDIR /openfast/build @@ -63,6 +55,7 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" +ARG BUILD_TESTING=OFF ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO RUN make -j${BUILD_CORES} install From ef8843ac4352e2f543714e84c744c6ca79e0d13b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 13:46:33 +0000 Subject: [PATCH 128/190] ENH: Use a multi-stage build to reduce final image size --- share/docker/openfast_ubuntu/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 27876821e2..e680264217 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,7 +14,7 @@ # limitations under the License. # ARG BASE=ubuntu:mantic -FROM ${BASE} +FROM ${BASE} AS build # Install dependencies # For gfortran-8 @@ -56,9 +56,13 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ARG BUILD_TESTING=OFF -ARG BUILD_CORES=4 RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO + +ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +FROM ${BASE} as production +COPY --from=build /openfast/install /openfast/install + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From d51173be45ce9f8923c298376d8f6486729156a8 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 14:43:53 +0000 Subject: [PATCH 129/190] FIX: Ensure system dependencies are available in final image --- share/docker/openfast_ubuntu/Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e680264217..7ce1f685af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -64,5 +64,23 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} + +RUN apt-get update -qq && \ + apt-get install -y software-properties-common build-essential && \ + add-apt-repository ppa:git-core/ppa -y && \ + apt-get install -y \ + cmake \ + cmake-curses-gui \ + gcc \ + gfortran \ + git \ + libblas-dev \ + liblapack-dev \ + make \ + nano \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + # Make `openfast` command work. ENV PATH=/openfast/install/bin:$PATH From de2bc7037ae0826397f1c3a217115eadcfcd4974 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:03:19 +0000 Subject: [PATCH 130/190] ENH: Reduce docker image size by minimising included packages --- share/docker/openfast_ubuntu/Dockerfile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 7ce1f685af..a40f1195af 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -67,19 +67,7 @@ COPY --from=build /openfast/install /openfast/install ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ - apt-get install -y \ - cmake \ - cmake-curses-gui \ - gcc \ - gfortran \ - git \ - libblas-dev \ - liblapack-dev \ - make \ - nano \ - python3-pip \ + apt-get install -y libblas-dev liblapack-dev \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From ea408d0a882a5c67de762de7b1f6b96cdb83d7c9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:06:05 +0000 Subject: [PATCH 131/190] ENH: Remove extra packages from first build stage --- share/docker/openfast_ubuntu/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index a40f1195af..c2b5d1706b 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,19 +25,14 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y software-properties-common build-essential && \ - add-apt-repository ppa:git-core/ppa -y && \ apt-get install -y \ cmake \ cmake-curses-gui \ gcc \ gfortran \ - git \ libblas-dev \ liblapack-dev \ make \ - nano \ - python3-pip \ && rm -rf /var/lib/apt/lists/* # Configure the environment From e1d51be64666c3e1da6d796f11c699968c28c4cb Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:08:51 +0000 Subject: [PATCH 132/190] ENH: Allow injection of all `cmake` args --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index c2b5d1706b..72b193ad82 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -50,8 +50,8 @@ WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" -ARG BUILD_TESTING=OFF -RUN cmake .. -DBUILD_TESTING=${BUILD_TESTING} -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install From 914408664ffba93635e0fbb7cb2150b89445f117 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:11:21 +0000 Subject: [PATCH 133/190] REF: Move environment variables and build args to more optimal places --- share/docker/openfast_ubuntu/Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 72b193ad82..f8630b88aa 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -21,8 +21,7 @@ FROM ${BASE} AS build # RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y # apt-get install gfortran-8 -ARG TIMEZONE=UTC -ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ @@ -35,21 +34,18 @@ RUN apt-get update -qq && \ make \ && rm -rf /var/lib/apt/lists/* -# Configure the environment -ENV FC=/usr/bin/gfortran - -WORKDIR /openfast - # Copy in the checked-out code version. +WORKDIR /openfast COPY . . -# Build the project +# Build the project. RUN mkdir build WORKDIR /openfast/build # NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" +ENV FC=/usr/bin/gfortran ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" RUN cmake .. ${CMAKE_OPTIONS} @@ -59,6 +55,7 @@ RUN make -j${BUILD_CORES} install FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install +ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ From 597800db177a390d1289c3ce597c538470cfb60c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:13:02 +0000 Subject: [PATCH 134/190] ENH: Set `CMAKE_BUILD_TYPE` to `RELEASE` by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index f8630b88aa..ea28951f07 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -46,7 +46,7 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ENV FC=/usr/bin/gfortran -ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELWITHDEBINFO" +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 From ec7ec8274d840cb85447f7804a142248d846a111 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 15:35:14 +0000 Subject: [PATCH 135/190] FIX: Add essential dependencies back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index ea28951f07..e84ff43629 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,6 +25,8 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ apt-get install -y \ + software-properties-common \ + build-essential \ cmake \ cmake-curses-gui \ gcc \ From 161b51b16eb8118d930fbde3c6dee4253af370cd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:36:36 +0000 Subject: [PATCH 136/190] ENH: Add `nano` back to production image --- share/docker/openfast_ubuntu/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e84ff43629..b41e25822c 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -61,7 +61,10 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y libblas-dev liblapack-dev \ + apt-get install -y \ + libblas-dev \ + liblapack-dev \ + nano \ && rm -rf /var/lib/apt/lists/* # Make `openfast` command work. From 180d0207c511befb66ce065ae8b963b0b7b8f5a0 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 16:41:40 +0000 Subject: [PATCH 137/190] ENH: Add comments explaining build stages --- share/docker/openfast_ubuntu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index b41e25822c..2341120ed7 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -14,6 +14,8 @@ # limitations under the License. # ARG BASE=ubuntu:mantic + +# Build stage 1: builds openfast. FROM ${BASE} AS build # Install dependencies @@ -54,6 +56,7 @@ RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 RUN make -j${BUILD_CORES} install +# Build stage 2: provides built openfast in a small image. FROM ${BASE} as production COPY --from=build /openfast/install /openfast/install From 00067fe64979936e29fded36a4062dd69806c79c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:01 +0000 Subject: [PATCH 138/190] CHO: Add dockerfiles to `.dockerignore` --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index f4bfc6a972..1c757d6d4e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -23,3 +23,4 @@ gha-creds-*.json gcp-creds-*.json .devcontainer/.zsh_history +share/docker From 8af81e745ae123fd572e53114ddb50f4cfe3c553 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 25 Mar 2024 17:10:33 +0000 Subject: [PATCH 139/190] FIX: Add `git` back to build stage --- share/docker/openfast_ubuntu/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2341120ed7..30812a3a33 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -33,6 +33,7 @@ RUN apt-get update -qq && \ cmake-curses-gui \ gcc \ gfortran \ + git \ libblas-dev \ liblapack-dev \ make \ From 78b5abbeb3f4ce434f99b48dd454642675c9c420 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:23:10 +0000 Subject: [PATCH 140/190] DOC: Add readme explaining dockerfile --- share/docker/openfast_ubuntu/README.md | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 share/docker/openfast_ubuntu/README.md diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md new file mode 100644 index 0000000000..3f5568f166 --- /dev/null +++ b/share/docker/openfast_ubuntu/README.md @@ -0,0 +1,42 @@ +# OpenFAST docker images + +## Summary +The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and +in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` +and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. + +## Image registry +Production images of OpenFAST for the `linux/amd64` platform are available on the +[NREL docker hub](https://hub.docker.com/r/nrel/openfast). + +## Build arguments +Provide any of the following build arguments to customise the image at build time. + +| Name | Type | Allowed values | Default | Description | +| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| +| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:mantic` | The docker image to base the OpenFAST image on. | +| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | +| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | +| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | + +For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CMAKE_OPTIONS` so the testing tree is built: + +```shell +# Run from the root of this repository. +git checkout v3.5.3 +docker build -f share/docker/openfast_ubuntu/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' . +``` + +**NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier +versions of OpenFAST, check out the code at that version and recreate the `Dockerfile` from v3.5.3 (or above) in the +checked-out repository first. + +## Building development images +Development images can be built from the production image as a base. Simply start a new `Dockerfile` with: + +```dockerfile +FROM nrel/openfast:3.5.3 +``` + +Images can be built for different platforms using the `--platform` option when building the image. From a02ec3d47b09760e21b1de1ccaca6ee50b72ce49 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 15:51:22 +0000 Subject: [PATCH 141/190] OPS: Add `build-docker-image` workflow --- .github/workflows/build-docker-image.yml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-docker-image.yml diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000000..18cc28aa5b --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,42 @@ +name: build-docker-image + +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag for Docker image (excluding the "v" prefix e.g. 3.5.3)' + required: true + ref: + description: 'Branch, tag, or commit SHA to build from' + required: true + default: main + +jobs: + build-and-push: + runs-on: ubuntu-latest + timeout-minutes: 300 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v5 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push to registry + uses: docker/build-push-action@v3.1.1 + with: + context: . + file: share/docker/openfast_ubuntu/Dockerfile + platforms: linux/amd64 + tags: nrel/openfast:${{ github.event.inputs.tag }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max From 6c68da098708f9e13ba1a2d692bcaf7557b3d8d2 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:05:44 +0000 Subject: [PATCH 142/190] CHO: Update copyright year in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 30812a3a33..40e68e1851 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,5 +1,4 @@ -# -# Copyright 2016 National Renewable Energy Laboratory +# Copyright 2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 1880475b22cc02e634ee172a052d7301be25b129 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:06:29 +0000 Subject: [PATCH 143/190] ENH: Get dockerfile if running workflow on an older version --- .github/workflows/build-docker-image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 18cc28aa5b..9a8d87be8f 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -15,6 +15,9 @@ jobs: build-and-push: runs-on: ubuntu-latest timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile steps: - name: Checkout uses: actions/checkout@v4 @@ -30,11 +33,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get Dockerfile for versions < 3.5.3 + run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + - name: Build and push to registry uses: docker/build-push-action@v3.1.1 with: context: . - file: share/docker/openfast_ubuntu/Dockerfile + file: $DOCKERFILE_PATH platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From ebbc2d9458fea21e8c6ce98d2efa0daf09925d66 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:15:13 +0000 Subject: [PATCH 144/190] OPS: Use correct docker action versions --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 9a8d87be8f..e03ced49d7 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -28,7 +28,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log in to DockerHub - uses: docker/login-action@v5 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,7 +37,7 @@ jobs: run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi - name: Build and push to registry - uses: docker/build-push-action@v3.1.1 + uses: docker/build-push-action@v5 with: context: . file: $DOCKERFILE_PATH From da484ff6c771d923d50b96cdafbecdd6601a019d Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:24:58 +0000 Subject: [PATCH 145/190] OPS: Use environment context instead of environment variables --- .github/workflows/build-docker-image.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index e03ced49d7..2643483304 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,13 +34,16 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get Dockerfile for versions < 3.5.3 - run: if [ ! -f $DOCKERFILE_PATH ]; then wget -O $DOCKERFILE_PATH $DOCKERFILE_PERMALINK; fi + run: | + if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ + then wget -O ${{ env.DOCKERFILE_PATH }} ${{ env.DOCKERFILE_PERMALINK }}; \ + fi - name: Build and push to registry uses: docker/build-push-action@v5 with: context: . - file: $DOCKERFILE_PATH + file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 tags: nrel/openfast:${{ github.event.inputs.tag }} push: true From c3f105c81d6e383d494b96b0933b660f92fec849 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:43:36 +0000 Subject: [PATCH 146/190] ENH: Use `--no-install-recommends` in dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 40e68e1851..2c991eb2c6 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -25,7 +25,7 @@ FROM ${BASE} AS build ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ software-properties-common \ build-essential \ cmake \ @@ -64,7 +64,7 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install -y \ + apt-get install --no-install-recommends -y \ libblas-dev \ liblapack-dev \ nano \ From dbdcd6b3a402d131cc85da87299ef366734ccb8d Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 26 Mar 2024 16:44:40 +0000 Subject: [PATCH 147/190] OPS: Factor out and fix docker repository in docker workflow --- .github/workflows/build-docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 2643483304..393ee1daa0 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,6 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile + DOCKER_HUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -45,7 +46,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: nrel/openfast:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 0eae5b540472d4c169ee91bb56f2058f5d27e0f7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:43:42 +0000 Subject: [PATCH 148/190] OPS: Add comment explaining Dockerfile download step --- .github/workflows/build-docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 393ee1daa0..5dbc379a9c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -34,6 +34,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build + # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the + # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From 5a38b4b410f36e8ce85b04f49458ce85446b5e58 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:44:26 +0000 Subject: [PATCH 149/190] OPS: Rename environment variable for consistency --- .github/workflows/build-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 5dbc379a9c..f168e08ba1 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -18,7 +18,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile - DOCKER_HUB_REPOSITORY: octue/openfast + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 - tags: ${{ env.DOCKER_HUB_REPOSITORY }}:${{ github.event.inputs.tag }} + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 1a270fa2a5ed416b67408d9f32646579bbadc634 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:45:09 +0000 Subject: [PATCH 150/190] CHO: Move `.idea` into correct section of `.gitignore` --- .gitignore | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5cf777ca93..8004a8eb5d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,8 @@ vs-build/ .atom .fortls .devcontainer +.idea + # backup files *.asv ~$*.xlsx @@ -54,6 +56,3 @@ vs-build/ #Simulink cache files varcache *.slxc - -# JetBrains IDEs config -.idea From 061bc25cc9c6af796e5764c890fc2d8cfcaa4cd8 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:05 +0000 Subject: [PATCH 151/190] ENH: Add 2016 to start of copyright notice in Dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 2c991eb2c6..89e5b74ba1 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2024 National Renewable Energy Laboratory +# Copyright 2016-2024 National Renewable Energy Laboratory # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From dc671e98ba64616f5b33ff1cbeb38dc898917c51 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 10:54:21 +0000 Subject: [PATCH 152/190] OPS: Build docker image for `linux/aarch64` too --- .github/workflows/build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index f168e08ba1..0452726552 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -48,7 +48,7 @@ jobs: with: context: . file: ${{ env.DOCKERFILE_PATH }} - platforms: linux/amd64 + platforms: linux/amd64,linux/aarch64 tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha From b6f9d8e7519ecf115e00544a525302ee41b72ca3 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 12:06:49 +0000 Subject: [PATCH 153/190] OPS: Add description to docker workflow --- .github/workflows/build-docker-image.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 0452726552..76a8a20060 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -1,3 +1,6 @@ +# This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for +# the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed +# to the `nrel/openfast` repository. The build cache is stored in GitHub actions. name: build-docker-image on: @@ -34,9 +37,9 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - # The updated Dockerfile is only available in the repository at the tag 3.5.3 and above. If we want to build - # versions of OpenFAST that are below this version, we have to get the updated Dockerfile from that tag of the - # repository before building. For versions >= 3.5.3, the Dockerfile is already there so this step does nothing. + # The updated Dockerfile is only available in the repository at the tag v3.5.3 and above. To build versions of + # OpenFAST that are below this version, the updated Dockerfile from that tag of the repository has to be acquired + # before building. For versions >= v3.5.3, the Dockerfile is already there so this step does nothing. - name: Get Dockerfile for versions < 3.5.3 run: | if [ ! -f ${{ env.DOCKERFILE_PATH }} ]; \ From 0c858fafb10064e4f94feb93df9a849d5a98e8d6 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:11:36 +0000 Subject: [PATCH 154/190] OPS: Add automatic docker build on merge into `main` from RC branches --- .../build-docker-image-automatic.yml | 48 +++++++++++++++++++ ...mage.yml => build-docker-image-manual.yml} | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-docker-image-automatic.yml rename .github/workflows/{build-docker-image.yml => build-docker-image-manual.yml} (98%) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml new file mode 100644 index 0000000000..1eb16128fe --- /dev/null +++ b/.github/workflows/build-docker-image-automatic.yml @@ -0,0 +1,48 @@ +# This workflow builds an OpenFAST docker image for the linux/amd64 and linux/aarch64 architectures on merge into +# `main` from a release candidate branch. The image is tagged both with "latest" and the version extracted from the +# release candidate branch's name (e.g. "rc-3.5.3") before being pushed to the `nrel/openfast` repository. The build +# cache is stored in GitHub actions. +name: build-docker-image-automatic + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + build-and-push: + if: ${{ (github.event.pull_request.merged == true) && startsWith(github.head_ref, 'rc-') }} + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Build and push to registry + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64,linux/aarch64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest + push: true + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image-manual.yml similarity index 98% rename from .github/workflows/build-docker-image.yml rename to .github/workflows/build-docker-image-manual.yml index 76a8a20060..088854ff93 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -1,7 +1,7 @@ # This manually-triggered workflow builds OpenFAST docker images for the linux/amd64 and linux/aarch64 architectures for # the specified git ref (this can be a branch, tag, or commit hash). The image is tagged with the given tag and pushed # to the `nrel/openfast` repository. The build cache is stored in GitHub actions. -name: build-docker-image +name: build-docker-image-manual on: workflow_dispatch: From 86f3f128861d012572e0f8106913db7b79f36c04 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Wed, 27 Mar 2024 18:15:00 +0000 Subject: [PATCH 155/190] OPS: Add `test-build-docker-image` workflow --- .github/workflows/test-build-docker-image.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test-build-docker-image.yml diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml new file mode 100644 index 0000000000..0d4e0b85a6 --- /dev/null +++ b/.github/workflows/test-build-docker-image.yml @@ -0,0 +1,36 @@ +# This workflow tests building an OpenFAST docker image for the linux/amd64 architecture on push to a release candidate +# branch. The build cache is stored in GitHub actions. +name: test-build-docker-image + +on: + pull_request: + branches: + - main + +jobs: + test-build: + if: startsWith(github.head_ref, 'rc-') + runs-on: ubuntu-latest + timeout-minutes: 300 + env: + DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract tag from release candidate branch name + id: extract-tag + run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + + - name: Test building docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }} + platforms: linux/amd64 + push: false + cache-from: type=gha + cache-to: type=gha,mode=max From 68605cb13405722432acb36cb0ed99b96b8497c7 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 10:22:00 +0000 Subject: [PATCH 156/190] ENH: Use long-term-support ubuntu base by default --- share/docker/openfast_ubuntu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index 89e5b74ba1..e4774eb803 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -ARG BASE=ubuntu:mantic +ARG BASE=ubuntu:jammy # Build stage 1: builds openfast. FROM ${BASE} AS build From 2195efa5b73d0b1094d0fd60fbe20d684a8bdc83 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:02:23 +0000 Subject: [PATCH 157/190] DOC: Update documentation --- docs/source/install/index.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 9da66481dc..fd06e3b1c6 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -11,8 +11,8 @@ maintained paths for obtaining an OpenFAST executable. Most users of OpenFAST will not require modifying or compiling the source code. **For the simplest installation of OpenFAST without changing the source -code,** refer to the table in the :ref:`download_binaries` section and read -the corresponding documentation for specific instructions. +code,** refer to the table in the :ref:`download_binaries` or :ref:`use_docker` +sections and read the corresponding documentation for specific instructions. For instructions on compiling, see :ref:`compile_from_source`. .. _download_binaries: @@ -154,6 +154,30 @@ containing the executables, and running a simple test command: cd C:\your\path\Desktop\openfast_binaries\ openfast_x64.exe /h + +.. _use_docker: + +Use a docker image +~~~~~~~~~~~~~~~~~~ +Multiple versions of OpenFAST are available as docker images from our `docker registry `_. +To pull and run one with files from your local machine available, run: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 openfast /files/main.fst + +This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same +local directory as the input files. You can also run commands inside the container with: + +.. code-block::shell + + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 /bin/bash + +Build your own images +~~~~~~~~~~~~~~~~~~~~~ +You can also build your own custom images using our `Dockerfile` or base your images on ours. See +`here ` for more information on this. + .. _compile_from_source: Compile from source From 631a44d6b1de390de0c577d3c6672d4e95a1aef8 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:03:16 +0000 Subject: [PATCH 158/190] DOC: Update dockerfile readme --- share/docker/openfast_ubuntu/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md index 3f5568f166..371f1a81f1 100644 --- a/share/docker/openfast_ubuntu/README.md +++ b/share/docker/openfast_ubuntu/README.md @@ -2,7 +2,7 @@ ## Summary The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and -in the cloud without much setup. By default, it's based on Ubuntu Mantic and is optimised in size and performance for +in the cloud without much setup. By default, it's based on Ubuntu Jammy and is optimised in size and performance for production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. @@ -15,7 +15,7 @@ Provide any of the following build arguments to customise the image at build tim | Name | Type | Allowed values | Default | Description | | --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| -| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:mantic` | The docker image to base the OpenFAST image on. | +| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | | `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | | `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | | `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | From 11ae1b8cfd71df7a40bb333214cd5f4017943ef8 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:06:55 +0000 Subject: [PATCH 159/190] DOC: Fix link in docs --- docs/source/install/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index fd06e3b1c6..50fbb647a9 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -176,7 +176,7 @@ local directory as the input files. You can also run commands inside the contain Build your own images ~~~~~~~~~~~~~~~~~~~~~ You can also build your own custom images using our `Dockerfile` or base your images on ours. See -`here ` for more information on this. +`here `_ for more information on this. .. _compile_from_source: From bdd085b4b7d2bc127f54fd516d2c523f11143bbf Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:36:49 +0000 Subject: [PATCH 160/190] OPS: Fix version extraction --- .github/workflows/test-build-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 0d4e0b85a6..2f4713b0a5 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -23,7 +23,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Test building docker image uses: docker/build-push-action@v5 From c2e744f6e452aaa1dcc4a82f326e288756dcecdd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 11:40:33 +0000 Subject: [PATCH 161/190] OPS: Use extracted tag in test workflow --- .github/workflows/test-build-docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 2f4713b0a5..26652ace25 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -14,6 +14,7 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -31,6 +32,7 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64 + tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }} push: false cache-from: type=gha cache-to: type=gha,mode=max From 58155a492c357305f46da8ab61fa46fe4d490cc9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 28 Mar 2024 14:21:54 +0000 Subject: [PATCH 162/190] OPS: Fix tag extraction in automated docker workflow --- .github/workflows/build-docker-image-automatic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 1eb16128fe..507d9183b4 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -34,7 +34,7 @@ jobs: - name: Extract tag from release candidate branch name id: extract-tag - run: echo "openfast-tag=${"${{ github.head_ref }}":3}" >> $GITHUB_OUTPUT + run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT - name: Build and push to registry uses: docker/build-push-action@v5 From 531dbe93150085ae2642a9edc4b99d46e4631383 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 28 Mar 2024 16:49:52 -0600 Subject: [PATCH 163/190] Update changelog with recent rc-3.5.3 additions --- docs/changelogs/v3.5.3.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md index 911429a610..101a884bd7 100644 --- a/docs/changelogs/v3.5.3.md +++ b/docs/changelogs/v3.5.3.md @@ -39,17 +39,35 @@ See GitHub Actions # Changelog +## Overview + +This release includes a long awaited set of bug fixes for linearization with BeamDyn. Anyone needing to linearize with BeamDyn should not use any version of OpenFAST prior to this release. + +Other notable improvements include corrections to turbine indexing when coupled to external codes such as AMR-Wind, new linearization regression tests, and new docker images (thanks to first time contributor @cortadocodes at the @Octue organization). + + ## General ### Build systems #2116 VSbuild: always build Registry as release x64 (@andrew-platt) -#2120 CMake: openmp optional for FF and CPP if not explicitly requested (@andrew-platt and @deslaughter) +#2120 #2125 CMake: openmp optional for FF and CPP if not explicitly requested (@andrew-platt and @deslaughter) +#2128 VSbuild: set VS version to VS 2017 (@andrew-platt) + + +### Docker builds + +#2124 Update dockerfile and facilitate nrel/openfast Docker Hub registry, with documentation (@cortadocodes, first time contributor) ### GH actions #2041 Upgrade to setup-python@v4 and cache@v4 for GH actions (@andrew-platt) +#2129 Fix cache failure in Github Actions caused by setup-python (@deslaughter) + +### Documentation + +#2130 Fix cache failure in Github Actions caused by setup-python (@andrew-platt) ## Solvers @@ -57,7 +75,6 @@ See GitHub Actions ### OpenFAST #2060 Fix BD + AD linearization indexing (negative damping results) (@deslaugher and @andrew-platt) -#2063 Fix bug in BD linearization resulting from reference rotation change (@deslaughter) ## Module changes @@ -69,6 +86,7 @@ See GitHub Actions ### BeamDyn +#2063 Fix bug in BD linearization resulting from reference rotation change (@deslaughter) #2085 Bug: BeamDyn Initial Strain and Linearization (@deslaughter) From 5a0cf8b2961ee14bfdca67be353787e5c4e09898 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 1 Apr 2024 13:52:30 -0600 Subject: [PATCH 164/190] SrvD: Fix seg fault if blade StC used while writing summary file --- modules/servodyn/src/ServoDyn.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/servodyn/src/ServoDyn.f90 b/modules/servodyn/src/ServoDyn.f90 index 6f48338bff..7fa4b05678 100644 --- a/modules/servodyn/src/ServoDyn.f90 +++ b/modules/servodyn/src/ServoDyn.f90 @@ -1486,7 +1486,7 @@ subroutine StC_Blade_Setup(SrvD_InitInp,SrvD_p,InputFileData,SrvD_u,SrvD_y,SrvD_ ! A little bit of information about the StC location if (unsum >0) then write(UnSum, '(A24,i2)') ' Blade StC instance: ',j - write(UnSum, '(10x,A)') 'Input file: '//trim(InputFileData%NStCfiles(j)) + write(UnSum, '(10x,A)') 'Input file: '//trim(InputFileData%BStCfiles(j)) do k=1,StC_InitInp%NumMeshPts write(UnSum, '(10x,A6,I1,A29)') 'Blade ',k,' location (global/inertial): ' write(UnSum, '(20x,3(2x,ES10.3e2))') u(1,j)%Mesh(k)%Position(1:3,1) From 0b594ddd5c3d61f418d5f1d307e28d5737fcfd9e Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 1 Apr 2024 13:57:23 -0600 Subject: [PATCH 165/190] Update changelog with this PR. --- docs/changelogs/v3.5.3.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md index 101a884bd7..b8a8b494ac 100644 --- a/docs/changelogs/v3.5.3.md +++ b/docs/changelogs/v3.5.3.md @@ -103,6 +103,7 @@ Other notable improvements include corrections to turbine indexing when coupled ### ServoDyn #2079 Handling of Paths for SrvD UserSubs Input Files (@rdamiani) +#2134 Bugfix seg fault if blade StC used while writing summary file (@aplatt) ### TurbSim From 4f6be2031258a1a8db12f3bb4d86504edc318d50 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 1 Apr 2024 15:10:35 -0600 Subject: [PATCH 166/190] Changelog: fix entry in 3.5.3 changelog --- docs/changelogs/v3.5.3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md index b8a8b494ac..51f325bb09 100644 --- a/docs/changelogs/v3.5.3.md +++ b/docs/changelogs/v3.5.3.md @@ -103,7 +103,7 @@ Other notable improvements include corrections to turbine indexing when coupled ### ServoDyn #2079 Handling of Paths for SrvD UserSubs Input Files (@rdamiani) -#2134 Bugfix seg fault if blade StC used while writing summary file (@aplatt) +#2134 Bugfix seg fault if blade StC used while writing summary file (@andrew-platt) ### TurbSim From 8d16cea0ec97081fed72764b811ec17fa6254d0f Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 1 Apr 2024 15:55:11 -0600 Subject: [PATCH 167/190] Docs: fix rendering of docker commands --- docs/source/install/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 50fbb647a9..5b4b0db3e8 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -162,14 +162,14 @@ Use a docker image Multiple versions of OpenFAST are available as docker images from our `docker registry `_. To pull and run one with files from your local machine available, run: -.. code-block::shell +.. code-block:: shell docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 openfast /files/main.fst This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same local directory as the input files. You can also run commands inside the container with: -.. code-block::shell +.. code-block:: shell docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 /bin/bash From 0aca3d0cc0efece37a148b7a4ed3538e18e1371b Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 11:45:30 +0100 Subject: [PATCH 168/190] ENH: Build FAST.Farm in docker image by default --- share/docker/openfast_ubuntu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index e4774eb803..d8b7951042 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -50,10 +50,11 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ENV FC=/usr/bin/gfortran -ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 +RUN make -j${BUILD_CORES} FAST.Farm RUN make -j${BUILD_CORES} install # Build stage 2: provides built openfast in a small image. From bd090f04696712acbc478aff2647f7510ea5d5f2 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 11:46:01 +0100 Subject: [PATCH 169/190] DEP: Replace `libblas-dev` and `liblapack-dev` with `libopenblas-dev` --- share/docker/openfast_ubuntu/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile index d8b7951042..6df47fd005 100644 --- a/share/docker/openfast_ubuntu/Dockerfile +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -33,8 +33,7 @@ RUN apt-get update -qq && \ gcc \ gfortran \ git \ - libblas-dev \ - liblapack-dev \ + libopenblas-dev \ make \ && rm -rf /var/lib/apt/lists/* From 96d0e5eef812e90ccad20a771029045f19a3264c Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 11:46:41 +0100 Subject: [PATCH 170/190] DOC: Update readme with new cmake default arguments --- share/docker/openfast_ubuntu/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md index 371f1a81f1..a03219c6c3 100644 --- a/share/docker/openfast_ubuntu/README.md +++ b/share/docker/openfast_ubuntu/README.md @@ -16,7 +16,7 @@ Provide any of the following build arguments to customise the image at build tim | Name | Type | Allowed values | Default | Description | | --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| | `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | -| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | +| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | | `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | | `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | From c185a0a7fe80cb3e15cb2c2e7ac9da10d5938181 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 11:50:16 +0100 Subject: [PATCH 171/190] REF: Move `Dockerfile` and readme up one directory --- .github/workflows/build-docker-image-automatic.yml | 2 +- .github/workflows/build-docker-image-manual.yml | 4 ++-- .github/workflows/test-build-docker-image.yml | 2 +- share/docker/{openfast_ubuntu => }/Dockerfile | 0 share/docker/{openfast_ubuntu => }/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename share/docker/{openfast_ubuntu => }/Dockerfile (100%) rename share/docker/{openfast_ubuntu => }/README.md (96%) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 507d9183b4..868a344c85 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 300 env: - DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index 088854ff93..26e61d485e 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -19,8 +19,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 300 env: - DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile - DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/openfast_ubuntu/Dockerfile + DOCKERFILE_PATH: share/docker/Dockerfile + DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/Dockerfile DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index 26652ace25..c0f2020aac 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 300 env: - DOCKERFILE_PATH: share/docker/openfast_ubuntu/Dockerfile + DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: octue/openfast steps: - name: Checkout diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/Dockerfile similarity index 100% rename from share/docker/openfast_ubuntu/Dockerfile rename to share/docker/Dockerfile diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/README.md similarity index 96% rename from share/docker/openfast_ubuntu/README.md rename to share/docker/README.md index a03219c6c3..402ababe1c 100644 --- a/share/docker/openfast_ubuntu/README.md +++ b/share/docker/README.md @@ -25,7 +25,7 @@ For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CM ```shell # Run from the root of this repository. git checkout v3.5.3 -docker build -f share/docker/openfast_ubuntu/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' . +docker build -f share/docker/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' . ``` **NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier From d0ac94bb0ceafb7cdb8a4044641e5288062d6368 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 11:52:11 +0100 Subject: [PATCH 172/190] ENH: Use `nrel` docker and github repository --- .github/workflows/build-docker-image-automatic.yml | 2 +- .github/workflows/build-docker-image-manual.yml | 4 ++-- .github/workflows/test-build-docker-image.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 868a344c85..b3d16797ba 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -18,7 +18,7 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/Dockerfile - DOCKERHUB_REPOSITORY: octue/openfast + DOCKERHUB_REPOSITORY: nrel/openfast steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index 26e61d485e..a569f3ffce 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -20,8 +20,8 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/Dockerfile - DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/octue/openfast/update-dockerfiles/share/docker/Dockerfile - DOCKERHUB_REPOSITORY: octue/openfast + DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile + DOCKERHUB_REPOSITORY: nrel/openfast steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test-build-docker-image.yml b/.github/workflows/test-build-docker-image.yml index c0f2020aac..1bd4d7b96b 100644 --- a/.github/workflows/test-build-docker-image.yml +++ b/.github/workflows/test-build-docker-image.yml @@ -14,7 +14,7 @@ jobs: timeout-minutes: 300 env: DOCKERFILE_PATH: share/docker/Dockerfile - DOCKERHUB_REPOSITORY: octue/openfast + DOCKERHUB_REPOSITORY: nrel/openfast steps: - name: Checkout uses: actions/checkout@v4 From 433773899fae3262f8eb7f6fa01df2b77c4170ff Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 12:24:08 +0100 Subject: [PATCH 173/190] FIX: Add missing packages to final image --- share/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index 6df47fd005..8ad6622160 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -64,9 +64,9 @@ ARG TIMEZONE=UTC ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y \ - libblas-dev \ - liblapack-dev \ + apt-get install --no-install-recommends -y \ + libopenblas-dev \ + libgomp1 \ nano \ && rm -rf /var/lib/apt/lists/* From e18dc413ef2e293858d06e6499a730010656a2ac Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 1 Apr 2024 10:33:33 -0600 Subject: [PATCH 174/190] Remove linking of implicit Fortran libraries. --- modules/nwtc-library/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nwtc-library/CMakeLists.txt b/modules/nwtc-library/CMakeLists.txt index 8074c3d7dc..080d1c391a 100644 --- a/modules/nwtc-library/CMakeLists.txt +++ b/modules/nwtc-library/CMakeLists.txt @@ -140,7 +140,6 @@ add_library(nwtclibs ${NWTC_SYS_FILE} ${NWTCLIBS_SOURCES}) target_link_libraries(nwtclibs PUBLIC ${LAPACK_LIBRARIES} ${CMAKE_DL_LIBS} - ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES} ) if (USE_DLL_INTERFACE) target_compile_definitions(nwtclibs PRIVATE USE_DLL_INTERFACE) From fcb2be94ea75e168242915f739479ec614d28376 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 16:55:16 +0100 Subject: [PATCH 175/190] FIX: Remove old dockerfile --- share/docker/openfast_ubuntu/Dockerfile | 74 ------------------------- share/docker/openfast_ubuntu/README.md | 42 -------------- 2 files changed, 116 deletions(-) delete mode 100644 share/docker/openfast_ubuntu/Dockerfile delete mode 100644 share/docker/openfast_ubuntu/README.md diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile deleted file mode 100644 index e4774eb803..0000000000 --- a/share/docker/openfast_ubuntu/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 2016-2024 National Renewable Energy Laboratory -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ARG BASE=ubuntu:jammy - -# Build stage 1: builds openfast. -FROM ${BASE} AS build - -# Install dependencies -# For gfortran-8 -# RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y -# apt-get install gfortran-8 - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y \ - software-properties-common \ - build-essential \ - cmake \ - cmake-curses-gui \ - gcc \ - gfortran \ - git \ - libblas-dev \ - liblapack-dev \ - make \ - && rm -rf /var/lib/apt/lists/* - -# Copy in the checked-out code version. -WORKDIR /openfast -COPY . . - -# Build the project. -RUN mkdir build -WORKDIR /openfast/build - -# NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine -# will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an -# "internal error" -ENV FC=/usr/bin/gfortran -ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" -RUN cmake .. ${CMAKE_OPTIONS} - -ARG BUILD_CORES=4 -RUN make -j${BUILD_CORES} install - -# Build stage 2: provides built openfast in a small image. -FROM ${BASE} as production -COPY --from=build /openfast/install /openfast/install - -ARG TIMEZONE=UTC -ENV DEBIAN_FRONTEND=noninteractive TZ=${TIMEZONE} - -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y \ - libblas-dev \ - liblapack-dev \ - nano \ - && rm -rf /var/lib/apt/lists/* - -# Make `openfast` command work. -ENV PATH=/openfast/install/bin:$PATH diff --git a/share/docker/openfast_ubuntu/README.md b/share/docker/openfast_ubuntu/README.md deleted file mode 100644 index 371f1a81f1..0000000000 --- a/share/docker/openfast_ubuntu/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# OpenFAST docker images - -## Summary -The `Dockerfile` in this directory can be used to reliably build OpenFAST as a docker image that can be run locally and -in the cloud without much setup. By default, it's based on Ubuntu Jammy and is optimised in size and performance for -production use. A multi-stage build is used, producing an Ubuntu image with just `libblas-dev`, `liblapack-dev`, `nano` -and `openfast` added. The image built by this `Dockerfile` can be customised at build time using build arguments. - -## Image registry -Production images of OpenFAST for the `linux/amd64` platform are available on the -[NREL docker hub](https://hub.docker.com/r/nrel/openfast). - -## Build arguments -Provide any of the following build arguments to customise the image at build time. - -| Name | Type | Allowed values | Default | Description | -| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| -| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | -| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | -| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | -| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | - -For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CMAKE_OPTIONS` so the testing tree is built: - -```shell -# Run from the root of this repository. -git checkout v3.5.3 -docker build -f share/docker/openfast_ubuntu/Dockerfile -t openfast:3.5.3 --platform=linux/amd64 --build-arg=CMAKE_OPTIONS='-DBUILD_TESTING=ON' . -``` - -**NOTE:** This version of the `Dockerfile` is only available in v3.5.3 and up of this repository. To build earlier -versions of OpenFAST, check out the code at that version and recreate the `Dockerfile` from v3.5.3 (or above) in the -checked-out repository first. - -## Building development images -Development images can be built from the production image as a base. Simply start a new `Dockerfile` with: - -```dockerfile -FROM nrel/openfast:3.5.3 -``` - -Images can be built for different platforms using the `--platform` option when building the image. From 8ea0b9db84e0589ec111b44d5799c1ca1fe6b36f Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 2 Apr 2024 09:55:37 -0600 Subject: [PATCH 176/190] Docs: update changelog for PR #2138 --- docs/changelogs/v3.5.3.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md index 51f325bb09..6c4d5bc7ee 100644 --- a/docs/changelogs/v3.5.3.md +++ b/docs/changelogs/v3.5.3.md @@ -53,6 +53,7 @@ Other notable improvements include corrections to turbine indexing when coupled #2116 VSbuild: always build Registry as release x64 (@andrew-platt) #2120 #2125 CMake: openmp optional for FF and CPP if not explicitly requested (@andrew-platt and @deslaughter) #2128 VSbuild: set VS version to VS 2017 (@andrew-platt) +#2138 Remove linking of implicit Fortran libraries. (@jrood-nrel) ### Docker builds From 7fb40b0b2dfe7402c11196bd2d2e057f95cd77d5 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 17:17:39 +0100 Subject: [PATCH 177/190] REF: Combine `make` commands in dockerfile --- share/docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index 8ad6622160..5394b69da2 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -53,8 +53,7 @@ ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=ON RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 -RUN make -j${BUILD_CORES} FAST.Farm -RUN make -j${BUILD_CORES} install +RUN make -j${BUILD_CORES} # Build stage 2: provides built openfast in a small image. FROM ${BASE} as production From db131b130d15cf3dc3b128fb3a59cb1873b506a2 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Tue, 2 Apr 2024 17:18:00 +0100 Subject: [PATCH 178/190] ENH: Turn off double precision docker builds by default --- share/docker/Dockerfile | 2 +- share/docker/README.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index 5394b69da2..ee6983d100 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -49,7 +49,7 @@ WORKDIR /openfast/build # will require about 6GB of memory. Otherwise, the gfortran compiler will exit with an # "internal error" ENV FC=/usr/bin/gfortran -ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE" +ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=OFF -DCMAKE_BUILD_TYPE=RELEASE" RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 diff --git a/share/docker/README.md b/share/docker/README.md index 402ababe1c..82517f7b1f 100644 --- a/share/docker/README.md +++ b/share/docker/README.md @@ -13,12 +13,12 @@ Production images of OpenFAST for the `linux/amd64` platform are available on th ## Build arguments Provide any of the following build arguments to customise the image at build time. -| Name | Type | Allowed values | Default | Description | -| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------------------------------- |-----------------------------------------------------------| -| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | -| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | -| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | -| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | +| Name | Type | Allowed values | Default | Description | +| --------------- | ------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------| +| `BASE` | String | Any valid docker image URI that has the `apt` package manager installed. | `ubuntu:jammy` | The docker image to base the OpenFAST image on. | +| `CMAKE_OPTIONS` | String | Any number of valid space-separated `cmake` options in the same format they're normally passed to `cmake` directly. See the options relevant to OpenFAST [here.](https://openfast.readthedocs.io/en/main/source/install/index.html#openfast-cmake-options) | `-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=OFF -DCMAKE_BUILD_TYPE=RELEASE` | Options to control how CMake is used to build OpenFAST. | +| `BUILD_CORES` | Integer | Any integer greater than 0. | `4` | The number of cores to use to build OpenFAST with `make`. | +| `TIMEZONE` | String | Any [valid timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | `UTC` | The timezone to use when running OpenFAST. | For example, to build OpenFAST v3.5.3 for the `linux/amd64` platform and set `CMAKE_OPTIONS` so the testing tree is built: From b1004214d2358444b3ac0ce8583045308ce7c3fb Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Thu, 4 Apr 2024 12:40:09 +0100 Subject: [PATCH 179/190] FIX: Revert to single `make` command in dockerfile --- share/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index ee6983d100..742d6b0a59 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -53,7 +53,7 @@ ARG CMAKE_OPTIONS="-DBUILD_TESTING=OFF -DBUILD_FASTFARM=ON -DDOUBLE_PRECISION=OF RUN cmake .. ${CMAKE_OPTIONS} ARG BUILD_CORES=4 -RUN make -j${BUILD_CORES} +RUN make -j${BUILD_CORES} install # Build stage 2: provides built openfast in a small image. FROM ${BASE} as production From 015bdd15294f3f7e5c4781c74057b62e73445bef Mon Sep 17 00:00:00 2001 From: Mayank Chetan Date: Thu, 4 Apr 2024 10:26:24 -0600 Subject: [PATCH 180/190] adding GH container registry to the workflows --- .github/workflows/build-docker-image-automatic.yml | 12 +++++++++++- .github/workflows/build-docker-image-manual.yml | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index b3d16797ba..ff63bdf513 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -19,6 +19,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast + GH_REGISTRY: ghcr.io/nrel/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -32,6 +33,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.GH_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GH_TOKEN }} + - name: Extract tag from release candidate branch name id: extract-tag run: echo "openfast-tag=$(expr substr "${{ github.head_ref }}" 4 100)" >> $GITHUB_OUTPUT @@ -42,7 +50,9 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64,linux/aarch64 - tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest + tags: | + ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest + ${{ env.GH_REGISTRY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest push: true cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index a569f3ffce..ab9c364d8a 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -22,6 +22,7 @@ jobs: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast + GH_REGISTRY: ghcr.io/nrel/openfast steps: - name: Checkout uses: actions/checkout@v4 @@ -37,6 +38,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.GH_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GH_TOKEN }} + # The updated Dockerfile is only available in the repository at the tag v3.5.3 and above. To build versions of # OpenFAST that are below this version, the updated Dockerfile from that tag of the repository has to be acquired # before building. For versions >= v3.5.3, the Dockerfile is already there so this step does nothing. @@ -52,7 +60,9 @@ jobs: context: . file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64,linux/aarch64 - tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} + tags: | + ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} + ${{ env.GH_REGISTRY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 2bc30e26f5404aae238b074d859e51cb90abacfa Mon Sep 17 00:00:00 2001 From: Mayank Chetan Date: Thu, 4 Apr 2024 10:32:41 -0600 Subject: [PATCH 181/190] Changing to auto generated token --- .github/workflows/build-docker-image-manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index ab9c364d8a..8193ac8f17 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -43,7 +43,7 @@ jobs: with: registry: ${{ env.GH_REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GH_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} # The updated Dockerfile is only available in the repository at the tag v3.5.3 and above. To build versions of # OpenFAST that are below this version, the updated Dockerfile from that tag of the repository has to be acquired From f08795d5287f293f71472b962195d9efdee451b2 Mon Sep 17 00:00:00 2001 From: Mayank Chetan Date: Thu, 4 Apr 2024 13:37:31 -0600 Subject: [PATCH 182/190] adding permissions for GHCR and Commenting out dockerhub login until we have credentials --- .../workflows/build-docker-image-automatic.yml | 18 +++++++++++------- .../workflows/build-docker-image-manual.yml | 16 ++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index ff63bdf513..bc4ad18490 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -20,6 +20,9 @@ jobs: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast GH_REGISTRY: ghcr.io/nrel/openfast + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@v4 @@ -27,18 +30,19 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + # Commenting out until we get the NREL DockerHub credentials + # - name: Log in to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ${{ env.GH_REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GH_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Extract tag from release candidate branch name id: extract-tag @@ -51,8 +55,8 @@ jobs: file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64,linux/aarch64 tags: | - ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest ${{ env.GH_REGISTRY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest +# ${{ env.DOCKERHUB_REPOSITORY }}:${{ steps.extract-tag.outputs.openfast-tag }},${{ env.DOCKERHUB_REPOSITORY }}:latest push: true cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index 8193ac8f17..81a1d0b2e4 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -23,6 +23,9 @@ jobs: DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast GH_REGISTRY: ghcr.io/nrel/openfast + permissions: + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@v4 @@ -32,11 +35,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + # Commenting out until we get the NREL DockerHub credentials + # - name: Log in to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -61,8 +65,8 @@ jobs: file: ${{ env.DOCKERFILE_PATH }} platforms: linux/amd64,linux/aarch64 tags: | - ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} ${{ env.GH_REGISTRY }}:${{ github.event.inputs.tag }} +# ${{ env.DOCKERHUB_REPOSITORY }}:${{ github.event.inputs.tag }} push: true cache-from: type=gha cache-to: type=gha,mode=max From a56bcc8dc8f91edbeb1527f7fc71316e789dc20a Mon Sep 17 00:00:00 2001 From: Mayank Chetan Date: Thu, 4 Apr 2024 15:12:47 -0600 Subject: [PATCH 183/190] correcting GH registry link --- .github/workflows/build-docker-image-automatic.yml | 2 +- .github/workflows/build-docker-image-manual.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index bc4ad18490..0fc86470f3 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -19,7 +19,7 @@ jobs: env: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast - GH_REGISTRY: ghcr.io/nrel/openfast + GH_REGISTRY: ghcr.io/OpenFAST/openfast permissions: contents: read packages: write diff --git a/.github/workflows/build-docker-image-manual.yml b/.github/workflows/build-docker-image-manual.yml index 81a1d0b2e4..608bd02307 100644 --- a/.github/workflows/build-docker-image-manual.yml +++ b/.github/workflows/build-docker-image-manual.yml @@ -22,7 +22,7 @@ jobs: DOCKERFILE_PATH: share/docker/Dockerfile DOCKERFILE_PERMALINK: https://raw.githubusercontent.com/OpenFAST/openfast/main/share/docker/Dockerfile DOCKERHUB_REPOSITORY: nrel/openfast - GH_REGISTRY: ghcr.io/nrel/openfast + GH_REGISTRY: ghcr.io/OpenFAST/openfast permissions: contents: read packages: write From 612915bbcbea3cc2ef27db20eebfefb91f5809ef Mon Sep 17 00:00:00 2001 From: Rei Landsberger Date: Thu, 4 Apr 2024 19:05:45 -0600 Subject: [PATCH 184/190] Adding Hyperlink to appendixD.rst Added the missing reference link about MEMBER OUTPUT LISTS to the relevant page from the readthedocs.io site (https://openfast.readthedocs.io/en/dev/source/user/subdyn/input_files.html#member-output-list). --- docs/source/user/subdyn/appendixD.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user/subdyn/appendixD.rst b/docs/source/user/subdyn/appendixD.rst index e2bcbab592..2705509d2b 100644 --- a/docs/source/user/subdyn/appendixD.rst +++ b/docs/source/user/subdyn/appendixD.rst @@ -7,7 +7,7 @@ This is a list of all possible output parameters for the SubDyn module. The names are grouped by meaning, but can be ordered in the OUTPUT CHANNELS section of the SubDyn input file as the user sees fit. :math:`M \alpha N \beta`, refers to node :math:`\beta` of member :math:`\alpha`, where :math:`\alpha` is a number in the range [1,9] and -corresponds to row :math:`\alpha` in the MEMBER OUTPUT LIST table (see Section ) and +corresponds to row :math:`\alpha` in the MEMBER OUTPUT LIST table (see :numref:`_SD_Member_Output`) and :math:`\beta` is a number in the range [1,9] and corresponds to node :math:`\beta` in the **NodeCnt** list of that table entry. From 43866bed9cb9dab64774010a86fba80092d8a2b8 Mon Sep 17 00:00:00 2001 From: Rei Landsberger Date: Thu, 4 Apr 2024 21:11:39 -0600 Subject: [PATCH 185/190] Removing the unnecessary undercase --- docs/source/user/subdyn/appendixD.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user/subdyn/appendixD.rst b/docs/source/user/subdyn/appendixD.rst index 2705509d2b..3cf6bcef2c 100644 --- a/docs/source/user/subdyn/appendixD.rst +++ b/docs/source/user/subdyn/appendixD.rst @@ -7,7 +7,7 @@ This is a list of all possible output parameters for the SubDyn module. The names are grouped by meaning, but can be ordered in the OUTPUT CHANNELS section of the SubDyn input file as the user sees fit. :math:`M \alpha N \beta`, refers to node :math:`\beta` of member :math:`\alpha`, where :math:`\alpha` is a number in the range [1,9] and -corresponds to row :math:`\alpha` in the MEMBER OUTPUT LIST table (see :numref:`_SD_Member_Output`) and +corresponds to row :math:`\alpha` in the MEMBER OUTPUT LIST table (see :numref:`SD_Member_Output`) and :math:`\beta` is a number in the range [1,9] and corresponds to node :math:`\beta` in the **NodeCnt** list of that table entry. From 86be0530216a8060bc8a243fea8b26ba2fd8315e Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 5 Apr 2024 09:02:52 -0600 Subject: [PATCH 186/190] Docs: docker from GitHub container repo --- docs/source/install/index.rst | 45 +++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 5b4b0db3e8..f5a4415ced 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -157,27 +157,58 @@ containing the executables, and running a simple test command: .. _use_docker: -Use a docker image -~~~~~~~~~~~~~~~~~~ -Multiple versions of OpenFAST are available as docker images from our `docker registry `_. +Running OpenFAST with docker +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +OpenFAST is avilable to be run on docker starting with version 3.5.3. Three approaches are shared below. + +Using a docker image from Docker hub +------------------------------------ +Multiple versions of OpenFAST are also available as docker images from our `docker registry `_. To pull and run one with files from your local machine available, run: .. code-block:: shell - docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 openfast /files/main.fst + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.3 openfast /files/main.fst This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same -local directory as the input files. You can also run commands inside the container with: +local directory as the input files. + +You can also run commands interactively inside the container with: .. code-block:: shell - docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.2 /bin/bash + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.3 /bin/bash + +To pull the latest container, substitute `latest` for `3.5.3` in the above +commands. + + +Using a docker image from GitHub container registry +--------------------------------------------------- +In addition to images hosted on Docker hub, we also host docker images on our +`GitHub container registry `_. +The commands for pulling an image from the GitHub container repository are +similar to those for pulling and running from Docker hub. + +To pull and run with local files: + +.. code-block:: shell + + docker run --rm -it --volume=/path/to/files:/files ghcr.io/OpenFAST/openfast:latest openfast /files/main.fst + +For running the container interactively: + +.. code-block:: shell + + docker run --rm -it --volume=/path/to/files:/files ghcr.io/OpenFAST/openfast:latest /bin/bash + Build your own images -~~~~~~~~~~~~~~~~~~~~~ +--------------------- You can also build your own custom images using our `Dockerfile` or base your images on ours. See `here `_ for more information on this. + .. _compile_from_source: Compile from source From 368c6b2e457a5aa88e2a81f0a1f67381397905ac Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 5 Apr 2024 09:09:24 -0600 Subject: [PATCH 187/190] docs: update changelog --- docs/changelogs/v3.5.3.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelogs/v3.5.3.md b/docs/changelogs/v3.5.3.md index 6c4d5bc7ee..1dc519fcee 100644 --- a/docs/changelogs/v3.5.3.md +++ b/docs/changelogs/v3.5.3.md @@ -59,6 +59,8 @@ Other notable improvements include corrections to turbine indexing when coupled ### Docker builds #2124 Update dockerfile and facilitate nrel/openfast Docker Hub registry, with documentation (@cortadocodes, first time contributor) +#2139 Add final dockerfile updates (@cortadocodes) +#2141 GH actions to push docker image to Github container registry (@mayankchetan, first time contributor) ### GH actions @@ -69,6 +71,8 @@ Other notable improvements include corrections to turbine indexing when coupled ### Documentation #2130 Fix cache failure in Github Actions caused by setup-python (@andrew-platt) +#2144 Edit to readthedocs.io -- Adding Internal Reference Hyperlink for appendixD.rst (@reilandsberger, first time contributor) +#2145 Docs/update for 3.5.3 release (@andrew-platt) ## Solvers From 8242f763840ec5b87b104431071255e58daf5cd9 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 5 Apr 2024 13:36:25 -0600 Subject: [PATCH 188/190] Docs: set to `latest` for all example docker commands --- docs/source/install/index.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index f5a4415ced..85c33ac203 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -168,7 +168,7 @@ To pull and run one with files from your local machine available, run: .. code-block:: shell - docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.3 openfast /files/main.fst + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:latest openfast /files/main.fst This command deletes the container (but not the image) when the analysis is finished and leaves the outputs in the same local directory as the input files. @@ -177,10 +177,9 @@ You can also run commands interactively inside the container with: .. code-block:: shell - docker run --rm -it --volume=/path/to/files:/files nrel/openfast:3.5.3 /bin/bash + docker run --rm -it --volume=/path/to/files:/files nrel/openfast:latest /bin/bash -To pull the latest container, substitute `latest` for `3.5.3` in the above -commands. +To pull a specific release, substitute the version number in place of `latest` in the above commands (i.e. `nrel/openfast:3.5.3`). Using a docker image from GitHub container registry From 2166f9faeeb3ec8493ba3e570852df2ca342fd7b Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 11 Apr 2024 11:19:45 -0600 Subject: [PATCH 189/190] GH actions: build docker on release instead of merge --- .github/workflows/build-docker-image-automatic.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-docker-image-automatic.yml b/.github/workflows/build-docker-image-automatic.yml index 0fc86470f3..01b80fcac2 100644 --- a/.github/workflows/build-docker-image-automatic.yml +++ b/.github/workflows/build-docker-image-automatic.yml @@ -5,15 +5,12 @@ name: build-docker-image-automatic on: - pull_request: + release: types: - - closed - branches: - - main + - released jobs: build-and-push: - if: ${{ (github.event.pull_request.merged == true) && startsWith(github.head_ref, 'rc-') }} runs-on: ubuntu-latest timeout-minutes: 300 env: From eabd6b54a2d072a9925b3eafbb61ad1c297632b9 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 11 Apr 2024 13:57:43 -0600 Subject: [PATCH 190/190] Update r-test pointer to v3.5.3 tag --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index dbe3e57873..548bf21436 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit dbe3e578733f1e9f0378b467c654046f9a54bf83 +Subproject commit 548bf2143633a7066f4582167fdf4180951fd7f6