Skip to content

Commit

Permalink
add parallel solvers
Browse files Browse the repository at this point in the history
  • Loading branch information
dangla committed Jan 31, 2023
1 parent 232ef20 commit 351e6bf
Show file tree
Hide file tree
Showing 1,737 changed files with 507,020 additions and 467,118 deletions.
2 changes: 1 addition & 1 deletion .githelp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Working with remotes
adding a remote: git remote add <shortname> <url>

Pushing
pushing to remote ifsttar: git push ifsttar master
pushing to remote ifsttar: git push Universite-Gustave-Eiffel master
pushing to remote dangla: git push dangla master
adding a remote: git remote add <shortname> <url>
Note: Github will no longer accept account passwords
Expand Down
12 changes: 12 additions & 0 deletions BilConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef BILCONFIG_H
#define BILCONFIG_H

#cmakedefine HAVE_OPENMP
#cmakedefine HAVE_PTHREAD
#cmakedefine HAVE_MPI

//#define BIL_CONFIG_OPTIONS "${BIL_CONFIG_OPTIONS}"

//${BIL_CONFIG_PRAGMAS}

#endif
23 changes: 9 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ endif()


# set the project name
project(bil C CXX Fortran)
project(bil LANGUAGES C CXX Fortran)


option(ENABLE_OPENMP "Enable OpenMP parallelization" OFF)
option(ENABLE_PTHREADS "Enable Pthreads parallelization" OFF)


# Add the CMake directory for custon CMake modules
Expand Down Expand Up @@ -69,21 +73,12 @@ include(Extralibs)



#[[
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
]]

include(SetCompilerFlags)


include(SetCompilerFlags)
# Bil options
# -----------
include(SetBilConfig)


# the executable and the library
Expand Down
13 changes: 10 additions & 3 deletions EXTRALIBS
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# This is a comment. Put a # in the first column to comment the line.
BLAS = /usr/lib/x86_64-linux-gnu/blas/libblas.so
LAPACK = /usr/lib/x86_64-linux-gnu/lapack/liblapack.so
SUPERLU = /usr/lib/x86_64-linux-gnu/libsuperlu.so
#SUPERLU = /usr/lib/x86_64-linux-gnu/libsuperlu.so
#SUPERLUMT = /home/dangla/Documents/Softwares/bil/bil-master/src/Libraries/superlu/superlu_mt-master/lib/libsuperlu_mt_OPENMP.so
#SUPERLUMT = /home/dangla/Documents/Softwares/bil/bil-master/src/Libraries/superlu/superlu_mt-master/lib/libsuperlu_mt_PTHREAD.so
SUPERLUDIST = /usr/local/lib/libsuperlu_dist.so
#LAPACK = /usr/lib/x86_64-linux-gnu/liblapack.so
#BLAS = /usr/lib/x86_64-linux-gnu/libblas.so
#UEL = /home/dangla/Documents/Softwares/bil/Projects/IoannisStefanou/libUEL_64.so
#GSL = /usr/lib/x86_64-linux-gnu/libgsl.so
#GSLCBLAS = /usr/lib/x86_64-linux-gnu/libgslcblas.so
#F2C = /usr/lib/x86_64-linux-gnu/libf2c.so

55 changes: 44 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ BIL_LIBS += ${BIL_EXTRALIBS}
include make.inc


# Options file
BILCONFIG_H := BilConfig.h


#=======================================================================
# Default target executed when no arguments are given to make.
all: bin doc
Expand All @@ -92,12 +96,12 @@ all: bin doc
# Target rules for binaries

.PHONY: bin
bin: make.inc path_init version_init info_init lib compile link
bin: make.inc path_init version_init info_init config_init lib compile link

compile: make.inc path_init version_init info_init lib
@echo "\nCompilation"
mkdir -p ${BIL_LIBDIR}
for i in ${BIL_DIRS}; do (cd $$i && ${MAKE}); done
for i in ${BIL_DIRS}; do ( ${MAKE} -C $$i ); done

link: make.inc
@echo "\nLinking with embedded location of shared libraries (rpath method), if any"
Expand Down Expand Up @@ -141,15 +145,15 @@ install-liba:

install-doc:
@echo "\nInstalling documentations"
cd doc && ${MAKE} install-doc
( ${MAKE} -C doc install-doc )


#=======================================================================
# Target rules for cleaning

