Skip to content

Conversation

@MShabara
Copy link
Contributor

@MShabara MShabara commented Aug 7, 2025

This PR resolves an error that occurs when plotting the wave elevation with multiple wave class instances. The implementation now correctly sums the waveAmpTime(:,2) values from all wave objects before plotting, ensuring the total wave elevation is accurately represented.

@MShabara MShabara requested a review from jniffene August 7, 2025 17:53
@MShabara
Copy link
Contributor Author

MShabara commented Aug 9, 2025

@jniffene The issue was due to the PR #1515 , the wave type is changed slightly from a string to an enumerator. I converted them to char in the initialization check.

Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MShabara. I added a minor simplification to the wave type comparison logic. I will also push a commit that extends your update for waves.plotElevation() to waves.plotSpectrum()

rampTime double {mustBeReal, mustBeNonNan, mustBeFinite} = 0
end

waveElevationSum = zeros(size(obj(1).waveAmpTime(:,2)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but is quite surprising MATLAB behavior to me. I would have thought that calling an object's method on an array of objects would error, not result in the entire object array being available in the method.

@akeeste akeeste removed the request for review from jniffene August 13, 2025 16:06
@akeeste akeeste self-assigned this Aug 13, 2025
@akeeste akeeste added Wave Class Wave Classs (waveClass.m) Bug bug in WEC-Sim source, high priority labels Aug 13, 2025
@akeeste
Copy link
Contributor

akeeste commented Aug 13, 2025

tests are passing. merging

@akeeste akeeste merged commit 54e974a into WEC-Sim:dev Aug 13, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug bug in WEC-Sim source, high priority Wave Class Wave Classs (waveClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants