From b166e8b27074492bdf95ef0e5a44ee29f71cc079 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 10 Mar 2025 19:56:40 +0100 Subject: [PATCH 1/4] fix: using MAPDL calls only to get the nodes in coordinate systems --- src/ansys/mapdl/core/mesh_grpc.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/ansys/mapdl/core/mesh_grpc.py b/src/ansys/mapdl/core/mesh_grpc.py index 5130ec6c5f8..01352a1e964 100644 --- a/src/ansys/mapdl/core/mesh_grpc.py +++ b/src/ansys/mapdl/core/mesh_grpc.py @@ -545,7 +545,32 @@ def nodes_in_coordinate_system(self, CS_id): if CS_id == 0: return self.nodes else: - self._mapdl.parameters["__node_loc__"] = self.nodes + # self._mapdl.parameters["__node_loc__"] = self.nodes + mapdl.starget("__nnodes__", entity="NODE", entnum="0", item1="COUNT") + mapdl.dim(par="__node_loc_cs__", type_="ARRAY", imax="__nnodes__", jmax=3) + + mapdl.starvget( + "__node_loc_cs__(1,1)", + entity="NODE", + entnum="0", + item1="LOC", + it1num="X", + ) + mapdl.starvget( + "__node_loc_cs__(1,2)", + entity="NODE", + entnum="0", + item1="LOC", + it1num="Y", + ) + mapdl.starvget( + "__node_loc_cs__(1,3)", + entity="NODE", + entnum="0", + item1="LOC", + it1num="Z", + ) + self._mapdl.vfun("__node_loc_cs__", "local", "__node_loc__", CS_id) return self._mapdl.parameters["__node_loc_cs__"] From ea925c29fb8dd2c0f908c7acdef69149958b423c Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 10 Mar 2025 19:38:01 +0000 Subject: [PATCH 2/4] chore: adding changelog file 3792.added.md [dependabot-skip] --- doc/changelog.d/3792.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/3792.added.md diff --git a/doc/changelog.d/3792.added.md b/doc/changelog.d/3792.added.md new file mode 100644 index 00000000000..3adff40767b --- /dev/null +++ b/doc/changelog.d/3792.added.md @@ -0,0 +1 @@ +perf: using MAPDL calls only to get the nodes in coordinate systems \ No newline at end of file From c61e0f2296b5e87763e9096cd9813ed2f9e25be1 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 10 Mar 2025 21:05:02 +0100 Subject: [PATCH 3/4] fix: update MAPDL calls to use instance methods for node location retrieval --- src/ansys/mapdl/core/mesh_grpc.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ansys/mapdl/core/mesh_grpc.py b/src/ansys/mapdl/core/mesh_grpc.py index 01352a1e964..6156daac066 100644 --- a/src/ansys/mapdl/core/mesh_grpc.py +++ b/src/ansys/mapdl/core/mesh_grpc.py @@ -546,24 +546,26 @@ def nodes_in_coordinate_system(self, CS_id): return self.nodes else: # self._mapdl.parameters["__node_loc__"] = self.nodes - mapdl.starget("__nnodes__", entity="NODE", entnum="0", item1="COUNT") - mapdl.dim(par="__node_loc_cs__", type_="ARRAY", imax="__nnodes__", jmax=3) + self._mapdl.starget("__nnodes__", entity="NODE", entnum="0", item1="COUNT") + self._mapdl.dim( + par="__node_loc_cs__", type_="ARRAY", imax="__nnodes__", jmax=3 + ) - mapdl.starvget( + self._mapdl.starvget( "__node_loc_cs__(1,1)", entity="NODE", entnum="0", item1="LOC", it1num="X", ) - mapdl.starvget( + self._mapdl.starvget( "__node_loc_cs__(1,2)", entity="NODE", entnum="0", item1="LOC", it1num="Y", ) - mapdl.starvget( + self._mapdl.starvget( "__node_loc_cs__(1,3)", entity="NODE", entnum="0", From 5a78abcc14d1f02944b763fdc905da68ca16b487 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 10 Mar 2025 22:38:03 +0100 Subject: [PATCH 4/4] fix: replace starget with get for node count retrieval in MeshGrpc --- src/ansys/mapdl/core/mesh_grpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/mapdl/core/mesh_grpc.py b/src/ansys/mapdl/core/mesh_grpc.py index 6156daac066..e64065343af 100644 --- a/src/ansys/mapdl/core/mesh_grpc.py +++ b/src/ansys/mapdl/core/mesh_grpc.py @@ -546,7 +546,7 @@ def nodes_in_coordinate_system(self, CS_id): return self.nodes else: # self._mapdl.parameters["__node_loc__"] = self.nodes - self._mapdl.starget("__nnodes__", entity="NODE", entnum="0", item1="COUNT") + self._mapdl.get("__nnodes__", entity="NODE", entnum="0", item1="COUNT") self._mapdl.dim( par="__node_loc_cs__", type_="ARRAY", imax="__nnodes__", jmax=3 )