Skip to content

Re: How to use a SuperIdentity3D pointer to pass between two time step

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics How to use a SuperIdentity3D pointer to pass between two time step Re: How to use a SuperIdentity3D pointer to pass between two time step

#2647
steed188
Participant

Dear mathias,
Yeah, I’ve tried SuperData3D. But it seems I did wrong.
For example, I defined a SuperData3D named “Store_VecData” in the main function, then assume that we accumulate the velocity to it every step and then write it to VTK files.
I did it like below.

Code:
void main(){
….
//define a SuperData
SuperData3D<T,T> Store_VecData ( cuboidGeometry, loadBalancer, 2, 3 );
….
getResults(…,Store_VecData,…)
}

void getResults(…,SuperData3D<T,T>& Store_VecData,…){
SuperLatticePhysVelocity3D<T,DESCRIPTOR>velocity_lattice( sLattice, converter );
SuperIdentity3D<double,double> phyVelocity(velocity_lattice);

// if iT is 1 then assign the initial value to Store_VecData;
if (iT == 1 ){
SuperData3D <T,T> temp_Data (phyVelocity);
Store_VecData = temp_Data;
}

//Othewise I want extract SuperF from SuperData and add
// this time ‘s value, store it to SuperData again.
if (iT > 1){
SuperDataF3D <T,T> last_Data ( Store_VecData );
SuperData3D <T,T> this_Data ( last_Data + phyVelocity );
Store_VecData = this_Data;
}

//write SuperData to VTKfiles
SuperDataF3D <T,T> toVTK ( Store_VecData );
vtmWriterTS.write( toVTK ,iT );
}

Well. I didn’t work. Always Segmentation fault. 😀
Would you like point out the fault?

By the way, thank you for noticing that the spring school. I’ll discuss it with my prof.

steed188.