Skip to content

Commit f93f6cb

Browse files
update success reprod code
1 parent a7b7ffe commit f93f6cb

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

examples/bracket/bracket.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"""
1818

1919
import numpy as np
20-
from paddle import fluid
2120

2221
import ppsci
2322
from ppsci.utils import config

ppsci/geometry/mesh.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,9 @@ def random_boundary_points(self, n, random="pseudo", criteria=None):
348348
face_points = sample_in_triangle(
349349
self.v0[i], self.v1[i], self.v2[i], npoint, random, criteria
350350
)
351-
face_normal = np.tile(self.face_normal[i], [npoint, 1])
351+
face_normal = np.tile(self.face_normal[i], [npoint, 1]).astype(
352+
paddle.get_default_dtype()
353+
)
352354
valid_area = np.full(
353355
[npoint, 1],
354356
valid_areas[i] / npoint,

ppsci/utils/expression.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def train_forward(
6565
else:
6666
raise TypeError(f"expr type({type(expr)}) is invalid")
6767

68+
# put field 'area' into output_dict
69+
if "area" in input_dicts[i]:
70+
output_dict["area"] = input_dicts[i]["area"]
71+
6872
output_dicts.append(output_dict)
6973

7074
# clear differentiation cache
@@ -104,6 +108,10 @@ def eval_forward(
104108
else:
105109
raise TypeError(f"expr type({type(expr)}) is invalid")
106110

111+
# put field 'area' into output_dict
112+
if "area" in input_dict:
113+
output_dict["area"] = input_dict["area"]
114+
107115
# clear differentiation cache
108116
clear()
109117

0 commit comments

Comments
 (0)