#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/ArrayRef.hpp>
#include <fiber/field/RegularlyFragmentedField.hpp>
#include <fiber/field/UniformCartesianArray.hpp>
#include <fiber/grid/types/RegularlyFragmentedGrid.hpp>
#include <fiber/field/Cell.hpp>
{
Finit();
Grid&myGrid = BP[0.0][
"DemoGrid"];
Skeleton&VertexSkeleton = myGrid[VertexSkeletonID];
Skeleton&CellSkeleton = myGrid[CellSkeletonID];
VertexRep [FIBER_POSITIONS] = VertexF;
point start = {0,0,0};
RefPtr<FragmentID> ID1 = VertexF->getFragmentID ({0,0,0});
VertexF->setPersistentData(VertexMem1,ID1);
start = {2,1,0};
dims = {3,2,1};
RefPtr<FragmentID> ID2 = VertexF->getFragmentID ({1,0,0});
VertexF->setPersistentData(VertexMem2,ID2);
#if 1
RepCellToVertex [FIBER_POSITIONS] = CellToVertexF;
(*CellMem1)[{0,0,0}] = 10.2;
(*CellMem1)[{1,0,0}] = 11.2;
RefPtr<FragmentID> IDa = CellToVertexF->getFragmentID ({0,0,0});
CellToVertexF->setPersistentData(CellMem1,IDa);
(*CellMem2)[{0,0,0}] = 20.2;
(*CellMem2)[{1,0,0}] = 21.2;
RefPtr<FragmentID> IDb = CellToVertexF->getFragmentID ({1,0,0});
CellToVertexF->setPersistentData(CellMem2,IDb);
#endif
BP->
save(
"061_RegularlyFragmentedFieldWithHigherTopo.f5");
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 auto end(_Container &__cont) -> decltype(__cont.end())
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
A generic Chart object that may be used to cast information of points within a manifold to numerical ...
Definition Chart.hpp:91
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
RefPtr< Chart > makeCartesianChart(const string &name={}, uint16_t epsg_code=0)
Create a cartesian chart here, if not existent yet.
Definition Grid.cpp:114
Class for N-dimensional MultiArrays with MemCore memory management.
Definition MemArray.hpp:34
A multidimensional index that is automatically a lower-dimensional index via recursion.
Definition MultiIndex.hpp:449
A convenience class for optimized handling of fields that are fragmented in a regular manner (n-dimen...
Definition RegularlyFragmentedField.hpp:27
static RefPtr< RegularlyFragmentedField > newField(const MultiIndex< DIMS > &FragmentNumbers, const WeakPtr< Field > &SimilarField, const string &FragmentNamePrefix="RegularFragment")
Create a new regularly fragmented Field from an existing Field that is sufficiently fragmented.
Definition RegularlyFragmentedField.hpp:145
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
A Skeleton is a set of Representation object, each of them accessed by an Representer object.
Definition Skeleton.hpp:102
StrongPtr< Object, ObjectBase > RefPtr
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
static RegularlyFragmentedGrid create(Grid &myGrid, const RefPtr< RegularlyFragmentedField< VertexDims > > &VertexPositions, const SkeletonID &FragmentedSkeletonID)
Create a fragment skeleton on the given Grid.
Definition grid/types/RegularlyFragmentedGrid.hpp:169