The problem that I am working on demands for constraints on a section of edge of the problem geometry. The issue can be illustrated using the following diagram.
I want my constraints to be imposed on BC portion of the edge AD. In my case I tried imposing the constraint as follows
rec = Rectangle((0, -0.3), (13.0, 0.7))
IC_s = PointwiseBoundaryConstraint(
nodes=nodes,
geometry=rec,
outvar={"c": 1.0},
batch_size=cfg.batch_size.IC,
parameterization={t_symbol: 0.0, x:(6.5,7.5), y:0.7},
)
domain.add_constraint(IC_s, "IC_s")
But I was running into an error as depicted below
Error executing job with overrides: []
Traceback (most recent call last):
File "SingleGeom.py", line 84, in run
IC_s = PointwiseBoundaryConstraint(
File "/modulus/modulus/domain/constraint/continuous.py", line 276, in __init__
invar = geometry.sample_boundary(
File "/modulus/modulus/geometry/geometry.py", line 479, in sample_boundary
assert np.sum(curve_areas) > 0, "Geometry has no surface"
AssertionError: Geometry has no surface
This error is thrown only if the constraint is imposed on an intermediate portion or a point of geometry edge. For example, there’s no error if “x: (6.5,7.5)” is not specified under parametrization option of PointwiseBoundaryConstraint(). Also, the program runs fine if ‘x’ is at one of the corners (i.e. x=0 or x =13) of problem geometry.
Is there a way around this issue?