Select inner faces as FEM boundary

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Select inner faces as FEM boundary

Post by HoWil »

Good afternoon,

I want to use FC to build a mesh for an external FEniCS model.
Therefore, I need to select faces in order to set boundary groups while I use the new GMESH feature in FEM-WB. The single domain of the model is a box with a cutted sphere in the center and looks like in the following pic:
Screenshot from 2016-11-28 16-06-41.png
Screenshot from 2016-11-28 16-06-41.png (178.34 KiB) Viewed 3342 times
I want now to select the inner, spherical faces to use them for a boundary condition. How do I select them?
Is it possible to hide one of the outer faces to see inside the box?

Thanks in advance,
HoWil
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Select inner faces as FEM boundary

Post by ulrich1a »

HoWil wrote:I want now to select the inner, spherical faces to use them for a boundary condition. How do I select them?
I think Bernd coded it that way, that you can just use the sphere of your model to set the inner boundery.
So you need only to hide the Box and unhide the Sphere, in order to select the surface of the Sphere for your boundery condition.

Ulrich
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Select inner faces as FEM boundary

Post by ickby »

Hello,

I think the only option you have is to use clipping planes. Go to View->clipping Plane and than simply select the inner face. However, as the plane settings open in the tasks panel and all clipping planes vanish on close it cannot be used parallel to annother open task. so this only works if it is enough to preselect a face before running a fem tool.
It is a point on my neverending list to make the cpliping planes a own dock widget, but I dod not yet manage to find the time for it.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Select inner faces as FEM boundary

Post by HoWil »

you can just use the sphere of your model to set the inner boundery
Basically there is no sphere; I used the 'Subtractive Sphere' feature in Part-Design-Next (PDN).
I think in PDN it is not possible to draw more than one 'bodies' like a box (from the additive primitive pull down menu) and a sphere in one PDN-body.
Thx
Last edited by HoWil on Mon Nov 28, 2016 3:44 pm, edited 2 times in total.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Select inner faces as FEM boundary

Post by HoWil »

ickby wrote:Hello,

I think the only option you have is to use clipping planes. Go to View->clipping Plane and than simply select the inner face. However, as the plane settings open in the tasks panel and all clipping planes vanish on close it cannot be used parallel to annother open task. so this only works if it is enough to preselect a face before running a fem tool.
It is a point on my neverending list to make the cpliping planes a own dock widget, but I dod not yet manage to find the time for it.
Now I at least know this feature even if I can't use it ;).
I did see it before but did not know how to enable it.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Select inner faces as FEM boundary

Post by HoWil »

Any further ideas??
Thx in advance,
HoWil
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Select inner faces as FEM boundary

Post by ulrich1a »

I got it. There is the quick and dirty way with the python console.
First find out the face number of the inner sphere. This can be done with cut-view. You will find the face name in the bottom of the FreeCAD-Window.
Now make your constraint and use any face you want. Have a look into the python console. There you will find a line like this:

Code: Select all

App.ActiveDocument.FemConstraintPressure.References = [(App.ActiveDocument.Sphere,"Face5"))
Use the edit-feature of the python console to get again that line. (use the up-arrow)
Edit this line and put the right face-number in.
With return you are done.

Ulrich
Attachments
Inner_constraint.png
Inner_constraint.png (35.74 KiB) Viewed 3308 times
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Select inner faces as FEM boundary

Post by HoWil »

@Ulrich1a
Thank you very much. Worked like a charm.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Select inner faces as FEM boundary

Post by HoWil »

Is there maybe also a command for selecting a face/domain via coordinates or an intersecting box?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Select inner faces as FEM boundary

Post by bernd »

I missed the topic but ulrich posted an answer to the problem already.

I addition two more possibilities.

Arch --> Section Plane --> See post viewtopic.php?t=15183&start=10#p121641

or

Draft --> Downgrade --> See topic viewtopic.php?t=12381

If it is one one or two faces I would use the python command.
Post Reply