Skip to content

Re: Uploading data

#2970
kolotinsky
Participant

Dear Fabian,
I have changed my vti data from Appended to Ascii:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<VTKFile type=”ImageData” version=”1.0″ byte_order=”LittleEndian” header_type=”UInt64″>
<ImageData WholeExtent=”-1 50 -1 50 -1 50″ Origin=”0 0 0″ Spacing=”1 1 1″>
<Piece Extent=”-1 50 -1 50 -1 50″>
<PointData>
<DataArray type=”Float64″ Name=”ForceField” NumberOfComponents=”3″ format=”ascii” RangeMin=”0.00014142135266500606″ RangeMax=”0.00014142135266500606″>
0.000099999997474 0.000099999997474 0 0.000099999997474 0.000099999997474 0
0.000099999997474 0.000099999997474 0 0.000099999997474 0.000099999997474 0
……………………………………………………………………………………………………………………………………………
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Now vtiReader reads my data correctly, but on the step “define external field” I have segmentation fault in case of such
definition:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<T> spacing(3, T());
spacing[0] = 1;
spacing[1] = 1;
spacing[2] = 1;
olb::BlockVTIreader3D< T, BaseType > datareader(“forcefield.vti”,”ForceField”);
BlockDataF3D<T, BaseType> blockfield(datareader.getBlockData());
AnalyticalF3D<T,T>* field;
field = new SpecialAnalyticalFfromBlockF3D<T,BaseType>(blockfield, datareader.getCuboid(), spacing);
sLattice.defineExternalField( superGeometry, 1,
DESCRIPTOR<T>::ExternalField::forceBeginsAt,
DESCRIPTOR<T>::ExternalField::sizeOfForce, *field );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I also tried to define force field such way:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
olb::BlockVTIreader3D< T, BaseType > datareader(“forcefield.vti”,”ForceField”);
BlockDataF3D<T, BaseType> blockfield(datareader.getBlockData());
AnalyticalF3D<T,T>* field;
field = new AnalyticalFfromBlockF3D<T,BaseType>(blockfield, datareader.getCuboid(), 0);
sLattice.defineExternalField( superGeometry, 1,
DESCRIPTOR<T>::ExternalField::forceBeginsAt,
DESCRIPTOR<T>::ExternalField::sizeOfForce, *field );
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

In this case I don’t get segmentation fault, but my system’s behaviour is wrong. To find out if the external field was written correctly I generated file contained external field using SuperVtmWriter3D:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SuperVTMwriter3D<T> vtmWriter( “ionwake3d” );

SuperLatticeExternalField3D<T, DESCRIPTOR> force( sLattice, DESCRIPTOR<T>::ExternalField::forceBeginsAt,
DESCRIPTOR<T>::ExternalField::sizeOfForce );
vtmWriter.addFunctor( force );
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

This generated file doesn’t math up with uploaded:

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<VTKFile type=”ImageData” version=”1.0″ byte_order=”LittleEndian” header_type=”UInt64″>
<ImageData WholeExtent=”-1 50 -1 50 -1 50″ Origin=”0 0 0″ Spacing=”1 1 1″>
<Piece Extent=”-1 50 -1 50 -1 50″>
<PointData>
<DataArray type=”Float32″ Name=”externalField” NumberOfComponents=”3″ format=”ascii” RangeMin=”0″ RangeMax=”18.759683655122647″>
0 0 0 0 0 0
0.26010000705718994 0.26010000705718994 0 0.5202000141143799 0.5202000141143799 0
0.780299961566925 0.780299961566925 0 1.0404000282287598 1.0404000282287598 0
1.3004999160766602 1.3004999160766602 0 1.56059992313385 1.56059992313385 0
……………………………………………………………………………………………………………………………………………………………..

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I think it is also important to say a few words about my system. Now I’m using uniform 50*50*50 grid with periodic boundary conditions.

By the way , is it comfortable for you to communicate via email or any social network? It will allow me to describe the problem in more details and attach required files. I suppose it will make our dialog more effective.
If yes this is my mail address: kolotinsky.daniil1998@gmail.com

Sincerely,
Daniil Kolotinsky