Syntax is :
::
+
myConditionalGroup = BLOC( condition= " python statement",
... #included keywords or others fact/bloc
)
BLOC can be seen as an 'if' statement
::
+
print_frequency = SIMP(statut='f', typ='TXM', defaut='every', into=['every','periodically','sometimes']),
frequency_every = BLOC ( condition= "print_frequency == 'every'",
particule_to_be_printed = SIMP(statut='o',typ='TXM', ),
- BLOC appears depending on the evaluation of the conditional statement. it has no mandatory or optional status
- BLOC cannot be repeat but included FACT or SIMP can
- if keywords inside the BLOC have a status. this status is applied within the BLOC
- ::
+
+::
+
wind_speed = SIMP(statut='o', typ = 'R'),
b_ask_wind_direction = BLOC ( condition= 'wind_speed > 0.5',
wind_direction = SIMP(statut='o', typ='TXM'),
Syntax is :
::
+
myGroup = FACT (
... #included keywords or others fact/bloc
)
"myGroup" is a python label. A group can not have the same name as its brothers.
It contains simple elements or groups. There is no recursivity depth limit.
::
+
job_properties = FACT(statut='o',
job_duration = SIMP(statut='o', typ='R', defaut=1000, val_min=0),
stack_size = SIMP(statut='f', typ='R', defaut=1000, val_min=0),
print_frequency = SIMP(statut='f', typ='TXM', defaut='every', into=['every','never','sometimes']),
close_time = SIMP(statut='f', typ='R', defaut=1000, val_min=0),
),
+
Definition of FACT including others groups :
+
::
ThresholdExceedence = FACT (
It is possible to constrain the number of instances (cardinality) of a FACT. The cardinality is specified using the min and max attributes.
If min=max=1 (default), the FACT appears only once in a valid dataset. If max > 1, the group of parameters can appear more than once. min/max specifies the minimum/maximum number of repetitions. "**" means there is no upper limit for the maximal cardinality.
::
+
species_parameters = FACT(statut='o', max="**",
species_name = SIMP(statut='o',typ='TXM'),
species_mass = SIMP(statut='o',typ='R',defaut=1.0),
The 'root node' is called 'JdC'. it has to be defined as :
::
+
JdC = JDC_CATA (
code = 'MyCodeName',
)
===============================
Variable names and identifiers are similar to those in many other languages :
-----------------------------------------------------------------------------
+-----------------------------------------------------------------------------
* They start with a letter (A_Z or a-z) or underscore "_"".
* They are followed by letters, numbers or underscores.
* if needed, classes or functions should be defined.
* arguments are separated with ','
-.. code:: python
-time_step = SIMP(statut='o', typ='R',)
+::
+
+ #code python :
+ time_step = SIMP(statut='o', typ='R',)
This is a instantiation operation. it creates an object of type SIMP. the SIMP __init__() is called with two arguments statut and typ.
You have to respect python syntax.
Source line code is :
::
+
myKeyword = SIMP (typ = 'F')
| Attribute "typ" defines the keyword type (in this case, float)
* text(TXM),
Examples :
+
::
+
number_of_species = SIMP( typ='I' ),
YoungModulus = SIMP( typ='R' ),
electrostatics_is_on = SIMP( typ=bool, ),
- A tuple of N elements (Tuple(3)).
* Class Tuple must first be defined in the catalog.
- ::
+
+ ::
+
import types
class Tuple:
def __init__(self,ntuple):
return "Tuple of %s elements" % self.ntuple
* Then, inside each tuple, each model element has a specified type.
- ::
+
+ ::
+
pair_identification = SIMP(statut ='o', typ=Tuple(2), validators=VerifTypeTuple(('TXM','TXM' )),),
simulation_box_sizes = SIMP(statut ='o', typ=Tuple(3), validators=VerifTypeTuple(('R' ,'R', 'R')),),
length = SIMP(statut ='o', typ=Tuple(2), validators=VerifTypeTuple(('R' ,'TXM' )),),
means that pair_identification is a tuple of two strings, simulation_box_sizes a tuple of three floats and lenght a tuple which first parameter is a float and second a string.
- ::
+ ::
+
Valid values for pair_identification : ('A', 'A'), ('A','B')
Valid values for simulation_box_sizes : (1,1.,0), (2.,-2.5, 10+3)
Valid values for length : (1,'m'), (2., 'cm') but also (-500, 'Fahr') or (32, 'fareneit')
+-------------------------------------+--------------------------------------------------+
- |
+ |
+
- Or previously user defined type in the catalog (a mesh for example)
A user-defined class inherits from the class ASSD
+
::
+
class mesh (ASSD) : pass
myMesh=SIMP(typ = 'mesh')
It is possible to constrain the number of instances (cardinality) of a keyword. The cardinality is specified using the min and max attributes.
If min=max=1 (default), the keyword has a single value. if max > 1, parameter is a list. min/max specify the minimum/maximum number of occurences in the list. 'max= "**"' sets no upper limit for the maximal cardinality.
::
+
scalar = SIMP(typ = 'R')
list_of_scalars = SIMP(typ = 'R',max="**")
list_of_3_to_5_scalars= SIMP(typ = 'R',max=5, min=3)
+-------------+-------------------------------------------------+-----------+
And some examples :
+
::
+
print_frequency = SIMP(statut='f', typ='TXM', defaut='every', into=['every','never','10 steps'])
close_time = SIMP(statut='f', typ='R' , defaut=1000, val_min=0),
number_of_steps = SIMP(statut='f', typ='I' , defaut=100 , val_min=0, val_max=1000)
Syntax is :
::
+
regles = (..list of rules),
-----------
AU_MOINS_UN rule forces to create at least one concept in the list. More than one can be created.
::
+
Structure = FACT ( statut ='f',
regles = (AU_MOINS_UN( 'Beam', 'Bar', 'Grid'),)
Beam = FACT (...),
UN_PARMI
--------
UN_PARMI rule obliges the user to create one and only one concept of the list.
-::
+::
+
FOR_DPD = BLOC(condition = "code=='DPD'",
regles=(UN_PARMI('Initialisation', 'Solver_Input'),
),
EXCLUS
------
EXCLUS means that, if one of the keyword is created, the others won't be allowed.
-::
+::
+
JOB_DURATION = FACT(statut='o',
regles=( EXCLUS('duration','number_of_time_step','end_at'),
),
--------
The rule means that if one keyword is selected, the others have to be also.
The keywords order is not meaningful.
-::
+::
+
GRILLE = FACT(statut='f',
regles=( ENSEMBLE('ORIG_AXE','AXE'),
),
---------------
The rule means that if the FIRST keyword is selected, the others have to be also.
The keywords order is meaningful.
-::
+::
+
FREQUENCE = FACT(statut='f',
regles=( PRESENT_PRESENT('FREQ_MIN','FREQ_MAX','FREQ_PAS')
),
--------------
The rule means that if the FIRST keyword is selected, the others aren't allowed.
The keywords order is meaningful.
-::
+::
+
GRID = FACT(statut='f',
regles=( PRESENT_ABSENT('GroupOfNodes','GroupOfFaces','GroupOfEdges'),
),
All rules can be combinated, creating more complicated rules.
-::
+::
+
GRID = FACT(statut='f',
regles=( PRESENT_ABSENT('GroupOfNodes','GroupOfFaces','GroupOfEdges'),
ENSEMBLE('GroupOfFaces','GroupOfEdges'),