diff options
author | Ruben Undheim <ruben.undheim@gmail.com> | 2019-02-10 08:20:54 +0000 |
---|---|---|
committer | Ruben Undheim <ruben.undheim@gmail.com> | 2019-02-10 08:20:54 +0000 |
commit | ffda26309128be5d112df61a03e4827e47ecfac8 (patch) | |
tree | 7552a0f13b6873dbf98c41b84cb81bac0f220ca7 /openEMS/Common/processfields.cpp | |
parent | 086965becc2a02254e3441a1d97b61ccab2d66ea (diff) |
Import GIT HEAD of openEMS sub-project (with Python interface)
Diffstat (limited to 'openEMS/Common/processfields.cpp')
-rw-r--r-- | openEMS/Common/processfields.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/openEMS/Common/processfields.cpp b/openEMS/Common/processfields.cpp index f52fc14..b486c32 100644 --- a/openEMS/Common/processfields.cpp +++ b/openEMS/Common/processfields.cpp @@ -71,6 +71,10 @@ string ProcessFields::GetFieldNameByType(DumpType type) return "J-Field"; case ROTH_FIELD_DUMP: return "RotH-Field"; + case D_FIELD_DUMP: + return "D-Field"; + case B_FIELD_DUMP: + return "B-Field"; case SAR_LOCAL_DUMP: return "SAR-local"; case SAR_1G_DUMP: @@ -95,6 +99,30 @@ bool ProcessFields::NeedConductivity() const return false; } +bool ProcessFields::NeedPermittivity() const +{ + switch (m_DumpType) + { + case D_FIELD_DUMP: + return true; + default: + return false; + } + return false; +} + +bool ProcessFields::NeedPermeability() const +{ + switch (m_DumpType) + { + case B_FIELD_DUMP: + return true; + default: + return false; + } + return false; +} + void ProcessFields::InitProcess() { if (Enabled==false) return; @@ -333,6 +361,44 @@ FDTD_FLOAT**** ProcessFields::CalcField() } } return field; + case D_FIELD_DUMP: + for (unsigned int i=0; i<numLines[0]; ++i) + { + pos[0]=posLines[0][i]; + for (unsigned int j=0; j<numLines[1]; ++j) + { + pos[1]=posLines[1][j]; + for (unsigned int k=0; k<numLines[2]; ++k) + { + pos[2]=posLines[2][k]; + + m_Eng_Interface->GetDField(pos,out); + field[0][i][j][k] = out[0]; + field[1][i][j][k] = out[1]; + field[2][i][j][k] = out[2]; + } + } + } + return field; + case B_FIELD_DUMP: + for (unsigned int i=0; i<numLines[0]; ++i) + { + pos[0]=posLines[0][i]; + for (unsigned int j=0; j<numLines[1]; ++j) + { + pos[1]=posLines[1][j]; + for (unsigned int k=0; k<numLines[2]; ++k) + { + pos[2]=posLines[2][k]; + + m_Eng_Interface->GetBField(pos,out); + field[0][i][j][k] = out[0]; + field[1][i][j][k] = out[1]; + field[2][i][j][k] = out[2]; + } + } + } + return field; default: cerr << "ProcessFields::CalcField(): Error, unknown dump type..." << endl; return field; |