#include <fiber/bundle/Bundle.hpp>
#include <fiber/bundle/StorageTransformations.hpp>
#include <fiber/finit/FinitAPI.h>
#include <memcore/Console.hpp>
int main(
int argc,
const char**argv)
{
Finit();
string InFile = "065_F5moveSkeleton_InputFile.f5";
if (argc>1)
{
BP->bindTo(InFile);
return 0;
}
{
Grid&myGrid = BPIn[0.0][
"TestGrid"];
RefPtr<Field> PositionsF = myGrid[FIBER_POSITIONS];
std::fill(Mem->myChunk()->get_vector().begin(),
Mem->myChunk()->get_vector().end(),
point{1.,0.,2.} );
Console() <<
"Mem size: " << Mem->nElements();
PositionsF->setPersistentData(Mem);
{
std::fill(Mem->myChunk()->get_vector().begin(),
Mem->myChunk()->get_vector().end(), 42.0);
myGrid["Values"]->setPersistentData(Mem);
}
Console() <<
"Save file " << InFile;
}
string OutFile = "065_F5moveSkeleton_OutFile.f5";
{
BP->bindToNew(OutFile);
bool success;
BP->sync();
RefPtr<Grid> myGrid = BP[0.0]("TestGrid");
if (!myGrid)
{
return 1;
}
const int PointSkeletonDims = 3;
SkeletonID mySkeletonIDCoarse(PointSkeletonDims,0);
RefPtr<Skeleton> mySkeletonFine = (*myGrid)(mySkeletonIDCoarse);
if (!mySkeletonFine)
{
Console() <<
"Cannot find root (finest) skeleton" ;
return false;
}
mySkeletonFine->setIsotropicRefinement(10);
}
return 0;
}
int main()
Demonstrates minimal usage of the FiberLib Create Bundle, insert a time slice, and safe it to a file.
Definition 010-SimpleSave.cpp:13
constexpr void fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
int save(const string &url, const RefPtr< LoaderProgress > &SaveProgress=nullptr, const RefPtrStorageTransformations &ST=nullptr)
Definition Bundle.cpp:1142
The main entity holding all information.
Definition Bundle.hpp:173
static RefPtr< Bundle > load(bool &success, const RefPtr< LoaderParameters > &ld, const RefPtr< Bundle > &B=nullptr)
Load a Bundle object or append new data to an existing Bundle.
Definition Bundle.cpp:139
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2