50 lines
1.9 KiB
C++
50 lines
1.9 KiB
C++
#ifndef FESA_ELEMENTS_ELEMENT_FACTORY_H_
|
|
#define FESA_ELEMENTS_ELEMENT_FACTORY_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "fesa/core/status.h"
|
|
#include "fesa/elements/element.h"
|
|
#include "fesa/elements/element_capabilities.h"
|
|
|
|
namespace fesa {
|
|
|
|
class Domain;
|
|
class ElementDefinition;
|
|
|
|
/// @brief Creates checked numerical elements from Domain-owned definitions.
|
|
class ElementFactory {
|
|
public:
|
|
/// @brief Creates the supported runtime kernel for one semantic definition.
|
|
/// @param definition Definition owned by domain for the returned operation.
|
|
/// @param domain Immutable owner of referenced nodes, property, and material.
|
|
/// @return A non-null element or a structured model failure.
|
|
Result<std::unique_ptr<Element>> Create(const ElementDefinition& definition,
|
|
const Domain& domain) const;
|
|
|
|
/// @brief Binds a typed view of an existing stable runtime kernel.
|
|
/// @note Returns null for a different family. The kernel must outlive the
|
|
/// returned adapter and remain at its address; no second kernel is created.
|
|
std::unique_ptr<SolidTrialElement> BindSolidTrial(const Element& kernel) const;
|
|
/// @copydoc BindSolidTrial
|
|
std::unique_ptr<ShellReferenceElement> BindShellReference(
|
|
const Element& kernel) const;
|
|
|
|
private:
|
|
/// @brief Creates one checked B33 runtime candidate.
|
|
Result<std::unique_ptr<Element>> CreateBeam(
|
|
const ElementDefinition& definition, const Domain& domain) const;
|
|
|
|
/// @brief Creates one checked MITC4 runtime candidate.
|
|
Result<std::unique_ptr<Element>> CreateShell(
|
|
const ElementDefinition& definition, const Domain& domain) const;
|
|
|
|
/// @brief Creates one checked three-component C3D8 runtime candidate.
|
|
Result<std::unique_ptr<Element>> CreateSolid(
|
|
const ElementDefinition& definition, const Domain& domain) const;
|
|
};
|
|
|
|
} // namespace fesa
|
|
|
|
#endif // FESA_ELEMENTS_ELEMENT_FACTORY_H_
|