setting Dirichlet boundary conditions by a function - change of behaviour for vector variables
Hi,
currently, when setting the Dirichlet boundary conditions (ebcs) by a function, the function should return a 1D array with all values of the first component, then of the second one etc. concatenated together (= DOF-by-DOF ordering). Passing a 2D array has been silently ignored, but now with numpy 1.13 out, this lead to #404 [1].
It is not a hard-to-fix bug, but I would also like to make the behaviour of the boundary conditions setting functions consistent with the material parameters setting functions, and change the ordering from DOF-by-DOF to node-by-node, e.g. all components in the first node, all components in the second node, etc.
Example: having in 3 nodes the values (2 DOFs per node)
[[1, 2], [3, 4], [5, 6]]
the old behaviour required the function to return [1, 3, 5, 2, 4, 6], while the new version will require either [1, 2, 3, 4, 5, 6], or directly
[[1, 2], [3, 4], [5, 6]]
that will be ravelled automatically. So, with the new behaviour, the returned
vector values would have the same shape as the coors
argument (the
coordinates) that are passed into the setting functions. IMHO this is much
easier to get right for users.
Any thoughts?
Cheers, r.
FYI: this will be merged soon. Besides the Dirichlet BCs, also the shift in the shifted-periodic boundary conditions needs to be transposed for variables with more than one component.
r.
On 06/13/2017 03:44 PM, Robert Cimrman wrote:
Hi,
currently, when setting the Dirichlet boundary conditions (ebcs) by a function, the function should return a 1D array with all values of the first component, then of the second one etc. concatenated together (= DOF-by-DOF ordering). Passing a 2D array has been silently ignored, but now with numpy 1.13 out, this lead to #404 [1].
It is not a hard-to-fix bug, but I would also like to make the behaviour of the boundary conditions setting functions consistent with the material parameters setting functions, and change the ordering from DOF-by-DOF to node-by-node, e.g. all components in the first node, all components in the second node, etc.
Example: having in 3 nodes the values (2 DOFs per node)
[[1, 2], [3, 4], [5, 6]]
the old behaviour required the function to return [1, 3, 5, 2, 4, 6], while the new version will require either [1, 2, 3, 4, 5, 6], or directly
[[1, 2], [3, 4], [5, 6]]
that will be ravelled automatically. So, with the new behaviour, the returned vector values would have the same shape as the
coors
argument (the coordinates) that are passed into the setting functions. IMHO this is much easier to get right for users.Any thoughts?
Cheers, r.
[1] https://github.com/sfepy/sfepy/issues/404
SfePy mailing list sfepy@python.org https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/
participants (1)
-
Robert Cimrman