Skip to content

Commit 6e285bd

Browse files
Fix ill-posed problem by providing additional data. (#144)
See precice/fenics-adapter#113 for details.
1 parent c8e6dee commit 6e285bd

File tree

1 file changed

+5
-1
lines changed
  • HT/partitioned-heat/fenics-fenics

1 file changed

+5
-1
lines changed

HT/partitioned-heat/fenics-fenics/heat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
File, solve, lhs, rhs, grad, inner, dot, dx, ds, interpolate, VectorFunctionSpace, MeshFunction, MPI
3030
from fenicsprecice import Adapter
3131
from errorcomputation import compute_errors
32-
from my_enums import ProblemType, Subcycling
32+
from my_enums import ProblemType, Subcycling, DomainPart
3333
import argparse
3434
import numpy as np
3535
from problem_setup import get_geometry, get_problem_setup
@@ -211,6 +211,10 @@ def determine_gradient(V_g, u, flux):
211211
precice.store_checkpoint(u_n, t, n)
212212

213213
read_data = precice.read_data()
214+
if problem is ProblemType.DIRICHLET and (domain_part is DomainPart.CIRCULAR or domain_part is DomainPart.RECTANGLE):
215+
# We have to data for an arbitrary point that is not on the circle, to obtain exact solution.
216+
# See https://github.com/precice/fenics-adapter/issues/113 for details.
217+
read_data[(0, 0)] = u_D(0, 0)
214218

215219
# Update the coupling expression with the new read data
216220
precice.update_coupling_expression(coupling_expression, read_data)

0 commit comments

Comments
 (0)