diff --git a/applications/DEM_application/python_scripts/main_script.py b/applications/DEM_application/python_scripts/main_script.py index a0f68052f01c..08d97347838c 100644 --- a/applications/DEM_application/python_scripts/main_script.py +++ b/applications/DEM_application/python_scripts/main_script.py @@ -22,16 +22,16 @@ class Solution(object): - def LoadParametersFile(self): - parameters_file = open("ProjectParametersDEM.json",'r') - self.DEM_parameters = Parameters(parameters_file.read()) - - def model_part_reader(self, modelpart, nodeid=0, elemid=0, condid=0): - return ReorderConsecutiveFromGivenIdsModelPartIO(modelpart, nodeid, elemid, condid) - - def __init__(self): - - self.LoadParametersFile() + def __init__(self, DEM_parameters=DEM_parameters): + print("entering _init_ main_script") + if "OMPI_COMM_WORLD_SIZE" in os.environ or "I_MPI_INFO_NUMA_NODE_NUM" in os.environ: + def model_part_reader(modelpart, nodeid=0, elemid=0, condid=0): + return ReorderConsecutiveFromGivenIdsModelPartIO(modelpart, nodeid, elemid, condid) + else: + def model_part_reader(modelpart, nodeid=0, elemid=0, condid=0): + #return ModelPartIO(modelpart) + return ReorderConsecutiveFromGivenIdsModelPartIO(modelpart, nodeid, elemid, condid) + self.model_part_reader = model_part_reader self.solver_strategy = self.SetSolverStrategy() self.creator_destructor = self.SetParticleCreatorDestructor() self.dem_fem_search = self.SetDemFemSearch() @@ -39,7 +39,6 @@ def __init__(self): self.SetAnalyticParticleWatcher() self.PreUtilities = PreUtilities() - # Creating necessary directories: self.main_path = os.getcwd() problem_name = self.GetProblemTypeFilename() @@ -242,8 +241,11 @@ def Initialize(self): self.materialTest.PrintChart() self.materialTest.PrepareDataForGraph() - self.post_utils = DEM_procedures.PostUtils(self.DEM_parameters, self.spheres_model_part) - self.report.total_steps_expected = int(self.final_time / self.dt) + self.post_utils = DEM_procedures.PostUtils(DEM_parameters, self.spheres_model_part) + + #self.SetFinalTime() + #self.Setdt() + self.report.total_steps_expected = int(self.final_time / self.dt) self.KRATOSprint(self.report.BeginReport(timer)) def GetMpFilename(self): @@ -383,7 +385,6 @@ def BeforeSolveOperations(self, time): #time_to_print = self.time - self.time_old_print # add new particles to analytic mp each time an output is generated #if (self.DEM_parameters["OutputTimeStep"].GetDouble() - time_to_print < 1e-2 * self.dt): self.FillAnalyticSubModelPartsWithNewParticles() - def BeforePrintingOperations(self, time): pass diff --git a/applications/DEM_application/test_examples/basic_benchmarks/DEM_benchmarks.py b/applications/DEM_application/test_examples/basic_benchmarks/DEM_benchmarks.py index 2d98358ea7ed..08aed41dd0c5 100644 --- a/applications/DEM_application/test_examples/basic_benchmarks/DEM_benchmarks.py +++ b/applications/DEM_application/test_examples/basic_benchmarks/DEM_benchmarks.py @@ -91,6 +91,7 @@ def SetFinalTime(self): def Setdt(self): self.dt = dt + #return self.dt def Initialize(self): self.DEM_parameters["problem_name"].SetString('benchmark' + str(benchmark_number)) @@ -127,7 +128,7 @@ def GetProblemTypeFilename(self): return 'benchmark' + str(benchmark_number) def BeforeSolveOperations(self, time): - super().BeforeSolveOperations(time) + super().BeforeSolveOperations() benchmark.ApplyNodalRotation(time, self.dt, self.spheres_model_part) def BeforePrintingOperations(self, time): diff --git a/applications/StructuralMechanicsApplication/CMakeLists.txt b/applications/StructuralMechanicsApplication/CMakeLists.txt index a107a7aecb4b..39ce4ffce383 100644 --- a/applications/StructuralMechanicsApplication/CMakeLists.txt +++ b/applications/StructuralMechanicsApplication/CMakeLists.txt @@ -31,7 +31,6 @@ set( KRATOS_STRUCTURAL_MECHANICS_APPLICATION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/hyper_elastic_isotropic_neo_hookean_plane_strain_2d.cpp ${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/linear_elastic_orthotropic_2D_law.cpp - ## ELEMENTS #Adding truss element ${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/truss_element_3D2N.cpp diff --git a/applications/StructuralMechanicsApplication/structural_mechanics_application.h b/applications/StructuralMechanicsApplication/structural_mechanics_application.h index 4d605d20d203..9527152fef8b 100644 --- a/applications/StructuralMechanicsApplication/structural_mechanics_application.h +++ b/applications/StructuralMechanicsApplication/structural_mechanics_application.h @@ -372,7 +372,7 @@ class KratosStructuralMechanicsApplication : public KratosApplication const LinearPlaneStress mLinearPlaneStress; const HyperElasticIsotropicNeoHookean3D mHyperElasticIsotropicNeoHookean3D; const HyperElasticIsotropicNeoHookeanPlaneStrain2D mHyperElasticIsotropicNeoHookeanPlaneStrain2D; - const LinearElasticOrthotropic2DLaw mLinearElasticOrthotropic2DLaw; + const LinearElasticOrthotropic2DLaw mLinearElasticOrthotropic2DLaw; ///@} ///@name Private Operators diff --git a/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.cpp b/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.cpp index 2bbcf0383421..4d716bbc1d60 100644 --- a/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.cpp +++ b/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.cpp @@ -39,13 +39,12 @@ namespace Kratos KRATOS_CREATE_VARIABLE( bool, TRUSS_IS_CABLE ) // Beam generalized variables - KRATOS_CREATE_VARIABLE(double, AREA_EFFECTIVE_Y) - KRATOS_CREATE_VARIABLE(double, AREA_EFFECTIVE_Z) - KRATOS_CREATE_VARIABLE(double, INERTIA_ROT_Y) - KRATOS_CREATE_VARIABLE(double, INERTIA_ROT_Z) - KRATOS_CREATE_VARIABLE(Vector, LOCAL_AXES_VECTOR) - KRATOS_CREATE_VARIABLE(bool, LUMPED_MASS_MATRIX) - KRATOS_CREATE_VARIABLE(Vector, LOCAL_INERTIA_VECTOR) + KRATOS_CREATE_VARIABLE( double, AREA_EFFECTIVE_Y ) + KRATOS_CREATE_VARIABLE( double, AREA_EFFECTIVE_Z ) + KRATOS_CREATE_VARIABLE( double, INERTIA_ROT_Y ) + KRATOS_CREATE_VARIABLE( double, INERTIA_ROT_Z ) + KRATOS_CREATE_VARIABLE( Vector, LOCAL_AXES_VECTOR ) + KRATOS_CREATE_VARIABLE( bool, LUMPED_MASS_MATRIX ) // Shell generalized variables KRATOS_CREATE_VARIABLE( Matrix, SHELL_STRAIN ) diff --git a/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.h b/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.h index 1103cf78e08c..710770b6943e 100644 --- a/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.h +++ b/applications/StructuralMechanicsApplication/structural_mechanics_application_variables.h @@ -48,10 +48,10 @@ namespace Kratos KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION, double, MEAN_RADIUS ) KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION, int, SECTION_SIDES ) KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION, Matrix , GEOMETRIC_STIFFNESS ) - KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Vector, LOCAL_AXIS_VECTOR_1) - KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Matrix, LOCAL_ELEMENT_ORIENTATION) - KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,double, ORTHOTROPIC_ORIENTATION_ASSIGNMENT) - KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Vector, ORTHOTROPIC_FIBER_ORIENTATION_1) + KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Vector, LOCAL_AXIS_VECTOR_1) + KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Matrix, LOCAL_ELEMENT_ORIENTATION) + KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,double, ORTHOTROPIC_ORIENTATION_ASSIGNMENT) + KRATOS_DEFINE_APPLICATION_VARIABLE(STRUCTURAL_MECHANICS_APPLICATION,Vector, ORTHOTROPIC_FIBER_ORIENTATION_1) // Truss generalized variables KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,double, TRUSS_PRESTRESS_PK2) @@ -65,7 +65,7 @@ namespace Kratos KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,double, INERTIA_ROT_Z) KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,Vector, LOCAL_AXES_VECTOR) KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,bool, LUMPED_MASS_MATRIX) - KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,Vector, LOCAL_INERTIA_VECTOR) + KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION,Vector, LOCAL_INERTIA_VECTOR) // Shell generalized variables KRATOS_DEFINE_APPLICATION_VARIABLE( STRUCTURAL_MECHANICS_APPLICATION, Matrix, SHELL_STRAIN ) diff --git a/applications/StructuralMechanicsApplication/tests/test_StructuralMechanicsApplication.py b/applications/StructuralMechanicsApplication/tests/test_StructuralMechanicsApplication.py index 300406fff95c..4c24a3183f9f 100644 --- a/applications/StructuralMechanicsApplication/tests/test_StructuralMechanicsApplication.py +++ b/applications/StructuralMechanicsApplication/tests/test_StructuralMechanicsApplication.py @@ -83,9 +83,6 @@ from test_multipoint_contstraints import TestMultipointConstraints as TTestMultipointConstraints from test_multipoint_contstraints import TestMultipointConstraintsTwo as TTestMultipointConstraintsTwo - - - # Nodal damping test from test_nodal_damping import NodalDampingTests as TNodalDampingTests # Spring damper element test @@ -289,9 +286,7 @@ def AssambleTestSuites(): TSprismMembranePatchTests, TSprismBendingPatchTests, TFofi4PointTentnoCableTests, - TFofi4PointTentCableTests, TMembraneQ4PointLoadTests, - TMembraneQ4TrussPointLoadTests, TShellQ4ThickBendingRollUpTests, # TShellQ4ThickDrillingRollUpTests, # FIXME: Needs get up to date TShellT3ThinBendingRollUpTests,