# Spatial Weighting of Losses (SDF weighting)

Hello, everyone.

I’m having trouble understanding the concept and usage of Spatial Weighting of Losses (SDF weighting).
In ldc example,
Introductory Example - NVIDIA Docs

# top wall

top_wall = PointwiseBoundaryConstraint(
nodes=nodes,
geometry=rec,
outvar={"u": 1.0, "v": 0},
batch_size=cfg.batch_size.TopWall,
lambda_weighting={"u": 1.0 - 20 * Abs(x), "v": 1.0},  # weight edges to be zero
criteria=Eq(y, height / 2),
)

# no slip
no_slip = PointwiseBoundaryConstraint(
nodes=nodes,
geometry=rec,
outvar={"u": 0, "v": 0},
batch_size=cfg.batch_size.NoSlip,
criteria=y < height / 2,
)

# interior
interior = PointwiseInteriorConstraint(
nodes=nodes,
geometry=rec,
outvar={"continuity": 0, "momentum_x": 0, "momentum_y": 0},
batch_size=cfg.batch_size.Interior,
lambda_weighting={
"continuity": Symbol("sdf"),
"momentum_x": Symbol("sdf"),
"momentum_y": Symbol("sdf"),
},
)

For boundary constraints for #top wall, they use Spatial Weighting of Losses (SDF weighting) as
“1-20*abs(x)” to avoid sharp discontinuity.

My question here is,

1. Why they chose “1-20abs(x)" as SDF weighting, for discontinuity also occurs in the center of x- direction in "1-20abs(x)”, as well.
2. Does SDF means Signed Distance Function?

For # interior
interior = PointwiseInteriorConstraint,
lambda_weighting={
“continuity”: Symbol(“sdf”),
“momentum_x”: Symbol(“sdf”),
“momentum_y”: Symbol(“sdf”),
},

1. What is the meaning of “Symbol(“sdf”)”?

I’d greatly appreciate it if you could answer the questions above. Thanks for the help!