# Import coordinates

**URL:** <https://pyfr.discourse.group/t/import-coordinates/619>\
**Category:** Development\
**Tags:** postprocessing\
**Created:** [6 June 2022 14:20 UTC](https://pyfr.discourse.group/t/import-coordinates/619 "2022-06-06T14:20:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [6 June 2022 14:20 UTC](https://pyfr.discourse.group/t/import-coordinates/619/1 "2022-06-06T14:20:45Z")

</div>

Hello, I want to import the coordinates of a bunch of points, and store the coordinates in an array as global variables. Is it possible? could anyone give me some suggestions?

Thaks a lot.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [6 June 2022 19:22 UTC](https://pyfr.discourse.group/t/import-coordinates/619/2 "2022-06-06T19:22:28Z")

</div>

Not without modifying the code. From then it really depends what you want to do with the points. There is a big difference between using the points in say a Python plugin compared with code on the backend.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [7 June 2022 15:04 UTC](https://pyfr.discourse.group/t/import-coordinates/619/3 "2022-06-07T15:04:36Z")

</div>

Yes, I want to modify the code. Can you give me some ideas?

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [7 June 2022 19:52 UTC](https://pyfr.discourse.group/t/import-coordinates/619/4 "2022-06-07T19:52:38Z")

</div>

The first thing you need to do is figure out how exactly what you want to do fits within the high-order FR framework. Only once you’ve done this and come up with a formulation which does not impact the order of accuracy is it sensible to start thinking about how to code up the functionality.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [12 June 2022 14:57 UTC](https://pyfr.discourse.group/t/import-coordinates/619/5 "2022-06-12T14:57:11Z")

</div>

Thanks.  
I want to use the coordinates of solution points in the physical space, how can I use the dictionary **vars** to get all solution points coordinates in other py file? Are there any examples for my reference?

 ![MTI747SXGMO_`MFN7F9YWVD](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/d95896bd0f7b02a17cbd71df5e1e69ca9028c160.png)

Best regards

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [13 June 2022 13:24 UTC](https://pyfr.discourse.group/t/import-coordinates/619/6 "2022-06-13T13:24:22Z")

</div>

It depends what Python file and in what context.

However, a quick search shows several values which make use of these coordinates:

> <https://github.com/PyFR/PyFR/blob/c9d02b004e70a71536cb423a0e0f39f66c59462a/pyfr/plugins/integrate.py#L44>

> <https://github.com/PyFR/PyFR/blob/d561c878dc0b517409409f4371bec0d08c399cbe/pyfr/plugins/sampler.py#L194>

for example.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![fei](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fei](https://pyfr.discourse.group/u/fei)\
**Post date:** [22 May 2023 15:50 UTC](https://pyfr.discourse.group/t/import-coordinates/619/7 "2023-05-22T15:50:26Z")

</div>

> [@fdw](#):
>
> `plocs.append(eles.ploc_at_np(pts).swapaxes(1, 2))`

In this way, x = plocs[0], y = plocs[1], z = plocs[2], are these right?

And when I use the physical coor of solution point, is it necessary to enter the element type?

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [23 May 2023 07:46 UTC](https://pyfr.discourse.group/t/import-coordinates/619/8 "2023-05-23T07:46:45Z")

</div>

The element type is handled in the loop, `eles` is an element object for a single element type.

As to where x, y and z are in that array, I imagine you’re right but check the shape of the array.
