| 1 |
// Copyright(C) 1999-2022, 2024 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#pragma once |
| 8 |
|
| 9 |
#include "Ioss_Transform.h" // for Transform, Factory |
| 10 |
#include "Ioss_TransformFactory.h" |
| 11 |
#include "Ioss_VariableType.h" // for VariableType |
| 12 |
#include <stddef.h> |
| 13 |
#include <string> // for string |
| 14 |
|
| 15 |
#include "iotr_export.h" |
| 16 |
|
| 17 |
namespace Ioss { |
| 18 |
class Field; |
| 19 |
} // namespace Ioss |
| 20 |
|
| 21 |
namespace Iotr { |
| 22 |
|
| 23 |
class IOTR_EXPORT Tensor_Factory : public Ioss::TransformFactory |
| 24 |
{ |
| 25 |
public: |
| 26 |
static const Tensor_Factory *factory(); |
| 27 |
|
| 28 |
private: |
| 29 |
Tensor_Factory(); |
| 30 |
IOSS_NODISCARD Ioss::Transform *make(const std::string &type) const override; |
| 31 |
}; |
| 32 |
|
| 33 |
class IOTR_EXPORT Tensor : public Ioss::Transform |
| 34 |
{ |
| 35 |
friend class Tensor_Factory; |
| 36 |
enum TranType { |
| 37 |
INVALID, |
| 38 |
TRACE, |
| 39 |
SPHERICAL, |
| 40 |
DEVIATOR, |
| 41 |
MAGNITUDE, |
| 42 |
INVARIANTS, |
| 43 |
INVARIANT1, |
| 44 |
INVARIANT2, |
| 45 |
INVARIANT3 |
| 46 |
}; |
| 47 |
|
| 48 |
public: |
| 49 |
IOSS_NODISCARD const Ioss::VariableType * |
| 50 |
output_storage(const Ioss::VariableType *in) const override; |
| 51 |
IOSS_NODISCARD size_t output_count(size_t in) const override; |
| 52 |
|
| 53 |
protected: |
| 54 |
explicit Tensor(const std::string &type); |
| 55 |
|
| 56 |
bool internal_execute(const Ioss::Field &field, void *data) override; |
| 57 |
|
| 58 |
private: |
| 59 |
TranType type_; |
| 60 |
}; |
| 61 |
} // namespace Iotr |