示例#1
0
def createAnalysisPartionedCuboid(param):
    dH = param['h']/param['nbParts']
    m = mdb.Model(param['modelName'])
    directions = list()
    matNames = list()
    a = m.rootAssembly
    s = m.ConstrainedSketch(name='__profile__', sheetSize=200.0)
    s.setPrimaryObject(option=STANDALONE)
    s.rectangle(point1=(param['l1'],0.), point2=(0.,param['l2']))
    p = m.Part(name='Part-1', dimensionality=THREE_D, type=DEFORMABLE_BODY)
    p.BaseSolidExtrude(sketch=s, depth=param['h'])
    s.unsetPrimaryObject()
    for cube in range(param['nbParts']-1):
        z0 = cube*dH
        middlePt = (param['l1']/3.,param['l2']/3.,z0+dH/3.)
        pt1 = p.DatumPointByCoordinate(coords=(0.,0.,z0+dH))
        pt2 = p.DatumPointByCoordinate(coords=(0.,param['l2']/3.,z0+dH))
        pt3 = p.DatumPointByCoordinate(coords=(param['l1']/3.,0.,z0+dH))
        pickedCells = p.cells.findAt((middlePt,))
        p.PartitionCellByPlaneThreePoints(cells=pickedCells, point1=p.datums[pt1.id], point2=p.datums[pt2.id], point3=p.datums[pt3.id])
    p.seedPart(size=param['seedSize'])
    p.generateMesh()
    elType = mesh.ElemType(C3D8R, hourglassControl=ENHANCED)
    p.setElementType((p.cells,), (elType,))
    i = a.Instance(name=p.name+'-1', part=p, dependent=ON)
    upperFaces = list()
    lowerFaces = list()
    for cube in range(param['nbParts']):
        sectionName = 'section_%i'%cube
        matName = 'mat_%i'%cube
        z0 = cube*dH
        middlePt = (param['l1']/3.,param['l2']/3.,z0+dH/3.)
        pickedCells2 = p.cells.findAt((middlePt,))
        # create material
        myMat = m.Material(name=matName)
        if isinstance(param['holzapfelParameters'],list) and len(param['holzapfelParameters']) == param['nbParts']: matParam = param['holzapfelParameters'][cube]
        elif len(param['holzapfelParameters']) == 5: matParam = param['holzapfelParameters']
        else: raise("parameter 'holzapfelParameters' of unknown type or wrong length")
        E,nu = getEandNu(matParam)
        if not param['stupidMaterial']:
            if matParam[1]==0.: myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL ,behaviorType=INCOMPRESSIBLE,localDirections=1)
            else: myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL ,behaviorType=COMPRESSIBLE,localDirections=1)
            if isinstance(param['fiberDirection'],list) and len(param['fiberDirection']) == param['nbParts']: fibreAngle = param['fiberDirection'][cube]
            elif isinstance(param['fiberDirection'],float): fibreAngle = param['fiberDirection']
            else: raise("parameter 'fiberDirection' of unknown type or wrong length")
            directions.append((math.cos(fibreAngle),math.sin(fibreAngle),0.))
            matNames.append(matName)
        else:
            if matParam[1]==0.: myMat.Hyperelastic(testData=OFF,table=((E/(4*(1.+nu)),0.),),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=INCOMPRESSIBLE)            
            else: myMat.Hyperelastic(testData=OFF,table=((E/(4*(1.+nu)),6*(1-2.*nu)/E),),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=COMPRESSIBLE)            
        abaqusTools.assignMaterialToPartition(matName,p,sectionName,pickedCells2,m)
        upperFacePoint = (param['l1']/3.,param['l2'],z0+dH/3.)
        upperFaces.append(i.faces.findAt((upperFacePoint,) ))
        lowerFacePoint = (param['l1']/3.,0.,z0+dH/3.)
        lowerFaces.append(i.faces.findAt((lowerFacePoint,) ))

    innerPt = (param['l1']/3.,param['l2']/3.,0.)
    innerFace = i.faces.findAt((innerPt,))
    innerSet = a.Set(faces=innerFace, name='innerFace')
    outerPt = (param['l1']/3.,param['l2']/3.,z0+dH)
    outerFace = i.faces.findAt((outerPt,))
    outerSet = a.Set(faces=outerFace, name='outerFace')
    lowerSet = tuple(lowerFaces)
    a.Set(faces=lowerSet, name='lowerFace')
    upperSet = tuple(upperFaces)
    a.Set(faces=upperSet, name='upperFace')
    
    m.StaticStep(name='Step-1', previous='Initial', nlgeom=ON, timePeriod=1.,initialInc=.0001,maxNumInc=10000, minInc=.000001)
    if param['BCType'] == 'Tension':
        m.PinnedBC(name='BC-1', createStepName='Step-1', region=innerSet, localCsys=None)
        m.DisplacementBC(name='BC-2', createStepName='Step-1', region=outerSet, u1=0.0, u2=0.0, u3=param['displ'])
    elif param['BCType'] == 'Compression':
        m.PinnedBC(name='BC-1', createStepName='Step-1', region=innerSet, localCsys=None)
        m.DisplacementBC(name='BC-2', createStepName='Step-1', region=outerSet, u1=0.0, u2=0.0, u3=-1.*param['displ'])
    elif param['BCType'] == 'ParrTension':
        m.PinnedBC(name='BC-1', createStepName='Step-1', region=upperSet, localCsys=None)
        m.DisplacementBC(name='BC-2', createStepName='Step-1', region=lowerSet, u1=0.0, u2=-1.*param['displ'], u3=0.0)
    elif param['BCType'] == 'ParrCompression':
        m.PinnedBC(name='BC-1', createStepName='Step-1', region=upperSet, localCsys=None)
        m.DisplacementBC(name='BC-2', createStepName='Step-1', region=lowerSet, u1=0.0, u2=param['displ'], u3=0.0)
    ## JOB
    myJobDef = JobDefinition(param['modelName'])
    myJobDef.setScratchDir(param['scratchDir'])
    if not param['stupidMaterial']:
        myJobDef.setToFibrous()        
        myJobDef.fibreDirections(directions)
        myJobDef.setFibreInputType('partition')
        myJobDef.setMatNames(matNames)
    myNewJob = myJobDef.create()
    if param['numCpus']>1: myNewJob.setValues(numCpus=param['numCpus'],numDomains=param['numCpus'],multiprocessingMode=THREADS)
    if param['saveCaeFile']:mdb.saveAs(myNewJob.name)
    return myNewJob,mdb
