// repetitive includes for werteunit.pas {$IFDEF tLLWerte_create} //constructor tLLWerte.create(original: pTLLWerteSingle; ps: tExtraInfos; xMin,xMax: longint); begin inherited create; params:=ps; kopiereVon(false,original,xMin,xMax); end; {$ENDIF} {$IFDEF tLLWerte_kopiereVon} //procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle); begin kopiereVon(sT,original,0,original^.params.xSteps-1); end; {$ENDIF} {$IFDEF tLLWerte_kopiereVon_xMiMa} //procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle; xMin,xMax: longint); begin kopiereVon(sT,original,xMin,xMax,0,original^.params.tSiz-1); end; {$ENDIF} {$IFDEF tLLWerte_kopiereVon_xTMiMa} //procedure tLLWerte.kopiereVon(sT: boolean; original: pTLLWerteSingle; xMin,xMax,tMin,tMax: longint); var i,j: longint; begin inherited create; tMax:=min(tMax,original^.params.tSiz-1); tMin:=max(tMin,0); params.tSiz:=tMax+1-tMin; xMax:=min(xMax,original^.params.xSteps-1); xMin:=max(xMin,0); params.xSteps:=xMax+1-xMin; zerstoereTransformationWennObsolet(params.transformationen); params.transformationen:=tKoordinatenAusschnitt.create(original^.params.transformationen,xMin,xMax,tMin,tMax); params.maxW:=0; params.minW:=0; params.np:=original^.params.np; params.beta:=original^.params.beta; params.refreshKnownValues; if not sT then begin holeRAM(0); for i:=xMin to xMax do for j:=tMin to tMax do werte[i-xMin+(j-tMin)*params.xSteps]:=original^.werte[i+j*original^.params.xSteps]; end; end; {$ENDIF} {$IFDEF tLLWerte_kopiereVonNach} //procedure tLLWerte.kopiereVonNach(original: pTLLWerteSingle; qxmin,qxmax,qtmin,qtmax,zxmin,ztmin: longint); var i,j: longint; begin inherited create; for i:=qxmin to qxmax do for j:=qtmin to qtmax do werte[i-qxmin+zxmin + (j-qtmin+ztmin)*params.xSteps]:= original^.werte[i+j*original^.params.xSteps]; end; {$ENDIF} {$IFDEF tLLWerte_kopiereVerzerrt} //procedure tLLWerte.kopiereVerzerrt(original: pTLLWerteSingle; zPs: tIntPointArray; zGs: tExtPointArray; zAs: tExtendedArray; xMin,xMax,tMin,tMax: longint; vB,nB: tTransformation; vA,nA: longint); var i,j,k: longint; tmp: extended; begin for i:=tMin to tMax do for j:=xMin to xMax do werte[j+i*params.xSteps]:=0; for i:=0 to length(zPs)-1 do for j:=0 to 1 do for k:=0 to 1 do if (zPs[i]['x']+j>=xMin) and (zPs[i]['x']+j<=xMax) and (zPs[i]['y']+k>=tMin) and (zPs[i]['y']+k<=tMax) then begin tmp:=original^.werte[i]; if (vA>0) or (nA>0) then tmp:=(tmp-original^.params.minW)/(original^.params.maxW-original^.params.minW); if vA>0 then vB.transformiereWert(tmp,vA-1); tmp:=tmp * (zGs[i]['x'] * (2*j-1) + 1-j) * (zGs[i]['y'] * (2*k-1) + 1-k); werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps]:= werte[zPs[i]['x']+j + (zPs[i]['y']+k)*params.xSteps] + tmp; end; for i:=tMin to tMax do for j:=xMin to xMax do begin tmp:=werte[j + i*params.xSteps] / zAs[j + i*params.xSteps]; if nA>0 then tmp:=nB.transformiereWert(tmp,nA-1); werte[j + i*params.xSteps]:=tmp; end; end; {$ENDIF} {$IFDEF tLLWerte_kopiereLOVerzerrt} //procedure tLLWerte.kopiereLOVerzerrt(original: pTLLWerteSingle; xMin,xMax,tMin,tMax: longint; verhHo,verhVe: extended); var i,j,hV,hB,vV,vB,h,v: int64; begin gibAus(intToStr(xMin)+' .. '+intToStr(xMax)+' x '+intToStr(tMin)+' .. '+intToStr(tMax),1); for i:=tMin to tMax do begin if verhVe>0 then begin vV:=max( 0, round( (params.tSiz-1-i+0.5)/ (1 + (i+0.5)/verhVe/(params.tSiz-1)) ) ); vB:=min( params.tSiz-1, round( (params.tSiz-1-i+0.5)/ (1 + (i-0.5)/verhVe/(params.tSiz-1)) ) ); end else begin vV:=i; vB:=i; end; for j:=xMin to xMax do begin if verhHo>0 then begin hV:=max( 0, round( (params.xSteps-1-(j+0.5))/ (1 + (j+0.5)/verhHo/(params.xSteps-1)) ) ); hB:=min( params.xSteps-1, round( (params.xSteps-1-(j-0.5))/ (1 + (j-0.5)/verhHo/(params.xSteps-1)) ) ); end else begin hV:=j; hB:=j; end; werte[j+i*params.xSteps]:=0; for h:=hV to hB do for v:=vV to vB do werte[j+i*params.xSteps]:= werte[j+i*params.xSteps]+ original^.werte[h+v*params.xSteps]; if (hB>=hV) and (vB>=vV) then werte[j+i*params.xSteps]:= werte[j+i*params.xSteps] / (hB+1-hV) / (vB+1-vV); end; end; end; {$ENDIF} {$IFDEF tLLWerte_integriere} //procedure tLLWerte.integriereSingle(qu: pTLLWerteSingle; xMi,xMa,tMi,tMa,xOf,tOf: longint; richtung: tIntegrationsRichtung); var i,j: longint; int,faktor: extended; begin case richtung of irHorizontal: begin faktor:=(qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1); for i:=tMi to tMa do begin int:=0; for j:=0 to xMi-1 do int:=int+qu^.werte[j + i*qu^.params.xSteps]; for j:=xMi to xMa do begin int:=int+qu^.werte[j + i*qu^.params.xSteps]; werte[j-xOf + (i-tOf)*params.xSteps]:=int*faktor; end; end; end; irEinfall: begin faktor:= sqrt( sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); for i:=tMi to tMa do begin // von links eintretendes (inkl. Ecke links unten) int:=0; for j:=1 to min(xMi,i) do int:=int+qu^.werte[xMi-j + (i-j)*qu^.params.xSteps]; for j:=0 to min(tMa-i,xMa-xMi) do begin int:=int+qu^.werte[xMi+j + (i+j)*qu^.params.xSteps]; werte[j+xMi-xOf + (i+j-tOf)*params.xSteps]:=int*faktor; end; end; for i:=xMi+1 to xMa do begin // von unten eintretendes (exkl. Ecke links unten) int:=0; for j:=1 to min(tMi,i) do int:=int+qu^.werte[i-j + (tMi-j)*qu^.params.xSteps]; for j:=0 to min(tMa-tMi,xMa-i) do begin int:=int+qu^.werte[i+j + (tMi+j)*qu^.params.xSteps]; werte[i+j-xOf + (tMi+j-tOf)*params.xSteps]:=int*faktor; end; end; end; irAusfall: begin faktor:= sqrt( sqr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)) + sqr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1))); gibAus('dx = '+floatToStr((qu^.params.xStop-qu^.params.xStart)/(qu^.params.xSteps-1)),1); gibAus('dt = '+floatToStr((qu^.params.tStop-qu^.params.tStart)/(qu^.params.tSiz-1)),1); for i:=tMi to tMa do begin // nach links austretendes (inkl. Ecke links oben) int:=0; for j:=1 to min(xMi,qu^.params.tSiz-1-i) do int:=int+qu^.werte[xMi-j + (i+j)*qu^.params.xSteps]; for j:=0 to min(i-tMi,xMa-xMi) do begin int:=int+qu^.werte[xMi+j + (i-j)*qu^.params.xSteps]; werte[j+xMi-xOf + (i-j-tOf)*params.xSteps]:=int*faktor; end; end; for i:=xMi+1 to xMa do begin // nach oben austretendes (exkl. Ecke links oben) int:=0; for j:=1 to min(qu^.params.tSiz-1-tMa,i) do int:=int+qu^.werte[i-j + (tMa+j)*qu^.params.xSteps]; for j:=0 to min(tMa-tMi,xMa-i) do begin int:=int+qu^.werte[i+j + (tMa-j)*qu^.params.xSteps]; werte[i+j-xOf + (tMa-j-tOf)*params.xSteps]:=int*faktor; end; end; end; end{of case}; end; {$ENDIF}