Delete

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "= How to use the PaStiX solver in Kratos = The KratosMultiphysics provides a method to automate as much as possible the process of make your application derivable in windows. ...")
 
(How to use the PaStiX solver in Kratos)
Line 1: Line 1:
= How to use the PaStiX solver in Kratos =
 
  
The
 
 
KratosMultiphysics provides a method to automate as much as possible the process of make your application derivable in windows.
 
 
There are only a couple small things that you need to take into account:
 
 
== Define you application name ==
 
 
The first thing you need to do is to indicate the compiler that you are going to allow the application to be derived.
 
This is done by defining the name of your application with the value "EXPORT,API" in the '''CMakeLists.txt''' file.
 
This is step is also mandatory if you want to make derivable any class in your application, even though it is not the application itself.
 
 
Add the following line in the file '''CMakeLists.txt''' of your application:
 
 
  set_target_properties(KratosFooApplication PROPERTIES COMPILE_DEFINITIONS "FOO_APPLICATION=EXPORT,API")
 
 
== Export your variables ==
 
 
In order to make your variables visible, you will need to change its declaration with the define name from the step 1.
 
We provide a couple of replacements for do that:
 
 
KRATOS_DEFINE_VARIABLE
 
KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS
 
 
will become:
 
 
KRATOS_DEFINE_APPLICATION_VARIABLE
 
KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS
 
 
For example:
 
 
KRATOS_DEFINE_VARIABLE(int, VAR_1)
 
 
will become
 
 
KRATOS_DEFINE_APPLICATION_VARIABLE(FOO_APPLICATION, int, VAR_1)
 
 
== Export your classes ==
 
 
Finally you will also need to indicate which classes are available to be used from other applications.
 
In order to do it you will need to use the  ''KRATOS_API()'' macro with the define name of your applications
 
in the declaration of the class.
 
 
For example
 
 
  class myclass() {
 
  }
 
 
will become:
 
 
  class KRATOS_API(FOO_APPLICATION) myclass() {
 
  }
 
 
If your class depends on a template parameter, you will also need to instantiate such class, as no code exists in compile time and otherwise will be impossible to export:
 
 
 
For instance, if you want to use class ''myclass'' with '''double''':
 
 
  temaplte<class T>
 
  class myclass() {
 
    ...
 
  };
 
 
becomes
 
 
  temaplte<class T>
 
  class KRATOS_API(FOO_APPLICATION) myclass() {
 
    ...
 
  };
 
 
 
  ...
 
 
 
  template class KRATOS_API(FOO_APPLICATION) myclass<double>;
 

Revision as of 14:21, 7 February 2017

Personal tools
Categories