diff --git a/LoadCase/Case.py b/LoadCase/Case.py old mode 100644 new mode 100755 diff --git a/LoadCase/Interaction.py b/LoadCase/Interaction.py old mode 100644 new mode 100755 diff --git a/LoadCase/InteractionHelpers.py b/LoadCase/InteractionHelpers.py old mode 100644 new mode 100755 index 6f32c39d54cf65f838804c2885e23192303be60c..0f638d536de390b8cf36b441d91a4534f7b74137 --- a/LoadCase/InteractionHelpers.py +++ b/LoadCase/InteractionHelpers.py @@ -1,6 +1,7 @@ import math from abaqus import * from abaqusConstants import * +from interaction import * import regionToolset from SpindleAssembly.AddComponents import return_assembly diff --git a/LoadCase/LoadsAndBCs.py b/LoadCase/LoadsAndBCs.py old mode 100644 new mode 100755 diff --git a/LoadCase/Step.py b/LoadCase/Step.py old mode 100644 new mode 100755 index 494d40bd72055fb110b7d0597f4b168970f2a99a..38f15ab94b70af1538f8522d96a6d19470b8ba60 --- a/LoadCase/Step.py +++ b/LoadCase/Step.py @@ -1,5 +1,6 @@ from abaqus import * from abaqusConstants import * +from step import * def Step(**kwargs): diff --git a/LoadCase/__init__.py b/LoadCase/__init__.py old mode 100644 new mode 100755 diff --git a/Parts/GeometryBuilder.py b/Parts/GeometryBuilder.py old mode 100644 new mode 100755 index 4b1bbe2419f87d083dd1657d53c5cf38e77ecdb6..f9f7ccb33e187ba362099a710337254be47139fd --- a/Parts/GeometryBuilder.py +++ b/Parts/GeometryBuilder.py @@ -5,11 +5,9 @@ from abaqusConstants import * import __main__ import section import regionToolset -import displayGroupMdbToolset as dgm import part import material import sketch -import displayGroupOdbToolset as dgo def create_MT_part( l, type, i, **kwargs ): diff --git a/Parts/__init__.py b/Parts/__init__.py old mode 100644 new mode 100755 diff --git a/Parts/standard_parts.py b/Parts/standard_parts.py old mode 100644 new mode 100755 index ebcb77d5224d79e87cbe61a83994a57703c29206..e133fbb10aa816719628dba9fa9bb669e601831a --- a/Parts/standard_parts.py +++ b/Parts/standard_parts.py @@ -3,11 +3,9 @@ from abaqusConstants import * import __main__ import section import regionToolset -import displayGroupMdbToolset as dgm import part import material import sketch -import displayGroupOdbToolset as dgo from Parts import GeometryBuilder as gb diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 327691bcbe48b5fef121709f958430718ebdf16e..0ba6d3f1a4aa066ff8abee95c536a7c9a6773988 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ ## Running the analysis -1. The interactive documentation on the application with the step-by-step guide on how to run the application are located in ```/docs/build/html/index.html``` of this repository. -2. To run the simplest test you need to navigate to the root of this directory and execute ```Abaqus cae noGUI=job.py``` in the command line. +1. The interactive documentation on the application with the step-by-step guide on how to run the application are located in ```/docs/build/html/index.html``` in this repository. +2. To run the somplest test you need to navigate to the root of this directory and execute ```Abaqus cae noGUI=job.py``` in the command line. 3. After the analysis has finished you will be able to open the ```Job-1.odb``` file in the Abaqus CAE graphical user interface. The detailed information about the analysis you can also find in ```Job-1.dat``` file. 4. For more advanced control of the application refer to the documentation. diff --git a/SpindleAssembly/AddComponents.py b/SpindleAssembly/AddComponents.py old mode 100644 new mode 100755 diff --git a/SpindleAssembly/PositionComponents.py b/SpindleAssembly/PositionComponents.py old mode 100644 new mode 100755 diff --git a/SpindleAssembly/PositionConnectors.py b/SpindleAssembly/PositionConnectors.py old mode 100644 new mode 100755 index c1e0d1ad5314044d202333cffa5a8996dd547cf3..919b4e6daae090e12c285f00292f8f48bde202a8 --- a/SpindleAssembly/PositionConnectors.py +++ b/SpindleAssembly/PositionConnectors.py @@ -1,6 +1,7 @@ import itertools from abaqus import * from abaqusConstants import * +from interaction import * from SpindleAssembly import AddComponents as ah from SpindleAssembly.AddComponents import return_assembly diff --git a/SpindleAssembly/PositionIpMTs.py b/SpindleAssembly/PositionIpMTs.py old mode 100644 new mode 100755 diff --git a/SpindleAssembly/__init__.py b/SpindleAssembly/__init__.py old mode 100644 new mode 100755 diff --git a/SpindleAssembly/assembly_random.py b/SpindleAssembly/assembly_random.py old mode 100644 new mode 100755 diff --git a/SpindleMesh/__init__.py b/SpindleMesh/__init__.py old mode 100644 new mode 100755 diff --git a/SpindleMesh/generate_mesh.py b/SpindleMesh/generate_mesh.py old mode 100644 new mode 100755 diff --git a/docs/build/doctrees/LoadCase.doctree b/docs/build/doctrees/LoadCase.doctree index 8f9e58c84d86d78e9ecbf2c3498562663f72ea1a..b4f0239960eb074924b69f7cf679593760ba3f4f 100644 Binary files a/docs/build/doctrees/LoadCase.doctree and b/docs/build/doctrees/LoadCase.doctree differ diff --git a/docs/build/doctrees/Parts.doctree b/docs/build/doctrees/Parts.doctree index b14cd608b65fc1603b107291dc6901176ada7f22..2833ed1290983ab32a4e61030f1cc1bf957967f5 100644 Binary files a/docs/build/doctrees/Parts.doctree and b/docs/build/doctrees/Parts.doctree differ diff --git a/docs/build/doctrees/SpindleAssembly.doctree b/docs/build/doctrees/SpindleAssembly.doctree index f4bfd0f37f7cca7b6f78b2940b0bceb850ab47e1..9977ecc44b91fbb13b0ebf149b962021e5d76b1b 100644 Binary files a/docs/build/doctrees/SpindleAssembly.doctree and b/docs/build/doctrees/SpindleAssembly.doctree differ diff --git a/docs/build/doctrees/SpindleMesh.doctree b/docs/build/doctrees/SpindleMesh.doctree index f9c0552e0fa775e10e43061b9daea842123bfa81..1b05ed6604d2531596a54d27592c559009525ed5 100644 Binary files a/docs/build/doctrees/SpindleMesh.doctree and b/docs/build/doctrees/SpindleMesh.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 9df3952c46d5e63f3beafc8b10327c1208b192c9..bdf01d1a1cd74c8360a75bf5633d7f39dc7257b8 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index aebe8ee1636f986dc0cca168db200254c40663cc..f0907699c38ea15ae2849a3225557472fb267d9b 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/job.py b/job.py old mode 100644 new mode 100755 index 67f6dc307155d309e4044e206135d951b7a82551..bb6d62f3a3e3df85c36895566c21f364158baa4c --- a/job.py +++ b/job.py @@ -17,7 +17,7 @@ from SpindleMesh import generate_mesh kwargs = {'x' : 0, 'y' : 0, 'index' : 0, - 'modelname' : 'test', + 'modelname' : 'spring200Pa-3', 'assembly' : 0, 'CentrosomeRadius': 0.12, 'CentrosomeLength': 0.24, @@ -38,12 +38,12 @@ kwargs = {'x' : 0, 'connectorNu' : 0.3, 'aMTnumber' : 20, 'aMTlength' : 2, - 'aMTsSpring' : 10, - 'groundSpring' : 10, + 'aMTsSpring' : 200, + 'groundSpring' : 200, 'StepName' : 'Standard_Buckling', 'NumberOfEigs' : 5, 'CompressiveLoad' : 1, - 'JobName' : 'Job-1'} + 'JobName' : 'spring200Pa-3'} ''' Call model functions ''' kwargs, data = Interaction.create_interactions(**kwargs) diff --git a/job_parametric.py b/job_parametric.py new file mode 100755 index 0000000000000000000000000000000000000000..08329bbc68bd7e738130de84dca4d321b32e856b --- /dev/null +++ b/job_parametric.py @@ -0,0 +1,116 @@ +""" +This script is designed to run the parametric studies with Spindle FEA. You can change 'nsamples' variable +to control the number of jobs with identical parameters. 'Spring' variable is the governing parameter of the study. +Its values are given in the corresponding list in this script. One can run parametric studies with any variable in +'kwargs' by altering this script accordingly. +""" + +from abaqus import * +from abaqusConstants import * +import __main__ +from LoadCase import Interaction +from LoadCase import Step +from LoadCase import LoadsAndBCs +from SpindleMesh import generate_mesh +import numpy as np + + +def generateKwargs(spring, jobname, modelname): + """ + Function that generates kwargs for parametric analysis + + :param spring: Spring stiffness parameter + + :type spring: float + + :param jobname: Name of the current job + + :type jobname: str + + :param modelname: Name of the current model + + :type modelname: str + + :return: kwargs + + :rtype: object + """ + kwargs = {'x' : 0, + 'y' : 0, + 'index' : 0, + 'modelname' : modelname, + 'assembly' : 0, + 'CentrosomeRadius': 0.20, + 'CentrosomeLength': 0.40, + 'CentrosomeE' : 1500000000.0, + 'CentrosomeNu' : 0.3, + 'ipMTnumber' : 6, + 'lengthInterval' : [2, 5], + 'separation' : [0.02876, 0.0414], + 'angle' : [96.39, 11.12], + 'd' : 0.015, + 'D' : 0.025, + 'ElasticModulus' : 1500000000.0, + 'PoissonRatio' : 0.3, + 'spindleLength' : 10, + 'Nconnectors' : 20, + 'connectorRadius' : 0.001, + 'connectorE' : 1500000000., + 'connectorNu' : 0.3, + 'aMTnumber' : 40, + 'aMTlength' : 2, + 'aMTsSpring' : spring, + 'groundSpring' : spring, + 'StepName' : 'Standard_Buckling', + 'NumberOfEigs' : 5, + 'CompressiveLoad' : 1, + 'JobName' : jobname} + return kwargs + + +def jobSubmit(**kwargs): + """ + Function to submit the job to Abaqus solver + + :param kwargs: model parameters + + :type kwargs: object + + :return: Null + + :rtype: Null + """ + name = kwargs['JobName'] + modelname = kwargs['modelname'] + mdb.Job(name=name, model=modelname, description='', type=ANALYSIS, atTime=None, + waitMinutes=0, waitHours=0, queue=None, memory=90, + memoryUnits=PERCENTAGE, getMemoryFromAnalysis=True, + explicitPrecision=SINGLE, nodalOutputPrecision=SINGLE, echoPrint=OFF, + modelPrint=OFF, contactPrint=OFF, historyPrint=OFF, userSubroutine='', + scratch='', resultsFormat=ODB, multiprocessingMode=DEFAULT, numCpus=1, + numGPUs=0) + mdb.jobs[name].submit(consistencyChecking=OFF) + mdb.jobs[name].waitForCompletion() + + +if __name__ == '__main__': + ''' Governing parameters ''' + spring = [1, 2, 5, 10, 15, 20, 40, 80, 100, 150, 200] + nsamples = 5 + modelname = [['spring_%s_%s' % (i, j) for j in range(nsamples)] for i in spring] + jobname = [['job_%s_%s' % (i, j) for j in range(nsamples)] for i in spring] + ''' Loop over parameters ''' + for i in range(np.shape(jobname)[1]): + for j in range(np.shape(jobname)[0]): + kwargs = generateKwargs(spring=spring[j], + modelname=modelname[j][i], + jobname=jobname[j][i]) + ''' Call modules ''' + kwargs, data = Interaction.create_interactions(**kwargs) + Step.Step(**kwargs) + LoadsAndBCs.create_load(data, **kwargs) + LoadsAndBCs.create_bc(**kwargs) + generate_mesh.standard_mesh(**kwargs) + ''' Create and submit a job ''' + jobSubmit(**kwargs) +