Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dead code in ParticipantConfiguration #2156

Open
davidscn opened this issue Dec 17, 2024 · 0 comments
Open

Dead code in ParticipantConfiguration #2156

davidscn opened this issue Dec 17, 2024 · 0 comments

Comments

@davidscn
Copy link
Member

Most of the following code is dead

PRECICE_CHECK(participant->isMeshReceived(fromMesh) || participant->isMeshProvided(toMesh),
"A read mapping of participant \"{}\" needs to map from a received to a provided mesh, but in this case they are swapped. "
"Did you intent to map from mesh \"{}\" to mesh \"{}\", or use a write mapping instead?",
participant->getName(), confMapping.toMesh->getName(), confMapping.fromMesh->getName());
PRECICE_CHECK(participant->isMeshReceived(fromMesh),
"Participant \"{}\" has a read mapping from mesh \"{}\", without receiving it. "
"Please add a receive-mesh tag with name=\"{}\"",
participant->getName(), fromMesh, fromMesh);
PRECICE_CHECK(participant->isMeshProvided(toMesh),
"Participant \"{}\" has a read mapping to mesh \"{}\", without providing it. "
"Please add a provide-mesh tag with name=\"{}\"",
participant->getName(), toMesh, toMesh);
} else {
// A write mapping maps from provided to received
PRECICE_CHECK(participant->isMeshProvided(fromMesh) || participant->isMeshReceived(toMesh),
"A write mapping of participant \"{}\" needs to map from a provided to a received mesh, but in this case they are swapped. "
"Did you intent to map from mesh \"{}\" to mesh \"{}\", or use a read mapping instead?",
participant->getName(), confMapping.toMesh->getName(), confMapping.fromMesh->getName());
PRECICE_CHECK(participant->isMeshProvided(fromMesh),
"Participant \"{}\" has a write mapping from mesh \"{}\", without providing it. "
"Please add a provided-mesh tag with name=\"{}\"",
participant->getName(), fromMesh, fromMesh);
PRECICE_CHECK(participant->isMeshReceived(toMesh),
"Participant \"{}\" has a write mapping to mesh \"{}\", without receiving it. "
"Please add a receive-mesh tag with name=\"{}\"",
participant->getName(), toMesh, toMesh);
}

because the first check (in both if branches) includes already the subsequent two. Seems to be a consequence of #2124.
We should remove the dead part or refine the error message in a suitable way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant