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.

Parents Reply Children
  • 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!

  • And to give you an example with Python scripting, the code I shared can be made as a script to run easily from Expert menu.

    Before the main Python code, you can add the following boilerplate and the script will run for any user:

    from plxscripting.easy import *
    s_i, g_i = new_server()

    # add rest of code here

    This file can be saved as a Python script, e.g. add_consolidation_phases.py and placed in (default location):
    C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\pytools\input

    Then, in Input go to Expert > Run Python tool > add_consolidation_phases

  • Dear Stefanos,

    Thank you for the clarifying information.
    Python scirpting is the next step for me =)

    For now I try to use only command reference.
    I suppose, there are not so many users in our country who use command line in PLAXIS (all the more Python). On the other hand I realise that it is powerful instrument for optimisation and automatisation of routine process. In this case PLAXIS has a great advantage in comparasing to other competitors. That's why I try to provide this information to our clients.