Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New postprocessing functions? #11894

Closed
peterrum opened this issue Mar 12, 2021 · 1 comment
Closed

New postprocessing functions? #11894

peterrum opened this issue Mar 12, 2021 · 1 comment

Comments

@peterrum
Copy link
Member

With PR #11804 merged, we will have an easy way to evaluate solution vectors at arbitrary (distributed) point.

Although the intention for writing this function was completely different, I have used locally this function for the following two post-processing tasks:

  1. evaluate the solution along a line with points positioned equidistantly and write the result into a text file (only by the root rank) - see also: https://github.com/dealii/dealii/pull/11804/files#diff-c64adc9b1ec4bb22e54afbc87f625e97c8843aa279ab338e8649da5d841ba7a2
  2. instead of writing 3D data on a very fine mesh with DataOut, I could write the data on a slice (2D) or an coarser (non-matching) 3D mesh - see also: https://github.com/dealii/dealii/pull/11804/files#diff-dd3e88a18dc69bf7b9ccf6444ad6fbe43d1deb33ffae7ab5bb399dca357cdf58

Both of these postprocessing tasks are different, however, need somewhere the ability to evaluate the solution at some points. In the second case, these points correspond to the support points.

My question would be if such postprocessing function would be useful in the library? If yes, what would be the correct place and how could appropriate interfaces look like?

Furthermore, I am not sure how to approach the second case? At the moment, I am doing the following: 1) create a new triangulation, 2) create a new DoFHandler, 3) collect the support points, 4) call the new function (point -> value), 5) write the result into a global vector, and 6) finally use DataOut to output the result. This works for now locally but I feel it is a bit clumsy. Wouldn't it be possible to write a new DataOut class (maybe DataOutSampling): it would be used as usual but in the attach_triangulation() function users could attach a triangulation object that does not match the vectors added for post processing? I am absolutely not an expert in DataOut and the interaction with the base class but I think this way one might be able to skip the creation of the DoFHandler since the patches could be directly filled.

Is there interest? Any ideas?

@tjhei This topic might be also interesting for you!?

@bangerth
Copy link
Member

The second task you think about above already works: You can select via lambda functions which cells to generate output on, and that includes non-active ones. So at least the downsampling thing works. The slicing is more difficult since we can't use cell-based output. I would suggest to leave that to viz tools -- in particular also because one quite frequently does not know up front which slice one really wants, and the right solution would be to just output the data necessary to make that decision at a later time.

As for evaluating at multiple points: Yes, that would be useful. I would simply build on the existing point_value() functions and overload as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants