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

Add function spaces check in linear solver #3214

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

nbouziani
Copy link
Contributor

@nbouziani nbouziani commented Nov 9, 2023

Description

This PR: 1) updates the LinearSolver's check on the solution and the rhs, and 2) fixes __eq__ for function spaces 3) fixes all the implications of 2), i.e. all bugs that would have been spotted with a proper function space equality check. This fixes the issues #3203 and #3130.

@nbouziani nbouziani changed the title Fix function spaces check in linear solver Add function spaces check in linear solver Nov 9, 2023
@connorjward
Copy link
Contributor

@nbouziani what is the status of this PR? It is failing some tests.

@@ -52,7 +52,8 @@ def poisson(h, degree=2):
# Assembling matrix
A = assemble(a, bcs=bc)
b = assemble(l)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b = assemble(l)
b = assemble(l, bcs=bc, zero_bc_nodes=True)

@@ -382,7 +382,8 @@ We will now show how to solve the Poisson problem on a high-order mesh, of order
bc = DirichletBC(V, 0.0, [1])
A = assemble(a, bcs=bc)
b = assemble(l)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b = assemble(l)
b = assemble(l, bcs=bc, zero_bc_nodes=True)

Comment on lines +385 to +386
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)

Comment on lines +55 to +56
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)

@@ -96,7 +97,8 @@ def poisson3D(h, degree=2):
# Assembling matrix
A = assemble(a, bcs=bc)
b = assemble(l)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b = assemble(l)
b = assemble(l, bcs=bc, zero_bc_nodes=True)

Comment on lines +100 to +101
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
b_riesz = b.riesz_representation(riesz_map="l2")
bc.apply(b_riesz)

@pbrubeck
Copy link
Contributor

Closing, as superseded by #3754

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

Successfully merging this pull request may close these issues.

3 participants