Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Copying ModelArrays is too simplistic #752

Open
timspainNERSC opened this issue Dec 4, 2024 · 0 comments
Open

Copying ModelArrays is too simplistic #752

timspainNERSC opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@timspainNERSC
Copy link
Collaborator

Current the function ModelArray::operator=(const ModelArray&) delegates to the Eigen library to directly copy one Eigen data array (Eigen::Array or Eigen::Matrix) to another. If the two arrays do not have the same length in the second dimension, then the second dimension data is copied across the first dimension. That this is happening can easily be observed by adding a line

    if (m_data.size() != from.size())
        throw std::length_error(…);

to the function that copies the data. Running the model with this included causes a unhandled exception to be thrown during set up as a ModelArray containing DG components is copied into a HField Model array that does not expect them.

@timspainNERSC timspainNERSC added the bug Something isn't working label Dec 4, 2024
@timspainNERSC timspainNERSC added this to the 3 Stand-alone model milestone Dec 4, 2024
@timspainNERSC timspainNERSC self-assigned this Dec 4, 2024
@timspainNERSC timspainNERSC moved this from Todo to In Progress in neXtSIM_DG overview Dec 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

1 participant