Hi,
Is it possible to impose in a fast and efficient way dirichlet BCs? In general one uses
A = dolfinx.fem.petsc.assemble_matrix(a, bcs)
A.assemble()
I wonder if there is a way to just do
A = dolfinx.fem.petsc.assemble_matrix(a)
A.assemblyBegin()
bc.apply(A) # or something similar
A.assemblyEnd()
Thanks.
dokken
November 30, 2023, 9:04am
2
I would suggest you have a look at:
http://jsdokken.com/FEniCS23-tutorial/src/lifting.html#identity-row-approach
and the lifting section, as it explains what goes on in DOLFINx
Hi @dokken ,
Thank you. It boils down to adding this:
for bc in bcs:
dofs, _ = bc.dof_indices()
A.zeroRows(dofs, diag=1)
bagla0
February 2, 2024, 10:46pm
4
Hello,
Can we impose BC over form assembly in legacy-dolfin?
assemble(form,bcs=bc)
, based on bcs being an argument in assemble here . However, getting
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[256], line 1
----> 1 assemble(form,bcs=bc)
TypeError: assemble() got an unexpected keyword argument 'bcs'
If not, can you suggest a process for imposing bc in form assembly?
bagla0
February 2, 2024, 11:04pm
5
I find that, bc.apply(assemble(form)) is working.
dokken
February 5, 2024, 8:58pm
6
You are looking at outdated documentation (v 1.5.0).
The newest documentation can be found at: Bitbucket
You can use bc.apply
on an assembled object as you showed in the last post.
1 Like