Erstmal danke für die Hilfe
Das Array muss nicht unbedingt 1000x1000 sein aber 200x200 möchte ich schon realisieren.
Ich wollte die Klasse so benutzen:
#include <iostream>
#include <cmath>
#include "Nachbarfeld.h"
using namespace std;
int main()
{
const double prec =0.2;
bool Bedingung[2];
Nachbarfeld arr;
for(int i = 0;i< IEND;i++) *arr.neib(i,0) = 0;
while (Bedingung[0])
{
Bedingung[0] =1; Bedingung[1] =1;
//Randwerte setzen
//Dipol:
*arr.neib(XMAX/2,YMAX/4,0) = 1;
*arr.neib(XMAX/2,YMAX*3/4,0) = -1;
for(int i = 0;i< IEND;i++)
{
double hilf = ( *arr.neib(i,1) + *arr.neib(i,2) + *arr.neib(i,3) + *arr.neib(i,4) )/4;
if( abs( *arr.neib(i,0) - hilf) < prec && Bedingung[1]==1) Bedingung[0] = 0;
if( abs( *arr.neib(i,0) - hilf) >= prec)
{
Bedingung[1] = 0;
Bedingung[0] = 1;
}
*arr.neib(i,0) = hilf;
}
}
// Ausgabe des Felds fstream...
}