-
Notifications
You must be signed in to change notification settings - Fork 12
Remove partially initializing volumeField constructor. #220
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
base: main
Are you sure you want to change the base?
Conversation
Deployed test documentation to https://exasim-project.com/NeoFOAM/Build_PR_220 |
@@ -119,20 +93,13 @@ class VolumeField : public GeometricFieldMixin<ValueType> | |||
const Executor& exec, | |||
std::string fieldName, | |||
const UnstructuredMesh& mesh, | |||
const Field<ValueType>& internalField, | |||
const std::vector<VolumeBoundary<ValueType>>& boundaryConditions, | |||
Database& db, | |||
std::string dbKey, | |||
std::string collectionName |
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.
Database& db,
std::string dbKey,
std::string collectionName
defining them as default parameter makes the usage and registration a lot simpler
Database& db = std::nullopt,
std::string dbKey = "",
std::string collectionName = ""
and should reduce the total amount of constructors
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 thought about wrapping this in a struct
struct DataBaseInfo {
Database& db;
std::string dbKey;
std::string collectionName;
}
and change the ctr of VolumeField
to take a std::optional<DataBaseInfo>
because you either have non or all three parameters.
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.
done
@@ -119,20 +93,13 @@ class VolumeField : public GeometricFieldMixin<ValueType> | |||
const Executor& exec, | |||
std::string fieldName, | |||
const UnstructuredMesh& mesh, | |||
const Field<ValueType>& internalField, |
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.
constructuors with boundaryConditions (that are only partially initialized) should call correct boundary conditions to set the boundaryValues of the domainField
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.
So how should we proceed here? leave the internalField in and call correctBoundary()
?
Motivation
This PR removes a constructor from
VolumeField
with a giveninternalField.
The constructor would copy only the giveninternalField
but doesn't specifically set theboundaryFields
. This seems like a partially initialized state which is rather unintuitive.Additional changes: