On 09/08/2016 10:17 PM, hanks0...@gmail.com wrote:
Thanks for your answer. But, I still don't know how I can deal with this error.

Then you need to describe more clearly what you want to do. As I mentioned 
here...


    > 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.

...your original formula for K_Inv[0][0] is so that it can lead to 1/0 for some values of x,y. There is simply nothing you can do about this -- it's not a question how you *compute* it, it's that that's what the *model* says. If you don't like it, you need to start thinking about whether that's the *correct model*!

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.

Reply via email to