from classes.conditionCreator import ConditionCreator from classes.processCreator import ProcessCreator from classes.classMemberCreator import ClassMemberCreator from classes.variableCreator import VariableCreator from applicationGenerator import ApplicationGenerator # Read the application name and generate Camel, Caps and Low appCamel = sys.argv[1] # Fetch the applications directory 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 &',)
if len(sys.argv) != 2: print("Error: Invalid usage.\nPlease call this script with your application name (in camelCase) like this: ") print("python createApplication.py MyNewApplication") exit() # Read the application name and generate Camel, Caps and Low appNameCamel = sys.argv[1] # Fetch the applications directory 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"'), ])
from classes.conditionCreator import ConditionCreator from classes.processCreator import ProcessCreator from classes.classMemberCreator import ClassMemberCreator from classes.variableCreator import VariableCreator from applicationGenerator import ApplicationGenerator # Read the application name and generate Camel, Caps and Low 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'])
from applicationGenerator import ApplicationGenerator if len(sys.argv) != 2: print("Error: Invalid usage.\nPlease call this script with your application name (in camelCase) like this: ") print("python laplacian_application_example.py MyNewApplication") exit() # Read the application name and generate Camel, Caps and Low appNameCamel = sys.argv[1] # 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([]) ])