iloop.cpp

来自「pic 模拟程序!面向对象」· C++ 代码 · 共 48 行

CPP
48 行
字号
/*====================================================================	 ILOOP.CPP	 0.90	(PeterM 4-16-96) Creation.====================================================================*/#include "iloop.h"#include "misc.h"#include "fields.h"#ifdef ICPCRAPvoid Iloop::putCharge_and_Current(Scalar t) {	int j,k;	// first calculate the current right at this instant.	Scalar Inow = I*get_time_value(t);	Vector3 **If = fields->getI();	// Loop over the loop setting the current	for(k=k1;k<k2;k++)		for(j=j1;j<j2;j++)			If[j][k]+=Vector3(0,0,Inow);}#elsevoid Iloop::putCharge_and_Current(Scalar t) {	int j,k;	// first calculate the current right at this instant.	Scalar Inow =I * get_time_value(t);	Vector3 **If = fields->getI();	// Loop over the loop setting the current	for(k=k1;k<k2;k++)		{ 			If[j1][k]+=Vector3(0,Inow,0);			If[j2][k]+=Vector3(0,-Inow,0);		}	for(j=j1;j<j2;j++)		{			If[j][k1]+=Vector3(-Inow,0,0);			If[j][k2]+=Vector3(Inow,0,0);		}}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?