Periodic boundary conditions for subspaces of mixed function space
8 months ago by
is it possible to define periodic boundary conditions only for a subspace of a mixed function space, and not the mixed FS as a whole?
I used the following workaround: instead of a mixed FS, use separate FS (in my case, one with periodic constraint), assemble the blocks separately. Retrieve the entries from the "submatrices" with mat.getValuesCSR(), manipulate the indices of the matrices which are not going to be in the "A00"-block, add boundary conditions (zero-rows in the off-diagonal matrices). Create matrices with the size of the total system for each block from the CSR data (PETSc.Mat().createAIJ(size, csr)), add everything together (axpy).
Maybe there is a more elegant way with PETSc, but works.
Community: FEniCS Project
Please login to add an answer/comment or follow this question.