Outputting DataOut Object into Personal Object Rather Than Outputing to File

42 views
Skip to first unread message

Chen R

unread,
May 26, 2021, 7:58:54 AM5/26/21
to deal.II User Group
Hi all,

I am trying to run a basic elasticity calculation based on the tutorial (tutorial 8). I want to output the results and thought of using DataOut class similar to the tutorial so that the results are in a predefined order. But I don't want to output the data into a file but instead return some object that contains the data.\

The data structures in the DataOut class are all protected/private. Is there no API of this class to just get the result itself without writing into a file format of some kind?

Is there such a way or am I going about this wrong?

Thank you,
Chen R.

vachanpo...@gmail.com

unread,
May 27, 2021, 7:14:38 AM5/27/21
to deal.II User Group
Chen,

I could not understand your motivation for doing this. If you want to "save" the data to be read again, then you can have a look at SolutionTransfer class.


Vachan

Wells, David

unread,
Jun 1, 2021, 11:19:23 AM6/1/21
to deal.II User Group
Hi Chen,

The internal data structures are designed so that we have a consistent intermediate representation that works for all supported output formats. It's generally not what you want to use since it works with the lowest common denominator (DG elements) representation of the solution. The 'right' answer is that you should use normal-looking deal.II code to compute whatever output quantities you care about.

What kind of results do you want to get out of this class?

Best,
David

From: dea...@googlegroups.com <dea...@googlegroups.com> on behalf of Chen R <chen...@gmail.com>
Sent: Wednesday, May 26, 2021 7:58 AM
To: deal.II User Group <dea...@googlegroups.com>
Subject: [deal.II] Outputting DataOut Object into Personal Object Rather Than Outputing to File
 
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/adeaf5ea-25fb-4fb9-b11e-5a0a6edbee1fn%40googlegroups.com.

Chen R

unread,
Jun 23, 2021, 3:57:21 AM6/23/21
to deal.II User Group
Hi David,

I am mainly trying to integrate the dealii system with our own geometric modeling program to do FE calculations. Right now created a basic elasticity solver based on the tutorials.
The thing is I want to create a triangulation from our geometry and calculate on it then present the results back to in our program, but not entirely sure in what order the results are outputted using the SolverCG.

My idea was to use some object like DataOut which can ouput the solution in a predetermined way but I see that this is not the way to do it.

Wolfgang Bangerth

unread,
Jun 23, 2021, 4:51:59 AM6/23/21
to dea...@googlegroups.com
On 6/23/21 1:57 AM, Chen R wrote:
>
> I am mainly trying to integrate the dealii system with our own geometric
> modeling program to do FE calculations. Right now created a basic elasticity
> solver based on the tutorials.
> The thing is I want to create a triangulation from our geometry and calculate
> on it then present the results back to in our program, but not entirely sure
> in what order the results are outputted using the SolverCG.
>
> My idea was to use some object like DataOut which can ouput the solution in a
> predetermined way but I see that this is not the way to do it.

Right. DataOut produces data in some internal format that is useful for later
outputting it in graphical form. What that internal format is is unimportant,
but it is not what you want anyway.

If you want to know what the solution is on an individual cell, ask the cell via
cell->get_dof_indices(...)
what its degrees of freedom are, and then query the solution vector for these
components. Or just call
cell->get_dof_values(...)
right away for the values of degrees of freedom located on a cell.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages