-
Notifications
You must be signed in to change notification settings - Fork 90
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
refactor: FieldSpecification context when targeting wrong fieldName #3508
base: develop
Are you sure you want to change the base?
Conversation
std::string fieldNamePath = | ||
GEOS_FMT( "\n{}: there is no {} named `{}` under the {} `{}`.\n", | ||
fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::fieldNameString() ), | ||
FieldSpecificationBase::viewKeyStruct::fieldNameString(), | ||
fs.getFieldName(), FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath() ); | ||
fs.getFieldName(), FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath()); | ||
|
||
fieldNameNotFoundMessage << fieldNamePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fieldNameNotFoundMessage <<
GEOS_FMT( "\n{}: there is no {} named `{}` under the {} `{}`.\n",
fs.getWrapperDataContext( FieldSpecificationBase::viewKeyStruct::fieldNameString() ),
FieldSpecificationBase::viewKeyStruct::fieldNameString(),
fs.getFieldName(), FieldSpecificationBase::viewKeyStruct::objectPathString(), fs.getObjectPath());
for( auto const & wrapperIter : subCellRegion.wrappers() ) | ||
{ | ||
auto const & wrapper = wrapperIter.second; | ||
fieldNameNotFoundMessage << wrapper->getName() << " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a comma here
fieldNameNotFoundMessage << wrapper->getName() << " "; | |
fieldNameNotFoundMessage << wrapper->getName() << ", "; |
if( stopIteration ) | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that, by exiting the iteration process, you gather all possible field name?
I'm not sure that all region contains the same set of fields.
Maybe it would be safer to gather them all in a std::set<string>
, then output them all (it would also have the benefit to sort them).
for( auto const & wrapperIter : subCellRegion.wrappers() ) | ||
{ | ||
auto const & wrapper = wrapperIter.second; | ||
fieldNameNotFoundMessage << wrapper->getName() << " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are assuming that all sub-region wrappers are wrappers of fields, but they are not all! localToGlobalMap globalToLocalMap isExternal ghostRank
, those are attributes not related to mesh fields.
Here is an exemple of fields declaration: src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp
The goal is to output only fields in this error output.
Here's the typical error encountered when setting the wrong target for a FieldSpecification :
Here we wanted to define initial conditions in FieldSpecifications to impose the value of a property (here: “rock_initialPorosity”).
However, this property doesn't exist because we've given it the wrong name. It expects the name of the Porosity model for stress (i.e. “rockPorosity_initialPorosity” here).
With more indications we would have (in progress)