# 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") test = code_aster.TestCase() rank = code_aster.getMPIRank() print("Nb procs", code_aster.getMPINumberOfProcs()) print("Rank", code_aster.getMPIRank()) pMesh2 = code_aster.ParallelMesh() pMesh2.readMedFile("xxParallelMesh001a/%d.med"%rank, True) pMesh2=DEFI_GROUP(reuse =pMesh2,MAILLAGE=pMesh2,CREA_GROUP_NO=_F(TOUT_GROUP_MA='OUI')) del pMesh2 pMesh = code_aster.ParallelMesh() pMesh.readMedFile("xxParallelMesh001a/%d.med"%rank, True) pMesh.debugPrint(rank+30) model = code_aster.Model(pMesh) test.assertEqual(model.getType(), "MODELE_SDASTER") model.addModelingOnMesh(code_aster.Physics.Mechanics,
# 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.,), _F(GROUP_NO="N4", DX=0.,DY=0.,DZ=0.,),),)
# 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 os import code_aster from code_aster.Commands import * from code_aster.Utilities.MEDPartitioner import MEDPartitioner code_aster.init("--test") test = code_aster.TestCase() rank = code_aster.getMPIRank() print("Nb procs", code_aster.getMPINumberOfProcs()) print("Rank", code_aster.getMPIRank()) if code_aster.getMPINumberOfProcs() > 1: is_parallel = True else: is_parallel = False # Split the mesh ms = MEDPartitioner("ssnv187a.mmed") ms.partitionMesh(True) # Where to save the mesh in a single folder