Kratos Structure: Basic Components

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "As a library, Kratos intends to help users develop easier and faster their own finite element code, taking advantage of the generic components provided by the Kratos Kernel or th...")
 
Line 7: Line 7:
 
== Object Oriented Design ==
 
== Object Oriented Design ==
  
Kratos follows an object oriented design philosophy,
+
Kratos follows an object oriented design philosophy, which is based on splitting a problem into multiple individual objects and defining their interactions through a common interface. In the case of Kratos, these objects tend to reproduce concepts from the finite element literature when possible, as seen in the following scheme.
 +
 
 +
[[Image:GSMainClasses.jpg]]
 +
 
 +
<tt>Vector</tt>, <tt>Matrix</tt>, and <tt>Quadrature</tt> are
 +
designed by basic numerical concepts. <tt>Node</tt>,
 +
<tt>Element</tt>, <tt>Condition</tt>, and <tt>Dof</tt> are defined
 +
directly from finite element concepts. <tt>Model</tt>,
 +
<tt>Mesh</tt>, and <tt>Properties</tt> are coming from practical
 +
methodology used in finite element modeling completed by
 +
<tt>ModelPart</tt>, and <tt>SpatialContainer</tt>, for organizing
 +
better all data necessary for analysis. <tt>IO</tt>,
 +
<tt>LinearSolver</tt>, <tt>Process</tt>, and <tt>Strategy</tt> are
 +
representing the different steps of finite element program flow.
 +
and finally <tt>Kernel</tt> and <tt>Application</tt> are defined
 +
for library management and defining its interface.
 +
 
 +
These main objects are described below:
 +
 
 +
* '''<tt>Vector</tt>''' Represents the algebraic vector and defines usual operators over vectors.
 +
 
 +
* '''<tt>Matrix</tt>''' Encapsulate matrix and its operators. There are different matrix classes are necessary. The most typical ones are dense matrix and compressed row matrix.
 +
 
 +
* '''<tt>Quadrature</tt>''' Implements the quadrature methods used in finite element method. For example the gaussian integration with different number of integration points.
 +
 
 +
* '''<tt>Geometry</tt>''' Defines a geometry over a list of points or <tt>Node</tt>s and provides from its usual parameter like area or center point to shape functions and coordinate transformation routines.
 +
 
 +
* '''<tt>Node</tt>''' <tt>Node</tt> is a point with additional facilities. Stores the nodal data, historical nodal data, and list of degrees of freedom. It provides also an interface to access all its data.
 +
 
 +
* '''<tt>Element</tt>''' Encapsulates the elemental formulation in one objects and provides an interface for calculating the local matrices and vectors necessary for assembling the global system of equations. It holds its geometry that meanwhile is its array of <tt>Node</tt>s. Also stores the elemental data and interface to access it.
 +
 
 +
* '''<tt>Condition</tt>''' Encapsulates data and operations necessary for calculating the local contributions of <tt>Condition</tt> in global system of equations. Neumann conditions are example '''Condition'''s which can be encapsulated by derivatives of this class.
 +
 
 +
* '''<tt>Dof</tt>''' Represents a degree of freedom (dof). It is a lightweight object which holds the its variable, like <tt>TEMPERATURE</tt>, its state of freedom, and a reference to its value in data structure. This class enables the system to work with different set of dofs and also represents the Dirichlet condition assigned to each dof.
 +
 
 +
* '''<tt>Properties</tt>''' Encapsulates data shared by different <tt>Element</tt>s or <tt>Condition</tt>s. It can stores any type of data and provide a variable base access to them.
 +
 
 +
* '''<tt>Model</tt>''' Stores the whole model to be analyzed. All <tt>Node</tt>s, <tt>Properties</tt>, <tt>Element</tt>s, <tt>Condition</tt>s and solution data. It also provides and access interface to these data.
 +
* '''<tt>ModelPart</tt>''' Holds all data related to an arbitrary part of model. It stores all existing components and data like <tt>Node</tt>s, <tt>Properties</tt>, <tt>Element</tt>s, <tt>Condition</tt>s and solution data related to a part of model and provides interface to access them in different ways.
 +
* '''<tt>Mesh</tt>''' Holds <tt>Node</tt>s, <tt>Properties</tt>, <tt>Element</tt>s, <tt>Condition</tt>s and represents a part of model but without additional solution parameters. It provides access interface to its data.
 +
 
 +
* '''<tt>SpatialContainer</tt>''' Containers associated with spacial search algorithms. This algorithms are useful for finding the nearest <tt>Node</tt> or <tt>Element</tt> to some point or other spacial searches. Quadtree and Octree are example of these containers.
 +
 
 +
* '''<tt>IO</tt>''' Provides different implementation of input output procedures which can be used to read and write with different formats and characteristics.
 +
 
 +
* '''<tt>LinearSolver</tt>''' Encapsulates the algorithms used for solving a linear system of equations. Different direct solvers and iterative solvers can be implemented in Kratos as a derivatives of this class.
 +
 
 +
* '''<tt>Strategy</tt>''' Encapsulates the solving algorithm and general flow of a solving process. Strategy manages the building of equation system and then solve it using a linear solver and finally is in charge of updating the results in the data structure.
 +
 
 +
* '''<tt>Process</tt>''' Is the extension point for adding new algorithms to Kratos. Mapping algorithms, Optimization procedures and many other type of algorithms can be implemented as a new process in Kratos.
 +
 
 +
