Open
Description
Before submitting the issue
- I have checked for Compatibility issues
- I have searched among the existing issues
- I am using a Python virtual environment
Description of the bug
It seems that the scoping operator does not return the correct cumulative index in some cases.
Steps To Reproduce
Use the attached RST file.
Open it, and run:
from ansys.dpf import core as dpf
rst_file = r"C:\Users\gayuso\AppData\Local\Temp\pytest-of-gayuso\pytest-1344\ansys0\file.rst"
model = dpf.Model(rst_file)
set_ = (1, 10)
cum_set = model.metadata.time_freq_support.get_cumulative_index(set_[0], set_[1])
scop = dpf.Scoping()
scop.location = "time_freq_steps"
scop.ids = [cum_set]
op = model.results.displacement()
op.inputs.time_scoping.connect(scop)
output = op.outputs.fields_container()[0].data
where output
is:
DPFArray([[ 0. , -0.02314378, 0. ],
[ 0. , 0. , 0. ],
[ 0. , 0. , 0. ]])
However, using MAPDL, and running:
post1
set,1,10
prnsol,u
I get:
PRINT U NODAL SOLUTION PER NODE
*****MAPDL VERIFICATION RUN ONLY*****
DO NOT USE RESULTS FOR PRODUCTION
***** POST1 NODAL DEGREE OF FREEDOM LISTING *****
LOAD STEP= 1 SUBSTEP= 10
TIME= 0.10000E-02 LOAD CASE= 0
THE FOLLOWING DEGREE OF FREEDOM RESULTS ARE IN THE GLOBAL COORDINATE SYSTEM
NODE UX UY UZ USUM
1 0.0000 -0.17485E-003 0.0000 0.17485E-003
2 0.0000 0.0000 0.0000 0.0000
3 0.0000 0.0000 0.0000 0.0000
MAXIMUM ABSOLUTE VALUES
NODE 0 0 0 0
VALUE 0.0000 -0.17485E-003 0.0000 0.17485E-003
I believe the issue is related to get_cumulative_index
, because it retuns cum_set= 11
, whereas MAPDL when issued set,list
returns 10
.
***** INDEX OF DATA SETS ON RESULTS FILE *****
SET TIME/FREQ LOAD STEP SUBSTEP CUMULATIVE
1 0.10000E-02 1 10 10
2 0.20000E-02 2 1 11
3 0.30000E-02 2 2 12
4 0.40000E-02 2 3 13
5 0.50000E-02 2 4 14
6 0.60000E-02 2 5 15
7 0.70000E-02 2 6 16
8 0.80000E-02 2 7 17
9 0.90000E-02 2 8 18
10 0.10000E-01 2 9 19
11 0.11000E-01 2 10 20
12 0.12000E-01 2 11 21
13 0.13000E-01 2 12 22
14 0.14000E-01 2 13 23
15 0.15000E-01 2 14 24
16 0.16000E-01 2 15 25
17 0.17000E-01 2 16 26
18 0.18000E-01 2 17 27
19 0.19000E-01 2 18 28
20 0.20000E-01 2 19 29
21 0.21000E-01 2 20 30
22 0.22000E-01 2 21 31
23 0.23000E-01 2 22 32
24 0.24000E-01 2 23 33
25 0.25000E-01 2 24 34
26 0.26000E-01 2 25 35
27 0.27000E-01 2 26 36
28 0.28000E-01 2 27 37
29 0.29000E-01 2 28 38
30 0.30000E-01 2 29 39
31 0.31000E-01 2 30 40
32 0.32000E-01 2 31 41
33 0.33000E-01 2 32 42
34 0.34000E-01 2 33 43
35 0.35000E-01 2 34 44
36 0.36000E-01 2 35 45
37 0.37000E-01 2 36 46
38 0.38000E-01 2 37 47
39 0.39000E-01 2 38 48
40 0.40000E-01 2 39 49
41 0.41000E-01 2 40 50
42 0.42000E-01 2 41 51
43 0.43000E-01 2 42 52
44 0.44000E-01 2 43 53
45 0.45000E-01 2 44 54
46 0.46000E-01 2 45 55
47 0.47000E-01 2 46 56
48 0.48000E-01 2 47 57
49 0.49000E-01 2 48 58
50 0.50000E-01 2 49 59
51 0.51000E-01 2 50 60
52 0.52000E-01 2 51 61
53 0.53000E-01 2 52 62
54 0.54000E-01 2 53 63
55 0.55000E-01 2 54 64
56 0.56000E-01 2 55 65
57 0.57000E-01 2 56 66
58 0.58000E-01 2 57 67
59 0.59000E-01 2 58 68
60 0.60000E-01 2 59 69
61 0.61000E-01 2 60 70
62 0.62000E-01 2 61 71
63 0.63000E-01 2 62 72
64 0.64000E-01 2 63 73
65 0.65000E-01 2 64 74
66 0.66000E-01 2 65 75
67 0.67000E-01 2 66 76
68 0.68000E-01 2 67 77
69 0.69000E-01 2 68 78
70 0.70000E-01 2 69 79
71 0.71000E-01 2 70 80
72 0.72000E-01 2 71 81
73 0.73000E-01 2 72 83
74 0.74000E-01 2 73 84
75 0.75000E-01 2 74 85
76 0.76000E-01 2 75 86
77 0.77000E-01 2 76 87
78 0.78000E-01 2 77 88
79 0.79000E-01 2 78 89
80 0.80000E-01 2 79 90
81 0.81000E-01 2 80 91
82 0.82000E-01 2 81 92
83 0.83000E-01 2 82 93
84 0.84000E-01 2 83 94
85 0.85000E-01 2 84 95
86 0.86000E-01 2 85 96
87 0.87000E-01 2 86 97
88 0.88000E-01 2 87 98
89 0.89000E-01 2 88 99
90 0.90000E-01 2 89 100
91 0.91000E-01 2 90 101
92 0.92000E-01 2 91 102
93 0.93000E-01 2 92 103
94 0.94000E-01 2 93 104
95 0.95000E-01 2 94 105
96 0.96000E-01 2 95 106
97 0.97000E-01 2 96 107
98 0.98000E-01 2 97 108
99 0.99000E-01 2 98 109
100 0.10000 2 99 110
101 0.10100 2 100 111
102 0.10200 2 101 112
103 0.10300 2 102 113
104 0.10400 2 103 114
105 0.10500 2 104 115
106 0.10600 2 105 116
107 0.10700 2 106 117
108 0.10800 2 107 118
109 0.10900 2 108 119
110 0.11000 2 109 120
If I run with cum_set
equals 1
, I do get the expected result:
DPFArray([[ 0. , -0.00017485, 0. ],
[ 0. , 0. , 0. ],
[ 0. , 0. , 0. ]])
Which Operating System are you using?
Windows
Which Python version are you using?
3.9