Author Topic: Trouble with first tutorials  (Read 647 times)

tsvilans

  • Newbie
  • *
  • Posts: 4
Trouble with first tutorials
« on: May 18, 2016, 12:15:45 PM »
Hi,

I am very new at this, so please forgive my lack of skill!

I've installed Kratos on a Windows x64 machine by downloading it through GiD. I've tried going through the tutorials but am receiving some errors when following the text exactly. Are they up-to-date with the newest version of Kratos?

Here is the Python code I'm using, from the beginner tutorials:

Code: [Select]
def main():
structure_model_part = ModelPart("StructurePart")

structure_model_part.AddNodalSolutionStepVariable(DISPLACEMENT)
structure_model_part.AddNodalSolutionStepVariable(FORCE)

model_part_io_structure = ModelPartIO("C:/Users/tsvi/Desktop/kratos")
model_part_io_structure.ReadModelPart(structure_model_part)

structure_model_part.SetBufferSize(3)
mesh = structure_model_part.GetMesh()
printEverything(mesh, structure_model_part)

#### INIT SOLVER
#### SETTING UP SOLVER

structure_model_part.Properties[1].SetValue(CONSTITUTIVE_LAW, LinearElasticPlaneStrain2DLaw())

rotation_dof = False
import inspect
import solid_mechanics_python_solver
inspect.getmembers(solid_mechanics_python_solver, predicate=inspect.ismethod)

solid_mechanics_python_solver.AddDofs(structure_model_part, rotation_dof)

domain_size = 2
echo_level = 0
solver = solid_mechanics_python_solver.MechanicalSolver(structure_model_part, domain_size)

solver.ReformDofSetAtEachStep = True
solver_type = "StaticSolver" # other choices: DynamicSolver, RelaxedDynamicSolver
problem_type = "Mechanical"
linesearchflag = False

load_restart = False
solver.Initialize()

solver.Solve()

mesh = structure_model_part.GetMesh()

This fails with the error:

Code: [Select]
NameError: global name 'STABILIZATION_FACTOR' is not defined
Am I missing a reference? A wrong namespace? I would really appreciate any help to get on my feet with Kratos! I am doing research into the design and fabrication of laminated timber assemblies and would like to eventually run some structural simulations that can model the anisotropic properties of timber laminates.

Much thanks!

Tom

pooyan

  • Global Moderator
  • Newbie
  • *****
  • Posts: 33
Re: Trouble with first tutorials
« Reply #1 on: May 18, 2016, 08:43:44 PM »
Dear Tom

For the installations we are actualizing the configure files for Visual Studio 2015. Also the tutorial became old due to some recent changes before next release. So please give us few days to update them again.

Sorry for inconveniences,

tsvilans

  • Newbie
  • *
  • Posts: 4
Re: Trouble with first tutorials
« Reply #2 on: May 18, 2016, 09:33:29 PM »
No worries, I've since built Kratos from source instead of using the GiD package, so I'll have a clean slate.

If there is any snippet of code that works with the new version, I would be really happy to take a look at it to start learning!

pooyan

  • Global Moderator
  • Newbie
  • *****
  • Posts: 33
Re: Trouble with first tutorials
« Reply #3 on: June 20, 2016, 02:03:43 PM »
We have updated the python section of the tutorials. Can you please check it again?

Bests