Goal-Oriented Adaptive mesh refinement at a single point
4 months ago by
I am solving a problem on the unit square, with 2 singularities at the points (0,1) and (1,1). I'd like to be able to tell my AdaptiveLinearVariationalSolver to refine at the singularity a=(0,1). I have an approximate solution u(x,y) = (u1(x,y), u2(x,y)), of which I am only interested in the horizontal component u1. I am attempting to do this by making my goal:
where $\delta_a^A\left(x\right)$δaA(x) is the delta function modeled by a Gaussian curve at the point a. I obtain u1 by splitting u which lives in a VectorFunctionSpace, and I define my delta function via an Expression. When I say M = delta*u1*dx, I get the error that "*** Error: Unable to assemble form.
*** Reason: Invalid value rank for coefficient 1 (got 1 but expecting 0). You might have forgotten to specify the value rank correctly in an Expression subclass.
*** Where: This error was encountered inside AssemblerBase.cpp.". Attached is the relevant portion of the code.
V = VectorFunctionSpace(mesh, "Lagrange", 4) W = FunctionSpace(mesh, "Lagrange", 4) u = TrialFunction(V) v = TestFunction(V) w = Function(V) u = Function(V) u1, u2 = split(u) u1, u2 = u.split(True)# not sure the difference # GOAL for adaptive refinement amps = 10000 delta = Expression("A*exp(-mpi*A*(pow(x-0.000013,2)+pow(x-.999983, 2)))", A=amps, mpi=math.pi, degree=4) J = delta*u1*dx # GOAL pde = LinearVariationalProblem(a, F-b, u, bc) solver = AdaptiveLinearVariationalSolver(pde, J)
Community: FEniCS Project
4 months ago by
n = Expression(("1.0","0.0"), degree=4) u1 = dot(u, n)
Please login to add an answer/comment or follow this question.