/* * Copyright (C) 2010 Thorsten Liebig (Thorsten.Liebig@gmx.de) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "engine_cylinder.h" #include "engine_extension.h" #include "operator_extension.h" Engine_Cylinder* Engine_Cylinder::New(const Operator_Cylinder* op) { Engine_Cylinder* e = new Engine_Cylinder(op); e->Init(); return e; } Engine_Cylinder::Engine_Cylinder(const Operator_Cylinder* op) : Engine(op) { cyl_Op = op; if (cyl_Op->GetClosedAlpha()) { ++numLines[1]; //necessary for dobled voltage and current line in alpha-dir, operator will return one smaller for correct post-processing } } inline void Engine_Cylinder::CloseAlphaVoltages() { unsigned int pos[3]; // copy voltages from last alpha-plane to first unsigned int last_A_Line = numLines[1]-1; for (pos[0]=0;pos[0]vv_R0[pos[2]]; for (pos[1]=0;pos[1]GetClosedAlpha();++pos[1]) { volt[2][0][0][pos[2]] += cyl_Op->vi_R0[pos[2]] * curr[1][0][pos[1]][pos[2]]; } } for (pos[1]=0;pos[1]GetClosedAlpha()==false) return Engine::IterateTS(iterTS); for (unsigned int iter=0;iterDoPreVoltageUpdates(); UpdateVoltages(); for (size_t n=0;nDoPostVoltageUpdates(); for (size_t n=0;nApply2Voltages(); if (cyl_Op->GetR0Included()) R0IncludeVoltages(); ApplyVoltageExcite(); CloseAlphaVoltages(); //current updates with extensions for (size_t n=0;nDoPreCurrentUpdates(); UpdateCurrents(); for (size_t n=0;nDoPostCurrentUpdates(); for (size_t n=0;nApply2Current(); ApplyCurrentExcite(); CloseAlphaCurrents(); ++numTS; } return true; }