Skip to main content

finite element method - AceFEM: Why SMTShowMesh doesn't show changes in initial configuration?


I am changing initial positions of nodes after the analysis has been initialized (after the SMTAnalysis[...]) and this procedure works fine, but the problem is that change is not shown in postprocessing. How can I get SMTShowMesh to plot modified version of initial configuration?


The following is a small example to illustrate the problem.



<< AceFEM`;
(* A small test analysis with 1 element. *)
Clear[testAnalysis]

testAnalysis[] := (
SMTInputData[];
SMTAddDomain["test","OL:SEPEQ1DFHYQ1NeoHooke",{"E *"->1000.,"\[Nu] *"->0.3}];
SMTAddMesh[{{0,0}, {1,0}, {0,1}, {1,1}},{"test" ->{{1,2,4,3}}}];
SMTAddEssentialBoundary[{{1, 1 -> 0, 2 -> 0}, {2, 2 -> 0}}];
SMTAddNaturalBoundary[{4, 2 -> -1}];

SMTAnalysis[];
);

We call the analysis function, see the initial configuration and print initial coordinates of all 4 nodes.


testAnalysis[]
SMTNodeData["X"]
SMTShowMesh[ImageSize->100,"BoundaryConditions"->True,"Marks"->"NodeNumber"]
(*{{0., 0.}, {1., 0.}, {0., 1.}, {1., 1.}}*)

one element



New values of initial coordinates are calculated (rotation of domain for 45 degrees).


newCoordinates = RotationTransform[Pi/4, {0.5, 0.5}] /@ SMTNodeData["X"]
(* {{0.5, -0.207107}, {1.20711, 0.5}, {-0.207107, 0.5}, {0.5, 1.20711}} *)

New coordinates are assigned to nodes and print of coordinates reflects that.


SMTNodeData["X", newCoordinates];
SMTNodeData["X"]
(* {{0.5, -0.207107}, {1.20711, 0.5}, {-0.207107, 0.5}, {0.5, 1.20711}} *)

Plotting of mesh does not show the change of initial coordinates. I expect to see element rotated for 45 degrees.



SMTShowMesh[ImageSize->100,"BoundaryConditions"->True,"Marks"->"NodeNumber"]

one element problem



Answer



AceFEM stores and uses also listSMTNodes which is constructed after SMTAnalysis[] command. It seems to not be changed automaticaly when you assign new coordinates to SMTNodeData["X", newCoordinates]. If you assign the coordinates to SMTNodes manualy (2nd and 3rd positions store X and Y coordinates of each point, so do not overwrite the 1st and 4th positions) as


SMTNodes[[;; , 2 ;; 3]] = newCoordinates;

then SMTShowMesh takes the required coordinates:


SMTShowMesh[ImageSize -> 100, "BoundaryConditions" -> True, "Marks" -> "NodeNumber"]


enter image description here


Comments