On 09/05/2016 06:04 AM, hanks0...@gmail.com wrote:
K_Inv[0][0]=2*r/(cos(theta)*cos(theta)),
K_Inv[1][1]=2*r/(sin(theta)*sin(theta)), K_Inv[2][2]=r
r is calculated by "r=sqrt(x^2+y^2) ", and theta is calculated by "theta=x/y"
But, as you can expect that ,on the points where |x|<0.0000001 or
|y|<0.000001, cos(theta) or sin(theta) is almost zero. So, It seems that It
causes the singularity.
So, At first I tried to change the above 2 element in K_Inv like this...
K_Inv[0][0]=2*r/(cos(theta)*cos(theta)+del)
K_Inv[1][1]=2*r/(sin(theta)*sin(theta)+del),
Instead of this approach, you should use the following: if r>delta, use the
formula above. If r<=delta, use l'Hopital's rule to get an expression that
avoids the division by zero.
That said, you still have a problem for those values of x,y where theta is
close to zero or one, but r is not. For example, for x=0, y=1, you have
r=1
theta=pi/2
cos(theta)=0
K_inv[0,0] = 2/0
You need to think about what you want to do with this situation.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.