This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

shared_entities in mixed function space

0 votes

I have been trying to debug a code which uses a mixed function space to solve the real and imaginary parts of the E-field. I think I have narrowed the bug down to a mapping problem. For now I would like to understand why following doesn't produce a list with a one-to-one index correspondence. My expectation was that mapping shared entities to global DOFs mean that for every dof index on processor a, there would be a single matching index on processor b.

Note: In this example, I have assumed that, due to the mixed function space, the dofmap maps edges N:2*N to corresponding DOFS if N is the number of edges.

from dolfin import *
import numpy as np

comm = mpi_comm_world()
mpirank = MPI.rank(comm)

mesh = UnitCubeMesh(2, 2, 2)
Vr = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
Vi = FunctionSpace(mesh, "Nedelec 1st kind H(curl)", 1)
V = Vr * Vi

meshtopo = mesh.topology()
dofmap = V.dofmap()

e2d = dofmap.dofs(mesh, 1)
e2dg = np.array([dofmap.local_to_global_index(i) for i in e2d])

shared_entities = meshtopo.shared_entities(1)
for k, n in shared_entities.items():
    print mpirank, e2dg[k]
asked Jun 30, 2016 by brk888 FEniCS Novice (990 points)

1 Answer

0 votes

Could you please tell me how to impliment the boundary condition, which if the problem's boundary condition is A in H0(curl)?

I can do Dirichlet boundary condition, Neumann boundary condition, Robin boundary condition, but not H0(curl).

I will appreciate your any help. Thanks!!!

answered Nov 21, 2016 by fanronghong FEniCS User (1,680 points)
...