more sim flags
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-12-19 18:04:01 -05:00
parent 7ccf0de17b
commit 6fbf5c9d1e
8 changed files with 430 additions and 59 deletions

View File

@ -47,11 +47,6 @@
*/
#define FLUID_PRESSURECELL_DIV_PRESSURE_CONST 5.0f
/**
* Set to 1 to clamp small density values to 0
*/
#define FLUID_PRESSURECELL_ENABLE_CLAMP_MIN_DENSITY 1
/**
* Cutoff after which density is clamped to zero while diffusing
*/
@ -93,9 +88,28 @@
#define FLUID_PRESSURECELL_BOUND_PRESSURE FLUID_PRESSURECELL_MAX_PRESSURE
/**
* Enables recapture
* Maximum divergence allowed
*/
#define FLUID_PRESSURECELL_MAX_DIVERGENCE 3.0f
/**
* Enables recapture of density when velocity pushes it outside of bounds
*/
#define FLUID_PRESSURECELL_ENABLE_RECAPTURE 1
/**
* Enables clamping small density values to 0
*/
#define FLUID_PRESSURECELL_ENABLE_CLAMP_MIN_DENSITY 0
/**
* Enables renormalizing the velocity field to a max value of 1 during projection
*/
#define FLUID_PRESSURECELL_ENABLE_VELOCITY_FIELD_NORMALIZAITON 1
#endif

View File

