예제 #1
0
double UpwindDiff::calcDy(GridField<double> &g, const int i, const int j, const int k)
{
	if((*_w)(i, j, k).y > 0.0)
		return (g(i, j, k) - g(i, j-1, k))/g.dx();
	else
		return (g(i, j+1, k) - g(i, j, k))/g.dx();
}
예제 #2
0
double UpwindDiff::calcDz(GridField<double> &g, const int i, const int j, const int k)
{
	if((*_w)(i, j, k).z > 0.0)
		return (g(i, j, k) - g(i, j, k-1))/g.dx();
	else
		return (g(i, j, k+1) - g(i, j, k))/g.dx();
}
예제 #3
0
Vector3 UpwindDiff::calcDx(GridField<Vector3> &g, const int i, const int j, const int k)
{
	if((*_w)(i, j, k).x > 0.0)
		return (g(i, j, k) - g(i-1, j, k))/g.dx();
	else
		return (g(i+1, j, k) - g(i, j, k))/g.dx();
}
예제 #4
0
double UpwindDiff::calcDx(GridField<double> &g, const int i, const int j, const int k)
{
	if((*_w)(i, j, k).x > 0.0){ // if(BURNT)
		return (g(i, j, k) - g(i-1, j, k))/g.dx();
	}
	else {// FUEL
		return (g(i+1, j, k) - g(i, j, k))/g.dx();
	}
}
예제 #5
0
double CentralDiff::calcDxy(GridField<double> &g, const int i, const int j, const int k)
{
	/*CellType c_t = LevelSet::getCellType(g(i,j,k));
	return ( g(i+1,j+1,k,c_t) - g(i+1,j-1,k,c_t) + g(i-1,j-1,k,c_t) - g(i-1,j+1,k,c_t) ) / (4.0*g.dx()*g.dx());*/
	/*double asd4 = g(i-1,j+1,k);
	double asd3 = g(i-1,j-1,k);
	double asd2 = g(i+1,j-1,k);
	double asd1 = g(i+1,j+1,k);
     */
	return ( g(i+1,j+1,k) - g(i+1,j-1,k) + g(i-1,j-1,k) - g(i-1,j+1,k) ) / (4.0*g.dx()*g.dx());
}
예제 #6
0
GridField<T>::GridField(const GridField<T> &g):GridMapping(g),_extrapolation(nullptr),_interpolation(nullptr),_extrapolate(true){
	int count = g.cellCount();
	_data = new T[count];

	//Iterera över g
	for (GridFieldIterator<T> iter = g.iterator(); !iter.done(); iter.next()) {
		setValueAtIndex(iter.value(), iter.index());
	}

	//Interpolation
	//Extra/Interpolation
	setInterpolation(g._interpolation);
	setExtrapolation(g._extrapolation);
}
예제 #7
0
Vector3 CentralDiff::calcDyz(GridField<Vector3> &g, const int i, const int j, const int k)
{
	return ( g(i,j+1,k+1) - g(i,j+1,k-1) + g(i,j-1,k-1) - g(i,j-1,k+1) ) / (4.0*g.dx()*g.dx());
}
예제 #8
0
double CentralDiff::calcDxz(GridField<double> &g, const int i, const int j, const int k)
{
	return ( g(i+1,j,k+1) - g(i+1,j,k-1) + g(i-1,j,k-1) - g(i-1,j,k+1) ) / (4.0*g.dx()*g.dx());
}
예제 #9
0
double CentralDiff::calcD2z(GridField<double> &g, const int i, const int j, const int k)
{
	return ( g(i,j,k+1) - 2.0*g(i,j,k) + g(i,j,k-1))/( g.dx()*g.dx() /* deltaZ^2 */ );
}
예제 #10
0
double CentralDiff::calcD2y(GridField<double> &g, const int i, const int j, const int k)
{
	return ( g(i,j+1,k) - 2.0*g(i,j,k) + g(i,j-1,k))/( g.dx()*g.dx() /* deltaY^2 */ );
}
예제 #11
0
double CentralDiff::calcDz(GridField<double> &g, const int i, const int j, const int k)
{
	return (double)(g(i, j, k+1) - g(i, j, k-1))/(g.dx()*2.0);
}
예제 #12
0
double CentralDiff::calcDy(GridField<double> &g, const int i, const int j, const int k)
{
	return (double)(g(i, j+1, k) - g(i, j-1, k))/(g.dx()*2.0);
}
예제 #13
0
double CentralDiff::calcDzp(GridField<double> &g, const int i, const int j, const int k)
{
	throw;
	//EJ DEFINIERAD I CENTRAL
	return (double)(g(i, j, k + 1) - g(i, j, k))/(g.dx());
}
예제 #14
0
Vector3 CentralDiff::calcDxy(GridField<Vector3> &g, const int i, const int j, const int k)
{
	return ( g(i+1,j+1,k) - g(i+1,j-1,k) + g(i-1,j-1,k) - g(i-1,j+1,k) ) / (4.0*g.dx()*g.dx());
}
예제 #15
0
double UpwindDiff::calcDzp(GridField<double> &g, const int i, const int j, const int k)
{
	return (double)(g(i, j, k + 1) - g(i, j, k))/(g.dx());
}
예제 #16
0
Vector3 CentralDiff::calcD2x(GridField<Vector3> &g, const int i, const int j, const int k)
{
	return ( g(i+1,j,k) - 2.0*g(i,j,k) + g(i-1,j,k))/( g.dx()*g.dx() /*deltaX^2 */ );
}
예제 #17
0
Vector3 CentralDiff::calcDz(GridField<Vector3> &g, const int i, const int j, const int k)
{
	return (Vector3)(g(i, j, k+1) - g(i, j, k-1))/(g.dx()*2.0);
}
예제 #18
0
Vector3 CentralDiff::calcDy(GridField<Vector3> &g, const int i, const int j, const int k)
{
	return (Vector3)(g(i, j+1, k) - g(i, j-1, k))/(g.dx()*2.0);
}