How to print values on gauss points

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Following steps are necessary to be abale to print values on '''Gauss points''': gid_io.PrintOnGaussPoints(CONTACT_STICK, self.model_part, time);")
 
Line 1: Line 1:
 
Following steps are necessary to be abale to print values on '''Gauss points''':
 
Following steps are necessary to be abale to print values on '''Gauss points''':
  
gid_io.PrintOnGaussPoints(CONTACT_STICK, self.model_part, time);
+
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));
 +
}
 +
    }
 +
 
 +
}

Revision as of 08:25, 3 May 2012

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)); } }

}

Personal tools
Categories