# (at your option) any later version. # # code_aster is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with code_aster. If not, see <http://www.gnu.org/licenses/>. # -------------------------------------------------------------------- import code_aster from code_aster.Commands import * test = code_aster.TestCase() code_aster.init("--test") rank = code_aster.getMPIRank() Mesh2 = code_aster.Mesh() Mesh2.readMedFile("xxNotParallelMechanicalLoad001i.med") model = AFFE_MODELE(MAILLAGE = Mesh2, AFFE = _F(MODELISATION = "D_PLAN", PHENOMENE = "MECANIQUE", TOUT = "OUI",), DISTRIBUTION=_F(METHODE='CENTRALISE',),) char_cin = AFFE_CHAR_CINE(MODELE=model, MECA_IMPO=(_F(GROUP_NO="N2", DX=0.,DY=0.,DZ=0.,),
# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # code_aster is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with code_aster. If not, see <http://www.gnu.org/licenses/>. # -------------------------------------------------------------------- import code_aster from code_aster.Commands import * code_aster.init("--test", "--continue") test = code_aster.TestCase() test.assertTrue("BLOK" in MAIL.getGroupsOfCells()) test.assertTrue("VOL" in MAIL.getGroupsOfCells()) support = MODELE.getMesh() test.assertTrue("VOL" in support.getGroupsOfCells()) del support asse = ASSEMBLAGE( MODELE=MODELE, CHAM_MATER=CHMAT, CHARGE=BLOCAGE, NUME_DDL=CO('NUMEDDL'),
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # code_aster is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with code_aster. If not, see <http://www.gnu.org/licenses/>. # -------------------------------------------------------------------- import code_aster from code_aster import AsterError code_aster.init("--test", ERREUR=_F(ERREUR_F='EXCEPTION')) test = code_aster.TestCase() # Creation du maillage monMaillage = code_aster.Mesh() # Relecture du fichier MED monMaillage.readMedFile("test001d.mmed") # Definition du modele Aster monModel = code_aster.Model(monMaillage) monModel.addModelingOnMesh(code_aster.Physics.Mechanics, code_aster.Modelings.Tridimensional) monModel.build()
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with code_aster. If not, see <http://www.gnu.org/licenses/>. # -------------------------------------------------------------------- import code_aster from code_aster.Commands import * from code_aster.Utilities.ExecutionParameter import ExecutionParameter, Options test = code_aster.TestCase() # extract from zzzz351a # DEBUT(CODE=_F(NIV_PUB_WEB='INTERNET'), DEBUG=_F(SDVERI='OUI')) code_aster.init("--test", "--abort") params = ExecutionParameter() test.assertTrue(params.option & Options.UseLegacyMode) params.disable(Options.UseLegacyMode) test.assertFalse(params.option & Options.UseLegacyMode) # MAIL = LIRE_MAILLAGE(UNITE=20, FORMAT='MED',) MAIL = code_aster.Mesh() MAIL.readMedFile('zzzz351a.mmed') MODELE = AFFE_MODELE(MAILLAGE=MAIL, AFFE=_F(TOUT='OUI', PHENOMENE='MECANIQUE', MODELISATION='3D'))
# import CodeAster import code_aster from code_aster.Commands import * # initialize code_aster.init(LANG='EN') # create and read mesh monMaillage = code_aster.Mesh() monMaillage.readMedFile("_ExportedFromSalomeObject_0_1_2_3.med") # prepare model monModel = code_aster.Model(monMaillage) monModel.addModelingOnMesh(code_aster.Physics.Mechanics, code_aster.Modelings.Tridimensional) monModel.build() # material settings matProp = code_aster.MaterialProperty("ELAS") matProp.addPropertyReal("E", 210000, True) matProp.addPropertyReal("NU", 0.3, True) steel = code_aster.Material() steel.addMaterialProperty(matProp) steel.build() fieldmat = code_aster.MaterialField(monMaillage) fieldmat.addMaterialsOnGroupOfCells(steel, ["beam"]) fieldmat.buildWithoutExternalStateVariables() # create boundary conditions
# (at your option) any later version. # # code_aster is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with code_aster. If not, see <http://www.gnu.org/licenses/>. # -------------------------------------------------------------------- import platform import code_aster from code_aster.Commands import * code_aster.init("--test", debug=True) test = code_aster.TestCase() # calling DEBUT/init another time must not fail DEBUT() from code_aster.Utilities.ExecutionParameter import ExecutionParameter params = ExecutionParameter() test.assertEqual( params.get_option('hostname'), platform.node()) # GreaterEqual because of multiplicative factor running testcases # timelimit = 123. - 10% (default time saved) test.assertGreaterEqual( params.get_option('tpmax'), 123 * 0.9) params.set_option('tpmax', 60.)