def createAnalysis(param):
    nbLamellae = len(param['parts'])-4
    ## IMPORT FILE
    mdb.ModelFromInputFile(inputFileName=param['inpFile'], name=param['modelName'])
    abaqusTools.deleteDefaultModel()
    ## SHORTCUTS
    myModel = mdb.models[param['modelName']]
    myPart = myModel.parts['PART-1']
    myAssembly = myModel.rootAssembly
    myInstance = myAssembly.instances['PART-1-1']
    mySets =  myAssembly.sets

    ## STEP CREATION
    nlGeom = OFF
    if param['nlgeom']: nlGeom = ON

    initInc = .01
    maxInc = .1
    if 'homogeneous' not in param['inpFile']:
        initInc = 1e-4
        maxInc = .1
        if ('Bonded' not in param['inpFile']) and ('bonded' not in param['inpFile']): initInc = 1e-6
    minInc = initInc/10000.
    myModel.StaticStep(initialInc=initInc ,timePeriod=param['timePeriod'], maxInc=maxInc, minInc=minInc, name='displ', nlgeom=nlGeom, previous='Initial',maxNumInc=10000)
    if 'homogeneous' not in param['inpFile'] and 'Bonded' not in param['inpFile']:
        myModel.steps['displ'].control.setValues(allowPropagation=OFF, resetDefaultValues=OFF, discontinuous=ON)
    ## ELEMENT INTEGRATION (to ensure hourglass control - may not be needed!!)
    elemType1 = mesh.ElemType(elemCode=C3D8R, elemLibrary=STANDARD, hourglassControl=ENHANCED)
    elemType2 = mesh.ElemType(elemCode=C3D4, elemLibrary=STANDARD)
    myPart.setElementType(regions=(myPart.elements,), elemTypes=(elemType1, elemType2))
    
    directions = list()
    matNames = list()
    for i,p in enumerate(param['parts']):
        ## MATERIALS
        mat = 'PM_'+p
        allMats = myModel.materials
        if allMats.has_key(mat): myMat = myModel.materials[mat]
        else:continue
        E,nu = getEandNu(param['holzapfelParameters'])
        if 'PLATE' in mat:
            if param['nlgeom']: myMat.Hyperelastic(testData=OFF,table=((300./1.3,2.4/1200.),),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=COMPRESSIBLE)
            else: myMat.Elastic(table=((1200., 0.3), ))
        elif 'NUCLEUS' in mat:
            if param['nlgeom']:
                myMat.Hyperelastic(testData=OFF,table=((0.00025,0.0),),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=INCOMPRESSIBLE)
                elemType1 = mesh.ElemType(elemCode=C3D8RH, elemLibrary=STANDARD, hourglassControl=ENHANCED)
                elemType2 = mesh.ElemType(elemCode=C3D4H, elemLibrary=STANDARD)
                region = myPart.sets['PT_'+p]
                myPart.setElementType(regions=region, elemTypes=(elemType1, elemType2))
            else: myMat.Elastic(table=((.0015, 0.499), ))
        elif not param['nlgeom']: myMat.Elastic(table=((E, nu), ))
        elif param['matType'] == 'neoHooke' or 'TRANSITIONZONE' in mat:
            matParam = (E/(4*(1.+nu)),6*(1-2.*nu)/E)
            if param['holzapfelParameters'][1]==0.:# incompressible
                myMat.Hyperelastic(testData=OFF,table=(matParam,),materialType=ISOTROPIC,type=NEO_HOOKE
                ,behaviorType=INCOMPRESSIBLE)
                elemType1 = mesh.ElemType(elemCode=C3D8RH, elemLibrary=STANDARD, hourglassControl=ENHANCED)
                elemType2 = mesh.ElemType(elemCode=C3D4H, elemLibrary=STANDARD)
                region = myPart.sets['PT_'+p]
                myPart.setElementType(regions=region, elemTypes=(elemType1, elemType2))
            else: myMat.Hyperelastic(testData=OFF,table=(matParam,),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=COMPRESSIBLE)
        elif param['matType'] == 'Holzapfel':
            matParam = param['holzapfelParameters']
            if 'homogeneous' not in param['inpFile']: nbDirection=1
            else: nbDirection=2
                        
            if matParam[1]==0.:# incompressible
                myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL
                ,behaviorType=INCOMPRESSIBLE,localDirections=nbDirection)
                elemType1 = mesh.ElemType(elemCode=C3D8RH, elemLibrary=STANDARD, hourglassControl=ENHANCED)
                elemType2 = mesh.ElemType(elemCode=C3D4H, elemLibrary=STANDARD)
                region = myPart.sets['PT_'+p]
                myPart.setElementType(regions=region, elemTypes=(elemType1, elemType2))
            else: myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL,behaviorType=COMPRESSIBLE,localDirections=nbDirection)
            
            if isinstance(param['fiberOrientation'],tuple) and len(param['fiberOrientation']) == nbLamellae:
                lamellarNo = int(''.join(x for x in mat if x.isdigit()))
                fibreAngle = param['fiberOrientation'][lamellarNo-1]
            elif isinstance(param['fiberOrientation'],float): fibreAngle = param['fiberOrientation']
            else: raise("parameter 'fiberOrientation' of wrong type or length")
            directions.append((math.sin(fibreAngle),math.cos(fibreAngle),0.))
            matNames.append(mat)

        ##BC'S
        if 'Hemi' in param['inpFile']:
            #symmetry at yMin
            yMax = 'NS_%s_WITH_YMIN'%p
            if  mySets.has_key(yMax): myModel.YsymmBC(createStepName='displ', name='ySymm_%s'%(p), region=mySets[yMax])
            #fixation
            dMin = 'NS_%s_WITH_ZMIN'%p
            if  mySets.has_key(dMin): myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=mySets[dMin])
            #displacement
            dMax = 'NS_%s_WITH_ZMAX'%p
            if  mySets.has_key(dMax): myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=mySets[dMax], u3=param['displ'],u1=0.,u2=0.)
        else:
            #fixation
            dMin = 'NS_BOTTOMPLATE_WITH_BACKGROUND'
            if mySets.has_key(dMin): myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=mySets[dMin])
            #displacement
            dMax = 'NS_TOPPLATE_WITH_BACKGROUND'
            if mySets.has_key(dMax): myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=mySets[dMax], u1=param['displ'],u2=0.,u3=0.)
        
        ##CONSTRAINTS - same for all interfaces - could be changed depending on the interface name!!
        if 'homogeneous' not in param['inpFile'] and 'Bonded' not in param['inpFile'] and 'bonded' not in param['inpFile'] :
            for interactionName in myModel.interactionProperties.keys():
                from abaqusPythonTools.interactions import Interactions
                inter = Interactions(myModel)
                inter.setName(interactionName)
                if param['interfaceType'] == 'Friction':
                    inter.setFrictionBehaviour('Friction',param['frictionCoef'])
                    inter.setSeparationAllowed()
                elif param['interfaceType'] == 'Rough':
                    inter.setFrictionBehaviour('Rough')
                elif param['interfaceType'] == 'Cohesive':
                    inter.setCohesiveBehaviour(useDefaultBehaviour=False,penalties=(100.0, 100.0, 100.0))
                elif param['interfaceType'] == 'CohesiveRough':
                    inter.setCohesiveBehaviour(useDefaultBehaviour=False)
                    inter.setFrictionBehaviour('Rough')
                elif param['interfaceType'] == 'CohesiveFriction':
                    inter.setCohesiveBehaviour(useDefaultBehaviour=False)
                    inter.setFrictionBehaviour('Friction',param['frictionCoef'])
                inter.changeInteraction()                        
    ## OUTPUT REQUESTS
    # fieldVariable = ('S', 'LE', 'U', 'RT', 'P', 'CSTRESS', 'CDISP', 'CFORCE')
    # myModel.fieldOutputRequests['F-Output-1'].setValues(variables=fieldVariable)

    ## JOB
    from abaqusPythonTools.jobCreation import JobDefinition
    myJobDef = JobDefinition(param['modelName'])
    myJobDef.setScratchDir(param['scratchDir'])
    if param['matType'] == 'Holzapfel':
        myJobDef.setToFibrous()        
        myJobDef.fibreDirections(directions)
        if 'homogeneous' in param['inpFile']: myJobDef.setFibreInputType('twoDirectionsZVert')
        myJobDef.setMatNames(matNames)
    myNewJob = myJobDef.create()
    if param['numCpus']>1: myNewJob.setValues(numCpus=param['numCpus'],numDomains=param['numCpus'],multiprocessingMode=DEFAULT)
    mdb.saveAs(param['modelName'])
    ##
    return myNewJob,mdb
