How to print values on Gauss points

From KratosWiki
Revision as of 08:35, 3 May 2012 by Kazem (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Following steps are necessary to be abale to print values on Gauss points:

1. Call PrintOnGaussPoints function of the gid_io with the variable that you want to see, i.e CONTACT_STICK, to the python file

 gid_io.PrintOnGaussPoints(CONTACT_STICK, self.model_part, time);

Note that the variable must be a double, a vector of doubles or a Matrix of doubles.

2. This function in his turn calls a function inside your element that is called GetValueOnIntegrationPoints.

This is an standard function of class of element and has 3 representatives for double, vector of doubles and Matrix of doubles.

One example of it can be found as ,

	void PfemContactElement3D::GetValueOnIntegrationPoints(const Variable<double>& rVariable, std::vector<double>& rValues, const ProcessInfo& rCurrentProcessInfo) {
       if (rVariable == CONTACT_STICK){
       for (unsigned int PointNumber = 0; PointNumber < 1; PointNumber++) {
       rValues[PointNumber] = double(this->GetValue(IS_CONTACT_MASTER));}}}

Here rVariable can be any registered variable of KRATOS. rValues is always a vector that has the length of the number of Gauss points in each element. This vector is filled as is desired and then its values is printed in GID through the function PrintOnGaussPointspresented in step 1.

Personal tools