37 lines
969 B
C++
37 lines
969 B
C++
#pragma once
|
|
|
|
#include "../Eigen/Dense"
|
|
#include <complex>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct PortNumericMode
|
|
{
|
|
int type = 0; // 1 = input, 2 = output
|
|
std::complex<double> gamma = 0.0;
|
|
double powerCoef = 1.0;
|
|
Eigen::Vector3d normal = Eigen::Vector3d::Zero();
|
|
|
|
Eigen::MatrixXi facesConn; // nf x 2 (1-based tet index, 1-based local face)
|
|
Eigen::MatrixXi portNewFaces; // nf x 3 (0-based port node indices)
|
|
Eigen::MatrixXi portEdgeOfFace; // nf x 3 (0-based port edge DOF index)
|
|
|
|
Eigen::MatrixXd portNodes;
|
|
Eigen::VectorXcd Ez;
|
|
Eigen::VectorXcd Et;
|
|
};
|
|
|
|
class PortModeLibrary
|
|
{
|
|
public:
|
|
bool LoadFromFile(const std::string& path);
|
|
void Clear();
|
|
void AddMode(const PortNumericMode& m);
|
|
bool HasModes() const { return !_mModes.empty(); }
|
|
int GetNbrModes() const { return static_cast<int>(_mModes.size()); }
|
|
const PortNumericMode& GetMode(int i) const { return _mModes[static_cast<size_t>(i)]; }
|
|
|
|
private:
|
|
std::vector<PortNumericMode> _mModes;
|
|
};
|