Skip to content

Re: Operate the whole vector field


Dear albert.mink,
Thank you for your example that I learned much from it. But I have still some problems.

1. how can I assign a AnalyticalF with another? I did like below, but it went wrong.

AnalyticalIdentity3D<T,T> * aMeanVelocity; //define an empty AnalyticalF
AnalyticalIdentity3D<T,T> Calc_Temp1( ……);
AnalyticalIdentity3D<T,T> Calc_Temp2( ……);
aMeanVelocity = new AnalyticPlus3D<T,T>( Calc_Temp1 , Calc_Temp2); //assign the AnalyticalF

It seems that I could not simply assign it using AnalyticalF_A=AnalyticalF_B

2. As I calculated a new kind of velocity, how can I write it to the same VTK file that the normal velocity is also written. Because they have the same variation name in VTK files causing error.
I did like below.

SuperLatticePhysVelocity3D<T, DESCRIPTOR> velocity( sLattice, converter ); //ordinary velocity like other cases
SuperLatticeFfromAnalyticalF3D<T,DESCRIPTOR> MeanVel( aMeanVelocity,sLattice,superGeometry ); //new kind of mean velocity calculated from AnalyticalF
vtmWriter.addFunctor( velocity ); //write this time’s instantaneous velocity to VTK
vtmWriter.addFunctor( MeanVel ); //write mean velocity to VTK
vtmWriter.write( iT );

It Seems wrong? how can I write two velocity into one VTK file ? Because they own the same name when written to VTK.

Thank you