[Kratos] Write element results in gid

Pablo Becker pbecker en cimne.upc.edu
Jue Jun 11 19:38:26 CEST 2015


Hello Victor.
First you must add the printing function to your element

   //TO PRINT ELEMENTAL VARIABLES (ONLY ONE GAUSS POINT PER ELEMENT)
    void FluidPhasePFEM22D::GetValueOnIntegrationPoints(const
Variable<double>& rVariable,
            std::vector<double>& rValues,
            const ProcessInfo& rCurrentProcessInfo)
{
if (rVariable == VISCOSITY)
{
// Set output vector (for a single integration point)
rValues.resize(1, false);
rValues[0]=this->GetValue(VISCOSITY);
}
else if (rVariable == TAU)
{
// Set output vector (for a single integration point)
rValues.resize(1, false);
rValues[0]=this->GetValue(TAU);
}
 else // Default behaviour (returns elemental data)
{
rValues.resize(1, false);
}
 }



and then, from python, the command is :

gid_io.PrintOnGaussPoints(TAU,model_part,time)

Hope that helps,

Pablo

On 11 June 2015 at 18:14, Víctor B <victorbzs en yahoo.es> wrote:

> Hi everyone,
>
> How I could write in the gid output from kratos variables by element?. I
> mean variables from the element database... I've tried with
> writeElementalResults but it doesn't work (I found a document from the
> internet with that method: writeElementalResults
> <http://www.tdx.cat/bitstream/handle/10803/6868/10_PD_Capitol09_pp_205_258.pdf?sequence=10>
> )
>
>
> Thanks in advanced
>
> Best
>
>
> _______________________________________________
> Kratos mailing list
> Kratos en listas.cimne.upc.edu
> http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/kratos
>
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://listas.cimne.upc.edu/pipermail/kratos/attachments/20150611/3e053996/attachment.htm 


Más información sobre la lista de distribución Kratos