clean:
@echo "\nCleaning directories (removing binaries,...)"
for i in ${BIL_DIRS} doc examples base; do (cd $$i && ${MAKE} clean); done
for i in ${BIL_DIRS} doc examples base; do (${MAKE} -C $$i clean); done
rm -f make.log
@echo "\nRemoving libraries"
rm -f ${BIL_LIBDIR}/*.a
Expand All @@ -164,7 +168,8 @@ clean-all: clean
rm -f ${BILINFO_H}
rm -f ${BILEXTRALIBS_H}
rm -f ${BILPATH_H}
cd doc && ${MAKE} clean-all
rm -f ${BILCONFIG_H}
( ${MAKE} -C doc clean-all )


#=======================================================================
Expand Down Expand Up @@ -233,18 +238,45 @@ lib:
touch ${BILEXTRALIBS_H}
echo "#ifndef BILEXTRALIBS_H" >> ${BILEXTRALIBS_H}
echo "#define BILEXTRALIBS_H" >> ${BILEXTRALIBS_H}
@if [ -n "${SUPERLU_DIR}" ]; then \
echo "#define SUPERLULIB ${SUPERLU_DIR}" >> ${BILEXTRALIBS_H} ; \
if [ -n "${LAPACK_DIR}" ] ; then \
echo "#define LAPACKLIB ${LAPACK_DIR}" >> ${BILEXTRALIBS_H} ; \
fi
@if [ -n "${BLAS_DIR}" ] ; then \
if [ -n "${BLAS_DIR}" ] ; then \
echo "#define BLASLIB ${BLAS_DIR}" >> ${BILEXTRALIBS_H} ; \
fi
@if [ -n "${LAPACK_DIR}" ] ; then \
echo "#define LAPACKLIB ${LAPACK_DIR}" >> ${BILEXTRALIBS_H} ; \
if [ -n "${GSLCBLAS_DIR}" ] ; then \
echo "#define GSLCBLASLIB ${GSLCBLAS_DIR}" >> ${BILEXTRALIBS_H} ; \
fi
if [ -n "${SUPERLU_DIR}" ]; then \
echo "#define SUPERLULIB ${SUPERLU_DIR}" >> ${BILEXTRALIBS_H} ; \
fi
if [ -n "${SUPERLUMT_DIR}" ]; then \
echo "#define SUPERLUMTLIB ${SUPERLUMT_DIR}" >> ${BILEXTRALIBS_H} ; \
fi
echo "#endif" >> ${BILEXTRALIBS_H}


#=======================================================================
# Target rules for config file

config:
rm -f ${BILCONFIG_H}
touch ${BILCONFIG_H}
echo "#ifndef BILCONFIG_H" >> ${BILCONFIG_H}
echo "#define BILCONFIG_H" >> ${BILCONFIG_H}
if [ ${ENABLE_OPENMP} = ON ]; then \
echo "#define HAVE_OPENMP" >> ${BILCONFIG_H} ; \
fi
if [ ${ENABLE_PTHREAD} = ON ]; then \
echo "#define HAVE_PTHREAD" >> ${BILCONFIG_H} ; \
fi
echo "#endif" >> ${BILCONFIG_H}

config_init:
@if [ ! -r ${BILCONFIG_H} ]; then ${MAKE} config ; fi



#=======================================================================
# Target rules for documentations

Expand Down Expand Up @@ -284,7 +316,7 @@ githelp:
# Target rules for tests

test:
@( cd base; pwd )
@( echo "base:"; cd base; pwd )
@( echo "BIL_PATH = ${BIL_PATH}" )
@( echo "Last part of BIL_PATH = ${notdir ${BIL_PATH}}" )
@( echo "BIL_COPYRIGHT = ${BIL_COPYRIGHT}" )
Expand All @@ -293,6 +325,7 @@ test:
@( echo "BLAS_DIR = ${BLAS_DIR}" )
@( echo "LAPACK_DIR = ${LAPACK_DIR}" )
@( echo "UEL_DIR = ${UEL_DIR}" )
@( echo "CFLAGS = ${CFLAGS}" )


#=======================================================================
Expand Down
4 changes: 4 additions & 0 deletions OPTIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a comment. Put a # in the first column to comment the line.
ENABLE_OPENMP = OFF
ENABLE_PTHREAD = OFF
ENABLE_MPI = OFF
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Building the documentation from source requires:
and optionally

- Doxygen (<http://www.stack.nl/~dimitri/doxygen>)


List of folders
===============
Expand All @@ -44,9 +44,9 @@ Building and Installation

There are two methods to build Bil from the command line:

1. from make (native method suited for linux-based OS)
2. from cmake (suited for any OS like Windows or MacOS)

- from make (native method suited for linux-based OS)
- from cmake (suited for any OS like Windows or MacOS)

1. Build Bil from make (native method)
--------------------------------------
Expand Down Expand Up @@ -77,8 +77,8 @@ Once the installation is completed, running
make clean

will delete all the local files previously created.


2. Build Bil from cmake (command line)
--------------------------------------

Expand Down Expand Up @@ -162,16 +162,17 @@ Some functionalities (like solvers ma38 and superlu) require the use of the foll

- **LAPACK**: you can obtain the latest LAPACK from http://www.netlib.org/lapack

- **SUPERLU**: you can obtain the relevant C functions by visiting the following
URL: https://github.com/xiaoyeli/superlu
- **SuperLU, SuperLU_MT, SuperLU_DIST**: you can obtain the relevant C functions by visiting the following
URL: https://portal.nersc.gov/project/sparse/superlu/.
Note that these three libraries cannot be mixed, only one can be loaded per build target. SuperMU_MT needs either "omp" or "pthread" library. SuperLU_DIST needs "mpi" library.

These librairies are not included in this package. You need to explicitly specify their location in the file "EXTRALIBS". You can also choose to disable the use of these libraries and the associated functionalities by deleting or commenting the locations.


External software
=================

This package contains some fortran routines provided by HSL: "HSL, a collection of Fortran codes for large-scale scientific computation. See http://www.hsl.rl.ac.uk/"
This package contains some fortran routines provided by HSL: "HSL, a collection of Fortran codes for large-scale scientific computation". See http://www.hsl.rl.ac.uk/.


Usage
Expand Down
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Request(21/10/2022) - Rename all files using the prefix "bil_".
To avoid confusion rename also "Bil.[c,h]" as "BilEntry.[c,h]"

Request(21/09/2019) - Improve solver "ludcmp" by pivoting rows and columns.

Request(22/04/2019) - Introduce a pointer to char in structures having to be initialized by data to be read in the datafile. This pointer should point to the beginning of the data in the file content.
Expand Down
74 changes: 74 additions & 0 deletions base/BBM/BBM
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Geometry # dimension (1, 2, 3) et symétrie (axis, plan) du pb
2 axis

Mesh # maillage considéré (généré avec GMSH)
carre.msh

Material # liste des matériaux (modèles et param. associés)
Model = BBM # nom du modèle
gravity = 0 # gravité
rho_s = 2000 # masse volumique des particules solides
slope_of_swelling_line = 0.004 # indice de gonflement elastique
slope_of_virgin_consolidation_line = 0.037 # pente de la NCL dans le plan (ln p', e)
shear_modulus = 1.e8# module de cisaillement
slope_of_critical_state_line = 1.2 # pente de la CSL dans le plan (p', q)
initial_pre-consolidation_pressure = 20e3 # preconsolidation
reference_consolidation_pressure = 0.01e6 # reference consolidation pressure
kappa_s = 0.008
initial_stress_11 = -1000 # contrainte initiale (isotrope)
initial_stress_22 = -1000 # contrainte initiale (isotrope)
initial_stress_33 = -1000 # contrainte initiale (isotrope)
initial_porosity = 0.25 # porosite initiale
rho_l = 1000 # masse volumique du fluide
k_int = 1e-20 # permeabilite intrinseque
mu_l = 0.001 # viscosite du liquide
suction_cohesion_coefficient = 0.8
#Curves = wrc # nom du fichier contenant p_c S_l k_rl LC
Curves = wrc2 pc = Range{x1 = 0 , x2 = 30.e6, n = 171} sl = Expressions(1){p0 = 1.e6 ; m = 0.6 ; sl = (1 + (pc/p0)**(1/(1-m)))**(-m)} kl = Expressions(1){kl = 1} kg = Expressions(1){kg = 1} lc = Expressions(1){l0 = 0.037 ; k = 0.004 ; beta = 20.e-6 ; r = 0.75 ; lc = (l0 - k)/(l0*((1-r)*exp(-beta*pc) + r) - k)}



Fields # champs constants ou linéaires dans l'espace
2
Value = 0.e3 Gradient = 0 0 Point = 0 0
Value = 1.e3 Gradient = 0 0 Point = 0 0

Initialization # initialisation des variables
0

Functions # fonctions temporelles, pour les CL
1
N = 3 F(0) = 1 F(1) = 250 F(2) = 1

Boundary Conditions # conditions aux limites (Dirichlet)
3
Region = 14 Unknown = u_1 Field = 0 Function = 0
Region = 11 Unknown = u_2 Field = 0 Function = 0
Region = 100 Unknown = p_l Field = 1 Function = 0

Loads # conditions aux limites (Neumann)
2
Region = 13 Equation = meca_1 Type = pressure Field = 2 Function = 1
Region = 12 Equation = meca_1 Type = pressure Field = 2 Function = 1

Points # points de l'espace pour le stockage des variables
1
0.5 0.5

Dates # dates pour le stockage des données
2
0 1 2

Objective Variations # variables objectives (une par ddl)
u_1 = 1.e-4
u_2 = 1.e-4
p_l = 1000

Iterative Process # param. num. pour le contrôle de la convergence
Iteration = 100
Tolerance = 1e-06
Repetition = 0

Time Steps
Dtini = 1.e-4
Dtmax = 1e-3
Loading

0 comments on commit 351e6bf

Please sign in to comment.