1
$\begingroup$

I want to display a collection of deformed meshes in a GraphicsGrid where the surface colors are proportional to the displacement.

mesh = ToElementMesh[Cuboid[{-0.1, -1, -0.1}, {0.1, 1, 0.1}], 
   "MeshOrder" -> 1];

tvars = {{u[t, x, y, z], v[t, x, y, z], w[t, x, y, z]}, 
   t, {x, y, z}};
pars = <|"Material" -> Entity["Element", "Titanium"]|>;

constraint = SolidFixedCondition[y^2 <= 0.001, tvars, pars];

eigenmodeOperator = 
  SolidMechanicsPDEComponent[tvars, 
   Join[pars, <|"AnalysisType" -> "Eigenmode"|>]];

{evals, evecs} = 
  NDEigensystem[{eigenmodeOperator == {0, 0, 0}, constraint}, 
   tvars[[1]], t, {x, y, z} \[Element] mesh, 6];

eigenfrequencies = Re[Sqrt[evals]/(2 Pi)]

Here is a picture showing how the coloring should work.

enter image description here

$\endgroup$
3
  • $\begingroup$ Understood, I thought FaceForm could take a map maybe using Texture. What about using ElementMeshToGraphicsComplex? $\endgroup$
    – Young
    Commented May 27, 2023 at 0:58
  • $\begingroup$ There are examples of this in the solid mechanics monograph $\endgroup$
    – user21
    Commented May 28, 2023 at 5:20
  • $\begingroup$ @user21 Can the NDEigensystem be computed in parallel? $\endgroup$
    – Young
    Commented May 28, 2023 at 19:14

1 Answer 1

1
$\begingroup$

Use VectorDisplacementPlot3D, however, the domain needs to reference the original geometric solid or boundary mesh region (the method I recommend BoundaryMeshRegion[bar]), not the element mesh.

bar=Cuboid[{-0.1, -1, -0.1}, {0.1, 1, 0.1}];
mesh = ToElementMesh[bar, "MeshOrder" -> 1, MeshQualityGoal -> 1]

... PDE ...

plots = Table[
   VectorDisplacementPlot3D[evecs[[i]], {x, y, z} \[Element] bar, 
    AxesLabel -> {x, y, z}, Ticks -> None, Axes -> True, Boxed -> False,
    PlotLabel ->  Style["Freq.=" <> ToString[eigenfrequencies[[i]]] <> " Hz", 12]],
   {i, Length[eigenfrequencies]}];
Grid[Partition[plots, 3]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.