# Metafor

ULiege - Aerospace & Mechanical Engineering

### Site Tools

doc:user:geometry:user:selections

# Node Groups

Node selections are used to apply boundary conditions (Prescribed Displacements) or to extract curves (Saving history curves to disk) on a specific node set which does not initially come from a geometric entity. In Metafor, a selection is represented by a Group. This object is a virtual geometric entity which can possess nodes, in the same way as other entities receive them when they are meshed.

## ''Group'' Creation

A Group is defined as any other geometric entity.

groupset.add( Group(number) )

## Information on the nodes of a ''Group''

Some functions can be used to obtain data on some nodes of a Group:

grp = groupset(number)

grp.getNo()                 # Returns the number of the group grp
grp.getNumberOfMeshPoints() # Returns the number of meshedPoints in the ''Group'' grp
grp.getMeshPoint(idx)       # Returns a reference towards the idxth MeshedPoint of the group grp.

groupset(number).add(GObject)
groupset(number).addMeshPointsInBox(xmin, xmax, ymin, ymax, zmin, zmax)
groupset(number).addInnerMeshPointsFromObject(target, selector) 

where

 number group number no number of the node 1) to add to the group xmin, ymin, zmin lower corner of the selection box xmax, ymax, zmax upper corner of the selection box target geometric entity used as support selector selection operator which reduces the number of MeshPoints in the group

nb : addInnerMeshPointsFromObject does not add nodes on boundary of target if target is a real geometrical object (meaning : not a group)

## Sorting the selected nodes

It is not always easy to select only the required nodes (on parametric studies for example). Therefore, it is possible to sort a selection, in order to select a subset of this first selection. This is done done with Node Sorting Operators.

groupset(number).selectMeshPoints(sorter,nbMeshPoints)

where

 number group number sorter sorting operator nbMeshPoints number of MeshPoints which will remain in the group

Example:

group.addMeshPointsFromObject(sideset(1))
group.selectMeshPoints(SortByNo(),3) 

These lines sort the nodes by user number and conservation of three values.

Adding nodes from the geometric object target (target can be a group):

groupset(number).addMeshPointsFromObject(target, selector)

where selector is an object of the Selector type. Here are some of its derived classes:

#### BoxSelector

Selection within a box :

BoxSelector(xMin, xMax, yMin, yMax, zMin, zMax)

where

 xMin minimal X value xMax maximal X value yMin minimal Y value yMax maximal Y value zMin minimal Z value zMax maximal Z value

#### RangeSelector

Selection in a given area :

RangeSelector(lock, vMin, vMax)

where

 lock direction of the selector : TX, TY or TZ vMin minimal value in lock direction vMax maximal value in lock direction

#### DistSelector

Spherical selection :

DistSelector (Cx, Cy, Cz, R)

where

 Cx, Cy, Cz center of the sphere R radius of the sphere

#### SectorSphericalSelector

Selection in a spherical sector :

SectorSphericalSelector (Cx, Cy, Cz, rMin, rMax, thetaMin, thetaMax, phiMin, phiMax)

where

 Cx, Cy, Cz center of the spherical sector rMin- rMax minimal - maximal radius of the spherical sector thetaMin-thetaMax minimal-maximal azimuth angle (from $0.0$ to $2 \pi$) phiMin-phiMax minimal-maximal elevation angle (from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$)

Note : angles are computed with respect to the structural frame translated toward the center or the sphere.

#### AnnealedSelector

Selection selection of a ring along the x, y or z direction :

AnnealedSelector(lock, x, y, z, rMin, rMax, hMin, hMax)

where

 lock direction of the axe of the ring (TX, TY or TZ) x,y,z center of the ring rMin,rMax minimal - maximal radius of the ring hMin,hMax minimal - maximal height of the ring

gets all nodes situated from the two cylinders of axis lock, of radii rMin and rMax, and of height between hMin and hMax.

#### SectorAnnealedSelector

Selection of a part or a ring, defined by two angles, along the x, y or z direction :

SectorAnnealedSelector(lock, x, y, z, rMin, rMax, thetaMin, thetaMax, hMin, hMax)

where

 lock direction of the axe of the ring (TX, TY or TZ) x,y,z center of the ring rMin, rMax minimal - maximal radius of the ring sector thetaMin, thetaMax minimal - maximal angle of the sector (from $-\pi$ to $\pi$) hMin, hMax minimal - maximal height of the ring sector

#### TorrusSelector

Selection of nodes inside a torus :

TorrusSelector(axe, Cx, Cy, Cz, rMin, rMax)

where

 axe Axe of the torus Cx, Cy, Cz center of the torrus rMin minimal Radius (to be explained) rMax maximal Radius (to be explained)

#### EllipseSelector

Selection within an ellipse :

EllipseSelector (lock, Cx, Cy, CZ, a, b)

where

 lock direction of axe perpendicular to the plane of the ellipse : TX, TY or TZ Cx, Cy, Cz center of the ellipse a small radius b big radius

#### PlaneSelector

Selection on one side of a plane :

PlaneSelector (plane, dir)

where

 plane Plane surface object dir boolean (True / False) defining the side of the plane (depending to the normal)

#### BoundarySelector

Select nodes that are on the surface of a meshed object (3D Models only) :

BoundarySelector ()

#### Boundary2DSelector

Select nodes that are on the surface of a meshed object (2D Models only) :

Boundary2DSelector ()

#### InverseSelector

Revert the effect of a selector :

InverseSelector (selector)

where

 selector selector whose effect will be inverted

Examples:

group.addMeshPointsFromObject(sideset(1), RangeSelector(TX, xmin, xmax))

gets all nodes from side #1 whose x coordinate is between xmin et xmax.

group.addMeshPointsFromObject(sideset(1), BoxSelector(xmin, xmax, ymin, ymax, zmin, zmax))

gets all nodes from side #1 in the rectangular box defined by xmin, xmax, ymin, ymax, zmin, zmax.

 group.addMeshPoints(DistSelector(x, y, z, R))

gets all nodes situated in a sphere of center (x,y,z) and radius R.

 group.addMeshPoints(SectorSphericalSelector(Cx, Cy, Cz, rMin, rMax, thetaMin, thetaMax, phiMin, phiMax))

gets all nodes in the spherical sector of center (Cx,Cy,Cz), of minimal and maximal radii rMin and rMax, of minimal and maximal azimuth angle thetaMin and thetaMax, and of minimal and maximal elevation angle pHiMin and phiMax.

Note : angles are computed with respect to the structural frame translated toward the center or the sphere. The elevation angle varies from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$ and the azimuth angle from $0.0$ to $2 \pi$.

group.addMeshPoints(TorrusSelector(Axe(curveset(1)), Cx, Cy, Cz, rMin, rMax))

gets all nodes in the toroidal sector defined by the revolution axis Axe(curveset(1)), the annular cross section centroid is (Cx, Cy, Cz) (This is the cross section used in the revolution mesher.) and the minimal and maximal radii rMin and rMax.

group.addMeshPoints(AnnealedSelector(TX, x, y, z, rMin, rMax, zMin, zMax))

gets all nodes situated from the two cylinders of axis TX, of radii rMin and rMax, and of height between zMin and zMax.

group.addMeshPoints(SectorAnnealedSelector(TX, x, y, z, rMin, rMax, thetaMin, thetaMax, zMin, zMax))

gets all nodes situated within two parts of cylinders of axis TX, of opening angle between thetaMin and thetaMax, of radii rMin and rMax, and of height between zMin and zMax.

1)
it is more of a MeshPoint, so a mesh point which can be found in domain.getTopology().getPointSet()