Skip to content

Commit 1579d2c

Browse files
Update generated code for DPF 252_daily on master (#2122)
* update generated code * "ponderation" -> "weights" (#2130) * "ponderation" -> "weights" * "ponderation" -> "weights" * temporarily skip retro for animation tests using ponderation explicitly * Reinstate translator.py * Keep translator.py during code generation --------- Co-authored-by: PProfizi <[email protected]>
1 parent 9d4185c commit 1579d2c

File tree

780 files changed

+67685
-82253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

780 files changed

+67685
-82253
lines changed

.ci/code_generation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
for file_path in files:
1818
if file_path.stem == "specification":
1919
continue
20+
if file_path.stem == "translator":
21+
continue
2022
if file_path.name == "build.py":
2123
continue
2224
if file_path.name == "operator.mustache":

doc/source/_static/dpf_operators.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

examples/00-basic/10-math_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,27 @@
105105
# ~~~~~~~~~~
106106
# First we define fields. By default, fields represent 3D vectors
107107
# so one elementary data is a 3D vector.
108-
# The optional ponderation field is a field which takes one value per entity,
108+
# The optional weights field is a field which takes one value per entity,
109109
# so we need to change its dimensionality (1D).
110110
num_entities = 3
111111
input_field = dpf.Field(nentities=num_entities)
112-
ponderation_field = dpf.Field(num_entities)
113-
ponderation_field.dimensionality = dpf.Dimensionality([1])
112+
weights_field = dpf.Field(num_entities)
113+
weights_field.dimensionality = dpf.Dimensionality([1])
114114

115115
input_field.scoping.ids = range(num_entities)
116-
ponderation_field.scoping.ids = range(num_entities)
116+
weights_field.scoping.ids = range(num_entities)
117117

118118
###############################################################################
119119
# Fill fields with data.
120120
# Add nine values because there are three entities.
121121
input_field.data = [-2.0, 2.0, 4.0, -5.0, 0.5, 1.0, 7.0, 3.0, -3.0]
122122
###############################################################################
123123
# Three weights, one per entity.
124-
ponderation_field.data = [0.5, 2.0, 0.5]
124+
weights_field.data = [0.5, 2.0, 0.5]
125125

126126
###############################################################################
127127
# Retrieve the result.
128-
acc = dpf.operators.math.accumulate(fieldA=input_field, ponderation=ponderation_field)
128+
acc = dpf.operators.math.accumulate(fieldA=input_field, weights=weights_field)
129129
output_field = acc.outputs.field()
130130

131131
# (-2.0 * 0.5) + (-5.0 * 2.0) + (7.0 * 0.5) = -7.5

examples/01-mathematical-operations/matrix-operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@
9494

9595
# Add a constant
9696
# Add 2 to each value in the field
97-
stress_2 = maths.add_constant_fc(fields_container=stress_2, ponderation=2.0).eval()
97+
stress_2 = maths.add_constant_fc(fields_container=stress_2, weights=2.0).eval()
9898

9999
# Multiply by a constant
100100
# Multiply each value in the field by 3
101-
stress_3 = maths.scale_fc(fields_container=stress_3, ponderation=3.0).eval()
101+
stress_3 = maths.scale_fc(fields_container=stress_3, weights=3.0).eval()
102102

103103
# Add fields containers
104104
# Each value of each field is added by the correspondent component of the others fields

examples/04-advanced/04-extrapolation_stress_3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
divide.inputs.fieldB.connect(stress_ref_nodal_op)
178178
rel_error = dpf.operators.math.scale()
179179
rel_error.inputs.field.connect(divide)
180-
rel_error.inputs.ponderation.connect(1.0)
180+
rel_error.inputs.weights.connect(1.0)
181181

182182
###############################################################################
183183
# Plot absolute and relative errors.

examples/04-advanced/05-extrapolation_strain_2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
divide.inputs.fieldB.connect(strain_ref_nodal_op)
168168
rel_error = dpf.operators.math.scale()
169169
rel_error.inputs.field.connect(divide)
170-
rel_error.inputs.ponderation.connect(1.0)
170+
rel_error.inputs.weights.connect(1.0)
171171

172172
###############################################################################
173173
# Plot absolute and relative errors.

examples/04-advanced/06-stress_gradient_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
# using :class:`scale <ansys.dpf.core.operators.math.scale.scale>` operator
111111
# inwards in the geometry, to get the path direction.
112112
#
113-
normal_vec_in_field = ops.math.scale(field=normal_vec_out_field, ponderation=-1.0)
113+
normal_vec_in_field = ops.math.scale(field=normal_vec_out_field, weights=-1.0)
114114
normal_vec_in = normal_vec_in_field.outputs.field.get_data().data[0]
115115
###############################################################################
116116
# Get nodal coordinates, they serve as the first point on the line.

examples/04-advanced/10-asme_secviii_divtwo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
poisson_ratio_correction = 1.3 / 1.5
116116
eppleqvmech_op = dpf.operators.math.scale_fc(
117-
fields_container=eppleqv, ponderation=poisson_ratio_correction
117+
fields_container=eppleqv, weights=poisson_ratio_correction
118118
)
119119
eppleqvmech = eppleqvmech_op.outputs.fields_container()
120120

@@ -134,23 +134,23 @@
134134
s123 = s123_op.outputs.fields_container()
135135
# SVM_scale=SVM*3
136136
ratio = 3.0
137-
seqvs_op = dpf.operators.math.scale_fc(fields_container=seqv, ponderation=ratio)
137+
seqvs_op = dpf.operators.math.scale_fc(fields_container=seqv, weights=ratio)
138138
seqvs = seqvs_op.outputs.fields_container()
139139
# S123/SVM*3
140140
sratio_op = dpf.operators.math.component_wise_divide(fieldA=s123, fieldB=seqvs)
141141
sratio = sratio_op.outputs.field()
142142
# S123/SVM*3-0.33
143-
sterm_op = dpf.operators.math.add_constant(field=sratio, ponderation=-1 / 3)
143+
sterm_op = dpf.operators.math.add_constant(field=sratio, weights=-1 / 3)
144144
sterm = sterm_op.outputs.field()
145145
# -alfasl/(1+m2)*stressterm
146146
ratio2 = -alfasl / (1 + m2)
147-
expt_op = dpf.operators.math.scale(field=sterm, ponderation=ratio2)
147+
expt_op = dpf.operators.math.scale(field=sterm, weights=ratio2)
148148
expt = expt_op.outputs.field()
149149
# exp(-alfasl/(1+m2)*stressterm)
150150
exp_op = dpf.operators.math.exponential(field=expt)
151151
exp = exp_op.outputs.field()
152152
# elu*exp(-alfasl/(1+m2)*stressterm)
153-
strainlimit_op = dpf.operators.math.scale(field=exp, ponderation=m2)
153+
strainlimit_op = dpf.operators.math.scale(field=exp, weights=m2)
154154
strainlimit = strainlimit_op.outputs.field()
155155

156156
###############################################################################

examples/04-advanced/13-manage_licensing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
print(field)
6969

7070
# Instantiate an Entry (not licensed) DPF operator
71-
op_entry = dpf.operators.math.add_constant(field=field, ponderation=2.0, server=server)
71+
op_entry = dpf.operators.math.add_constant(field=field, weights=2.0, server=server)
7272

7373
# Instantiate a Premium (licensed) DPF operator
7474
op_premium = dpf.operators.filter.field_high_pass(field=field, threshold=0.0, server=server)

examples/05-file-IO/04-basic-load-file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
divide.inputs.fieldB.connect(fc_out)
121121
scale = dpf.operators.math.scale()
122122
scale.inputs.field.connect(divide)
123-
scale.inputs.ponderation.connect(100.0)
123+
scale.inputs.weights.connect(100.0)
124124
rel_error = scale.eval()
125125

126126
###############################################################################

0 commit comments

Comments
 (0)