* '''<tt>Kernel</tt>''' Manages the whole Kratos by initializing different part of it and provides necessary interface to communicate with applications.
 +
 
 +
* '''<tt>Application</tt>''' Provide all information necessary for adding an application to Kratos. A derived class from it is necessary to give kernel its required information like new <tt>Variable</tt>s, <tt>Element</tt>s, <tt>Condition</tt>s, etc.
 +
 
 +
The main intention here was to hide all difficult but common
 +
finite element implementations like data structure and IO
 +
programming from developers.
 +
 
 +
== Multi-Layers Design ==

Revision as of 10:53, 5 May 2012

As a library, Kratos intends to help users develop easier and faster their own finite element code, taking advantage of the generic components provided by the Kratos Kernel or the features implemented in the different applications. As such, in the design of Kratos, the needs of three different types of potential users where considered:

  • Finite Element Developers These developers are considered to be more expert in FEM, from the physical and mathematical points of view, than C++ programming. For this reason, Kratos has to meet their needs without involving them in advanced programming concepts.
  • Application Developers These users are less interested in finite element programming and their programming knowledge may vary from very expert to higher than basic. They may use not only Kratos itself but also any other applications provided by finite element developers, or other application developers. Developers of optimization programs or design tools are the typical users of this kind.
  • Package Users Engineers and designers are a third group of users of Kratos. They use Kratos and its applications to model and solve their problem as a closed package, without getting involved in its implementation details. For these users Kratos has to provide a flexible external interface to enable them use different features of Kratos without requiring them to modify its internal structure.

Object Oriented Design

Kratos follows an object oriented design philosophy, which is based on splitting a problem into multiple individual objects and defining their interactions through a common interface. In the case of Kratos, these objects tend to reproduce concepts from the finite element literature when possible, as seen in the following scheme.

GSMainClasses.jpg

Vector, Matrix, and Quadrature are designed by basic numerical concepts. Node, Element, Condition, and Dof are defined directly from finite element concepts. Model, Mesh, and Properties are coming from practical methodology used in finite element modeling completed by ModelPart, and SpatialContainer, for organizing better all data necessary for analysis. IO, LinearSolver, Process, and Strategy are representing the different steps of finite element program flow. and finally Kernel and Application are defined for library management and defining its interface.

These main objects are described below:

  • Vector Represents the algebraic vector and defines usual operators over vectors.
  • Matrix Encapsulate matrix and its operators. There are different matrix classes are necessary. The most typical ones are dense matrix and compressed row matrix.
  • Quadrature Implements the quadrature methods used in finite element method. For example the gaussian integration with different number of integration points.
  • Geometry Defines a geometry over a list of points or Nodes and provides from its usual parameter like area or center point to shape functions and coordinate transformation routines.
  • Node Node is a point with additional facilities. Stores the nodal data, historical nodal data, and list of degrees of freedom. It provides also an interface to access all its data.
  • Element Encapsulates the elemental formulation in one objects and provides an interface for calculating the local matrices and vectors necessary for assembling the global system of equations. It holds its geometry that meanwhile is its array of Nodes. Also stores the elemental data and interface to access it.
  • Condition Encapsulates data and operations necessary for calculating the local contributions of Condition in global system of equations. Neumann conditions are example Conditions which can be encapsulated by derivatives of this class.
  • Dof Represents a degree of freedom (dof). It is a lightweight object which holds the its variable, like TEMPERATURE, its state of freedom, and a reference to its value in data structure. This class enables the system to work with different set of dofs and also represents the Dirichlet condition assigned to each dof.
  • Properties Encapsulates data shared by different Elements or Conditions. It can stores any type of data and provide a variable base access to them.
  • Model Stores the whole model to be analyzed. All Nodes, Properties, Elements, Conditions and solution data. It also provides and access interface to these data.
  • ModelPart Holds all data related to an arbitrary part of model. It stores all existing components and data like Nodes, Properties, Elements, Conditions and solution data related to a part of model and provides interface to access them in different ways.
  • Mesh Holds Nodes, Properties, Elements, Conditions and represents a part of model but without additional solution parameters. It provides access interface to its data.
  • SpatialContainer Containers associated with spacial search algorithms. This algorithms are useful for finding the nearest Node or Element to some point or other spacial searches. Quadtree and Octree are example of these containers.
  • IO Provides different implementation of input output procedures which can be used to read and write with different formats and characteristics.
  • LinearSolver Encapsulates the algorithms used for solving a linear system of equations. Different direct solvers and iterative solvers can be implemented in Kratos as a derivatives of this class.
  • Strategy Encapsulates the solving algorithm and general flow of a solving process. Strategy manages the building of equation system and then solve it using a linear solver and finally is in charge of updating the results in the data structure.
  • Process Is the extension point for adding new algorithms to Kratos. Mapping algorithms, Optimization procedures and many other type of algorithms can be implemented as a new process in Kratos.
  • Kernel Manages the whole Kratos by initializing different part of it and provides necessary interface to communicate with applications.
  • Application Provide all information necessary for adding an application to Kratos. A derived class from it is necessary to give kernel its required information like new Variables, Elements, Conditions, etc.

The main intention here was to hide all difficult but common finite element implementations like data structure and IO programming from developers.

Multi-Layers Design

Personal tools
Categories