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

Always initialize mass and rhs attributes of InstationaryModel #1137

merged 1 commit into from Nov 3, 2020


Copy link

@sdrave sdrave commented Oct 27, 2020

When InstationaryModel is instantiated with mass=None or rhs=None, this PR causes corresponding attributes to be initialized with an appropriate IdentityOperator or ZeroOperator. In particular, this is in agreement with the behavior of LTIModel.

Also see #1121.

@sdrave sdrave added the pr:change Change in existing functionality label Oct 27, 2020
@sdrave sdrave added this to the 2020.2 milestone Oct 27, 2020
U = self.time_stepper.solve(operator=self.operator,
rhs=None if isinstance(self.rhs, ZeroOperator) else self.rhs,
mass=None if isinstance(self.mass, IdentityOperator) else self.mass,
Copy link

Choose a reason for hiding this comment

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

Would it not be nicer to not have the check here and instead extend the check/switch in the timestepper? It already checks for None and could also check for IdentityOperator or ZeroOperator, respectively.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe, but I didn't want to touch the time steppers in this pr.

Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #1137 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
src/pymor/models/ 88.88% <100.00%> (ø)
src/pymor/reductors/ 77.77% <100.00%> (ø)
src/pymor/reductors/ 65.24% <100.00%> (+0.24%) ⬆️
src/pymor/vectorarrays/ 83.80% <0.00%> (-0.20%) ⬇️

@sdrave sdrave merged commit 5bdaecc into master Nov 3, 2020
2 checks passed
@sdrave sdrave deleted the mass_not_none branch November 3, 2020 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
pr:change Change in existing functionality
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants