writing f3d file

38 views
Skip to first unread message

Grace Lee

unread,
Oct 17, 2011, 2:11:31 PM10/17/11
to Field3D dev
When I run the snippet of code below (which btw is directly from f3d
documentation), I get this error : bool
Field3D::v1_1::writeFieldMapping(hid_t,
boost::intrusive_ptr<Field3D::v1_1::FieldMapping>): Assertion `io !=
0' failed.

// Create a scalar field to store a levelset
DenseField<float>::Ptr scalarField(new DenseField<float>);
scalarField->setSize(V3i(50, 50, 50));
scalarField->clear(1.0f);
scalarField->name = "character_head";
scalarField->attribute = "levelset";

// Note that the template type for writeVectorLayer<> is the
template type
// of the vector, not the vector type itself.
Field3DOutputFile out;
out.create("debugf3d.f3d");
out.writeScalarLayer<float>(scalarField);

I'm not sure why it's generating this error. Have you seen this error
before?

Thanks

Grace Lee

Magnus Wrenninge

unread,
Oct 17, 2011, 2:28:38 PM10/17/11
to field...@googlegroups.com
Did you call initIO()? It might be that the standard IO classes
haven't yet been registered. I'll add a note for us to print a better
error message when that happens.

Magnus

> --
> You received this message because you are subscribed to the Google Groups "Field3D dev" group.
> To post to this group, send email to field...@googlegroups.com.
> To unsubscribe from this group, send email to field3d-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/field3d-dev?hl=en.
>
>

Grace Lee

unread,
Oct 17, 2011, 4:20:49 PM10/17/11
to Field3D dev
Hi Magnus,

Thanks for answering my question. The error is now gone thanks to your
suggestion.

Happy,

Grace Lee

On Oct 17, 11:28 am, Magnus Wrenninge <magnus.wrenni...@gmail.com>
wrote:
> Did you call initIO()? It might be that the standard IO classes
> haven't yet been registered. I'll add a note for us to print a better
> error message when that happens.
>
> Magnus
>
Reply all
Reply to author
Forward
0 new messages