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() print("Your application has been generated in: applications/{}Application". format(appCamel))
# Fetch the applications directory debugApp = ApplicationGenerator(appNameCamel) # Add KratosVariables debugApp.AddVariables([ VariableCreator(name='MY_SCALAR', vtype='double'), ]) # Add test element debugApp.AddElements([ ElementCreator('LaplacianElement') .AddDofs(['TEMPERATURE']) .AddFlags([]) .AddClassMemberVariables([]) ]) debugApp.AddConditions([ ConditionCreator('PointSourceCondition') .AddDofs(['TEMPERATURE']) .AddFlags([]) ]) # debugApp.AddProcesses([ # ProcessCreator('DoSomethingProcess') # ]) debugApp.Generate() print("Your application has been generated in: applications/{}Application".format(appNameCamel))
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))
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))