There are multiple issues with your code, but lets first address the source of error message about "Boundary condition is not of prescribed form".
Bellow I have copied the first section of your original code, up until SMTAnalysis
command. After this we can already check if our data structures have been input correctly. (All built-in symbols/functions start with capital letter, your symbols defined in notebook should start with lowercase letter, so they can be easily distinguished. Keep in mind this good practice.)
<< AceFEM`;
(* Note: This code section has intentional errors! *)
SMTInputData[];
P = 1000000;
SMTAddDomain["Ω","ML:SEPET1DFLET1DHooke", {"E *" -> 1000, "ν *" -> 0.3}];
SMTAddMesh[ToElementMesh[
ImplicitRegion[x^2 + y^2 > 0.05, {x, y}],
{{-3, 3}, {-3, 3}},"MeshOrder" -> 1], "Ω"
];
Clear[λ];
λ[t_] := P (1 - t/0.008);
Plot[λ[t], {t, 0, 0.008}]
SMTAddEssentialBoundary[Line[{{-3, -3}, {3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {-3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{3, -3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> λ[t]];
SMTAnalysis[];
When you evaluate this code you get the error message saying "Error in natural boundary condition". Reason for this is that syntax SMTAddNaturalBoundary[..., 1 -> λ[t]];
is wrong. See the quote from documentation:
Current value of boundary conditions (Bt) is calculated from its value in previous time/load step (Bp): Bt=Bp+Δλ dB. Multiplier increment Δλ and reference BC intensity dB can have arbitrary values, but value of their product should be meaningful. Typically dB is set to 1 and multiplier λ goes from 0 to its final value. Multiplier can be also a function of time λ[t] and then time t goes from 0 to final time.
So, changing the definition of natural BC removes the error message, but there is another problem.
SMTAddNaturalBoundary[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 1 -> 1];
You apply the force (natural BC) to nodes with specific node numbers from 1-15, but how can you be sure upfront what are the node numbers on your mesh in some area of interest. See the picture bellow, where one node on the inner edge doesn't get the applied force, but it probably should.
It is much better to find nodes of interest with appropriate "node selector", some function of their initial position. This is the whole block of code for correct definition of input phase. For NBC all nodes on the circle with the specified radius are chosen.
(* This definition of hole size is clearer. *)
holeRadius = 0.25;
SMTInputData[];
SMTAddDomain["Ω","ML:SEPET1DFLET1DHooke", {"E *" -> 1000, "ν *" -> 0.3}];
SMTAddMesh[
ToElementMesh[
ImplicitRegion[x^2 + y^2 > holeRadius^2, {x, y}], {{-3, 3}, {-3, 3}},
"MeshOrder" -> 1],
"Ω"];
SMTAddEssentialBoundary[Line[{{-3, -3}, {3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{-3, 3}, {-3, -3}}], 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary[Line[{{3, -3}, {3, 3}}], 1 -> 0, 2 -> 0];
SMTAddNaturalBoundary[("X"^2 + "Y"^2 == holeRadius^2) &, 1 -> 1];
SMTAnalysis[];
SMTShowMesh["BoundaryConditions"->True,PlotRange->0.5,ImageSize->200]
Time always starts from 0 and I think BC multiplier should also start from 0, but it can change as arbitrary function of time.
Clear[λ];
maxLoad = 1000000;
maxTime = 0.008;
λ[t_] := maxLoad*(t/maxTime)
(*Plot[λ[t],{t,0,0.008}]*)
These are key parameters for SMTConvergence
that guide time stepping. Analysis will finish with somewhere between 10 and 100 steps. The first step will be smaller that maximum allowed step.
Δt0 = maxTime/20;
ΔtMax = maxTime/10;
ΔtMin = maxTime/100;
I am going to write explanation for analysis loop with inline comments, because it will be more readable. Analysis loop has two While
loops, the outer controls time/load stepping and the inner controls number of (Newton-Rhapson) iterations for each step.
(* Increase values of BC for the first step.
Size of time step is prescribed, and the load multiplier changes according to function λ. *)
SMTNextStep["Δt" -> Δt0,"λ[t]" -> λ];
While[
(* Do iterations until SMTConvergence returns something else than explicit True.
In case of "Adaptive Time" this is a list of 4 elements that guide further behaviour of analysis loop.
Return value of SMTConvergence is assigned to symbol step. *)
While[
step =
SMTConvergence[10^-8,15, {"Adaptive Time",8, ΔtMin, ΔtMax, maxTime}],
SMTNewtonIteration[];
];
If[
Not[step[[1]]],
(* All the code for collecting results goes here.
Code is evaluated only if no step back is needed. *)
SMTShowMesh[
"DeformedMesh"->False,"BoundaryConditions"->True,"Field"->"Sxx", "Contour" -> {-10^6, 10^6, 7},
"Show" -> "Window" | {"Animation", "MyTestName", ImageSize -> 400}]
];
If[
step[[4]] === "MinBound",
SMTStatusReport["Analyze"];
SMTStepBack[];
];
(* step[[3]] is test for outer While. This is the result of the last evaluation of SMTConvergence.
If it is True analysis should make another step (forward or backward).
It is False only if the final time has been reached or analysis has diverged. *)
step[[3]],
If[
step[[1]],
SMTStepBack[];
];
(* If analysis has converged in the last step and has not yet reached the final value of time,
another step should be made.
Step size is prescribed by SMTConvergence and saved in step[[2]]. *)
SMTNextStep["Δt" -> step[[2]],"λ[t]" -> λ]
];
SMTShowMesh["BoundaryConditions"->True,"Contour" -> True,"Field" -> "Sxx", "Mesh" -> Gray, ImageSize -> 300]
SMTAddNaturalBoundary
). Can you please edit your question to include all the code you have used and a clearly explain your goals. $\endgroup$