In AceFEM, the (Dirichlet or Neumann) boundary conditions can be applied by using commands SMTAddEssentialBoundary[] and SMTAddNaturalBoundary[]. Those commands are normally used in the input data phase, before an analysis starts. However, the same commands can be called in the middle of analysis to change the boundary conditions with the option "set"->True.
In the user help for AceFEM, you can find an example:
SMTAddEssentialBoundary[Line[{{0, 0}, {1, 1}}, "D"], 3 -> 1.5, "Set" -> True]
Here is a simple code for the two-phase analysis of an example from the question:
<< AceFEM`;
SMTInputData[];
L = 2; H = 10;
SMTAddDomain["A", "OL:SEPSQ1DFLPQ1HookeMises", {}];
SMTAddMesh[Polygon[{{0, 0}, {L, 0}, {L, H}, {0, H}}], "A",
"Q1", {4, 20}];
v0 = -0.01; (* Reference value of the prescribed vertical displacement *)
F0 = 1; (* Reference value of the horizontal force *)
SMTAddEssentialBoundary["Y" == 0 &, 1 -> 0, 2 -> 0];
SMTAddEssentialBoundary["Y" == H &, 2 -> v0]; (* Prescribed displacement is a variable load in the preliminary phase*)
SMTAnalysis[];
AnalysisBlock[FinalMultiplier_] := Block[{},
While[
While[
step = SMTConvergence[10^-8,15, {"Adaptive BC", 8, 10^-4, 0.1, FinalMultiplier}],
SMTNewtonIteration[];];
If[Not[step[[1]]],
AppendTo[res, {SMTNodeData[nodeDispl, "at"],SMTRData["Multiplier"]}];
];
If[step[[4]] === "MinBound", SMTStatusReport["Analyze"];SMTStepBack[]];
step[[3]]
,
If[step[[1]], SMTStepBack[];];
SMTNextStep[1, step[[2]]]
];
];
res = {};
nodeDispl = SMTFindNodes[Point[{L, H}]][[1]];
(* PRELIMINARY ANALYSIS *)
(* Compute preliminary analysis, where multiplier goes from 0 to 1,
to get correct state of model for prescribed displacement v0 *)
SMTNextStep[1,0.1];
AnalysisBlock[1]
(* CHANGE BOUNDARY CONDITIONS *)
(* Variable prescribed vertical displacements v0 becomes constant vertical displacement *)
SMTAddEssentialBoundary["Y" == H &, 2 -> 0, "Set" -> True];
(* Apply horizontal force F0=1 *)
SMTAddNaturalBoundary["X" == 0 && "Y" == H &, 1 -> F0,"Set" -> True];
(* Continue with THE PRIMARY ANALYSIS *)
SMTNextStep[1,0.01];
AnalysisBlock[2]