XIAN-FEM-2026June/3D opticsfem-master/phy/PortModeSolver.h

23 lines
639 B
C++

#pragma once
#include "PortModeData.h"
#include "../Eigen/Dense"
class Mesh_3D;
class MaterialLib;
// Solve numeric port modes on Mesh_3D boundary faces (MATLAB BoundaryEigenMode + GetPowerCoef).
// Assumptions: ports nearly z=const; rim edges get PEC; Et scaled by edge length (MATLAB convention).
bool ComputePortModesFromMesh(
Mesh_3D* mesh,
MaterialLib* matLib,
const Eigen::VectorXi& domainsInc,
const Eigen::VectorXi& domainsOut,
double lambda0,
double targetNeff,
int modeNum,
PortModeLibrary& outModes,
bool normalizeInputPower = true);
bool SavePortModesToFile(const PortModeLibrary& modes, const std::string& path);