Locations
How to point Dr.Q at a region of your part: surfaces, a body, or a region of space.
A location is how you tell Dr.Q which region of a part something applies to: a set of surfaces, a volume, or a chunk of space. It answers "where does this apply?" You attach a location to every boundary condition (where a force, support, pressure, or moment acts), and you can also use one to scope a convergence study to just the region you care about.
Under the hood every location resolves the same way: against the actual mesh, into a set of nodes (and, for surface operations, faces). You never touch nodes yourself, you describe the region geometrically and Dr.Q does the lookup. That is also why a location can come back empty, see Location Problems.
Two ways to specify a location
Geometry-based locations reference the CAD file and its face or solid IDs:
| How you write it | What it selects |
|---|---|
Location(file) | the whole outer surface of the part |
Location(file, surfaces={1, 4}) | just those CAD face IDs |
Location.body(file, [0]) | a whole solid/body by its region ID (a volume) |
Location.cavity(known_internal, boundary) | an internal void: a seed point inside it plus the faces that close it off |
Space-based locations describe a shape in coordinates, independent of the CAD tagging:
| How you write it | What it selects |
|---|---|
Location.sphere(center, radius, surface_only=False) | everything inside a sphere (or only its surface nodes) |
Location.box(center, dimensions, x_direction, y_direction, surface_only=False) | an oriented box: an origin, full extents, and two directions defining its rotation |
Location.everywhere() selects the whole model. (For a convergence study, "no location" already means everywhere, so you rarely need it explicitly.)
A few details worth knowing:
- Box dimensions are full extents, not half-widths, and the two direction vectors must not be parallel: they define a right-handed frame (x along
x_direction, y perpendicular and in-plane). - All coordinate inputs are physical quantities (distance vectors with units), not bare numbers, in keeping with Dr.Q's typed-units approach.
surface_onlymakes a sphere or box grab only the surface nodes inside it rather than the full volume. This matters when the region carries a surface load or support.
What a location is used for
- Boundary conditions. Every BC (force, deflection/support, pressure, moment, temperature) carries a location saying where it acts. Surface-type BCs (a pressure, a normal support) need a location that actually resolves to a surface, so
everywhere, a whole body, or a full-volume sphere/box are rejected there. Use a surface selection orsurface_only=True. - Scoping a convergence study. You can give a question a location so Dr.Q measures accuracy and aggregates results only in that region, instead of chasing convergence across the whole part.
The principal axis
A location can also give you its principal axis: a unit vector along the dominant geometric axis of the selected faces (a flat face's normal, or the axis of a curved or whole-body surface). Two caveats:
- It is only available for surface- and body-based selections. A cavity, sphere, box, or
everywherehas no single axis and raises an error, see Location Problems. - The result is sign-ambiguous: it is a line direction (from an inertia-tensor eigenvector), not an outward-pointing normal.
To orient a boundary condition, prefer an AxisSpecification over reading the axis off the location directly.