#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/ArrayRef.hpp>
#include <eagle/PhysicalSpace.hpp>
#include <fiber/bundle/Ownership.hpp>
{
Finit();
unlink("outfile.f5");
BP->bindTo("outfile.f5");
Verbose(0) << "Bundle Binder: " << BP->getBinder();
Representation&myCartesianRepresentation = BP[1.0][
"DemoGrid"].makeCartesianRepresentation(3);
Assert(getPrimaryBundle(BP[1.0]));
Assert(getPrimaryBundle(BP[1.0])->isBound());
Assert(getPrimaryBundle(BP[1.0][
"DemoGrid"]));
Assert(getPrimaryBundle(BP[1.0][
"DemoGrid"])->isBound());
Assert(getPrimaryBundle(*BP[1.0][
"DemoGrid"].findVertices() ));
Assert(getPrimaryBundle(*BP[1.0][
"DemoGrid"].findVertices())->isBound());
Assert(getPrimaryBundle(myCartesianRepresentation));
Assert(getPrimaryBundle(myCartesianRepresentation)->isBound());
RefPtr<Field>&Positions = myCartesianRepresentation[ FIBER_POSITIONS ];
Assert(getPrimaryBundle(*Positions));
Assert(getPrimaryBundle(*Positions)->isBound());
Verbose(0) << "Positions field is bound to " << getPrimaryBundle(*Positions)->boundUrl();
{
for(auto I : GridDims)
{
point&P = Coordinates[ I ];
P.x() = I[0]*0.83;
P.y() = I[1]*0.04*I[1];
P.z() = I[2]*0.01*I[2]*I[1];
}
puts("##################### CREATE CREATOR ######################");fflush(stdout);
if (MemBase::Creator_t
CoordinateCreator = Positions->createCreator(Coordinates) )
{
CoordinateCreator->touch();
}
}
#if 1
RefPtr<Field>&Values = myCartesianRepresentation["values"];
{
{
double& value = GridValues[ I ];
value = (I[0]*0.3)*(I[0]*0.3) +
(I[1]*0.2)*(I[0]*0.2) -
(I[2]*0.1)*(I[2]*0.1);
}
if (MemBase::Creator_t
ValueCreator = Values->createCreator(GridValues) )
{
ValueCreator->touch();
}
}
#endif
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
An array reference class, which is a convenience class for reference pointers to multidimensional mem...
Definition ArrayRef.hpp:28
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
The main entity holding all information.
Definition Bundle.hpp:173
A multidimensional index that is automatically a lower-dimensional index via recursion.
Definition MultiIndex.hpp:449
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
StrongPtr< Object, ObjectBase > RefPtr
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2