Hi,
There’s no random copy-paste here, that’s exactly the sequence you need to load a STEP file correctly.
The only issue in the comment code was related to the input argument of:
bmesh = OpenCascadeShapeSurfaceMeshToBoundaryMesh[shapeIn];
It was mistakenly written as shape instead of shapeIn.
Also, note that bmesh is a variable, not a Mathematica function.
You instantiate this variable as a BoundaryElementMesh object using the function above, which converts the OpenCascade shape into a boundary mesh representation.
Each BoundaryElementMesh object provides several built-in properties that you can easily access. For example, nodes:
bmesh["Coordinates"]
elements:
bmesh["BoundaryElements"]
or graphics:
bmesh["Wireframe"]
You can also add styling to the visualization, for example:
bmesh["Wireframe"["MeshElementStyle" -> FaceForm[Gray]]]
Or in general:
bmesh["Properties"]
In the Wolfram Language, some symbolic objects, such as BoundaryElementMesh, ElementMesh, or Dataset, act as data containers rather than pure functions. The expression bmesh["Wireframe"] means: ask the object bmesh to return its “Wireframe” representation.
This design makes it easy to access multiple views or derived data from the same object without defining separate functions. In other words, "property" acts like a method or query applied to the object, not a global function call. For more information on the mesh["Properties"] read Element Mesh Generation and Element Mesh Visualization documentation pages.
Coming back to your problem, I understand that you mainly work with FEM software that provides a graphical user interface (GUI). However, there are many other FEM tools that rely primarily on a command-line interface.
The strength of Mathematica lies in its symbolic representation combined with its dynamic visualization capabilities. To correctly describe a mechanical (structural) problem, you must specify the boundary conditions. This can easily be done using dedicated functions, see the reference Solid Mechanics - Boundary Conditions for detailed guidance.
The key idea is to express the locations where you want to apply the boundary conditions (which you would normally click on in a GUI) as logical conditions. For example,
x == 0
applies the boundary condition to all nodes where x is 0.
These boundary-condition functions often require two additional arguments:
vars, the list of dependent variables in your PDE system
pars, association of parameters, such as material properties.
You also need to specify the type of condition, for instance:
SolidBoundaryLoadValue[ x == lx, vars, pars, <|"Force" -> {0, 0, -10000}|>]
This defines a force-type boundary condition, of magnitude -10000, along the z, acting on all nodes where x == lx. The function returns a symbolic representation, not a numerical result, it’s part of the system definition you’ll later pass to NDSolve.
{ op == bv, bcs }
where:
op is the operator obtained from the main structural equations,
bc is the boundary load (or zero if the system is unloaded),
bcs is the list of boundary conditions (fixed, sliding, etc.).
The operator is defined as:
op = SolidMechanicsPDEComponent[vars, pars]
which represents the governing equation linking stress and strain.
See the reference Solid Mechanics monograph for a full derivation, but you don't need all the mathematical details now.
Once you have op, bv, and bcs, you can use:
pde = {op == bv, bc1};
displ = NDSolveValue[pde, vars[[1]], {x, y, z} \[Element] mesh]
to obtain the solution for your FEM model. See te attached notebook.
I strongly recommend reading the Structural Mechanics monograph and reproducing a few examples to become familiar with the overall workflow.
I’m also attaching the complete notebook instead of splitting the code so you can reproduce the process directly.
By the way, which version of Mathematica are you using? If possible, try running it on a recent version, it may help avoid compatibility issues.
Otherwise, feel free to reach out with details about your specific application, and we can help you troubleshoot your case.