コード例 #1
0
    def __init__(self,
                 EL,
                 ET,
                 GLT,
                 GTT,
                 nuLT,
                 nuTT,
                 CL=0,
                 CT=0,
                 CTL=0,
                 RefStrainRate=1,
                 SLc_T=None,
                 SLc_C=None,
                 SYc_T=None,
                 SYc_C=None,
                 SZc_T=None,
                 SZc_C=None,
                 SLYc=None,
                 SLZc=None,
                 ID=""):
        ConstitutiveLaw.__init__(self, ID)  # heritage
        #        self.__YoungModulus = YoungModulus
        #        self.__PoissonRatio = PoissonRatio

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get(
        ) == "3D":  # or ProblemDimension.Get() == "2Dstress" :
            Variable("DispZ")

        self.__parameters = {'EL':EL, 'ET':ET, 'GLT':GLT, 'GTT':GTT, 'nuLT':nuLT, 'nuTT':nuTT, 'CL':CL, 'CT':CT, 'CLT':CLT, 'RefStrainRate': RefStrainRate, \
                             'SLc_T':SLc_T, 'SLc_C':SLc_C, 'SYc_T':SYc_T, 'SYc_C':SYc_C, 'SZc_T':SZc_T, 'SZc_C':SZc_C, 'SLYc':SLYc, 'SLZc':SLZc}

        self.__DamageVariable = [0, 0, 0, 0, 0, 0]
コード例 #2
0
        def __init__(self, umat_name, props, statev, corate=0, ID=""):
            #props is a nparray containing all the material variables
            #nstatev is a nparray containing all the material variables
            ConstitutiveLaw.__init__(self, ID)  # heritage

            self.__InitialStatev = statev  #statev may be an int or an array
            # self.__useElasticModulus = True ??

            self.__currentGradDisp = self.__initialGradDisp = 0

            # Variable("DispX")
            # Variable("DispY")

            if ProblemDimension.Get() == "3D":
                # Variable("DispZ")
                ndi = 3
                nshr = 3
            elif ProblemDimension.Get() in ['2Dstress']:
                # ndi = 2 ; nshr = 1
                ndi = 3
                nshr = 3
            elif ProblemDimension.Get() in ['2Dplane']:
                ndi = 3
                nshr = 3  # the constitutive law is treated in a classical way

            #statev = ??? require to get te number of gauss point

            ### initialization of the simcoon UMAT
            sim.Umat_fedoo.__init__(self, umat_name, np.atleast_2d(props),
                                    corate, ndi, nshr)
コード例 #3
0
    def __init__(self, Kx=0, Ky=0, Kz=0, ID=""):
        ConstitutiveLaw.__init__(self, ID)  # heritage
        self.__parameters = {'Kx': Kx, 'Ky': Ky, 'Kz': Kz}

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get(
        ) == "3D":  # or ProblemDimension.Get() == "2Dstress" :
            Variable("DispZ")
コード例 #4
0
    def __init__(self, H, ID=""):
        ConstitutiveLaw.__init__(self, ID)  # heritage

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get() == "3D":
            Variable("DispZ")

        self.__H = H
コード例 #5
0
    def __init__(self, Vf=0.6, E_f=250000, E_m = 3500, nu_f = 0.33, nu_m = 0.3, angle=0, ID=""):
        ConstitutiveLaw.__init__(self, ID) # heritage
#        self.__YoungModulus = YoungModulus
#        self.__PoissonRatio = PoissonRatio
        
        Variable("DispX")
        Variable("DispY")        
        
        if ProblemDimension.Get() == "3D": # or ProblemDimension.Get() == "2Dstress" :
            Variable("DispZ")

        self.__parameters = {'Vf':Vf, 'E_f':E_f, 'E_m':E_m, 'nu_f':nu_f, 'nu_m':nu_m, 'angle':angle}   
コード例 #6
0
ファイル: WeakForm_Beam.py プロジェクト: 3MAH/fedoo
    def __init__(self, CurrentConstitutiveLaw, Section, Jx, Iyy, Izz, k=0, ID = ""):
        #k: shear shape factor
        
        if isinstance(CurrentConstitutiveLaw, str):
            CurrentConstitutiveLaw = ConstitutiveLaw.GetAll()[CurrentConstitutiveLaw]

        if ID == "":
            ID = CurrentConstitutiveLaw.GetID()
            
        WeakForm.__init__(self,ID)

        Variable("DispX") 
        Variable("DispY")            
        if ProblemDimension.Get() == '3D':
            Variable("DispZ")   
            Variable("RotX") #torsion rotation 
            Variable("RotY")   
            Variable("RotZ")
            Variable.SetVector('Disp' , ('DispX', 'DispY', 'DispZ') , 'global')
            Variable.SetVector('Rot' , ('RotX', 'RotY', 'RotZ') , 'global')            
        elif ProblemDimension.Get() == '2Dplane':
            Variable("RotZ")
            Variable.SetVector('Disp' , ['DispX', 'DispY'], 'global' )            
            Variable.SetVector('Rot' , ['RotZ'] ) 
        elif ProblemDimension.Get() == '2Dstress':
            assert 0, "No 2Dstress model for a beam kinematic. Choose '2Dplane' instead."
                          
        self.__ConstitutiveLaw = CurrentConstitutiveLaw
        self.__parameters = {'Section': Section, 'Jx': Jx, 'Iyy':Iyy, 'Izz':Izz, 'k':k}        
