60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "fesa/Core/Types.hpp"
|
|
|
|
#include <array>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace fesa {
|
|
|
|
enum class Dof : int { UX = 0, UY = 1, UZ = 2, RX = 3, RY = 4, RZ = 5 };
|
|
|
|
inline std::array<Dof, 6> allDofs() {
|
|
return {Dof::UX, Dof::UY, Dof::UZ, Dof::RX, Dof::RY, Dof::RZ};
|
|
}
|
|
|
|
inline int dofIndex(Dof dof) {
|
|
return static_cast<int>(dof);
|
|
}
|
|
|
|
inline int abaqusDofNumber(Dof dof) {
|
|
return dofIndex(dof) + 1;
|
|
}
|
|
|
|
inline std::optional<Dof> dofFromAbaqus(int dof) {
|
|
if (dof < 1 || dof > 6) {
|
|
return std::nullopt;
|
|
}
|
|
return static_cast<Dof>(dof - 1);
|
|
}
|
|
|
|
inline const char* dofLabel(Dof dof) {
|
|
switch (dof) {
|
|
case Dof::UX:
|
|
return "UX";
|
|
case Dof::UY:
|
|
return "UY";
|
|
case Dof::UZ:
|
|
return "UZ";
|
|
case Dof::RX:
|
|
return "RX";
|
|
case Dof::RY:
|
|
return "RY";
|
|
case Dof::RZ:
|
|
return "RZ";
|
|
}
|
|
return "";
|
|
}
|
|
|
|
inline std::vector<std::string> displacementComponentLabels() {
|
|
return {"UX", "UY", "UZ", "RX", "RY", "RZ"};
|
|
}
|
|
|
|
inline std::vector<std::string> reactionComponentLabels() {
|
|
return {"RFX", "RFY", "RFZ", "RMX", "RMY", "RMZ"};
|
|
}
|
|
|
|
} // namespace fesa
|