@ -18,7 +18,7 @@ LIBRARY_API Environment * fluid_environment_create(){
rVal->queue.cellularQueue = NULL;
rVal->queue.gridQueue = NULL;
rVal->queue.grid2Queue = NULL;
rVal->consts.dt = 0.02f;
rVal->consts.dt = FLUID_PRESSURECELL_SIM_STEP;
rVal->consts.gravity = FLUID_PRESSURECELL_GRAVITY;
//allocate arrays

View File

@ -10,7 +10,7 @@
/**
* Define as 1 to source values from surrounding chunks
*/
#define USE_BOUNDS 1
#define USE_BOUNDS 0

View File

@ -93,35 +93,35 @@ LIBRARY_API void pressurecell_approximate_pressure(Environment * environment, Ch
}
}
}
for(x = 0; x < DIM; x++){
for(y = 0; y < DIM; y++){
//pressure borders
//essentially, if the pressure builds up next to an edge, we don't have to have a 0 pressure area right next to it on the edge itself
//there are two values that should potentially be set to here
//either, same pressure as voxel in normal direction if this edge is actually an edge
//otherwise, set to the pressure of the neighboring chunk
pressureTemp[IX(0,x,y)] = pressureCache[IX(0,x,y)];
pressureTemp[IX(DIM-1,x,y)] = pressureCache[IX(DIM-1,x,y)];
pressureTemp[IX(x,0,y)] = pressureCache[IX(x,0,y)];
pressureTemp[IX(x,DIM-1,y)] = pressureCache[IX(x,DIM-1,y)];
pressureTemp[IX(x,y,0)] = pressureCache[IX(x,y,0)];
pressureTemp[IX(x,y,DIM-1)] = pressureCache[IX(x,y,DIM-1)];
// pressureTemp[IX(0,x,y)] = border[IX(0,x,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// pressureTemp[IX(DIM-1,x,y)] = border[IX(DIM-1,x,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// pressureTemp[IX(x,0,y)] = border[IX(x,0,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// pressureTemp[IX(x,DIM-1,y)] = border[IX(x,DIM-1,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// pressureTemp[IX(x,y,0)] = border[IX(x,y,0)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// pressureTemp[IX(x,y,DIM-1)] = border[IX(x,y,DIM-1)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// for(x = 0; x < DIM; x++){
// for(y = 0; y < DIM; y++){
// //pressure borders
// //essentially, if the pressure builds up next to an edge, we don't have to have a 0 pressure area right next to it on the edge itself
// //there are two values that should potentially be set to here
// //either, same pressure as voxel in normal direction if this edge is actually an edge
// //otherwise, set to the pressure of the neighboring chunk
// pressureTemp[IX(0,x,y)] = pressureCache[IX(0,x,y)];
// pressureTemp[IX(DIM-1,x,y)] = pressureCache[IX(DIM-1,x,y)];
// pressureTemp[IX(x,0,y)] = pressureCache[IX(x,0,y)];
// pressureTemp[IX(x,DIM-1,y)] = pressureCache[IX(x,DIM-1,y)];
// pressureTemp[IX(x,y,0)] = pressureCache[IX(x,y,0)];
// pressureTemp[IX(x,y,DIM-1)] = pressureCache[IX(x,y,DIM-1)];
// // pressureTemp[IX(0,x,y)] = border[IX(0,x,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// // pressureTemp[IX(DIM-1,x,y)] = border[IX(DIM-1,x,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// // pressureTemp[IX(x,0,y)] = border[IX(x,0,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// // pressureTemp[IX(x,DIM-1,y)] = border[IX(x,DIM-1,y)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// // pressureTemp[IX(x,y,0)] = border[IX(x,y,0)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
// // pressureTemp[IX(x,y,DIM-1)] = border[IX(x,y,DIM-1)] * FLUID_PRESSURECELL_BOUND_PRESSURE;
//divergence borders
phi0[IX(0,x,y)] = divCache[IX(0,x,y)];
phi0[IX(DIM-1,x,y)] = divCache[IX(DIM-1,x,y)];
phi0[IX(x,0,y)] = divCache[IX(x,0,y)];
phi0[IX(x,DIM-1,y)] = divCache[IX(x,DIM-1,y)];
phi0[IX(x,y,0)] = divCache[IX(x,y,0)];
phi0[IX(x,y,DIM-1)] = divCache[IX(x,y,DIM-1)];
}
}
// //divergence borders
// phi0[IX(0,x,y)] = divCache[IX(0,x,y)];
// phi0[IX(DIM-1,x,y)] = divCache[IX(DIM-1,x,y)];
// phi0[IX(x,0,y)] = divCache[IX(x,0,y)];
// phi0[IX(x,DIM-1,y)] = divCache[IX(x,DIM-1,y)];
// phi0[IX(x,y,0)] = divCache[IX(x,y,0)];
// phi0[IX(x,y,DIM-1)] = divCache[IX(x,y,DIM-1)];
// }
// }
float a = 1;
float c = 6;
chunk->projectionIterations = 0;
@ -294,9 +294,7 @@ LIBRARY_API void pressurecell_approximate_divergence(Environment * environment,
// }
newDivergence = (du+dv+dw) * (-0.5f * FLUID_PRESSURECELL_SPACING);
// divArr[IX(x,y,z)] = divArr[IX(x,y,z)] + newDivergence - FLUID_PRESSURECELL_RESIDUAL_MULTIPLIER * divArr[IX(x,y,z)] + outflowDiv;
newDivergence = fmax(-3.0f,fmin(3.0f,newDivergence));
divArr[IX(x,y,z)] = newDivergence;
if(newDivergence > 3 || newDivergence < -3){
if(newDivergence > FLUID_PRESSURECELL_MAX_DIVERGENCE || newDivergence < -FLUID_PRESSURECELL_MAX_DIVERGENCE){
printf("Invalid divergence! \n");
printf("%f \n",newDivergence);
printf("%f %f \n", uArr[IX(x+1,y,z)], uArr[IX(x-1,y,z)]);
@ -305,6 +303,8 @@ LIBRARY_API void pressurecell_approximate_divergence(Environment * environment,
printf("%f %f %f \n", du, dv, dw);
printf("\n");
}
newDivergence = fmax(-FLUID_PRESSURECELL_MAX_DIVERGENCE,fmin(FLUID_PRESSURECELL_MAX_DIVERGENCE,newDivergence));
divArr[IX(x,y,z)] = newDivergence;
//store pressure value from this frame
presureCache[IX(x,y,z)] = pressureTemp[IX(x,y,z)];

View File

@ -461,34 +461,37 @@ LIBRARY_API double pressurecell_project_velocity(Environment * environment, Chun
//check for NaNs
if(pressureDifferenceX != pressureDifferenceX){
printf("NaN x pressure! %f \n",pressureDifferenceX);
pressureDifferenceX = 0;
}
if(pressureDifferenceY != pressureDifferenceY){
printf("NaN y pressure! %f \n",pressureDifferenceY);
pressureDifferenceY = 0;
}
if(pressureDifferenceZ != pressureDifferenceZ){
printf("NaN z pressure! %f \n",pressureDifferenceZ);
pressureDifferenceZ = 0;
}
//make sure the pressure gradient does not push the velocity into walls
if(x == 1 && pressureDifferenceX > 0){
pressureDifferenceX = 0;
}
if(x == DIM-2 && pressureDifferenceX < 0){
pressureDifferenceX = 0;
}
if(y == 1 && pressureDifferenceY > 0){
pressureDifferenceY = 0;
}
if(y == DIM-2 && pressureDifferenceY < 0){
pressureDifferenceY = 0;
}
if(z == 1 && pressureDifferenceZ > 0){
pressureDifferenceZ = 0;
}
if(z == DIM-2 && pressureDifferenceZ < 0){
pressureDifferenceZ = 0;
}
// if(x == 1 && pressureDifferenceX > 0){
// pressureDifferenceX = 0;
// }
// if(x == DIM-2 && pressureDifferenceX < 0){
// pressureDifferenceX = 0;
// }
// if(y == 1 && pressureDifferenceY > 0){
// pressureDifferenceY = 0;
// }
// if(y == DIM-2 && pressureDifferenceY < 0){
// pressureDifferenceY = 0;
// }
// if(z == 1 && pressureDifferenceZ > 0){
// pressureDifferenceZ = 0;
// }
// if(z == DIM-2 && pressureDifferenceZ < 0){
// pressureDifferenceZ = 0;
// }
float magnitude = sqrt(uArr[IX(x,y,z)] * uArr[IX(x,y,z)] + vArr[IX(x,y,z)] * vArr[IX(x,y,z)] + wArr[IX(x,y,z)] * wArr[IX(x,y,z)]);
if(maxMagnitude < magnitude){
@ -559,7 +562,7 @@ LIBRARY_API double pressurecell_project_velocity(Environment * environment, Chun
}
}
//normalize vector field
if(maxMagnitude > 1){
if(FLUID_PRESSURECELL_ENABLE_VELOCITY_FIELD_NORMALIZAITON && maxMagnitude > 1){
for(y = 1; y < DIM-1; y++){
for(z = 1; z < DIM-1; z++){
for(x = 1; x < DIM-1; x++){

View File

@ -86,6 +86,11 @@ public class ServerFluidChunk {
*/
FloatBuffer weights;
/**
* The float view of the center weight delta buffer
*/
FloatBuffer weightsAdd;
/**
* The float view of the center velocity x buffer
*/
@ -255,6 +260,7 @@ public class ServerFluidChunk {
//get float view
this.weights = this.bWeights[CENTER_BUFF].asFloatBuffer();
this.weightsAdd = this.b0Weights[CENTER_BUFF].asFloatBuffer();
this.velocityX = this.bVelocityX[CENTER_BUFF].asFloatBuffer();
this.velocityY = this.bVelocityY[CENTER_BUFF].asFloatBuffer();
this.velocityZ = this.bVelocityZ[CENTER_BUFF].asFloatBuffer();
@ -333,6 +339,28 @@ public class ServerFluidChunk {
weights.put(this.IX(x,y,z),weight);
}
/**
* Gets the weight delta of a voxel at a poisiton
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @return The weight of the specified voxel
*/
public float getWeightDelta(int x, int y, int z){
return weightsAdd.get(this.IX(x,y,z));
}
/**
* Sets a weight delta
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @param weight The weight
*/
public void setWeightDelta(int x, int y, int z, float weight){
weightsAdd.put(this.IX(x,y,z),weight);
}
/**
* Gets the velocity x buffer
* @return The velocity x buffer

View File

@ -274,7 +274,7 @@ public class ServerFluidManager {
lock.lock();
ServerFluidChunk fluidChunk = this.getChunk(worldPos.x, worldPos.y, worldPos.z);
fluidChunk.setAsleep(false);
fluidChunk.setWeight(voxelPos.x, voxelPos.y, voxelPos.z, weight);
fluidChunk.setWeightDelta(voxelPos.x, voxelPos.y, voxelPos.z, weight);
fluidChunk.setPressure(voxelPos.x, voxelPos.y, voxelPos.z, weight);
lock.unlock();
}

View File

@ -0,0 +1,326 @@
#include <math.h>
#include "stb/stb_ds.h"
#include "fluid/queue/boundsolver.h"
#include "fluid/queue/chunkmask.h"
#include "fluid/queue/chunk.h"
#include "fluid/dispatch/dispatcher.h"
#include "fluid/env/environment.h"
#include "fluid/env/utilities.h"
#include "fluid/sim/pressurecell/pressure.h"
#include "fluid/sim/pressurecell/pressurecell.h"
#include "fluid/sim/pressurecell/solver_consts.h"
#include "fluid/sim/simulator.h"
#include "fluid/tracking/tracking.h"
#include "math/ode/multigrid.h"
#include "../../../util/chunk_test_utils.h"
#include "../../../util/test.h"
/**
* Error margin for tests
*/
#define FLUID_PRESSURE_CELL_ERROR_MARGIN 0.00001f
/**
* Number of chunks
*/
#define CHUNK_DIM 1
float density1[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.69048923, 0.68344504, 0.6719319, 0.6808653, 0.61352354, 0.49754804, 0.7234441, 0.57645786, 0.7317031, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.6984813, 0.69282156, 0.67653066, 0.69057816, 0.64129937, 0.55511373, 0.56887656, 0.5835239, 0.7316138, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.7001391, 0.69658595, 0.6767782, 0.6936621, 0.64707285, 0.5544145, 0.56652504, 0.5847117, 0.7317505, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.699174, 0.701909, 0.67882633, 0.6936772, 0.6522789, 0.55257237, 0.5700313, 0.73026735, 0.6555278, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.70207363, 0.70383906, 0.6792504, 0.69247365, 0.65833366, 0.54427963, 0.39388853, 0.72895956, 0.65592605, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.7078093, 0.7024574, 0.7070358, 0.6794525, 0.69907266, 0.6824797, 0.54927284, 0.38852876, 0.8125048, 0.65346754, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.7024204, 0.70782405, 0.6771119, 0.69818544, 0.67861336, 0.5336991, 0.386235, 0.809665, 0.64991826, 0.632615, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.701668, 0.7064921, 0.6709687, 0.6975948, 0.6792441, 0.5507235, 0.3906892, 0.7285534, 0.729877, 0.63085526, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.7068763, 0.70258623, 0.70411986, 0.6791243, 0.69460607, 0.679187, 0.5668111, 0.6980342, 0.77743393, 0.7290218, 0.63053304, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.70393914, 0.70599574, 0.673777, 0.6981548, 0.67023003, 0.539208, 0.69742954, 0.7801849, 0.6521156, 0.63046247, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.69505364, 0.7075167, 0.6823159, 0.6987195, 0.6793542, 0.55382913, 0.38184577, 0.7262258, 0.6526648, 0.6310061, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.6974854, 0.84601957, 0.6755932, 0.7014735, 0.68225557, 0.5679463, 0.38261777, 0.7268857, 0.6532826, 0.6336673, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.70763224, 0.70234615, 0.7049022, 0.680908, 0.70073855, 0.684178, 0.5632769, 0.38307858, 0.72715807, 0.6561662, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.6992224, 0.7068133, 0.6760351, 0.69826126, 0.68544674, 0.57073545, 0.3807425, 0.7275822, 0.6564954, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.7010081, 0.7065021, 0.6787313, 0.6976757, 0.68454695, 0.55566454, 0.38474354, 0.7270711, 0.6573914, 0.84601957, 0.0,
0.0, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.84601957, 0.70205253, 0.69598716, 0.6992517, 0.67132705, 0.69343287, 0.6783944, 0.50955003, 0.4855342, 0.72251993, 0.64864814, 0.84601957, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
float density2[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0029071963, 0.0029055434, 0.0028604858, 0.002862821, 0.0028883053, 0.0029455917, 0.0027377964, 0.0024298602, 0.0022809561, 0.0030127885, 0.0022584598, 0.0019038058, 0.002192472, 0.001893526, 0.0023016082, 0.0024864834, 0.0,
0.0, 0.002878285, 0.0027990057, 0.002710093, 0.0028773542, 0.0029079828, 0.0029519256, 0.0027618376, 0.0024239637, 0.0023359426, 0.003706993, 0.0024229914, 0.0021850686, 0.0021620078, 0.0019132678, 0.0023095193, 0.0024914155, 0.0,
0.0, 0.0028768796, 0.0028015007, 0.002728702, 0.0028688486, 0.0028774058, 0.0029523983, 0.0027382995, 0.0024160685, 0.002372823, 0.0043275533, 0.0025287517, 0.0021229072, 0.0021578507, 0.0019168254, 0.0022555662, 0.0024844967, 0.0,
0.0, 0.0028729956, 0.003019339, 0.0034048627, 0.002931812, 0.0028098298, 0.002928262, 0.0026999596, 0.0023828072, 0.0023553716, 0.0038732972, 0.0024743115, 0.0021061092, 0.002129224, 0.0021310255, 0.0021483311, 0.0024807944, 0.0,
0.0, 0.002892332, 0.0028387038, 0.0029367406, 0.0027860203, 0.002753709, 0.002901138, 0.0026421903, 0.002382853, 0.0022791468, 0.002649561, 0.0023153157, 0.0021116734, 0.0019652026, 0.0022460392, 0.0021509244, 0.002474897, 0.0,
0.0, 0.0028859456, 0.0028289936, 0.0028582828, 0.0026348107, 0.0027488465, 0.0028233859, 0.0026550873, 0.0023762158, 0.002196001, 0.0025025937, 0.0023788367, 0.0020892739, 0.0019345157, 0.001947522, 0.0021423819, 0.0024688644, 0.0,
0.0, 0.0028867908, 0.0028328996, 0.002863477, 0.0027837725, 0.0027575644, 0.0028812631, 0.002965174, 0.0023779138, 0.0022570486, 0.0024692873, 0.002386025, 0.002040072, 0.0019170775, 0.0019375072, 0.0021361792, 0.0020626576, 0.0,
0.0, 0.002914303, 0.0029045553, 0.0028627655, 0.0027895444, 0.0027071557, 0.0030298224, 0.0034991035, 0.0024891982, 0.0022432837, 0.002453341, 0.00233485, 0.0020335945, 0.00192543, 0.0022252914, 0.0022449153, 0.0020582865, 0.0,
0.0, 0.0029149298, 0.0029053083, 0.0028636232, 0.0028114105, 0.0028017322, 0.0029813172, 0.002905295, 0.0023630715, 0.0023044, 0.0025730145, 0.0024000912, 0.00209579, 0.0023913595, 0.002054754, 0.002238055, 0.0020570676, 0.0,
0.0, 0.002912843, 0.002913472, 0.0028661473, 0.0028094947, 0.0027854575, 0.0028969152, 0.0030807627, 0.0028274248, 0.0022927579, 0.002337793, 0.0023666902, 0.0019478231, 0.0022202244, 0.0020541926, 0.002128221, 0.0020578138, 0.0,
0.0, 0.002911812, 0.002913742, 0.0028663892, 0.002795482, 0.0026347619, 0.0028233184, 0.002841899, 0.002392985, 0.002345942, 0.0025121677, 0.0023975193, 0.002053815, 0.0020195432, 0.0022295043, 0.0021382656, 0.00208789, 0.0,
0.0, 0.0029128017, 0.0029296442, 0.0028632018, 0.0028035976, 0.0027603882, 0.0029455903, 0.0029620656, 0.0024368216, 0.0023019095, 0.0025845922, 0.0024592287, 0.0020861498, 0.0020250913, 0.0022376133, 0.0021470294, 0.002092873, 0.0,
0.0, 0.0029151703, 0.0029291515, 0.0028612064, 0.0027797476, 0.0027750924, 0.0030008035, 0.0039316965, 0.002535492, 0.0023111792, 0.0026051914, 0.0024528776, 0.0020895363, 0.0020343012, 0.0022447193, 0.0021514012, 0.0024336297, 0.0,
0.0, 0.0029178213, 0.0029280584, 0.0028618686, 0.002773584, 0.002755808, 0.002922501, 0.0032724957, 0.0024275917, 0.0023428807, 0.002885429, 0.0025337767, 0.0021274977, 0.0021930304, 0.0022549084, 0.002152021, 0.0024416512, 0.0,
0.0, 0.0029051662, 0.0029105232, 0.0028606895, 0.0027759492, 0.0027809688, 0.002933839, 0.0027737482, 0.0024880639, 0.0024379366, 0.0027836931, 0.002507882, 0.0021080591, 0.0019652026, 0.0022530025, 0.0021827887, 0.0025507864, 0.0,
0.0, 0.0029044556, 0.0029056359, 0.002828672, 0.0027649098, 0.0027503509, 0.0029168916, 0.0027354914, 0.0022664426, 0.0023302413, 0.002510533, 0.0023725051, 0.0019143604, 0.0018669084, 0.0022160688, 0.0021505316, 0.0025277825, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
};
float u1[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.5874545E-4, 0.0014632348, 0.004202116, 0.008936257, 0.0156222405, 0.03759462, 0.06228456, 0.06278213, 0.055959605, 0.054622963, 0.04232567, 0.019482028, 0.008279134, 0.003794775, 0.0017010869, 0.0015193546, 0.0,
0.0, -0.008298971, -0.009509156, -0.012617575, -0.01893841, -0.01857699, -0.009818174, 0.013164489, 0.014566375, 0.041004285, 0.0067270263, 0.008189897, 0.001520605, -0.0036249808, -0.0059337686, -0.0035335273, -0.001876206, -0.011984693,
0.0, -0.0025506124, -0.0025819046, -0.005750152, -0.012309375, -0.012260433, -0.007065423, 0.007885578, 0.007293687, 0.060674336, 0.0049953116, 0.01233317, 0.0055984883, 0.001189472, 5.119554E-5, 0.0013379811, 0.0011881284, -0.006296722,
0.0, -0.003062474, -0.004982933, -0.008680933, -0.016468463, -0.014558284, -0.012196412, -0.014078753, -0.016717333, 0.030290788, -0.0052808444, -0.001270294, 0.0011982755, 4.818444E-4, -8.97697E-5, 0.001677933, 0.0017477236, -0.005144657,
0.0, -0.0017868747, -0.0045674536, -0.008496323, -0.014442761, -0.014022475, -0.02254467, -0.022509897, -0.03187213, 0.018825829, -7.0925767E-4, 0.010312297, 0.004628042, -3.3031148E-4, 7.3223043E-4, 0.0019656145, 0.002444057, -0.0021530367,
0.0, -0.0019888338, -0.0048081786, -0.0090272445, -0.014486008, -0.014638092, -0.018715195, -0.01510355, -0.033456754, 0.019874558, 0.0056790216, 0.004223332, 0.0053986446, -0.0011108677, -9.673022E-5, 5.720368E-4, 0.0017315921, -0.0012986752,
0.0, -0.003463803, -0.007282666, -0.012425532, -0.016521461, -0.0070743035, 5.429203E-4, 0.0070499023, -0.00678288, 0.025092093, 0.006512445, 0.005874667, 0.008148553, 2.83584E-4, -0.0013698484, -0.0014965344, 2.8312465E-4, -8.659475E-4,
0.0, -0.0062634023, -0.011159876, -0.016063442, -0.016834961, 0.0016583395, 0.026719777, 0.039747823, 0.022476789, -0.015632156, 0.011731358, 0.011537961, 0.013361163, 6.393147E-4, -0.004025147, -0.0040842704, -0.0021773065, -0.0024226033,
0.0, -0.006475626, -0.009457158, -0.0109054465, -0.012170998, -0.008282777, -0.0073043797, -7.590549E-4, -0.007890651, 0.015836995, 0.004021777, 0.0037430234, 2.8686263E-4, 0.0011820751, -0.0038337824, -0.0033757691, -0.002005882, -0.0022952573,
0.0, -0.0069432408, -0.0081206765, -0.006394053, -0.009964473, -0.026804786, -0.051031377, -0.054990858, -0.049987447, -0.009225023, -0.005928298, -0.018200703, -0.0131686935, -0.008730947, -0.0053813397, -0.0033604195, -0.0021645476, -0.0023571365,
0.0, -0.009968959, -0.011912394, -0.009412086, -0.010057292, -0.019419216, -0.023865659, -0.024779635, -0.025471825, -0.0136103565, -0.004517858, -0.011046195, -0.012630715, -0.010028927, -0.0076574674, -0.006217146, -0.004498036, -0.0039754524,
0.0, -0.011805796, -0.013777586, -0.010155864, -0.0060557774, -0.006237537, -0.002555993, -0.017533554, 1.9637728E-4, -0.03693986, -0.018330967, -0.023356412, -0.01678964, -0.009743225, -0.008613119, -0.008426685, -0.007257497, -0.004064,
0.0, -0.012579988, -0.014164174, -0.010362106, -0.0056747026, -0.001418308, 0.01039884, 3.285159E-5, 0.0150177125, -0.027779164, -0.028556854, -0.020253912, -0.015226167, -0.0061555803, -0.0077824835, -0.008973096, -0.008176464, -0.0032867868,
0.0, -0.012153802, -0.012579672, -0.008464375, -0.0034959663, -0.004769141, 0.010289033, -0.00715359, 0.027434085, -0.015229169, -0.013515536, -0.012678702, -0.013494567, -0.006014964, -0.007481211, -0.008593624, -0.008135741, -0.0024451148,
0.0, -0.007376228, -0.006154538, -0.0017192396, 0.0054650744, 0.0023596762, -0.0064586746, -0.010464562, -1.2331898E-4, 0.008835612, -0.013587953, -0.013248458, -0.009179113, -0.0022388143, -0.0033494288, -0.0049637547, -0.0062812194, 0.0014360776,
0.0, -0.003794968, -0.0058901557, -0.009424328, -0.013158713, -0.020129813, -0.0371757, -0.04651646, -0.041470673, -0.026366247, -0.0356579, -0.03799817, -0.019415978, -0.011737447, -0.007339083, -0.005311134, -0.004772558, -0.0013867166,
0.0, 9.336786E-4, 7.671094E-4, 6.659016E-4, 0.0012424137, 0.0028505137, 0.0032647299, 0.004053183, 0.011592951, 0.016845014, 0.015351919, 0.010156329, 0.006080689, 0.0038226258, 0.0021137327, 0.0018891345, 0.0018324897, 0.0026015781,
};
float u2[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.3754143E-4, 0.0012976385, 0.0034549758, 0.007897754, 0.010461241, 0.012918171, 0.026087662, 0.02649513, 0.049712554, 0.03031959, 0.028060697, 0.012234627, 0.00783662, 0.003786027, 0.001675939, 0.0013230317, 4.7671565E-6,
0.0, -0.009697662, -0.0113384845, -0.015175774, -0.022887273, -0.02762455, -0.02593206, -0.017099865, -0.016199486, 0.028544381, -0.0057118707, -0.0064025535, -0.010757958, -0.008265029, -0.005985656, -0.0035190566, -0.0017091334, -0.011025013,
0.0, -0.0035819446, -0.004468945, -0.008771062, -0.016442712, -0.021904541, -0.021251194, -0.0150248455, -0.021080231, 0.012941504, -0.0051341807, -0.0050091883, -0.0054996433, -0.0015197262, 8.300959E-5, 0.0017807735, 0.0017675266, -0.004835345,
0.0, -0.0043272213, -0.0059303474, -0.010477669, -0.021441873, -0.029193968, -0.03110532, -0.028166246, -0.029882673, -0.010910313, -0.0083871335, -0.0100448, -0.00560889, -0.0018568237, -9.585853E-5, 0.0018682451, 0.0022675113, -0.004248966,
0.0, -0.0026478614, -0.0035209055, -0.0072111473, -0.01778731, -0.02511963, -0.027293118, -0.031044817, -0.02407258, -0.01431217, -0.0044077714, -0.0050173705, -0.0031844063, -0.0016137012, 6.674709E-4, 0.0020588252, 0.002999479, -0.0014952623,
0.0, -0.0027244554, -0.0042657256, -0.008364594, -0.017696392, -0.023031974, -0.022327036, -0.025788924, -0.021256315, -0.033305272, -0.0056634126, -0.006338282, -0.00459313, -0.0033145559, -6.4389815E-4, 5.451114E-4, 0.0024087743, -6.595833E-4,
0.0, -0.0037065626, -0.0063992753, -0.011458237, -0.01921247, -0.020713877, -0.015445438, -0.013090985, -0.022836355, -0.019556336, -0.003159946, 6.803073E-4, -0.0020247113, -0.003154813, -0.0028415425, -0.0016840381, 3.7324513E-4, -3.531565E-4,
0.0, -0.006173445, -0.009905719, -0.014281878, -0.018425312, -0.017041508, -0.008563244, -0.006765726, -0.023715999, 0.012059895, -0.0036010765, 0.007455617, 6.698056E-4, -0.0043561067, -0.0053677806, -0.0046495, -0.0022294421, -0.0019283685,
0.0, -0.0063878694, -0.008668763, -0.009685313, -0.0111630475, -0.012029763, -0.01557609, -0.014827887, -0.0160511, -0.0011896974, -0.007605665, -3.1256565E-4, -0.007053777, -0.0060904557, -0.0045748535, -0.0036228525, -0.0020701543, -0.0020102235,
0.0, -0.0069897426, -0.008374774, -0.006926623, -0.007907194, -0.011045558, -0.019141877, -0.021267254, -0.009046103, -0.03483986, -0.006840328, -0.006784836, -0.013072143, -0.008692229, -0.005379714, -0.0033776332, -0.0022422133, -0.0024367513,
0.0, -0.009824188, -0.012340311, -0.010573625, -0.008892886, -0.009866875, -0.015037514, -0.016838938, -0.011925519, 0.009665033, -0.008891027, -0.0035432251, -0.009717715, -0.009361874, -0.007474806, -0.006245209, -0.004581082, -0.004184998,
0.0, -0.011214084, -0.013990467, -0.01143796, -0.0063058427, -0.004263657, -0.0061195884, -0.004169246, -0.008021667, 0.006730642, -0.0072471146, -0.0068214997, -0.007024556, -0.0075391647, -0.00811444, -0.008405699, -0.0073947376, -0.0044575697,
0.0, -0.011701416, -0.014320106, -0.01171696, -0.0057956944, -0.0014291223, 0.0015882127, 0.005617155, 2.5159394E-4, 0.015960988, -0.0019108044, -0.0117830485, -0.0015709276, -0.0039938916, -0.007416416, -0.008960701, -0.008673688, -0.0037965667,
0.0, -0.011149769, -0.01278032, -0.010069659, -0.003944026, 3.5748817E-4, 0.0032040149, 0.008802291, 0.003419067, 0.044948913, -0.0029407276, -0.0034930126, -0.00367138, -0.0043693422, -0.0073979977, -0.0086394455, -0.008502812, -0.0028200732,
0.0, -0.006036193, -0.005548721, -0.0018835298, 0.0059616533, 0.0103949765, 0.0116134165, 0.007883946, 0.01848658, 0.045054544, 0.0012527043, 0.0030250205, 2.3392276E-6, 1.4186339E-4, -0.00289018, -0.004855968, -0.0063825794, 0.0015042748,
0.0, -0.0029990342, -0.0047226823, -0.008441756, -0.01193225, -0.013653657, -0.015356253, -0.018478515, -0.014835461, -0.023181496, -0.013229921, -0.021890199, -0.013530319, -0.010149003, -0.0072005894, -0.005204054, -0.0044600884, -0.0013305129,
0.0, 0.0010131361, 0.0015698853, 0.0026352354, 0.0050916877, 0.00762484, 0.010391836, 0.01806389, 0.028979605, 0.035792578, 0.029282358, 0.021566533, 0.012757775, 0.0070499266, 0.0035502822, 0.0020925389, 0.0018906511, 0.0030561793,
};
float v1[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.07495171, 0.13037163, 0.22837798, 0.111540794, 0.055412777, 0.021746306, 0.0, 0.0, 0.0, 0.0, 1.7992349E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.073671944, 0.1180906, 0.24594572, 0.09138391, 0.052607965, 0.02716596, 0.0058612972, 0.0, 0.0, 0.0, 2.887083E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.060661368, 0.088546365, 0.243999, 0.05837086, 0.053247612, 0.028946854, 0.006271675, 0.0, 0.0, 0.0, 4.07671E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06823539, 0.046769943, 0.22792958, 0.06405762, 0.05619423, 0.032554585, 0.007894913, 0.0, 0.0, 0.0, 6.618185E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.045478247, 0.031622197, 0.22459242, 0.08632775, 0.07145331, 0.033000905, 0.0012288786, 0.0, 0.0, 0.0, 8.7155355E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.631472E-4, 0.04246614, 0.006532563, 0.22301438, 0.06889216, 0.06045446, 0.03867068, 0.006034296, 0.0, 0.0, 0.0, 9.840637E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.042757392, 3.4675223E-4, 0.24138361, 0.07590463, 0.06579979, 0.042933658, 0.010410709, 0.0, 0.0, 0.0, 0.0010693239,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.048665356, 0.010801062, 0.28959805, 0.080575734, 0.07235194, 0.052530337, 0.014948753, 0.0, 0.0, 0.0, 0.0010730048,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0077874674, 0.04145623, 0.029418165, 0.22559077, 0.10404523, 0.10236042, 0.06010509, 0.025777323, 0.0, 0.0, 0.0, 0.0010738779,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.030838711, 0.014698686, 0.26755768, 0.07617534, 0.093826, 0.058117617, 0.026466856, 0.0, 0.0, 0.0, 0.0011680513,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.100573994, 0.0027592022, 0.20054255, 0.07174908, 0.060341433, 0.059837684, 0.016888937, 0.0, 0.0, 0.0, 0.0012110593,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0814893, 0.0, 0.25330362, 0.050132096, 0.046711568, 0.051703498, 0.01490547, 0.0, 0.0, 0.0, 0.0010928395,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0018544559, 0.04334154, 0.023279162, 0.2115915, 0.055906907, 0.053190976, 0.04613092, 0.011655849, 0.0, 0.0, 0.0, 9.1104506E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06785628, 0.008279819, 0.24983591, 0.07533173, 0.07174466, 0.042484436, 0.009783864, 0.0, 0.0, 0.0, 7.43858E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05383518, 0.010722554, 0.22867525, 0.079919904, 0.07276804, 0.038078267, 0.00967988, 0.0, 0.0, 0.0, 7.788517E-4,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.004937459, 0.043655004, 0.02293531, 0.25831464, 0.074603796, 0.072446845, 0.0297832, 0.011572254, 0.0, 0.0, 0.0, 8.599485E-4,
0.0, 0.0, 0.0015548205, 0.0038109077, 0.01044689, 0.015299626, 0.017869225, 0.026386706, 0.047127057, 0.05731042, 0.046601392, 0.029021088, 0.014518207, 0.0102321785, 0.0058495384, 0.0014577125, 7.015204E-4, 0.0015353825,
};
float v2[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, -0.025785228, -0.02765071, -0.031635117, -0.040080477, -0.03779744, -0.017380022, -0.036196772, -0.22027917, -0.40528932, -0.056375552, -0.03947026, -0.0010517047, -0.012352764, -0.013122707, -0.012370644, -0.011037422, -0.01039087,
0.0, -0.023716193, -0.025800193, -0.032497812, -0.045410924, -0.043220013, -0.022148317, -0.009867554, -0.3157268, -0.48205405, -0.020433862, -0.05375182, 5.920471E-4, -0.010927142, -0.011600992, -0.011149427, -0.010017972, -0.009528188,
0.0, -0.02279939, -0.024884038, -0.031053575, -0.04212137, -0.03797055, -0.015134738, -0.0116676185, -0.35938817, -0.49015468, -0.055841252, -0.06116283, -0.003409952, -0.010228395, -0.011801685, -0.01112409, -0.00991568, -0.009081068,
0.0, -0.021991795, -0.029118603, -0.037797943, -0.040780257, -0.033994034, -0.01055996, -0.012985408, -0.39906058, -0.49330288, -0.06546464, -0.070093736, -0.010583761, -0.009316711, -0.012702831, -0.011938088, -0.010136714, -0.008685569,
0.0, -0.02174265, -0.025654431, -0.032329813, -0.039231017, -0.029584251, -0.0038711524, -0.0045739906, -0.44755682, -0.4839789, -0.061975773, -0.09221831, -0.017509086, -0.010608952, -0.013819456, -0.012597324, -0.010527763, -0.0083327275,
0.0, -0.021344142, -0.025697574, -0.03195727, -0.037084848, -0.027740536, -0.008169498, -0.004505349, -0.47618937, -0.59927434, -0.09427301, -0.1102684, -0.027894521, -0.0070902994, -0.014069555, -0.012533876, -0.0108338045, -0.007880638,
0.0, -0.021041363, -0.026306445, -0.032933626, -0.035691436, -0.023778528, -0.006685052, 0.0010992636, -0.4739799, -0.4494282, -0.1479196, -0.1169845, -0.0392917, -0.0038494084, -0.013208208, -0.012664009, -0.010056013, -0.007375172,
0.0, -0.02115185, -0.0272717, -0.033812, -0.03498607, -0.022002282, -0.01139488, -0.03202019, -0.56954545, -0.5003418, -0.14347334, -0.12042652, -0.044782534, -0.0026407372, -0.011483522, -0.012805974, -0.010407592, -0.006872984,
0.0, -0.021124369, -0.027739214, -0.034269597, -0.033856858, -0.019124573, -0.054841045, -0.008351544, -0.64536667, -0.46405035, -0.20326708, -0.1349865, -0.067356825, 0.0012023227, -0.010824342, -0.012325776, -0.010717871, -0.006188782,
0.0, -0.021318754, -0.027927948, -0.034517463, -0.034279972, -0.020061746, -0.029075375, -0.064505614, -0.6289067, -0.4380356, -0.17905523, -0.09473625, -0.06845887, -3.885953E-4, -0.011452666, -0.012576127, -0.010569937, -0.0063873036,
0.0, -0.02161521, -0.027842898, -0.034291983, -0.035178907, -0.020443268, -0.031464327, -0.018424947, -0.59829104, -0.5140266, -0.115326636, -0.12142156, -0.04929101, -0.0020165453, -0.01168426, -0.012311093, -0.01019475, -0.0063740304,
0.0, -0.02232925, -0.027875807, -0.033730637, -0.035381176, -0.022149451, -0.010602264, -0.018922018, -0.5761325, -0.56978714, -0.11443269, -0.10240987, -0.04145927, -0.0017463466, -0.011695216, -0.012057789, -0.009791409, -0.0063643977,
0.0, -0.023500329, -0.028082507, -0.03364174, -0.036718246, -0.022564692, -0.028452277, 0.006313865, -0.45316198, -0.5991353, -0.11651272, -0.09142207, -0.03379512, -0.0035454382, -0.01168898, -0.011930665, -0.010532097, -0.0063430076,
0.0, -0.024795728, -0.028260244, -0.033772163, -0.039166432, -0.025411718, -0.027113238, 0.0036409113, -0.4613797, -0.49224916, -0.089239426, -0.101765126, -0.03167178, -0.0030135533, -0.010428783, -0.011696345, -0.0104984045, -0.0063497405,
0.0, -0.025737468, -0.02814392, -0.03309461, -0.039091256, -0.02729659, -0.01544366, -0.001967845, -0.44903657, -0.4773431, -0.1096199, -0.073718265, -0.017880213, 3.6657148E-4, -0.008986275, -0.0111503145, -0.010738926, -0.006296382,
0.0, -0.026237676, -0.026955353, -0.029345706, -0.032962028, -0.023191141, -0.021966612, -0.010014506, -0.45091882, -0.43938738, -0.11584482, -0.076067306, -0.019610189, -0.0016823263, -0.008950987, -0.01103647, -0.0106221605, -0.0065716775,
0.0, -0.013631253, -0.0119126635, -0.013091518, -0.025543287, -0.045408323, -0.05389628, -0.039428465, -0.0070654363, 0.05565011, 0.016276876, 0.009760057, -0.0035257067, -0.005076375, -0.0036057476, -0.0030896452, -0.0031953307, -0.0025803433,
};
float w1[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.007995574, -0.03178949, -0.049939584, -0.0666793, 0.0020305307, 0.14776164, 0.4455282, 0.5463945, -0.019356264, -0.42971942, -0.19611414, -0.052846804, 0.026099192, 0.035086986, 0.020386802, -0.009538848, 0.0021235037,
0.0, 0.00968355, -0.035901606, -0.06015748, -0.07293044, 0.0052576875, 0.18366118, 0.5637157, 0.6524996, -0.0061254376, -0.56451577, -0.25112972, -0.0700231, -8.5346075E-4, 0.042002693, 0.024621356, -0.010179977, 0.002747961,
0.0, 0.011543012, -0.035418577, -0.059597414, -0.064593546, 0.025972366, 0.20066856, 0.5661536, 0.61330926, -0.102020144, -0.76415455, -0.27378026, -0.093330584, -0.013755148, 0.037295587, 0.023616264, -0.0114454655, 0.003409903,
0.0, 0.0134931225, -0.034360852, -0.061323684, -0.05867481, 0.044963878, 0.23281312, 0.6794568, 0.4883663, 0.020421302, -0.7846543, -0.29966316, -0.111805275, -0.025195803, 0.032266926, 0.024729528, -0.012540879, 0.004672922,
0.0, 0.014873199, -0.037870668, -0.065648094, -0.05441257, 0.0486015, 0.32666254, 0.7261764, 0.49760777, -0.2656258, -0.6937406, -0.24567866, -0.1337345, -0.009739383, 0.030223884, 0.025204197, -0.013533601, 0.0058334065,
0.0, 0.015915118, -0.040403407, -0.069306895, -0.04822306, 0.06615838, 0.29023907, 0.70845747, 0.38475767, 0.18763995, -0.6315426, -0.65660787, -0.15009153, -0.018406035, 0.02814384, 0.026476618, -0.01411321, 0.0067835245,
0.0, 0.016526045, -0.04358537, -0.07282761, -0.039805565, 0.078717254, 0.3196445, 0.7603053, 0.38784638, 0.21383975, -0.5932712, -0.70658594, -0.16741054, -0.028038144, 0.026130367, 0.027537582, -0.013849806, 0.007529141,
0.0, 0.016733408, -0.04787018, -0.07625742, -0.029693268, 0.08233404, 0.38775533, 0.83306104, 0.38583615, -0.12427759, -0.40097833, -0.74296033, -0.17946045, -0.033964634, 0.027059412, 0.027531317, -0.013877997, 0.0077021173,
0.0, 0.016986491, -0.051716115, -0.07739638, -0.016651645, 0.09053377, 0.4308985, 0.92792165, 0.30557334, 0.53082156, -0.32197458, -0.6312536, -0.18585317, -0.104300775, 0.021780932, 0.027716309, -0.013728598, 0.008054714,
0.0, 0.017148042, -0.049894657, -0.07786523, -0.0206481, 0.096435815, 0.41292298, 0.8785957, 0.43017375, 0.40605792, -0.37856877, -0.8586891, -0.18234612, -0.10578066, 0.024093175, 0.02918287, -0.014040872, 0.008019047,
0.0, 0.017041652, -0.048247244, -0.07850698, -0.030365925, 0.08110559, 0.3846694, 0.9833039, 0.45977232, -0.6575063, -0.41058746, -0.8233464, -0.19639288, -0.035314377, 0.028582092, 0.029896373, -0.01413085, 0.008007783,
0.0, 0.01622289, -0.046300348, -0.07641395, -0.0348907, 0.07505031, 0.4452669, 0.9377378, 0.42903307, 0.20393874, -0.47558916, -0.85585725, -0.1799802, -0.027756324, 0.03071461, 0.029455608, -0.013879229, 0.0075918334,
0.0, 0.014543518, -0.044166025, -0.0728542, -0.040631954, 0.06931914, 0.39194003, 0.73604834, 0.47496444, 0.5159114, -0.40083906, -0.7018352, -0.15551147, -0.020908598, 0.031571105, 0.028231783, -0.013914808, 0.006930269,
0.0, 0.012244187, -0.042307343, -0.07047079, -0.04919783, 0.04569034, 0.3549434, 0.84822965, 0.35828856, -0.24401438, -0.5891589, -0.5832966, -0.14791003, -0.013859988, 0.031173097, 0.026293937, -0.013148394, 0.005932888,
0.0, 0.010051465, -0.03929174, -0.06609341, -0.05578621, 0.03696809, 0.28956857, 0.7534919, 0.33201864, 0.020052165, -0.507104, -0.5454807, -0.13356233, -0.0066357157, 0.03227058, 0.025749201, -0.0121128615, 0.0048156,
0.0, 0.008386129, -0.032430433, -0.054539498, -0.05172768, 0.0444008, 0.21804509, 0.57737386, 0.30129638, -0.15235071, -0.37757212, -0.43829358, -0.11597147, -0.023462875, 0.028038615, 0.021138411, -0.011254291, 0.0035827705,
0.0, 0.0023068509, -0.0135902455, -0.008319176, -0.022064934, -0.04023528, -0.043180272, -0.01838019, 0.013527469, 0.019328823, 0.019701743, 0.033389226, 0.035167407, 0.025359172, 0.01073396, 0.0053944914, -0.0046581835, 0.0055236537,
};
float w2[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.00690459, -0.028317763, -0.042238966, -0.06733722, -0.045721736, 0.0051486343, 0.052943822, 0.009234749, 0.020925403, -0.03924048, -0.011240643, 0.007938115, 0.03834484, 0.035441805, 0.020747142, -0.008245127, 0.0019389516,
0.0, 0.008255522, -0.035331283, -0.05763488, -0.08380559, -0.053885914, 0.0024751374, 0.07213999, -0.010284402, 0.032092355, -0.0052926233, 1.9571895E-4, 0.01534215, 0.046897765, 0.04259965, 0.025606943, -0.008893084, 0.0030333921,
0.0, 0.0097205, -0.03388134, -0.056809388, -0.08084918, -0.044009548, 0.016085865, 0.08895086, -0.027412567, 0.031925507, -0.016334305, -0.017409988, -0.0039050337, 0.037112456, 0.037884086, 0.024474746, -0.010325384, 0.004739044,
0.0, 0.011278988, -0.03398596, -0.058141842, -0.082554325, -0.040728603, 0.020681156, 0.09706818, -0.049581084, 0.0550964, -0.024747102, -0.025093473, -0.020830806, 0.029783688, 0.03636776, 0.025281772, -0.011619182, 0.006230622,
0.0, 0.012506152, -0.03607227, -0.06381825, -0.085656814, -0.03982256, 0.02067127, 0.099034645, -0.07916098, -0.049684577, -0.050175745, -0.04562496, -0.038854882, 0.020934515, 0.034606412, 0.025782159, -0.012741616, 0.0077370317,
0.0, 0.01340583, -0.037973545, -0.067646846, -0.0842683, -0.0328807, 0.030614989, 0.101642534, -0.07958494, -0.11124825, -0.04521421, -0.0340844, -0.04341436, 0.018487748, 0.03577463, 0.027113196, -0.013333533, 0.008904041,
0.0, 0.013923872, -0.03994198, -0.07070374, -0.08214109, -0.028247016, 0.033852722, 0.07883721, -0.09005991, 0.08281832, -0.026660457, -0.034572963, -0.0483382, 0.014326005, 0.035206474, 0.02838719, -0.013633336, 0.009905391,
0.0, 0.013959141, -0.04355441, -0.0751236, -0.079309076, -0.023790957, 0.033267356, 0.04516268, -0.09556345, -0.12306079, 0.003421976, -0.036439165, -0.049219582, 0.012651271, 0.034917843, 0.02968013, -0.013647314, 0.010456416,
0.0, 0.013910792, -0.046116557, -0.075698055, -0.07143499, -0.014427891, 0.023319744, 0.023755739, -0.103689685, 0.088923365, -0.039321996, -0.048723582, -0.051373724, 0.009518884, 0.033316232, 0.030376306, -0.013513833, 0.01087009,
0.0, 0.014304785, -0.044590358, -0.07551337, -0.074158214, -0.01584947, 0.03849706, 0.04845552, -0.10632829, 0.021865087, 0.03415319, -0.023960654, -0.049688537, 0.0116242245, 0.03538465, 0.030611103, -0.013808219, 0.010888959,
0.0, 0.014396073, -0.043479197, -0.07599259, -0.08069808, -0.022592653, 0.03520938, 0.058179967, -0.111512415, -0.1826192, 0.01511534, -0.023107946, -0.049395315, 0.013074702, 0.03741208, 0.03137692, -0.013899026, 0.010734033,
0.0, 0.013783261, -0.042952675, -0.076006725, -0.08509737, -0.026502382, 0.04041989, 0.10347313, -0.11128995, -0.16262999, 0.0128521165, -0.011929154, -0.0450091, 0.016828896, 0.038980123, 0.030859688, -0.013652833, 0.010073,
0.0, 0.012496312, -0.04226914, -0.07417465, -0.08575863, -0.029490722, 0.031035993, 0.11291907, -0.08216443, -0.08993718, -0.011105006, -0.038718563, -0.04418421, 0.01800762, 0.038635753, 0.02944169, -0.013114094, 0.009059717,
0.0, 0.010766116, -0.042411923, -0.07436321, -0.08990196, -0.038699206, 0.018042168, 0.09795842, -0.087596774, -0.041904643, -0.05204625, -0.04040942, -0.039167315, 0.021000933, 0.037747413, 0.027459428, -0.012317735, 0.007833809,
0.0, 0.009210755, -0.040547874, -0.07031732, -0.089140564, -0.041798577, 0.017622303, 0.09476206, -0.07507296, 0.02885139, -0.033748083, -0.033416986, -0.031752206, 0.027608957, 0.038130876, 0.026959557, -0.011281685, 0.006657029,
0.0, 0.007728724, -0.032638453, -0.0543884, -0.07256207, -0.029818054, 0.029904818, 0.0832958, -0.049660508, -0.040904876, -0.028365463, -0.045895312, -0.035171013, 0.021954678, 0.032285675, 0.021919765, -0.010390895, 0.0056577357,
0.0, 0.00456764, -0.016222883, -0.0201119, -0.045866154, -0.061571, -0.047546547, -0.01237516, 0.030627111, 0.026964664, 0.01574358, 0.03827329, 0.04330434, 0.03705151, 0.02033998, 0.010187634, -0.004075733, 0.00655562,
};
float p1[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0035670307, 0.0037519077, 0.004353941, 0.006888071, 0.011418129, 0.015109462, 0.010487172, -0.0034104995, -0.014130759, -0.0014538198, 0.008005521, 0.009658143, 0.007379012, 0.0047208806, 0.0028988235, 0.0019935477, 0.005383016,
0.0, 0.0036339893, 0.0038802365, 0.004726059, 0.007742572, 0.012791801, 0.01626625, 0.009576439, -0.006734189, -0.019600796, -0.003778313, 0.0074987696, 0.010287835, 0.008124475, 0.0052558673, 0.0031883402, 0.002143778, 0.0057146954,
0.0, 0.003534598, 0.003845297, 0.0049080853, 0.008327667, 0.013854575, 0.016823573, 0.0076464824, -0.011631581, -0.026898133, -0.007462665, 0.006495481, 0.010672652, 0.008682789, 0.005656019, 0.0033737456, 0.002214227, 0.0059239287,
0.0, 0.0035023422, 0.0039144754, 0.0052125645, 0.009005613, 0.015069102, 0.017806552, 0.006131085, -0.015898224, -0.033830803, -0.0109007275, 0.005608417, 0.011278705, 0.00938969, 0.0061281417, 0.0035946819, 0.0023062637, 0.0061478764,
0.0, 0.0034546733, 0.0038901812, 0.005368391, 0.009631489, 0.016234528, 0.018491458, 0.0051314277, -0.018510265, -0.039421175, -0.014851752, 0.00435683, 0.011868765, 0.0101130055, 0.006595841, 0.0038165115, 0.0023911472, 0.006283846,
0.0, 0.0034369382, 0.0039350893, 0.00560912, 0.01026496, 0.017215293, 0.019394731, 0.0040728617, -0.022299075, -0.044977795, -0.017941913, 0.0033921693, 0.01312977, 0.010981776, 0.007140745, 0.004078534, 0.0025082242, 0.0063732746,
0.0, 0.0034592769, 0.0040689465, 0.0059910226, 0.011014135, 0.018258292, 0.020015115, 0.002792015, -0.02578813, -0.049008057, -0.020707615, 0.0023704397, 0.013593956, 0.01159437, 0.0076029846, 0.0043534776, 0.0026566817, 0.00640034,
0.0, 0.0035216308, 0.0042784563, 0.006474854, 0.011767582, 0.019089026, 0.019565048, 3.0207713E-4, -0.0286791, -0.05193023, -0.023293413, 7.257753E-4, 0.013501886, 0.011986874, 0.008009927, 0.0046787565, 0.0028826252, 0.00638256,
0.0, 0.0036354074, 0.0045501455, 0.007032138, 0.01259169, 0.019532034, 0.018423298, -0.0033231743, -0.03175086, -0.055640448, -0.025004141, -9.2448463E-4, 0.012931292, 0.012117446, 0.008346997, 0.0049896375, 0.0031160647, 0.006384333,
0.0, 0.0036756033, 0.00450237, 0.0068447976, 0.012380064, 0.019785987, 0.019887937, -6.4173667E-4, -0.031716865, -0.055614084, -0.02559746, -5.182841E-4, 0.013509515, 0.012275699, 0.008295058, 0.004879895, 0.003032904, 0.0064350287,
0.0, 0.0037642801, 0.0045038196, 0.006696069, 0.012179836, 0.019960167, 0.021428755, 0.0015093446, -0.02910846, -0.055960238, -0.027489351, -6.6976406E-4, 0.01350914, 0.01218857, 0.00813376, 0.004754947, 0.0029489703, 0.006499801,
0.0, 0.0038783392, 0.0045401, 0.0065574944, 0.011838551, 0.019715555, 0.021335714, 0.0021067543, -0.028249016, -0.05254845, -0.024268692, 2.0850108E-4, 0.013381962, 0.011903726, 0.007908891, 0.0046469592, 0.0029222292, 0.0065087317,
0.0, 0.004018108, 0.0045961593, 0.006390855, 0.011266265, 0.01858692, 0.01997862, 0.0028275189, -0.02572604, -0.04898281, -0.021254018, 0.0010651113, 0.012930483, 0.011382662, 0.007591998, 0.0045382157, 0.002939552, 0.006457929,
0.0, 0.0041731293, 0.0046532513, 0.0061834618, 0.010569918, 0.017325973, 0.018878827, 0.0027887924, -0.023116997, -0.04509181, -0.019810522, 0.0017105391, 0.012332662, 0.010704719, 0.0071673896, 0.0043781265, 0.0029428892, 0.0063593257,
0.0, 0.0043677706, 0.00473097, 0.0059503424, 0.009791202, 0.015968984, 0.017721957, 0.0027589106, -0.022544833, -0.043984953, -0.01884706, 0.0016579189, 0.011603806, 0.010029047, 0.006750433, 0.004202535, 0.0029388368, 0.0062673087,
0.0, 0.004467266, 0.0047083287, 0.00559506, 0.008826739, 0.0142960185, 0.016231472, 0.002365559, -0.023061382, -0.045862976, -0.019081675, 0.0014703159, 0.0108214095, 0.009217494, 0.006198264, 0.003938177, 0.0028626546, 0.0060940436,
0.0, 0.0057129725, 0.0055759405, 0.004755295, 0.0044168574, 0.0057596113, 0.0092698885, 0.012633574, 0.012033449, 0.008460517, 0.009089271, 0.008123784, 0.0060786377, 0.004359043, 0.003648824, 0.003706444, 0.003789333, 0.005285475,
};
float p2[DIM*DIM] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0034753745, 0.0037100601, 0.0045107906, 0.0072914227, 0.011443592, 0.012474147, 0.0017856838, -0.020445101, -0.040151637, -0.015942598, 1.2335806E-4, 0.0075223953, 0.0074309334, 0.005182589, 0.0032561682, 0.0022284773, 0.005706813,
0.0, 0.0035388637, 0.0038638741, 0.004917987, 0.008134491, 0.012597628, 0.012771792, -6.772519E-4, -0.026751073, -0.047870234, -0.019566985, -0.0013777312, 0.0076260106, 0.007943463, 0.0056681926, 0.0035595298, 0.0024090477, 0.006010679,
0.0, 0.0034274554, 0.003822204, 0.005130998, 0.008778271, 0.013551761, 0.012710872, -0.004375068, -0.034920916, -0.059010696, -0.025123766, -0.0035043254, 0.0075817727, 0.008387315, 0.0060702837, 0.0037800604, 0.002514221, 0.0061825477,
0.0, 0.003405869, 0.0038875313, 0.005458435, 0.009557971, 0.014732905, 0.013003572, -0.0075370953, -0.042718485, -0.06919746, -0.03046759, -0.0057079233, 0.007741799, 0.008997169, 0.00657727, 0.004044268, 0.002646326, 0.0063875727,
0.0, 0.003375316, 0.0039389743, 0.0057520703, 0.01030348, 0.015865907, 0.013232662, -0.010281467, -0.048867702, -0.07772811, -0.035549287, -0.00806895, 0.007848146, 0.009611898, 0.0070491456, 0.004303596, 0.0027713634, 0.0065043527,
0.0, 0.0033808518, 0.0040524607, 0.0061169784, 0.011069209, 0.016925441, 0.013590862, -0.012330187, -0.053911984, -0.08580613, -0.041331816, -0.010505348, 0.008043385, 0.010252585, 0.007579228, 0.004601672, 0.0029256735, 0.006569149,
0.0, 0.003421242, 0.0042305263, 0.006574579, 0.011886253, 0.01783499, 0.013233279, -0.015205167, -0.05975044, -0.09305661, -0.044737846, -0.012584043, 0.007946371, 0.010658336, 0.007996055, 0.00489584, 0.0030847378, 0.006563129,
0.0, 0.0035015603, 0.0044803335, 0.0071192402, 0.012673371, 0.018317815, 0.011768223, -0.018634329, -0.06349405, -0.097521245, -0.048113305, -0.014947925, 0.007269997, 0.010768353, 0.008295109, 0.0052161175, 0.0033359963, 0.006516198,
0.0, 0.0036310244, 0.0047817794, 0.007691141, 0.013385944, 0.018394494, 0.009285375, -0.022677919, -0.0685168, -0.09441626, -0.049468283, -0.016842144, 0.0061009475, 0.010562491, 0.008506367, 0.005508198, 0.003589036, 0.0064836703,
0.0, 0.0036590528, 0.004708868, 0.0074825888, 0.013216334, 0.018843256, 0.011350766, -0.02136419, -0.0683413, -0.10182799, -0.05097184, -0.017323097, 0.0067872894, 0.010891065, 0.008537315, 0.005407767, 0.0034909456, 0.0065455106,
0.0, 0.0037326228, 0.00467441, 0.007276718, 0.012952156, 0.019028485, 0.012961522, -0.018934784, -0.065985285, -0.10131818, -0.052126396, -0.01715085, 0.0070069316, 0.0109078, 0.008409833, 0.0052846405, 0.0033947008, 0.0066214837,
0.0, 0.003831762, 0.0046722647, 0.007065588, 0.012508794, 0.018637963, 0.013773526, -0.016761655, -0.062217142, -0.096474715, -0.04995351, -0.015993873, 0.0071721333, 0.010727043, 0.008195091, 0.0051575485, 0.0033466022, 0.006650018,
0.0, 0.0039615934, 0.004692435, 0.0068218526, 0.01184727, 0.017632743, 0.013488344, -0.014212585, -0.057160616, -0.090763055, -0.046478823, -0.0139080705, 0.0071592447, 0.010294369, 0.007865652, 0.005008492, 0.0033525797, 0.0066228095,
0.0, 0.0041090176, 0.0047119227, 0.0065280497, 0.011050571, 0.01637705, 0.012521911, -0.013213031, -0.05409639, -0.084573485, -0.040809374, -0.011313535, 0.0070656985, 0.009729719, 0.007437086, 0.004796117, 0.0033043034, 0.0065538515,
0.0, 0.0042929747, 0.004746838, 0.0062131924, 0.010207438, 0.0151589075, 0.0119823115, -0.01212391, -0.051474493, -0.080775045, -0.037992585, -0.010196819, 0.0068641943, 0.009222041, 0.00701225, 0.004565269, 0.00323537, 0.0064936797,
0.0, 0.0043911957, 0.0046866494, 0.0058005867, 0.009249139, 0.013868682, 0.0114594, -0.011070085, -0.05137592, -0.082873896, -0.037884448, -0.009543034, 0.0067258887, 0.008630254, 0.006525058, 0.0042775804, 0.003104476, 0.0063473657,
0.0, 0.0059472094, 0.0056735687, 0.0049339114, 0.005271273, 0.007865905, 0.012145799, 0.013516705, 0.0075346585, 1.3637968E-4, 0.005754965, 0.007795761, 0.0067899153, 0.0049962425, 0.003993009, 0.0038375491, 0.0038404951, 0.0051774373,
};
/**
*
*/
int fluid_sim_pressurecell_first_layer_test1(){
printf("fluid_sim_pressurecell_first_layer_test1\n");
int rVal = 0;
Environment * env = fluid_environment_create();
Chunk ** queue = NULL;
queue = createChunkGrid(env,CHUNK_DIM,CHUNK_DIM,CHUNK_DIM);
int chunkCount = arrlen(queue);
//setup chunk values
float deltaDensity = 0.01f;
Chunk * currentChunk = queue[0];
currentChunk->divergenceCache[CENTER_LOC][IX(4,4,4)] = 0;
float * d = currentChunk->d[CENTER_LOC];
float * u = currentChunk->u[CENTER_LOC];
float * v = currentChunk->v[CENTER_LOC];
float * w = currentChunk->w[CENTER_LOC];
float * p = currentChunk->pressureCache[CENTER_LOC];
for(int x = 0; x < DIM; x++){
for(int z = 0; z < DIM; z++){
d[IX(x,1,z)] = density1[x*DIM+z];
d[IX(x,2,z)] = density2[x*DIM+z];
u[IX(x,1,z)] = u1[x*DIM+z];
u[IX(x,2,z)] = u2[x*DIM+z];
v[IX(x,1,z)] = v1[x*DIM+z];
v[IX(x,2,z)] = v2[x*DIM+z];
w[IX(x,1,z)] = w1[x*DIM+z];
w[IX(x,2,z)] = w2[x*DIM+z];
p[IX(x,1,z)] = p1[x*DIM+z];
p[IX(x,2,z)] = p2[x*DIM+z];
}
}
//actually simulate
int frameCount = 50;
for(int frame = 0; frame < frameCount; frame++){
fluid_tracking_reset(env);
fluid_solve_bounds(chunkCount,queue,env);
fluid_dispatch(chunkCount,queue,env,FLUID_DISPATCHER_OVERRIDE_PRESSURECELL);
fluid_simulate(env);
fluid_solve_bounds(chunkCount,queue,env);
printf("pressure: %lf\n", currentChunk->pressureCellData.pressureTotal);
printf("velocity: %lf\n", currentChunk->pressureCellData.velocityMagTotal);
printf("\n");
currentChunk->d0[CENTER_LOC][IX(4,4,4)] = 1.0f;
}
//test the result
float expected, actual;
//
// cell that originall had values
//
expected = -3;
actual = currentChunk->divergenceCache[CENTER_LOC][IX(4,4,4)];
// if(fabs(expected - actual) > FLUID_PRESSURE_CELL_ERROR_MARGIN){
// rVal += assertEqualsFloat(expected,actual,"Failed to calculate divergence correctly (4,4,4)! expected: %f actual: %f \n");
// }
rVal++;
printf("densitySum: %f\n",currentChunk->pressureCellData.densitySum);
printf("density (1,1,10): %f \n",d[IX(1,1,10)]);
printf("density (1,1,11): %f \n",d[IX(1,1,11)]);
printf("density (1,1,12): %f \n",d[IX(1,1,12)]);
printf("density (1,1,1): %f \n",d[IX(1,1,1)]);
return rVal;
}
/**
* Testing pressure values
*/
int fluid_sim_pressurecell_first_layer_tests(int argc, char **argv){
int rVal = 0;
// rVal += fluid_sim_pressurecell_first_layer_test1();
return rVal;
}