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

Error when trying to add a natural BC with Poisson solver #254

Open
bknight1 opened this issue Oct 17, 2024 · 3 comments
Open

Error when trying to add a natural BC with Poisson solver #254

bknight1 opened this issue Oct 17, 2024 · 3 comments

Comments

@bknight1
Copy link
Member

bknight1 commented Oct 17, 2024

Describe the bug
When adding natural BCs:

A_diffusion.add_natural_bc([0], mesh.boundaries.Left.name)
A_diffusion.add_natural_bc([0], mesh.boundaries.Right.name)
A_diffusion.add_natural_bc([0], mesh.boundaries.Top.name)
A_diffusion.add_natural_bc([0], mesh.boundaries.Bottom.name)

When attempting to solve, I get the following error:

AttributeError                            Traceback (most recent call last)
Cell In[27], line 1
----> 1 A_diffusion.solve()

File [~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx:858](http://localhost:8888/lab/tree/Coupled_diffusion/~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx#line=857), in underworld3.cython.generic_solvers.SNES_Scalar.solve()

File [~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx:176](http://localhost:8888/lab/tree/Coupled_diffusion/~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx#line=175), in underworld3.cython.generic_solvers.SolverBaseClass._build()

File [~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx:730](http://localhost:8888/lab/tree/Coupled_diffusion/~/Documents/Research/GitHub/underworld3/src/underworld3/cython/petsc_generic_snes_solvers.pyx#line=729), in underworld3.cython.generic_solvers.SNES_Scalar._setup_pointwise_functions()

AttributeError: 'NaturalBC' object has no attribute 'fn_F'

Looking through dev, it looks like NaturalBC has attribute 'fn_f' and EssentialBC is 'fn', although I may be wrong.

Cheers

@bknight1
Copy link
Member Author

I'm trying to set zero flux on each boundary for the multicomponent diffusion benchmark

@lmoresi
Copy link
Member

lmoresi commented Oct 17, 2024

OK - I'll take a look - but shouldn't a zero flux be the same as no BC ?

@bknight1
Copy link
Member Author

It should be. I had missed something when setting up my terms that's why it wasn't solving, not the BCs.

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

No branches or pull requests

2 participants