示例#3
0
def createAnalysisFromSipExport(param):
    ## IMPORT FILE
    mdb.ModelFromInputFile(inputFileName=param['sipInpFile'], name=param['modelName'])
    abaqusTools.deleteDefaultModel()
    ## SHORTCUTS
    myModel = mdb.models[param['modelName']]
    myPart = myModel.parts['PART-1']
    myAssembly = myModel.rootAssembly
    myInstance = myAssembly.instances['PART-1-1']
    mySets =  myAssembly.sets

    ## STEP CREATION
    nlGeom = OFF
    if param['nlgeom']:
        nlGeom = ON
    if param['matType'] == 'Hooke':
        initInc = .05
        maxInc = .15
    else:
        initInc = .01
        maxInc = .1
    if 'Contact' in param['sipInpFile']:
        initInc = 1e-4
        maxInc = .1    

    minInc = min(initInc,maxInc)/1000.
    myModel.StaticStep(initialInc=initInc ,timePeriod=param['timePeriod'], maxInc=maxInc, minInc=minInc, name='displ', nlgeom=nlGeom, previous='Initial',maxNumInc=10000)
    ## ELEMENT INTEGRATION (to ensure hourglass control and hybrid integration - may not be needed!!)
    elemType1 = mesh.ElemType(elemCode=C3D8RH, elemLibrary=STANDARD, hourglassControl=ENHANCED)
    elemType2 = mesh.ElemType(elemCode=C3D4, elemLibrary=STANDARD)
    myPart.setElementType(regions=(myPart.elements,), elemTypes=(elemType1, elemType2))
    
    directions = list()
    matNames = list()
    for i,p in enumerate(param['parts']):
        ## MATERIALS
        mat = 'PM_'+p
        allMats = myModel.materials
        if allMats.has_key(mat):
            myMat = myModel.materials[mat]
        else:continue
        E,nu = getEandNu(param['holzapfelParameters'])
        if 'BRIDGES' in mat:
            if param['nlgeom']:
                myMat.Hyperelastic(testData=OFF,table=((6*(1-2.*0.45)/0.4,0.4/(4*(1.+0.45))),),materialType=ISOTROPIC,type=NEO_HOOKE,behaviorType=COMPRESSIBLE)
            else: myMat.Elastic(table=((0.4, 0.45), ))
        elif param['matType'] == 'Hooke':
            myMat.Elastic(table=((E, nu), ))
        elif param['matType'] == 'neoHooke':
            if param['holzapfelParameters'][1]==0.:# incompressible
                myMat.Hyperelastic(testData=OFF,table=((E/(4*(1.+nu)),6*(1-2.*nu)/E),),materialType=ISOTROPIC,type=NEO_HOOKE
                ,behaviorType=INCOMPRESSIBLE)
            else:
                myMat.Hyperelastic(testData=OFF,table=((E/(4*(1.+nu)),6*(1-2.*nu)/E),),materialType=ISOTROPIC,type=NEO_HOOKE
                ,behaviorType=COMPRESSIBLE)
        elif param['matType'] == 'Holzapfel':
            if param['holzapfelParameters'][1]==0.:# incompressible
                myMat.Hyperelastic(table=(param['holzapfelParameters'],),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL
                ,behaviorType=INCOMPRESSIBLE,localDirections=1)
            else:
                myMat.Hyperelastic(table=(param['holzapfelParameters'],),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL
                ,behaviorType=COMPRESSIBLE,localDirections=1)
            if 'SECTIONED' in mat:
                fibreAngle = 2.*param['fiberOrientation']
            else:
                fibreAngle = 0.
            region = myPart.sets['PT_'+p]
            myPart.MaterialOrientation(region=region, orientationType=SYSTEM, localCsys=None)
            directions.append((0.,math.sin(fibreAngle),math.cos(fibreAngle)))
            matNames.append(mat)
        ##BC'S
        dMin = 'NS_%s_WITH_%sMIN'%(p,param['loadDirection'])
        if  mySets.has_key(dMin):
            myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=mySets[dMin])
        dMax = 'NS_%s_WITH_%sMAX'%(p,param['loadDirection'])
        if  mySets.has_key(dMax):
            if param['loadDirection'] == 'X':
                myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=mySets[dMax], u1=param['displ'])
            elif param['loadDirection'] == 'Y':
                myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=mySets[dMax], u2=param['displ'])
            elif param['loadDirection'] == 'Z':
                myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=mySets[dMax], u3=param['displ'])
        
        ##CONSTRAINTS - same for all interfaces - could be changed depending on the interface name!!
        if 'Contact' in param['sipInpFile']:
            for interactionName in myModel.interactionProperties.keys():
                from abaqusPythonTools.interactions import Interactions
                inter = Interactions(myModel)
                inter.setName(interactionName)
                if param['interfaceType'] == 'Tie':
                    masterRegion = myModel.interactions[interactionName+'-1'].master[0]
                    slaveRegion = myModel.interactions[interactionName+'-1'].slave[0]
                    del myModel.interactions[interactionName+'-1']
                    del myModel.interactionProperties[interactionName]
                    inter.setMasterSlave(masterRegion,slaveRegion)
                    inter.setInteractionToTie()
                elif param['interfaceType'] == 'Friction':
                    inter.setFrictionBehaviour('Friction')
                elif param['interfaceType'] == 'Cohesive':
                    inter.setCohesiveBehaviour()
                inter.changeInteraction()                        
    ## OUTPUT REQUESTS
    fieldVariable = ('S', 'LE', 'U', 'RT', 'P', 'CSTRESS', 'CDISP', 'CFORCE')
    myModel.fieldOutputRequests['F-Output-1'].setValues(variables=fieldVariable)
    ## RESTART DEF
    if param['allowRestart']:
        myModel.steps['displ'].Restart(numberIntervals=5,timeMarks=OFF,overlay=ON)
    ## JOB
    from abaqusPythonTools.jobCreation import JobDefinition
    myJobDef = JobDefinition(param['modelName'])
    myJobDef.setScratchDir(param['scratchDir'])
    if param['matType'] == 'Holzapfel':
        myJobDef.setToFibrous()        
        myJobDef.fibreDirections(directions)
        myJobDef.setFibreInputType('fromSip')
        myJobDef.setMatNames(matNames)
    myNewJob = myJobDef.create()
    if param['numCpus']>1: 
        myNewJob.setValues(numCpus=param['numCpus'],numDomains=param['numCpus'],multiprocessingMode=DEFAULT)
    mdb.saveAs(param['modelName'])
    ##
    return myNewJob,mdb
