44#include "Grid/grid_dist_id.hpp"
45#include "Matrix/SparseMatrix.hpp"
46#include "Vector/Vector.hpp"
47#include "FiniteDifference/FDScheme.hpp"
48#include "FiniteDifference/util/common.hpp"
49#include "FiniteDifference/eq.hpp"
50#include "Solvers/umfpack_solver.hpp"
51#include "Solvers/petsc_solver.hpp"
56 static const unsigned int dims = 2;
59 static const unsigned int nvar = 3;
62 static const bool boundary[];
81 static const int grid_type = STAGGERED_GRID;
84const bool lid_nn::boundary[] = {NON_PERIODIC,NON_PERIODIC};
124 typedef void const_field;
126 static float val() {
return 1.0;}
130constexpr unsigned int v[] = {0,1};
131constexpr unsigned int P = 2;
132constexpr unsigned int ic = 2;
213#include "Vector/vector_dist.hpp"
214#include "data_type/aggregate.hpp"
216int main(
int argc,
char* argv[])
240 openfpm_init(&argc,&argv);
243 constexpr int velocity = 0;
244 constexpr int pressure = 1;
253 long int sz[] = {96,32};
255 szu[0] = (size_t)sz[0];
256 szu[1] = (size_t)sz[1];
334 fd.impose(
ic_eq(),0.0, EQ_3, {0,0},{sz[0]-2,sz[1]-2},
true);
335 fd.impose(
Prs(), 0.0, EQ_3, {0,0},{0,0});
338 fd.impose(
vx_eq(),0.0, EQ_1, {1,0},{sz[0]-2,sz[1]-2});
339 fd.impose(
vy_eq(),0.0, EQ_2, {0,1},{sz[0]-2,sz[1]-2});
343 fd.impose(
v_x(),0.0, EQ_1, {0,0},{0,sz[1]-2});
344 fd.impose(
avg_vy_f(),0.0, EQ_2 , {-1,0},{-1,sz[1]-1});
346 fd.impose(
v_x(),0.0, EQ_1, {sz[0]-1,0},{sz[0]-1,sz[1]-2});
347 fd.impose(
avg_vy(),1.0, EQ_2, {sz[0]-1,0},{sz[0]-1,sz[1]-1});
350 fd.impose(
avg_vx_f(),0.0, EQ_1, {0,-1},{sz[0]-1,-1});
351 fd.impose(
v_y(), 0.0, EQ_2, {0,0},{sz[0]-2,0});
353 fd.impose(
avg_vx(),0.0, EQ_1, {0,sz[1]-1},{sz[0]-1,sz[1]-1});
354 fd.impose(
v_y(), 0.0, EQ_2, {0,sz[1]-1},{sz[0]-2,sz[1]-1});
363 fd.impose(
Prs(), 0.0, EQ_3, {-1,-1},{sz[0]-1,-1});
364 fd.impose(
Prs(), 0.0, EQ_3, {-1,sz[1]-1},{sz[0]-1,sz[1]-1});
365 fd.impose(
Prs(), 0.0, EQ_3, {-1,0},{-1,sz[1]-2});
366 fd.impose(
Prs(), 0.0, EQ_3, {sz[0]-1,0},{sz[0]-1,sz[1]-2});
369 fd.impose(
v_x(), 0.0, EQ_1, {-1,-1},{-1,sz[1]-1});
370 fd.impose(
v_y(), 0.0, EQ_2, {-1,-1},{sz[0]-1,-1});
393 auto x = solver.
solve(fd.getA(),fd.getB());
410 fd.template copy<velocity,pressure>(x,{0,0},{sz[0]-1,sz[1]-1},g_dist);
412 g_dist.write(
"lid_driven_cavity_p_umfpack");
This class represent an N-dimensional box.
This class decompose a space into sub-sub-domains and distribute them across processors.
Derivative second order on h (spacing)
Class that contain Padding information on each direction positive and Negative direction.
Test structure used for several test.
Sparse Matrix implementation.
Sparse Matrix implementation stub object when OpenFPM is compiled with no linear algebra support.
This is a distributed grid.
stub when library compiled without eigen
static Vector< T > solve(const SparseMatrix< T, id_type, impl > &A, const Vector< T, impl > &b)
stub solve
[Definition of the system]
[Definition of the system]
It ancapsulate the minus operation.
It model an expression expr1 * expr2.
It model an expression expr1 + ... exprn.