42 #include "Grid/grid_dist_id.hpp" 43 #include "Matrix/SparseMatrix.hpp" 44 #include "Vector/Vector.hpp" 45 #include "FiniteDifference/FDScheme.hpp" 46 #include "FiniteDifference/util/common.hpp" 47 #include "FiniteDifference/eq.hpp" 48 #include "Solvers/umfpack_solver.hpp" 49 #include "Solvers/petsc_solver.hpp" 54 static const unsigned int dims = 2;
57 static const unsigned int nvar = 3;
60 static const bool boundary[];
79 static const int grid_type = STAGGERED_GRID;
82 const bool lid_nn::boundary[] = {NON_PERIODIC,NON_PERIODIC};
122 typedef void const_field;
124 static float val() {
return 1.0;}
128 constexpr
unsigned int v[] = {0,1};
129 constexpr
unsigned int P = 2;
130 constexpr
unsigned int ic = 2;
211 #include "Vector/vector_dist.hpp" 212 #include "data_type/aggregate.hpp" 214 int main(
int argc,
char* argv[])
238 openfpm_init(&argc,&argv);
241 constexpr
int velocity = 0;
242 constexpr
int pressure = 1;
251 long int sz[] = {96,32};
253 szu[0] = (size_t)sz[0];
254 szu[1] = (size_t)sz[1];
332 fd.impose(
ic_eq(),0.0, EQ_3, {0,0},{sz[0]-2,sz[1]-2},
true);
333 fd.impose(
Prs(), 0.0, EQ_3, {0,0},{0,0});
336 fd.impose(
vx_eq(),0.0, EQ_1, {1,0},{sz[0]-2,sz[1]-2});
337 fd.impose(
vy_eq(),0.0, EQ_2, {0,1},{sz[0]-2,sz[1]-2});
341 fd.impose(
v_x(),0.0, EQ_1, {0,0},{0,sz[1]-2});
342 fd.impose(
avg_vy_f(),0.0, EQ_2 , {-1,0},{-1,sz[1]-1});
344 fd.impose(
v_x(),0.0, EQ_1, {sz[0]-1,0},{sz[0]-1,sz[1]-2});
345 fd.impose(
avg_vy(),1.0, EQ_2, {sz[0]-1,0},{sz[0]-1,sz[1]-1});
348 fd.impose(
avg_vx_f(),0.0, EQ_1, {0,-1},{sz[0]-1,-1});
349 fd.impose(
v_y(), 0.0, EQ_2, {0,0},{sz[0]-2,0});
351 fd.impose(
avg_vx(),0.0, EQ_1, {0,sz[1]-1},{sz[0]-1,sz[1]-1});
352 fd.impose(
v_y(), 0.0, EQ_2, {0,sz[1]-1},{sz[0]-2,sz[1]-1});
361 fd.impose(
Prs(), 0.0, EQ_3, {-1,-1},{sz[0]-1,-1});
362 fd.impose(
Prs(), 0.0, EQ_3, {-1,sz[1]-1},{sz[0]-1,sz[1]-1});
363 fd.impose(
Prs(), 0.0, EQ_3, {-1,0},{-1,sz[1]-2});
364 fd.impose(
Prs(), 0.0, EQ_3, {sz[0]-1,0},{sz[0]-1,sz[1]-2});
367 fd.impose(
v_x(), 0.0, EQ_1, {-1,-1},{-1,sz[1]-1});
368 fd.impose(
v_y(), 0.0, EQ_2, {-1,-1},{sz[0]-1,-1});
391 auto x = solver.
solve(fd.getA(),fd.getB());
408 fd.template copy<velocity,pressure>(x,{0,0},{sz[0]-1,sz[1]-1},g_dist);
410 g_dist.write(
"lid_driven_cavity_p_umfpack");
Derivative second order on h (spacing)
[Definition of the system]
It ancapsulate the minus operation.
Sparse Matrix implementation stub object when OpenFPM is compiled with no linear algebra support.
Class that contain Padding information on each direction positive and Negative direction.
stub when library compiled without eigen
It model an expression expr1 * expr2.
This class decompose a space into sub-sub-domains and distribute them across processors.
Sparse Matrix implementation.
This is a distributed grid.
[Definition of the system]
This class represent an N-dimensional box.
static Vector< double > solve(SparseMatrix< double, id_type, impl > &A, const Vector< double > &b, size_t opt=UMFPACK_NONE)
stub solve
It model an expression expr1 + ... exprn.
Test structure used for several test.