Commit 75aeeff0 authored by Radek Fučík's avatar Radek Fučík
Browse files

initial commit

	modified:   README.md
	new file:   core.h
	new file:   core.hpp
	new file:   d1q3.h
	new file:   d2q5.h
	new file:   d2q9.h
	new file:   d3q27.h
	new file:   d3q7.h
	new file:   defs.h
	new file:   defs.hpp
	new file:   export_latex
	new file:   export_latex.cpp
	new file:   export_latex_compare
	new file:   export_latex_compare.cpp
	new file:   lbm.h
	new file:   lbmat
	new file:   lbmat.cpp
	new file:   script_backsubst_searcher.py
	new file:   script_backsubst_searcher_all.sh
	new file:   simplify
	new file:   simplify.cpp
	new file:   tpde.h
	new file:   tpde.hpp
parent 035d8cd1
Loading
Loading
Loading
Loading

Makefile

0 → 100644
+27 −0
Original line number Diff line number Diff line
defaults: lbmat simplify export_latex export_latex_compare

CXXFLAGS=-O2 -I. -std=c++11
LIBS=-lm -lginac 

DEPS = *.h *.hpp

lbmat: $(DEPS) lbmat.cpp
	$(CXX) $(CXXFLAGS) lbmat.cpp -o lbmat  $(LIBS) 

simplify: $(DEPS) simplify.cpp
	$(CXX) $(CXXFLAGS) simplify.cpp -o simplify  $(LIBS)

export_latex: $(DEPS) export_latex.cpp
	$(CXX) $(CXXFLAGS) export_latex.cpp -o export_latex  $(LIBS)

export_latex_compare: $(DEPS) export_latex_compare.cpp
	$(CXX) $(CXXFLAGS) export_latex_compare.cpp -o export_latex_compare  $(LIBS)

clean:
	@rm -rf export_latex
	@rm -rf export_latex_compare
	@rm -rf lbmat
	@rm -rf simplify
	@rm -rf *.o
	@rm -rf *.d
+41 −1
Original line number Diff line number Diff line
# lbmat
```
 .----------------.  .----------------.  .----------------.  .----------------.  .----------------. 
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| |   _____      | || |   ______     | || | ____    ____ | || |      __      | || |  _________   | |
| |  |_   _|     | || |  |_   _ \    | || ||_   \  /   _|| || |     /  \     | || | |  _   _  |  | |
| |    | |       | || |    | |_) |   | || |  |   \/   |  | || |    / /\ \    | || | |_/ | | \_|  | |
| |    | |   _   | || |    |  __'.   | || |  | |\  /| |  | || |   / ____ \   | || |     | |      | |
| |   _| |__/ |  | || |   _| |__) |  | || | _| |_\/_| |_ | || | _/ /    \ \_ | || |    _| |_     | |
| |  |________|  | || |  |_______/   | || ||_____||_____|| || ||____|  |____|| || |   |_____|    | |
| |              | || |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'  '----------------' 
```

# Lattice Boltzmann Method Analysis Tool

 https://mmg-gitlab.fjfi.cvut.cz/gitlab/lbm/lbmat

 Developped by:
* Radek Fučík (fucik@fjfi.cvut.cz) FNSPE CTU in Prague, Czech Republic
* Robert Straka (straka@metal.agh.edu.pl) AGH Krakow, Poland
* Jakub Klinkovský (klinkovsky@mmg.fjfi.cvut.cz) FNSPE CTU in Prague, Czech Republic
* Pavel Eichler (eichlpa1@fjfi.cvut.cz) FNSPE CTU in Prague, Czech Republic
* Tomáš Oberhuber (oberhuber.tomas@fjfi.cvut.cz) FNSPE CTU in Prague, Czech Republic

 Read and cite: <br/>
* Radek Fučík, Pavel Eichler, Jakub Klinkovský, Robert Straka and Tomáš Oberhuber: <i>Lattice Boltzmann Method Analysis Tool (LBMAT)</i> in review in Elsevier Computers & Mathematics with Applications

* Radek Fučík and Robert Straka: <i>Equivalent finite difference and partial differential equations for the lattice Boltzmann method</i>, Elsevier Computers & Mathematics with Applications, vol. 90, 2021, 96-103 
 https://doi.org/10.1016/j.camwa.2021.03.014

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 https://www.gnu.org/licenses/

core.h

0 → 100644
+58 −0
Original line number Diff line number Diff line
// Lattice Boltzmann Method Analysis Tool
// https://mmg-gitlab.fjfi.cvut.cz/gitlab/lbm/lbmat

#pragma once

#include "defs.h"
#include "lbm.h"
#include "tpde.h"

template< typename LBM_TYPE >
struct CORE : BASE
{
	using LBM=LBM_TYPE;
	LBM lbm;

	const int MAXO=5;	// maximal time order to deal with, increase this if you need more than that
	int ORDER=4;		// Taylor order
	int MFCO=4;		// maximal factors common order for TPDE 
	int verbosity=0;
	// link to lbm
	int Q=0, D=0;
	bool use_symbolic_coefs=false; // use symbolic coefficients for abs_rhs to save memory

	FUN fun;

	int dump_lst_count=0;
	int subs_lst_level=0;

	// virtualize for non-matrix LBMs!!! (such as CuLBM...)
	virtual void assemble_pdes(TPDE *pde);

	bool find_lowest_time_derivative(TPDE &expression, int basindex, int order, int& kt, int& kx, int& ky, int&kz);

	void subs_time_derivatives_up_to_order(TPDE &expr, int basindex, TPDE *ders, int max_order);
	void eliminate_all_spatial_orders_for_given_time_order(int basindex, int time_order, TPDE *ders);
	void eliminate_all_spatial_orders_for_given_time_order(TPDE &target, int basindex, int time_order, TPDE &source);
	void replace_time_derivative(TPDE &target, int bj, int time_order, TPDE &derivative);

	void eliminate_higher_raw_moments(vct& bas, TPDE *pde, TPDE*abs_rhs, int offset);

	// Algorithm 1
	void gauss_eliminate_derivatives_on_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);
	void gauss_eliminate_derivatives_below_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);
	void gauss_eliminate_derivatives_above_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);
	void gauss_eliminate_coefs_on_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);
	void gauss_eliminate_coefs_below_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);
	void gauss_eliminate_coefs_above_diagonal(int bi, vct& bas, TPDE*abs_rhs, int index_offset);

	// Algorithm 2
	void compute_NSE();
	void compute_ADE();

	void compute_all();

	CORE();
};

#include "core.hpp"
Loading