Copy phase sequence

Dear Support Team,

For example, I have five phases of embankment staged construction with Plastic calculations:

After successful calculation I would like to calculate the same phase sequence (the same five stages), but with Consolidation type of calculation (or another activated structures). An alternative solution, like this:

Maybe, it is not very difficult for five phases, but it can be an issue to set the same 15–20 phases manually.

Could you please inform me whether it is possible to copy phase sequence?
It is interesting to copy activated geometry and phase settings.
 
Maybe we have possibilities of regenerate, set, groupfiltered and apply options for optimisation.

Great thanks in advance.

  • Dear Rushan,

    This case can be easily handled using Python scripting.
    An example of code can be found below (hopefully it will be uploaded with correct indentation):

    # for every phase in the project
    for parent in g_i.Phases[:]:
       # if it's a plastic phase
       if parent.DeformCalcType == parent.DeformCalcType.plastic:
          # create new child phase
           newphase = g_i.phase(parent)
           # set it to safety
           newphase.DeformCalcType = newphase.DeformCalcType.consolidation

    Answer Verified By: Rushan Gizzatullin 

  • Dear Stefanos,

    Thank you for the Python script.

    Correct if I am wrong.
    Is it correct, that in common way it is not possible to copy phase(s) via command line directly?

    Thank you.

  • Dear Rushan,

    The icon to create a phase is creating a new phase and copying all settings from the parent phase.

    For instance, the generated command is:
    phase Phase_1
    this means that a new phase will be created and it will copy all settings for all features from Phase_1 to a new phase.

    You can also use the following syntax that will create a phase from the lastly created phase using indexing:
    phase Phases[-1]

    This means that you can make a command log that will create all plastic phases, then create new phases from the previous and assign them as consolidation ensuring the correct order.

    However, there is no for-loop via the command line, therefore, the size of the command log depends on the number of reference phases, which can be written manually. That is why Python is the easiest solution for this. 

    An example starting from Tutorial 3 that has 6 plastic phases would be:

    phase Phases[1] # creates Phase_7 from Phase_1
    set Model.CurrentPhase Phases[-1] # sets current phase to initialise the settings
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_7 to Consolidation
    phase Phases[2] # creates Phase_8 from Phase_2
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_8 to Consolidation
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phases[3] # creates Phase_9 from Phase_3
    set Model.CurrentPhase Phases[-1] 
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_9 to Consolidation
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phases[4] # creates Phase_10 from Phase_4
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_10 to Consolidation
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phases[5] # creates Phase_11 from Phase_5
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_11 to Consolidation
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phases[6] # creates Phase_12 from Phase_6
    set Model.CurrentPhase Phases[-1] 
    set Phases[-1].DeformCalcType "Consolidation" # sets Phase_12 to Consolidation
    set Phases[-1].PreviousPhase Phases[-2]

    In the above example, I can create 6 new consolidation phases, from the existing plastic phases, however, you see that there is no abstract way when creating each phase, e.g. command phase Phases[6] needs to be manually edited based on the number of phases.

    In any case, you can extend this command log to any size based on the number of reference phases.

  • Dear Stefanos,

    Thank you very much for the idea about set Phases[-1].PreviousPhase Phases[-2].

    So, e.g. I can make command log like this:

    phase Phase_1
    set Model.CurrentPhase Phases[-1]
    phase Phase_2
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phase_3
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phase_4
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].PreviousPhase Phases[-2]
    phase Phase_5
    set Model.CurrentPhase Phases[-1]
    set Phases[-1].PreviousPhase Phases[-2]

    Then make a group filter:

    groupfiltered Phases "ShouldCalculate=True"

    After that apply to all grouped phases Consolidation type of calculation:

    apply groups[-1] "sps" "DeformCalcType" "Consolidation"

    and finally ungroup it:

    ungroup Groups[-1]

    In such case the only manual thing is to change Phase_#.

    Could you please inform me is it correct?

    Thank you.

  • Dear Rushan,

    The groupfiltered command is great, however, it only works if the condition is met. 

    This means that all phases that are set to be calculated will be included in the group. If the parent phases are already calculated, it will work perfectly.

    The example I gave is if you start a project from scratch but your way will also work!

    The challenge is to have the same for 50, 70, 100 phases. Then, Python scripting with 4 lines of code wins!