def createAnalysis(param):
    if param['matType'] != 'Hooke' and not param['nlgeom']:
        print 'non linear geometry enforced with hyperelastic materials'
        param['nlgeom'] = True
    ## IMPORT FILE
    if param['sipInpFile']:
        myModel = mdb.ModelFromInputFile(inputFileName=param['sipInpFile'], name=param['modelName'])
        shellTo2DGeo(myModel)
    else:
        myModel = mdb.ModelFromInputFile(inputFileName=param['inpFile'], name=param['modelName'])
    abaqusTools.deleteDefaultModel()
    ## SHORTCUTS
    myAssembly = myModel.rootAssembly
    allMats = myModel.materials
    ## STEP CREATION
    nlGeom = OFF
    if param['nlgeom']: nlGeom = ON
    t0 = 0.01
    if (param['interfaceType'] is not 'Tie') and (param['interfaceType'] is not 'Rough'):t0 = 1e-5
    myModel.StaticStep(initialInc=t0 ,timePeriod=param['timePeriod'], maxInc=.1, minInc=1e-9, name='displ', nlgeom=nlGeom, previous='Initial')
    
    directions = list()
    matNames = list()
    slMaCouples = list()
    for i,myPart in enumerate(myModel.parts.values()):
        myPSet = myPart.sets
        part = myPart.name.split('_')[0]
        if part == 'INPLANE6' and param['load'] == 'custom':
            del myModel.parts['INPLANE6_Geo']
            del myAssembly.features['INPLANE6_instance']
            continue
        partType = [p for p in param['parts'] if p in part][0]#find if it is a sectionned or in plane lamellae
        ## MATERIALS
        cSys = myPart.DatumCsysByThreePoints(coordSysType=CARTESIAN,origin=(0.,0.,0.),point1=(1.,0.,0.),point2=(0.,1.,0.))       
        mat = 'SM_'+part
        if allMats.has_key(mat):
            myMat = myModel.materials[mat]
        else:
            print 'material %s unknown!!!'%mat
            continue
        E = 0.06#equivalent GM only as we are perp to fibers!!
        nu = 0.499
        if partType == 'BRIDGES':
            myMat.Elastic(table=((0.4, 0.45), ))
        elif param['matType'] == 'Hooke':
            myMat.Elastic(table=((E, nu), ))
        elif param['matType'] == 'neoHooke':
            matParam = (E/(4*(1.+nu)),6*(1-2.*nu)/E)
            if matParam[1]==0.:# incompressible
                myMat.Hyperelastic(testData=OFF,table=(matParam,),materialType=ISOTROPIC,type=NEO_HOOKE
                ,behaviorType=INCOMPRESSIBLE)
            else:
                myMat.Hyperelastic(testData=OFF,table=(matParam,),materialType=ISOTROPIC,type=NEO_HOOKE
                ,behaviorType=COMPRESSIBLE)
        elif param['matType'] == 'Holzapfel':
            if partType == 'SECTIONED':
                #issue: shell/2D do not allow for mat properties out-of-plane --> fibres cannot be out-of-plane
                #--> the effect of the angle is incorporated into the mat properties, k1 only, that are reduced according to the cos of the angle
                fibreAngle = 2.*param['fiberOrientation']
                matParam = (param['holzapfelParameters'][0],param['holzapfelParameters'][1],param['holzapfelParameters'][2]*math.cos(fibreAngle),param['holzapfelParameters'][3],param['holzapfelParameters'][4])
            else:
                matParam = param['holzapfelParameters']
            if matParam[1]==0.:# incompressible
                myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL
                ,behaviorType=INCOMPRESSIBLE,localDirections=1)
            else:
                myMat.Hyperelastic(table=(matParam,),materialType=ANISOTROPIC,anisotropicType=HOLZAPFEL
                ,behaviorType=COMPRESSIBLE,localDirections=1)
            myPart.MaterialOrientation(region=(myPart.faces[0],), orientationType=SYSTEM, axis=AXIS_3, localCsys=myPart.datums[cSys.id])#AXIS_3 is the normal to the shell
            directions.append((0.,1.,0.))
            matNames.append(mat)
        ## SECTION
        myModel.HomogeneousSolidSection(name='Section_%s'%part, material=mat, thickness=None)
        myPart.SectionAssignment(region=(myPart.faces[0],), sectionName='Section_%s'%part)
        ## BC'S
        
        myISet = myAssembly.instances['%s_instance'%part].sets
        dMin = 'NS_%s_WITH_XMIN'%part
        dMax = 'NS_%s_WITH_XMAX'%part

        if param['load'] == 'custom':
            if 'tt01_01_noBScSegDS' in param['sipInpFile']:
                if  myISet.has_key(dMin):
                    myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=myISet[dMin])
                if part == 'SECTIONED5':
                    x1 = (1.10898,1.29364)
                    x2 = (1.29274,0.74189)
                    d1 = (0.134,-0.12)
                    d2 = (0.18,-0.10)
                    for node in myISet['SF_%s_WITH_INPLANE6'%part].nodes:
                        i += 1
                        abaqusTools.applyInterpolatedDisplacement(myModel,node,x1,x2,d1,d2,'mov_%d'%(i))
            elif 'tt02_02_CroppedNoBScSegDS' in param['sipInpFile']:
                if  myISet.has_key(dMax):
                    myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=myISet[dMax])
                if part == 'SECTIONED2':
                    x1 = (0.261,1.943)
                    x2 = (0.297,0)
                    d1 = (-0.23617,0.09717)
                    d2 = (-0.390945,-0.02034)
                    for node in myISet['SF_%s_WITH_INPLANE1'%part].nodes:
                        i += 1
                        abaqusTools.applyInterpolatedDisplacement2(myModel,node,x1,x2,d1,d2,'mov_%d'%(i))
        else:
            if  myISet.has_key(dMin):
                myModel.PinnedBC(createStepName='displ', localCsys=None, name='fix_%d'%(i), region=myISet[dMin])
            if  myISet.has_key(dMax):
                if param['load'] == 'tension':
                    myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=myISet[dMax], u1=param['displ'])
                elif param['load'] == 'shear':
                    myModel.DisplacementBC(createStepName='displ', localCsys=None, name='mov_%d'%(i), region=myISet[dMax], u2=param['displ'])
                else:raise Exception('unknonw load type')
        ## Get Master/Slave couples
        oParts = list(myModel.parts.keys())
        oParts.remove(myPart.name)
        for setName in myPSet.keys():
            if setName.startswith('SF_%s_WITH_'%part):
                for oPart in oParts:
                    oPartName = oPart.split('_')[0]
                    if oPartName=='INPLANE6':
                        continue
                    elif oPartName in setName:
                        if [oPartName,part] not in slMaCouples:
                            slMaCouples.append([part,oPartName])
    ## CONSTRAINTS - same for all interfaces!!
    for nbInteraction,slMaCouple in enumerate(slMaCouples):
        masterName = 'SF_%s_WITH_%s'%(slMaCouple[1],slMaCouple[0])
        slaveName = 'SF_%s_WITH_%s'%(slMaCouple[0],slMaCouple[1])
        myMaInstance = myAssembly.instances['%s_instance'%slMaCouple[1]]
        mySlInstance = myAssembly.instances['%s_instance'%slMaCouple[0]]
        from abaqusPythonTools.interactions import Interactions
        inter = Interactions(myModel)
        inter.setName('interaction_%i'%nbInteraction)
        if param['interfaceType'] == 'Tie':
            inter.setMasterSlave(myMaInstance.sets[masterName],mySlInstance.sets[slaveName])
            inter.setInteractionToTie()
        else:
            inter.setMasterSlave(myMaInstance.surfaces[masterName],mySlInstance.surfaces[slaveName])
            inter.setNormalStiffness(param['normalStiffness'])
            if param['interfaceType'] == 'Friction':
                inter.setFrictionBehaviour('Friction')
            elif param['interfaceType'] == 'Rough':
                inter.setFrictionBehaviour('Rough')
            elif param['interfaceType'] == 'Cohesive':
                inter.setCohesiveBehaviour(useDefaultBehaviour=False,penalties=param['cohesivePenalties'])
            elif param['interfaceType'] == 'CohesiveRough':
                inter.setCohesiveBehaviour(useDefaultBehaviour=False,penalties=param['cohesivePenalties'])
                inter.setFrictionBehaviour('Rough')
            elif param['interfaceType'] == 'CohesiveFriction':
                inter.setCohesiveBehaviour()
                inter.setFrictionBehaviour('Friction')
        inter.createInteraction()

    ## OUTPUT REQUESTS
    #fieldVariable = ('S', 'LE', 'U', 'RF', 'P', 'CSTRESS', 'CDISP', 'CFORCE')
    #myModel.fieldOutputRequests['F-Output-1'].setValues(variables=fieldVariable)
    ## JOB
    from abaqusPythonTools.jobCreation import JobDefinition
    myJobDef = JobDefinition(param['modelName'])
    myJobDef.setScratchDir(param['scratchDir'])
    if param['matType'] == 'Holzapfel':
        myJobDef.setToFibrous()        
        myJobDef.fibreDirections(directions)
        myJobDef.setFibreInputType('fromSip')
        myJobDef.setMatNames(matNames)
    myNewJob = myJobDef.create()
    if param['numCpus']>1: 
        myNewJob.setValues(numCpus=param['numCpus'],numDomains=param['numCpus'],multiprocessingMode=DEFAULT)
    mdb.saveAs(param['modelName'])
    return myNewJob,mdb