Thanks David --- that trick works.

One more question: how can I find node numbers or element numbers that
satisfied the condition?  I'd like to see whether all necessary elements
are taken into account or not.

Best,
K. Lee.

On Thu, Nov 3, 2011 at 11:48 AM, David Knezevic
<[email protected]>wrote:

> On 11/02/2011 11:41 PM, Kyunghoon Lee wrote:
>
>> Hi all,
>>
>> I have a mesh (generated with gmsh) that has an internal line inside of a
>> domain to evaluate an output along the line.  As shown in the below mesh
>> figure, the line is composed of element edges from (-2,-0.5) to
>> (-2.0,0.5).
>>
>> I set the internal line as a physical line and try to get an output, but
>> it
>> seems my output functional evaluation has never called.  So I switched my
>> strategy to pass the coordinates of the element edges along the internal
>> line such as
>>
>>     virtual void boundary_assembly(FEMContext&**c) {
>>         AutoPtr<Elem>  elem_side = c.elem->build_side(c.side);
>>         const Real centroid_x = elem_side->centroid()(0);
>>         const Real centroid_y = elem_side->centroid()(1);
>>
>>         if( (-2.0 == centroid_x)&&  ((-0.5<= centroid_y) || (centroid_y<=
>>
>> 0.5)) ) {
>>          .......
>>         }
>>
>>
>> but again my output evaluation has never called --- it looks like there is
>> no element edges satisfying (-2.0 == centroid_x).  I'm afraid probably the
>> way I specify coordinates may not correct.  Plz suggest me some ideas to
>> fix the problem.
>>
>
> Well, for one thing, it's not a good idea to use "==" with floating point
> numbers (as in "(-2.0 == centroid_x)"). See if doing "abs(centroid_x+2.0) <
> 1.e-6" helps.
>
>
>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to