-
Notifications
You must be signed in to change notification settings - Fork 249
Python Script Tutorial: Generating New Modelparts
ModelParts
are the essential data structure to hold FEM objects in Kratos.
Since the "physics" of a problem is provided by the Element
and Condition
which implement it, in order to describe a new physical problem one should provide a new ModelPart
describing the connectivity but also made of the relevant element technology.
In Kratos, essentially all of the FEM objects (Nodes
, Elements
, Conditions
, Properties
, ProcessInfo
) are managed by shared pointers, and can hence have multiple owners. This mean in the practice that a given, say, Node
may belong at the same time to multiple ModelParts.
A typical use case is that in which multiple physical problems should be solved on a single discretization of the problem. This is the case for example of the Fluid-Thermal problem that we will describe at the end of the tutorial. Kratos has a special Modeler
named ConnectivityPreserveModeler
that fills a modelpart by preserving the same connectivity as in the source model part while changing the element technology.
The resultant modelpart is a "free standing" root modelpart, completely independent of the original one. Nevertheless it shares:
- Pointers to the same nodes
- Same
ProcessInfo
- Same
Properties
- Same
Tables
as in the source modelpart.
The difference thus lays in the Element type being employed, which substitute in the new modelpart the element of the old modelpart with a new element implementing the desired physics.
The usage of the modeler is as follows:
modeler = KratosMultiphysics.ConnectivityPreserveModeler()
modeler.GenerateModelPart(self.main_model_part, self.thermal_model_part, "Element2D3N", "Condition2D2N")
- 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