some more int vs. u-int fixes
parent
fd2623d740
commit
5a47a6443a
|
@ -731,18 +731,18 @@ bool Operator::CalcEFieldExcitation()
|
|||
vector<unsigned int> vDelay;
|
||||
vector<unsigned int> vDir;
|
||||
unsigned int ipos;
|
||||
int pos[3];
|
||||
unsigned int pos[3];
|
||||
double coord[3];
|
||||
double delta[3];
|
||||
double amp=0;
|
||||
|
||||
for (pos[2]=0;pos[2]<(int)numLines[2];++pos[2])
|
||||
for (pos[2]=0;pos[2]<numLines[2];++pos[2])
|
||||
{
|
||||
delta[2]=fabs(MainOp->GetIndexDelta(2,pos[2]));
|
||||
for (pos[1]=0;pos[1]<(int)numLines[1];++pos[1])
|
||||
for (pos[1]=0;pos[1]<numLines[1];++pos[1])
|
||||
{
|
||||
delta[1]=fabs(MainOp->GetIndexDelta(1,pos[1]));
|
||||
for (pos[0]=0;pos[0]<(int)numLines[0];++pos[0])
|
||||
for (pos[0]=0;pos[0]<numLines[0];++pos[0])
|
||||
{
|
||||
delta[0]=fabs(MainOp->GetIndexDelta(0,pos[0]));
|
||||
coord[0] = discLines[0][pos[0]];
|
||||
|
@ -759,7 +759,7 @@ bool Operator::CalcEFieldExcitation()
|
|||
CSPropElectrode* elec = prop->ToElectrode();
|
||||
if (elec!=NULL)
|
||||
{
|
||||
if ((elec->GetActiveDir(n)) && (pos[n]<(int)numLines[n]-1))
|
||||
if ((elec->GetActiveDir(n)) && (pos[n]<numLines[n]-1))
|
||||
{
|
||||
amp = elec->GetWeightedExcitation(n,coord)*delta[n]*gridDelta;
|
||||
if (amp!=0)
|
||||
|
@ -824,7 +824,7 @@ bool Operator::CalcEFieldExcitation()
|
|||
// cerr << n << " " << coord[0] << " " << coord[1] << " " << coord[2] << endl;
|
||||
if (elec!=NULL)
|
||||
{
|
||||
if ((elec->GetActiveDir(n)) && (pos[n]<(int)numLines[n]-1))
|
||||
if ((elec->GetActiveDir(n)) && (pos[n]<numLines[n]-1))
|
||||
{
|
||||
amp = elec->GetWeightedExcitation(n,coord)*deltaN*gridDelta;
|
||||
if (amp!=0)
|
||||
|
|
|
@ -185,12 +185,13 @@ bool ProcessFields::DumpVectorArray2VTK(ofstream &file, string name, FDTD_FLOAT*
|
|||
{
|
||||
WriteVTKHeader(file, discLines, numLines);
|
||||
WriteVTKVectorArray(file, name, array, numLines);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProcessFields::DumpMultiVectorArray2VTK(ofstream &file, string names[], FDTD_FLOAT**** array[], unsigned int numFields, double** discLines, unsigned int* numLines)
|
||||
{
|
||||
WriteVTKHeader(file, discLines, numLines);
|
||||
for (int n=0;n<numFields;++n)
|
||||
for (unsigned int n=0;n<numFields;++n)
|
||||
{
|
||||
WriteVTKVectorArray(file, names[n], array[n], numLines);
|
||||
file << endl;
|
||||
|
|
11
openems.cpp
11
openems.cpp
|
@ -131,7 +131,12 @@ int openEMS::SetupFDTD(const char* file)
|
|||
cerr << "Can't read openEMS FDTD Settings... " << endl;
|
||||
exit(-1);
|
||||
}
|
||||
FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&NrTS);
|
||||
int help=0;
|
||||
FDTD_Opts->QueryIntAttribute("NumberOfTimesteps",&help);
|
||||
if (help<0)
|
||||
NrTS=0;
|
||||
else
|
||||
NrTS = help;
|
||||
FDTD_Opts->QueryDoubleAttribute("endCriteria",&endCrit);
|
||||
if (endCrit==0)
|
||||
endCrit=1e-6;
|
||||
|
@ -325,14 +330,14 @@ void openEMS::RunFDTD()
|
|||
double t_diff;
|
||||
//*************** simulate ************//
|
||||
int step=PA->Process();
|
||||
if ((step<0) || (step>NrTS)) step=NrTS;
|
||||
if ((step<0) || (step>(int)NrTS)) step=NrTS;
|
||||
while ((FDTD_Eng->GetNumberOfTimesteps()<NrTS) && (change>endCrit))
|
||||
{
|
||||
FDTD_Eng->IterateTS(step);
|
||||
step=PA->Process();
|
||||
// cout << " do " << step << " steps; current: " << eng.GetNumberOfTimesteps() << endl;
|
||||
currTS = FDTD_Eng->GetNumberOfTimesteps();
|
||||
if ((step<0) || (step>NrTS - currTS)) step=NrTS - currTS;
|
||||
if ((step<0) || (step>(int)(NrTS - currTS))) step=NrTS - currTS;
|
||||
|
||||
gettimeofday(&currTime,NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue