How does the function "evaluate_vector_field()" for example work?

24 views
Skip to first unread message

Abbas

unread,
Mar 23, 2023, 3:54:19 PM3/23/23
to deal.II User Group
Hello, 

Not exactly an FEM or dealii question but here goes. 
I am not interested in knowing how the function "evaluate_vector_field" works per se, but I want to know how I can figure it out for myself from looking at the source code. 

The function "evaluate_vector_field" is a good example. It is not exactly documented how it works. I grep searched the include and the source files for the function but I can't find the hard code that does the work.    

I can ask "How does data post-processor calculate the gradients at the cell vertices?" but I want try figure out things like that on my own before coming here. 

So, where is the hard code associated with the function "evaluate_vector_field()". I can't find it. 

Thanks of course, 
Abbas  

Wolfgang Bangerth

unread,
Mar 23, 2023, 7:56:33 PM3/23/23
to dea...@googlegroups.com
The function is abstract virtual, so it is not implemented in the
library. You need to implement in user code when you use it, as shown in
the various examples in the documentation, for example here:

https://dealii.org/developer/doxygen/deal.II/classDataPostprocessorTensor.html

What you are probably asking is where is this function called, and with
which values. If you want to find that place, it is here:
https://github.com/dealii/dealii/blob/master/source/numerics/data_out.cc#L657-L664
I will say that that is quite a big function in which it is hidden.
DataOut is not for the faint of heart.

In the end, if you are interested in learning the internal structure of
deal.II, it is often useful to start reading the code via an IDE. IDEs
are able to parse the entirety of the project and can jump to the place
where a function is defined that you call from a user project; you don't
have to know where that function is.

There is also the approach to just start working on small projects
within the library. We have a number of starter projects for which we
would be very happy to accept patches:
https://github.com/dealii/dealii/issues?q=is%3Aissue+is%3Aopen+label%3A%22Starter+project%22

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Reply all
Reply to author
Forward
0 new messages