コード例 #7
0
    def __init__(self,
                 GIc=0.3,
                 SImax=60,
                 KI=1e4,
                 GIIc=1.6,
                 SIImax=None,
                 KII=5e4,
                 axis=2,
                 ID=""):
        # GIc la ténacité (l'énergie à la rupture = l'aire sous la courbe du modèle en N/mm)
        #        SImax = 60.  # la contrainte normale maximale de l'interface (MPa)
        #        KI = 1e4          # la raideur des éléments cohésive (la pente du modèle en N/mm3)
        #
        #        # Mode II (12)
        #        G_IIc = 1.6
        #        KII = 5e4

        #
        ##----------------------- la puissance du critère de propagation (cas de critère de Power Law)---------------------------
        #        alpha = 2.
        #

        ConstitutiveLaw.__init__(self, ID)  # heritage
        self.__DamageVariable = 0  #damage variable
        self.__DamageVariableOpening = 0  # DamageVariableOpening is used for the opening mode (mode I). It is equal to DamageVariable in traction and equal to 0 in compression (soft contact law)
        self.__DamageVariableIrreversible = 0  #irreversible damage variable used for time evolution
        self.__parameters = {
            'GIc': GIc,
            'SImax': SImax,
            'KI': KI,
            'GIIc': GIIc,
            'SIImax': SIImax,
            'KII': KII,
            'axis': axis
        }

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get(
        ) == "3D":  # or ProblemDimension.Get() == "2Dstress" :
            Variable("DispZ")

        self.__currentInterfaceStress = None
コード例 #8
0
    def __init__(self, YoungModulus, PoissonRatio, YieldStress, ID=""):
        #only scalar values of YoungModulus and PoissonRatio are possible
        ConstitutiveLaw.__init__(self, ID)  # heritage

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get() == "3D":
            Variable("DispZ")

        self.__YoungModulus = YoungModulus
        self.__PoissonRatio = PoissonRatio
        self.__YieldStress = YieldStress

        self.__P = None  #irrevesrible plasticity
        self.__currentP = None  #current iteration plasticity (reversible)
        self.__PlasticStrainTensor = None
        self.__currentPlasticStrainTensor = None
        self.__currentSigma = None  #lissStressTensor object describing the last computed stress (GetStress method)

        self.__tol = 1e-6  #tolerance of Newton Raphson used to get the updated plasticity state (constutive law alogorithm)
コード例 #9
0
    def __init__(self, EX, EY, EZ, GYZ, GXZ, GXY, nuYZ, nuXZ, nuXY, ID=""):
        ConstitutiveLaw.__init__(self, ID)  # heritage
        #        self.__YoungModulus = YoungModulus
        #        self.__PoissonRatio = PoissonRatio

        Variable("DispX")
        Variable("DispY")

        if ProblemDimension.Get() == "3D":
            Variable("DispZ")

        self.__parameters = {
            'EX': EX,
            'EY': EY,
            'EZ': EZ,
            'GYZ': GYZ,
            'GXZ': GXZ,
            'GXY': GXY,
            'nuYZ': nuYZ,
            'nuXZ': nuXZ,
            'nuXY': nuXY
        }
コード例 #10
0
    def __init__(self, CurrentConstitutiveLaw, ID=""):
        if isinstance(CurrentConstitutiveLaw, str):
            CurrentConstitutiveLaw = ConstitutiveLaw.GetAll(
            )[CurrentConstitutiveLaw]

        if ID == "":
            ID = CurrentConstitutiveLaw.GetID()

        WeakForm.__init__(self, ID)

        Variable("DispX")
        Variable("DispY")
        if ProblemDimension.Get() == "3D": Variable("DispZ")

        self.__ConstitutiveLaw = CurrentConstitutiveLaw
        self.__InitialStressVector = 0
コード例 #11
0
    def GetStressTensor(self, U, constitutiveLaw, Type="Nodal"):
        """
        Not a static method.
        Return the Stress Tensor of an assembly using the Voigt notation as a python list. 
        The total displacement field and a ConstitutiveLaw have to be given.
        
        Can only be used for linear constitutive law. 
        For non linear ones, use the GetStress method of the ConstitutiveLaw object.

        Options : 
        - Type :"Nodal", "Element" or "GaussPoint" integration (default : "Nodal")

        See GetNodeResult, GetElementResult and GetGaussPointResult.

        example : 
        S = SpecificAssembly.GetStressTensor(Problem.Problem.GetDoFSolution('all'), SpecificConstitutiveLaw)
        """
        if isinstance(constitutiveLaw, str):
            constitutiveLaw = ConstitutiveLaw.GetAll()[constitutiveLaw]

        if Type == "Nodal":
            return listStressTensor([
                self.GetNodeResult(e, U)
                if e != 0 else np.zeros(self.__Mesh.GetNumberOfNodes())
                for e in constitutiveLaw.GetStressOperator()
            ])

        elif Type == "Element":
            return listStressTensor([
                self.GetElementResult(e, U)
                if e != 0 else np.zeros(self.__Mesh.GetNumberOfElements())
                for e in constitutiveLaw.GetStressOperator()
            ])

        elif Type == "GaussPoint":
            NumberOfGaussPointValues = self.__Mesh.GetNumberOfElements(
            ) * self.__nb_pg  #Assembly.__saveOperator[(self.__Mesh.GetID(), self.__elmType, self.__nb_pg)][0].shape[0]
            return listStressTensor([
                self.GetGaussPointResult(e, U)
                if e != 0 else np.zeros(NumberOfGaussPointValues)
                for e in constitutiveLaw.GetStressOperator()
            ])

        else:
            assert 0, "Wrong argument for Type: use 'Nodal', 'Element', or 'GaussPoint'"
コード例 #12
0
ファイル: WeakForm_InternalForce.py プロジェクト: 3MAH/fedoo
    def __init__(self, CurrentConstitutiveLaw, ID="", nlgeom=False):
        if isinstance(CurrentConstitutiveLaw, str):
            CurrentConstitutiveLaw = ConstitutiveLaw.GetAll(
            )[CurrentConstitutiveLaw]

        if ID == "":
            ID = CurrentConstitutiveLaw.GetID()

        WeakForm.__init__(self, ID)

        Variable("DispX")
        Variable("DispY")
        if ProblemDimension.Get() == "3D":
            Variable("DispZ")
            Variable.SetVector('Disp', ('DispX', 'DispY', 'DispZ'))
        else:  #2D assumed
            Variable.SetVector('Disp', ('DispX', 'DispY'))

        self.__ConstitutiveLaw = CurrentConstitutiveLaw
        self.__InitialStressTensor = 0
        self.__InitialGradDispTensor = None

        self.__nlgeom = nlgeom  #geometric non linearities

        if nlgeom:
            if ProblemDimension.Get() == "3D":
                GradOperator = [[
                    OpDiff(IDvar, IDcoord, 1) for IDcoord in ['X', 'Y', 'Z']
                ] for IDvar in ['DispX', 'DispY', 'DispZ']]
                #NonLinearStrainOperatorVirtual = 0.5*(vir(duk/dxi) * duk/dxj + duk/dxi * vir(duk/dxj)) using voigt notation and with a 2 factor on non diagonal terms
                NonLinearStrainOperatorVirtual = [
                    sum([
                        GradOperator[k][i].virtual() * GradOperator[k][i]
                        for k in range(3)
                    ]) for i in range(3)
                ]
                NonLinearStrainOperatorVirtual += [
                    sum([
                        GradOperator[k][0].virtual() * GradOperator[k][1] +
                        GradOperator[k][1].virtual() * GradOperator[k][0]
                        for k in range(3)
                    ])
                ]
                NonLinearStrainOperatorVirtual += [
                    sum([
                        GradOperator[k][0].virtual() * GradOperator[k][2] +
                        GradOperator[k][2].virtual() * GradOperator[k][0]
                        for k in range(3)
                    ])
                ]
                NonLinearStrainOperatorVirtual += [
                    sum([
                        GradOperator[k][1].virtual() * GradOperator[k][2] +
                        GradOperator[k][2].virtual() * GradOperator[k][1]
                        for k in range(3)
                    ])
                ]
            else:
                GradOperator = [[
                    OpDiff(IDvar, IDcoord, 1) for IDcoord in ['X', 'Y']
                ] for IDvar in ['DispX', 'DispY']]
                NonLinearStrainOperatorVirtual = [
                    sum([
                        GradOperator[k][i].virtual() * GradOperator[k][i]
                        for k in range(2)
                    ]) for i in range(2)
                ] + [0]
                NonLinearStrainOperatorVirtual += [
                    sum([
                        GradOperator[k][0].virtual() * GradOperator[k][1] +
                        GradOperator[k][1].virtual() * GradOperator[k][0]
                        for k in range(2)
                    ])
                ] + [0, 0]

            self.__NonLinearStrainOperatorVirtual = NonLinearStrainOperatorVirtual

        else:
            self.__NonLinearStrainOperatorVirtual = 0
コード例 #13
0
 def __init__(self, YoungModulus, PoissonRatio, ID=""):
     ConstitutiveLaw.__init__(self, ID)  # heritage
     self.__YoungModulus = YoungModulus
     self.__PoissonRatio = PoissonRatio