On 5/7/20 10:25 PM, 孙翔 wrote:
I have a .txt file which stores a permeability distribution in the z-direction as follows

z                 value
0                 0.1
1                 0.3
2                 0.5
3                 0.2
4                 0.8
5                 0.4
6                 0.7
7                 0.5
8                 0.6
......

Does Dealii have a function to read it into the code and apply the distribution in the model? Maybe, there is an interpolation function that can help me get the value at quadrature points. if there is no such a function, can I get the real coordinate at the quadrature point? I can wirte my own interpolation function to get the coefficient at the quadrature point.

Xiang,
there is the InterpolatedTensorProductGridData that can do the interpolation for you. It's meant for arbitrary dimensions, but of course also works in 1d. But there are then two pieces missing that you need to provide yourself:

* You need to read the data into the arrays with which you create objects of the class mentioned above.

* You will create an object of that type with dim==1. In your code, you will ask
  fe_values.quadrature_point(q)
to get the coordinates of the q'th quadrature point, of which you will then only use the last coordinate value to call the 1d function.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f5d39635-4854-96b6-be11-99ee420754a9%40colostate.edu.

Reply via email to