Exemple #1
0
debugApp = ApplicationGenerator(appCamel)

# Add KratosVariables
debugApp.AddVariables([
    VariableCreator(name='1DVariable', vtype='double'),
    VariableCreator(name='3DVariable', vtype='int', is3D=True),
])

# Add test element
debugApp.AddElements([
    ElementCreator('CustomTestElement').AddDofs(['DOF_1', 'DOF_2']).AddFlags(
        ['FLAG_1', 'FLAG_2']).AddClassMemberVariables([
            ClassMemberCreator(name='Variable1',
                               vtype='double *',
                               default='nullptr'),
            ClassMemberCreator(name='Variable2', vtype='int', default='0'),
            ClassMemberCreator(name='Variable3',
                               vtype='std::string &',
                               default='0'),
            # ClassMemberCreator(name='Warnvar1', vtype='std::string &',)
        ])
])

debugApp.AddConditions([ConditionCreator('CustomTestCondition')])

debugApp.AddProcesses([
    ProcessCreator('CustomTestProcessAlpha'),
    ProcessCreator('CustomTestProcessDelta')
])

debugApp.Generate()
Exemple #2
0
debugApp = ApplicationGenerator(appNameCamel)


# Add KratosVariables
debugApp.AddVariables([
    VariableCreator(name='DOF_1', vtype='double'),
    VariableCreator(name='DOF_2', vtype='double'),
    VariableCreator(name='ScalarVariable', vtype='double'),
    VariableCreator(name='VectorVariable', vtype='double', is3D=True),
])

# Add test element
debugApp.AddElements([
    ElementCreator('CustomTestElement')
    .AddDofs(['DOF_1', 'DOF_2'])
    .AddFlags(['FLAG_1', 'FLAG_2'])
    .AddClassMemberVariables([
        ClassMemberCreator(name='VariableA', vtype='double *', default='nullptr'),
        ClassMemberCreator(name='VariableB', vtype='int', default='0'),
        ClassMemberCreator(name='VariableC', vtype='std::string', default='"Usefull String"'),
    ])
])

debugApp.AddConditions([
    ConditionCreator('CustomTestCondition')
])

debugApp.Generate()

print("Your application has been generated in: applications/{}Application".format(appNameCamel))
Exemple #3
0
appCamel = "MyLaplacian"

# Fetch the applications directory
debugApp = ApplicationGenerator(appCamel)

# Add KratosVariables
debugApp.AddVariables([
    VariableCreator(name='MY_SCALAR', vtype='double'),
    VariableCreator(name='MY_VECTOR', vtype='int', is3D=True),
])

# Add test element
debugApp.AddElements([
    ElementCreator('MyLaplacianElement')
    .AddDofs(['TEMPERATURE'])
    .AddDofs(['MY_SCALAR'])
    .AddFlags([])
    .AddClassMemberVariables([])
])

# debugApp.AddConditions([
#     ConditionCreator('MyFaceCondition')
# 	.AddDofs(['TEMPERATURE'])
#     .AddFlags([])
# ])
#
# debugApp.AddProcesses([
#     ProcessCreator('DoSomethingProcess')
# ])

debugApp.Generate()
from applicationGenerator import ApplicationGenerator

# Set the application name and generate Camel, Caps and Low
appNameCamel = "MyExample"

# Fetch the applications directory
debugApp = ApplicationGenerator(appNameCamel)

# Add KratosVariables
debugApp.AddVariables([
    VariableCreator(name='MY_SCALAR', vtype='double'),
])

# Add test element
debugApp.AddElements([
    ElementCreator('MyElement').AddDofs(['TEMPERATURE']).AddFlags(
        []).AddClassMemberVariables([])
])

debugApp.AddConditions(
    [ConditionCreator('MyCondition').AddDofs(['TEMPERATURE']).AddFlags([])])

# debugApp.AddProcesses([
#     ProcessCreator('DoSomethingProcess')
# ])

debugApp.Generate()

print("Your application has been generated in: applications/{}Application".
      format(appNameCamel))