Skip to content

Instantly share code, notes, and snippets.

@Foadsf
Foadsf / deletedPost.md
Created February 15, 2022 11:15
Implementing Brent solver instead of Newton method in thermoI.H to resolve maximum number of iterations error --> https://scicomp.stackexchange.com/questions/30080/implementing-brent-solver-instead-of-newton-method-in-thermoi-h-to-resolve-maxim

Someone in [this page][1] has claimed to successfully implement [Brent solver][2] in [thermoI.H][3] instead of Newton solver to resolve the infamous

FOAM FATAL ERROR: Maximum number of iterations exceeded

issue. The part of code he is referring to is:

template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::species::thermo<Thermo, Type>::T

(

@Foadsf
Foadsf / .gitignore
Last active February 12, 2022 00:00
Scilab Serial Communication Toolbox (SSCT) --> this Gist is deprecated. please use https://github.com/Foadsf/ssct
docinfo.html
Documentation.md
pics/
@Foadsf
Foadsf / paraview_GUI_result.png
Last active September 20, 2021 11:09
paraview script to solve this problem http://bit.ly/2NnDKAW
paraview_GUI_result.png
@Foadsf
Foadsf / CMakeLists.txt
Last active January 6, 2021 05:50
printing the platform information in OpenCL following this SO post https://stackoverflow.com/a/50667352/4999991
cmake_minimum_required(VERSION 3.1)
project(OpenCL_Example)
find_package(OpenCL REQUIRED)
include_directories(${OpenCL_INCLUDE_DIRS})
link_directories(${OpenCL_LIBRARY})
add_executable(main main.c)
target_include_directories(main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
/* File CMAIN.C */
#include <stdio.h>
extern int __stdcall FACT (int n);
extern void __stdcall PYTHAGORAS (float a, float b, float *c);
main()
{
float c;
@Foadsf
Foadsf / CMakeLists.txt
Last active June 21, 2020 11:13
small clinfo, fetching OpenCL platfroms and theri device's infomation
cmake_minimum_required(VERSION 3.1)
project(OpenCL_Example)
find_package(OpenCL REQUIRED)
include_directories(${OpenCL_INCLUDE_DIRS})
link_directories(${OpenCL_LIBRARY})
add_executable(main main.c)
target_include_directories(main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
@Foadsf
Foadsf / test.md
Last active June 10, 2020 14:23
to test markdown inside the HTML tags
#Lorem **ipsum** dolor sit amet, consectetur adipiscing elit, sed

Unfortunately, the field of mechanical engineering, in general, has been very alien towards Free, Libre, and Open-Source CAD Software (FLOSS). As a FLOSS user and advocate, I have been personally harassed and ridiculed in my workplace many times in real life. But here on the internet, we should not tolerate bigotry and suppression.

The r/cad subreddit is very hostile against Free, Libre, and Open-Source CAD Software (FLOSS). They had previously banned Kurt Kremitzki, one of the FreeCAD developers and Debian package maintainers (this tweet). While ago I posted this in support of FLOSS CAD/CAE developers and inviting others to contribute by donation. However, my post was immediately removed with no explanation as I have described [here](https://www.reddit.com/r/opensource/comments/ckkl5e/supporting_free_libre_and_open_sourc

@Foadsf
Foadsf / example.sql
Created March 27, 2020 12:10
MySQL While Loop
SET @year = 2020;
DELIMITER $$
DROP PROCEDURE IF EXISTS reapeatEvent;
CREATE PROCEDURE reapeatEvent()
BEGIN
WHILE (@year < 2030) DO
@Foadsf
Foadsf / test_file_one.txt
Created March 24, 2020 14:37
trying to git branch, checkout, and rename a folder in abash script
test