How to Add a New Element (Condition)

From KratosWiki
Revision as of 09:37, 3 May 2012 by Kazem (Talk | contribs)
Jump to: navigation, search

1.Adding & Registeration: In the application's .cpp file of the relating applicationadd new element (i.e. linear_element) as below

mLinearElement2D3N(0, Element::GeometryType::Pointer(new Triangle2D<Node<3>  >
(Element::GeometryType::PointsArrayType(3, Node<3>())))),

2D represents for 2 dimensional and 3N for three-nodded element. In the register section of the same file:

KRATOS_REGISTER_ELEMENT("LinearElement2D3N", mLinearElement2D3N)

2.Including: In the application's .h file simply include header file,

#include "custom_elements/linear_element.h"

add the element as the member variable of the application's class

...class KratosR1StructuralApplication : public KratosApplication
const LinearElement  mLinearElement2D3N;

Trivially, if you are working in Linux there would be a CMakeLists.txt, in application folder, the .cpp file to is to be added inside

...list of files to be build 
Personal tools