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
merged 1 commit into from Nov 3, 2020

Conversation

sdrave
Copy link
Member

@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,
initial_data=U0,
mass=None if isinstance(self.mass, IdentityOperator) else self.mass,
Copy link
Contributor

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.

@codecov
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/basic.py 88.88% <100.00%> (ø)
src/pymor/reductors/basic.py 77.77% <100.00%> (ø)
src/pymor/reductors/residual.py 65.24% <100.00%> (+0.24%) ⬆️
src/pymor/vectorarrays/list.py 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
Labels
pr:change Change in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants