charMeca1.build()

charMeca2 = code_aster.KinematicsMechanicalLoad()
charMeca2.setModel(monModel)
charMeca2.addImposedMechanicalDOFOnCells(
    code_aster.PhysicalQuantityComponent.Dy, 0.1, "COTE_H")
charMeca2.addImposedMechanicalDOFOnCells(
    code_aster.PhysicalQuantityComponent.Dz, 0.1, "COTE_H")
charMeca2.build()

# Define the nonlinear method that will be used
monSolver = code_aster.PetscSolver(code_aster.Renumbering.Sans)
monSolver.setPreconditioning(code_aster.Preconditioning.Ml)

# Define a nonlinear Analysis
statNonLine = code_aster.NonLinearStaticAnalysis()
statNonLine.addStandardExcitation(charMeca1)
statNonLine.addStandardExcitation(charMeca2)
statNonLine.setModel(monModel)
statNonLine.setMaterialField(affectMat)
statNonLine.setLinearSolver(monSolver)

temps = [0., 0.5, 1.]
timeList = code_aster.TimeStepManager()
timeList.setTimeList(temps)

error1 = code_aster.EventError()
action1 = code_aster.SubstepingOnError()
action1.setAutomatic(False)
error1.setAction(action1)
timeList.addErrorManager(error1)
Exemplo n.º 2
0
charMeca1 = code_aster.ImposedDisplacementReal(monModel)
charMeca1.setValue( imposedDof1, "Bas" )
charMeca1.build()
test.assertEqual(charMeca1.getType(), "CHAR_MECA")

imposedPres1 = code_aster.PressureReal()
imposedPres1.setValue( code_aster.PhysicalQuantityComponent.Pres, 1000. )
charMeca2 = code_aster.DistributedPressureReal(monModel)
charMeca2.setValue( imposedPres1, "Haut" )
charMeca2.build()
test.assertEqual(charMeca2.getType(), "CHAR_MECA")

monSolver = code_aster.MumpsSolver( code_aster.Renumbering.Metis )

# Define a first nonlinear Analysis
statNonLine1 = code_aster.NonLinearStaticAnalysis()
statNonLine1.addStandardExcitation( charMeca1 )
statNonLine1.addStandardExcitation( charMeca2 )
statNonLine1.setModel( monModel )
statNonLine1.setMaterialField( affectMat )
statNonLine1.setLinearSolver( monSolver )
# elas = code_aster.Behaviour()
elas = code_aster.Behaviour(code_aster.ConstitutiveLaw.Elas,
                                   code_aster.StrainType.SmallStrain)
statNonLine1.addBehaviourOnCells( elas )


temps = [0., 0.5 ]
timeList = code_aster.TimeStepManager()
timeList.setTimeList( temps )