-
Notifications
You must be signed in to change notification settings - Fork 245
Solving strategies
This tutorial explains the top-level python layer of Kratos and how to use it. It is based on the previous tutorial of the high-rise building (structural case). The final files can be retrieved here.
The AnalysisStage has replaced what was previously done in the MainKratos-Script: Plugging together and combining the individual components that are necessary for performing a simulation in a particular application.
This means that this is the place to do the user-scripting, which was previously done in the MainScript. This is achieved by deriving a user-defined AnalysisStage based on the AnalysisStage from the application that is used, e.g. StructuralMechanicsAnalysis
or FluidDynamicsAnalysis
.
The big advantage is that the only the functions, which are needed for the user-scripting, will be overridden. This way the if something changes in the baseclass, the changes are automatically used.
More information can be found in the description of the AnalysisStage.
The tasks for this part of the tutorial are:
- Modifying the thickness of the structure
- Printing the reaction forces on the fixed end of the structure.
- Creating point-load conditions, which are used later to change the way the loading is applied on the structure.
Start by checking the functions of the AnalysisStage for suitable places to perform the above tasks.
For a description of what a process is and how we are going to use it to write a custom process, please read this entry in the Wiki first.
As opposed to defining a custom AnalysisStage, another way of printing the reaction-forces is to define a custom process. The link above contains a template for a process defined in python.
Tasks:
- use the AnalysisStage from above to change the loading from line-loads to point-loads using the following process:
assign_vector_variable_process
- create a custom process for printing the reactions and add it to the simulation.
The PythonSolver
is used inside the AnalysisStage, it is responsible for solving the "physics" of the problem. A detailed list of functionalities can be found in the Wiki.
Writing a custom solver is an advanced usecase, which is not covered in this tutorial. An example can be found in the Wiki.
This part of the tutorial aims to modify the settings of the solver, which can be found in ProjectParametrs.json
under "solver_settings".
Helpful advice: using "wrong" settings on purpose will print hte admissible settings that are available.
- Getting Kratos (Last compiled Release)
- Compiling Kratos
- Running an example from GiD
- Kratos input files and I/O
- Data management
- Solving strategies
- Manipulating solution values
- Multiphysics
- Video tutorials
- Style Guide
- Authorship of Kratos files
- Configure .gitignore
- How to configure clang-format
- How to use smart pointer in Kratos
- How to define adjoint elements and response functions
- Visibility and Exposure
- Namespaces and Static Classes
Kratos structure
Conventions
Solvers
Debugging, profiling and testing
- Compiling Kratos in debug mode
- Debugging Kratos using GDB
- Cross-debugging Kratos under Windows
- Debugging Kratos C++ under Windows
- Checking memory usage with Valgind
- Profiling Kratos with MAQAO
- Creating unitary tests
- Using ThreadSanitizer to detect OMP data race bugs
- Debugging Memory with ASAN
HOW TOs
- How to create applications
- Python Tutorials
- Kratos For Dummies (I)
- List of classes and variables accessible via python
- How to use Logger
- How to Create a New Application using cmake
- How to write a JSON configuration file
- How to Access DataBase
- How to use quaternions in Kratos
- How to do Mapping between nonmatching meshes
- How to use Clang-Tidy to automatically correct code
- How to use the Constitutive Law class
- How to use Serialization
- How to use GlobalPointerCommunicator
- How to use PointerMapCommunicator
- How to use the Geometry
- How to use processes for BCs
- How to use Parallel Utilities in futureproofing the code
- Porting to Pybind11 (LEGACY CODE)
- Porting to AMatrix
- How to use Cotire
- Applications: Python-modules
- How to run multiple cases using PyCOMPSs
- How to apply a function to a list of variables
- How to use Kratos Native sparse linear algebra
Utilities
Kratos API
Kratos Structural Mechanics API