Expose sinusoidal, dirac pulse and step pulse excitation to the Python API.
This commit is contained in:
parent
026f12355f
commit
8c08cf5312
18
openems.cpp
18
openems.cpp
@ -855,6 +855,24 @@ void openEMS::SetGaussExcite(double f0, double fc)
|
|||||||
m_Exc->SetupGaussianPulse(f0, fc);
|
m_Exc->SetupGaussianPulse(f0, fc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void openEMS::SetSinusExcite(double f0)
|
||||||
|
{
|
||||||
|
this->InitExcitation();
|
||||||
|
m_Exc->SetupSinusoidal(f0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void openEMS::SetDiracExcite(double f_max)
|
||||||
|
{
|
||||||
|
this->InitExcitation();
|
||||||
|
m_Exc->SetupDiracPulse(f_max);
|
||||||
|
}
|
||||||
|
|
||||||
|
void openEMS::SetStepExcite(double f_max)
|
||||||
|
{
|
||||||
|
this->InitExcitation();
|
||||||
|
m_Exc->SetupStepExcite(f_max);
|
||||||
|
}
|
||||||
|
|
||||||
Excitation* openEMS::InitExcitation()
|
Excitation* openEMS::InitExcitation()
|
||||||
{
|
{
|
||||||
delete m_Exc;
|
delete m_Exc;
|
||||||
|
@ -102,6 +102,10 @@ public:
|
|||||||
bool CheckAbortCond();
|
bool CheckAbortCond();
|
||||||
|
|
||||||
void SetGaussExcite(double f0, double fc);
|
void SetGaussExcite(double f0, double fc);
|
||||||
|
void SetSinusExcite(double f0);
|
||||||
|
void SetDiracExcite(double f_max);
|
||||||
|
void SetStepExcite(double f_max);
|
||||||
|
|
||||||
Excitation* InitExcitation();
|
Excitation* InitExcitation();
|
||||||
|
|
||||||
void SetCSX(ContinuousStructure* csx);
|
void SetCSX(ContinuousStructure* csx);
|
||||||
|
@ -48,6 +48,9 @@ cdef extern from "openEMS/openems.h":
|
|||||||
void Set_Mur_PhaseVel(int idx, double val)
|
void Set_Mur_PhaseVel(int idx, double val)
|
||||||
|
|
||||||
void SetGaussExcite(double f0, double fc)
|
void SetGaussExcite(double f0, double fc)
|
||||||
|
void SetSinusExcite(double f0)
|
||||||
|
void SetDiracExcite(double f_max)
|
||||||
|
void SetStepExcite(double f_max)
|
||||||
|
|
||||||
void SetAbort(bool val)
|
void SetAbort(bool val)
|
||||||
|
|
||||||
|
@ -232,6 +232,33 @@ cdef class openEMS:
|
|||||||
"""
|
"""
|
||||||
self.thisptr.SetGaussExcite(f0, fc)
|
self.thisptr.SetGaussExcite(f0, fc)
|
||||||
|
|
||||||
|
def SetSinusExcite(self, f0):
|
||||||
|
""" SetSinusExcite(f0)
|
||||||
|
|
||||||
|
Set a sinusoidal signal as excitation signal.
|
||||||
|
|
||||||
|
:param f0: float -- frequency in Hz.
|
||||||
|
"""
|
||||||
|
self.thisptr.SetSinusExcite(f0)
|
||||||
|
|
||||||
|
def SetDiracExcite(self, f_max):
|
||||||
|
""" SetDiracExcite(f_max)
|
||||||
|
|
||||||
|
Set a dirac pulse as excitation signal.
|
||||||
|
|
||||||
|
:param f_max: float -- maximum simulated frequency in Hz.
|
||||||
|
"""
|
||||||
|
self.thisptr.SetDiracExcite(f_max)
|
||||||
|
|
||||||
|
def SetStepExcite(self, f_max):
|
||||||
|
""" SetStepExcite(f_max)
|
||||||
|
|
||||||
|
Set a step function as excitation signal.
|
||||||
|
|
||||||
|
:param f_max: float -- maximum simulated frequency in Hz.
|
||||||
|
"""
|
||||||
|
self.thisptr.SetStepExcite(f_max)
|
||||||
|
|
||||||
|
|
||||||
def SetBoundaryCond(self, BC):
|
def SetBoundaryCond(self, BC):
|
||||||
""" SetBoundaryCond(BC)
|
""" SetBoundaryCond(BC)
|
||||||
|
Loading…
Reference in New Issue
Block a user