Go to the first, previous, next, last section, table of contents.

# Customization

#### Repeating a condition

Question:

I assign X condition on some nodes and then assign Y condition on some nodes(include some nodes I select when assign X condition),then I write a calculate file,those nodes I select both when I assign X condition and Y condition only have Y condition value,but the X condition is lost.Could you tell me the reason?

Response:

If you desire to apply a same condition (same name with different values) more of one times to a entity, this condition must be declared as CANREPEAT: yes in the *.cnd file.

If CANREPEAT: no (default), then the second same condition replaces the first:

Sample *.cnd:

    NUMBER: 1 CONDITION: Face-Load
    CONDTYPE: over lines
    CONDMESHTYPE: over face elements
    CANREPEAT: yes
    QUESTION: X_preassure:
    VALUE: 0
    HELP: 2D case, X force for length unit
    QUESTION: Y_preassure
    VALUE: 0
    HELP: 2D case, Y force for length unit
    END CONDITION

Inside the bas file also exist a `*CanRepeat` keyword:

If command `*CanRepeat` is added after `*nodes` or `*elems` in `*Set cond`, one entity can be several times in the entities list of the loop. If command `*NoCanRepeat` is used, entities will be just once in the entities list.

By default, `*CanRepeat` is off except for the case of one condition that have the `*CanRepeat` flag already set.

Sample *.bas:

    *Set Cond Face-Load *elems *canrepeat
    *# if
    canrepeat is missing, it is assumed by default  in this case,
    *# because Face-Load have CANREPEAT: yes
    *loop elems *OnlyInCond
      Elem number=*elemsnum, Nodes of the loaded face= *globalnodes Px=*cond(X_preassure) Py=*cond(Y_preassure)
    *end elems

Go to the first, previous, next, last section, table of contents.