Skip to content

Commit

Permalink
Merge pull request KratosMultiphysics#868 from KratosMultiphysics/fix…
Browse files Browse the repository at this point in the history
…-history

Fix history
  • Loading branch information
roigcarlo authored Oct 20, 2017
2 parents 92c812e + d3bc043 commit 9a281b7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 34 deletions.
29 changes: 15 additions & 14 deletions applications/DEM_application/python_scripts/main_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@

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()
self.procedures = self.SetProcedures()
self.SetAnalyticParticleWatcher()
self.PreUtilities = PreUtilities()


# Creating necessary directories:
self.main_path = os.getcwd()
problem_name = self.GetProblemTypeFilename()
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion applications/StructuralMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -289,9 +286,7 @@ def AssambleTestSuites():
TSprismMembranePatchTests,
TSprismBendingPatchTests,
TFofi4PointTentnoCableTests,
TFofi4PointTentCableTests,
TMembraneQ4PointLoadTests,
TMembraneQ4TrussPointLoadTests,
TShellQ4ThickBendingRollUpTests,
# TShellQ4ThickDrillingRollUpTests, # FIXME: Needs get up to date
TShellT3ThinBendingRollUpTests,
Expand Down

0 comments on commit 9a281b7

Please sign in to comment.