sandialabs / seacas

The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Other
131 stars 79 forks source link

How to instantiate a transform? #433

Closed spyridon97 closed 7 months ago

spyridon97 commented 7 months ago

In the past, Iotr::Factory was part of Ioss_transform.h.

This has been moved in Iotr_Factory.h

Are we supposed to include Iotr_Factory.h to create a transform such as

    auto transform = std::unique_ptr<Ioss::Transform>(Iotr::Factory::create("offset"));
    transform->set_property("offset", -1);

Or is there another way, such that we don't need to include?

gsjaardema commented 7 months ago

That should be how it is done. You need to include transform/Iotr_Factory.h

The change was made about a year ago:

commit 5fa52564b446a67c7058060ce2ef520a099a98d6
Author: Ben Boeckel <ben.boeckel@kitware.com>
Date:   Wed Oct 26 12:34:44 2022 -0400

    ioss: move Iotr_Factory to its own header

    In the right library of course.
spyridon97 commented 7 months ago

maybe it would be convenient to have a create factory function in ioss_transform.h. which internally would return a Iotr::Factory.

gsjaardema commented 7 months ago

Yes, maybe Ioss::Transform *Ioss::create_transform(const std::string &transform_type)

gsjaardema commented 7 months ago

I will have to think about this some more -- the simple implementation makes Ioss library depend on Iotr library which is the reverse of how it should be... I will look more at Iotr::Factory and see whether it really needs to be in the Iotr library, or whether it could live at the IOSS level (which is where it was at one time...)

spyridon97 commented 7 months ago

Maybe you could have Ioss::TransformFactory like Ioss::IOFactory. And remove Iotr::Factory.

gsjaardema commented 7 months ago

See #434

gsjaardema commented 7 months ago

I tihnk this can be closed. Please reopen if still problems with the fix.