Commit 54046c12 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

Merge branch 'oneFluid'

parents 504a2614 f7b61685
Pipeline #4586 passed with stage
in 2 minutes and 3 seconds
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
mbtests :
image : immc/migflow-valid:v0.6
script:
- mkdir build
- cd build/
- cmake .. -DENABLE_PETSC=1 -DPETSC_DIR=/usr/lib/petscdir/petsc3.9/ -DPETSC_ARCH=x86_64-linux-gnu-real
- PPATH=$(pwd)
- make -j4
- cd ../validation
- PYTHONPATH=$PPATH:$PYTHONPATH python3 mbtests.py
from distutils.sysconfig import get_python_inc
import platform
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wno-unused-function',
'-std=gnu99',
'-Iscontact',
'-Ihxt',
'-Isrc',
'-DDIMENSION=2'
]
# Clang automatically sets the '-std=' flag to 'c++14' for MSVC 2015 or later,
# which is required for compiling the standard library, and to 'c++11' for older
# versions.
#if platform.system() != 'Windows':
# flags.append( '-std=c++11' )
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# You can get CMake to generate this file for you by adding:
# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
# to your CMakeLists.txt file.
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def FindCorrespondingSourceFile( filename ):
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
return replacement_file
return filename
def FlagsForFile( filename, **kwargs ):
# If the file is a header, try to find the corresponding source file and
# retrieve its flags from the compilation database if using one. This is
# necessary since compilation databases don't have entries for header files.
# In addition, use this source file as the translation unit. This makes it
# possible to jump from a declaration in the header file to its definition in
# the corresponding source file.
filename = FindCorrespondingSourceFile( filename )
if not database:
return {
'flags': flags,
'include_paths_relative_to_dir': DirectoryOfThisScript(),
'override_filename': filename
}
compilation_info = database.GetCompilationInfoForFile( filename )
if not compilation_info.compiler_flags_:
return None
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object.
final_flags = list( compilation_info.compiler_flags_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
try:
final_flags.remove( '-stdlib=libc++' )
except ValueError:
pass
return {
'flags': final_flags,
'include_paths_relative_to_dir': compilation_info.compiler_working_dir_,
'override_filename': filename
}
Marblesbag software has been developped by:
MigFlow software has been developped by:
===========================================
Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
......
# Marblesbag - Copyright (C) <2010-2018>
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of Marblesbag: see AUTHORS file.
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (Marblesbag) is free software:
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
......@@ -19,35 +19,35 @@
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
ALL: libmbfluid3.so libmbfluid2.so libscontact2.so libscontact3.so
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
Project(MigFlow C)
option(ENABLE_PETSC "Enable PETSc" OFF)
## Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_C_STANDARD 99)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/migflow)
if(ENABLE_PETSC)
find_package(PETSc)
if(PETSC_FOUND)
add_definitions("-DHXT_HAVE_PETSC ${PETSC_CFLAGS}")
link_directories("${PETSC_LIBDIR}")
list(APPEND EXTERNAL_LIBRARIES ${PETSC_LIBS})
list(APPEND EXTERNAL_INCLUDES ${PETSC_INC})
endif(PETSC_FOUND)
endif(ENABLE_PETSC)
add_subdirectory(python)
add_subdirectory(tools)
add_subdirectory(scontact)
add_subdirectory(fluid)
CFLAGS=-Wno-unused-function -O3 -g -march=native -mtune=native -fPIC -std=gnu99 -Iscontact -Ihxt -Isrc
LDFLAGS=-shared -lm
FLUID_C=src/fluid_problem.c src/mesh.c src/mesh_find.c scontact/quadtree.c hxt/hxt_linear_system.c hxt/hxt_linear_system_lu.c hxt/hxt_message.c src/mbxml.c src/yxml.c src/fluid_problem_io.c
FLUID_H=src/tools.h src/fluid_problem.h hxt/hxt_linear_system.h src/mesh_find.h src/mesh.h scontact/quadtree.h scontact/vector.h
USE_PETSC=1
ifeq ($(USE_PETSC),1)
FLUID_C += hxt/hxt_linear_system_petsc.c
CFLAGS += -I${PETSC_DIR}/${PETSC_ARCH}/include -I${PETSC_DIR}/include -I${PETSC_DIR}/include/petsc/mpiuni -DHXT_HAVE_PETSC
LDFLAGS += -L${PETSC_DIR}/${PETSC_ARCH}/lib -Wl,-rpath=${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc
endif
SCONTACT_C=scontact/quadtree.c scontact/scontact.c src/mbxml.c src/yxml.c
SCONTACT_H=scontact/quadtree.h scontact/scontact.h src/mbxml.h src/yxml.h
libmbfluid2.so : ${FLUID_C} ${FLUID_H}
${CC} ${FLUID_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=2
libmbfluid3.so : ${FLUID_C} ${FLUID_H}
${CC} ${FLUID_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=3
libscontact2.so : ${SCONTACT_C} ${SCONTACT_H}
${CC} ${SCONTACT_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=2
libscontact3.so : ${SCONTACT_C} ${SCONTACT_H}
${CC} ${SCONTACT_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=3
clean :
${RM} *.so *.pyc -r __pycache__
Marblesbag Licensing
MigFlow Licensing
============================================
This file attempts to include all licenses that apply within Marblesbag (this program) source tree, in particular any that are supposed to be exposed to the end user for credit requirements for instance.
This file attempts to include all licenses that apply within MigFlow (this program) source tree, in particular any that are supposed to be exposed to the end user for credit requirements for instance.
Marblesbag General
MigFlow General
-----------------------------------------
Marblesbag is a fluid-particules flow simulation software
MigFlow is a fluid-particules flow simulation software
Copyright (C) <2015-2018> <Universite catholique de Louvain (UCL), Belgium
Copyright (C) <2015-2018> Universite de Montpellier, France>
......@@ -23,9 +23,9 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
The list of the contributors to the development of Marblesbag is given in the AUTHORS file (all authors are or were affiliate to the Universite catholique de Louvain, UCL or the Univeristy of Montpellier, when they developed Marblesbag).
The list of the contributors to the development of MigFlow is given in the AUTHORS file (all authors are or were affiliate to the Universite catholique de Louvain, UCL or the Univeristy of Montpellier, when they developed MigFlow).
Website of Marblesbag: https://git.immc.ucl.ac.be/fluidparticles/marblesbag
Website of MigFlow: https://git.immc.ucl.ac.be/fluidparticles/MigFlow
Contact: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
This program has dependencies on other libraries and Website depedencies which are or not under GPL and that are commonly distributed with this program core libraries.
......
MigFlow is a free and open source software dedicated to the simulations, in complex geometry, of immersed granular flows (mixture fluid-grains) presenting a large discrepancy in the solid volume fraction going from pure fluid to porous media. The fluid is solved using the finite element method at a greater scale than the grain scale while the grains are solved using the discrete element method to obtain accurate representation of the local effects due to the grains configuration.
Installation
============
+ Prerequisite :
* Install [PETSc](https://www.mcs.anl.gov/petsc/download/index.html)
git clone -b maint https://bitbucket.org/petsc/petsc petsc
* Add the following lines in your bashrc
export PETSC_DIR=TheGoodPath
export PETSC_ARCH=seq-real-opt
* Compiling options for PETSc:
- Linux
./configure --with-mpi=0 COPTFLAGS="-O3 -march=native -mtune=native" --with-fc=0 --with-cxx=0 --with-debugging=0
- MacOs
./configure --with-mpi=0 COPTFLAGS="-O3" --with-fc=0 --with-cxx=0 --with-debugging=0
* Compile PETSc
make -j4
+ Go to the gitlab/immc project to upload your ssh or https link
+ Open your terminal and type the following commands
git clone https://username@git.immc.ucl.ac.be/fluidparticles/migflow.git
cd migflow
make
On MacOS remove "-march=native -mtune=native" and "#-Wl,-rpath=${PETSC_DIR}/${PETSC_ARCH}/lib" in the Makefile
+ Write the following line in your bashrc
export PYTHONPATH=TheGoodPath/migflow/python:$PYTHONPATH
Test cases ready to use
======================
The test cases are in the TheGoodPath/migflow/testcases directory. You have to generate meshes using *.geo files as it is described in the section __Run test cases__.
- depot-2d:
* _dep.py_ --> simple deposit of grains with different densities
- sablier-2d:
* _depot-fluid.py_ --> 2d simulation of grains falling in an hourglass. Example using lmgc to add some friction
- shaker:
* _shaker.py_ --> Sorting grains with sinusoidal inflow conditions
- couette-2d:
* _melangeur.py_ --> couette flow with grains without gravity, simple example of rotating boundary conditions
* _betonlmgc.py_ --> Mixing grains with respect to their size + possibility to use lmgc90 to add friction
- drop-2d/drop-3d:
+ SimpleDrop:
+ _drop.py_ --> Drop falling in a viscous fluid with parameters of [Metzger et al.](https://doi.org/10.1017/S0022112007005381)
+ _dropReload.py_ --> Example to reload simulation (only drop-3d)
+ InteractingDrops:
+ Vert:
* _2VertDrops.py_ --> Two vertically aligned interacting drops with parameters of [Machu et al.](https://doi.org/10.1017/S0022112001005882)
+ Diag:
* _2DiagDrops.py_ --> Interacting drops with an horizontal offset with parameters of [Machu et al.](https://doi.org/10.1017/S0022112001005882)
- depot-3d:
This case stages more than 500000 grains. This is not a basic case that could be used to get acquainted with the implementation
* _depot.py_ --> deposit of grains with radius distribution given in [Andre et al.](https://doi.org/10.1016/j.powtec.2010.08.020)
Test cases structure:
---------------------
Test cases are build using the same pattern:
1. Initialization of the particles objects container and placement of the grains. This is usually done in documented examples by the function __genInitialPosition__ in which the properties of each grain are set by the function:
p = scontact2.ParticleProblem() \\Initialization of the container
p.load_msh_boundaries("mesh.msh", ["tag1", "tag2",...]) \\Load the physical boundaries the grains cannot cross
p.add_particle((x,y),r,m) \\Add a grain at position (x,y) with radius r and mass m
These statements correspond to a 2D case. For a 3D case, replace sctontact2 by scontact3 and add a z-coordinate
1. Set the boundary conditions applied on the fluid
strong_boundaries = [("tag1",field,condition), ("tag2",field,condition),...]
+ In 2D, the field values are
+ 0 horizontal velocity
+ 1 vertical velocity
+ 2 pressure
+ In 3D, the field values are
+ 0 horizontal-width velocity
+ 1 vertical velocity
+ 2 horizontal-depth velocity
+ 3 pressure
1. Specify all the physical and numrical fluid parameters to construct the fluid object:
fluid = fluid.fluid_problem("mesh.msh",g,nu*rho,rho,epsilon,strong_boundaries)
| Parameters | Description |
| ----------------------- | ----------------------- |
| mesh.msh | mesh name |
| g | gravity |
| nu | kinematic viscosity |
| rho | fluid density |
| epsilon | stabilization parameter |
| strong_boundaries | boundary object |
1. Initialize and localize the grains in the fluid space
fluid.set_particles(p.mass(), p.volume(), p.position(), p.velocity())
1. Computation loop. The use of the adaptive mesh function is optional:
fluid.adapt_mesh(lcmax,lcmin,N)
| Parameters | Description |
| ----------------------- | ----------------------- |
| lcmax | max mesh size |
| lcmin | min mesh size |
| N | number of elements wanted |
Using the contacts solver require to specify a tolerance _tol_ and the number of sub-time steps _nsub_:
p.iterate(dt/nsub, forces, tol)
The tolerance represents the order of magnitude of the error made on the interpenetration during the resolution. This tolerance has to be adapted according to the radii of the grains. If a small tolerance has to be imposed due to the small size of the grains, it slows down a lot the resolution. It is possible to speed up the computation by increasing the number of sub-time steps so that the number of contacts solved at each time iteration is much smaller.
Run test cases:
---------------
1. Use the [GMSH](http://gmsh.info/) software to create the file __mesh.msh__ from the file __mesh.geo__. If you are using a newer version of GMSH than GMSH 2, please insert the following command line at the end of the __mesh.geo__ file
Mesh.MshFileFormat = 2;
Using the GMSH interface you can create the __mesh.msh__ file:
Modules-->Mesh-->2D/3D
File-->Save Mesh
or using your terminal (replace -3 by -2 for 2D meshes):
gmsh -3 mesh.geo mesh.msh
1. Launch the python file without any arguments:
python run.py
Visualisation:
--------------
Output files have format *.vtk, *.vtp, *.vtm that are compatible with the application [ParaView](https://www.paraview.org/). The results can be viewed in [ParaView](https://www.paraview.org/) using the state file __view.pvsm__ included in each test case directory.
For some test cases, the __view.pvsm__ file requires the add of a plugin to show the contacts between the grains.
This plugin is provided in the directory __marblesbag/paraview_utils__:
1. Open [ParaView](https://www.paraview.org/)
2. Tools-->Manage Plugins-->Load New
3. Select the marblesbag.xml file in the marblesbag/paraview_util directory
4. Check the Auto Load option
A macro is given in the directory __marblesbag/paraview_utils__ to update automatically the output files during simulations:
1. Open [ParaView](https://www.paraview.org/)
2. Macros-->Add new macro
3. Select the refresh_mb_output.py file in the marblesbag/paraview_utils directory
Visualise the output files:
1. Open [ParaView](https://www.paraview.org/)
2. File-->Load State-->view.pvsm
# MigFlow
MigFlow is a free and open source software dedicated to the simulations, in complex geometry, of immersed granular flows (mixture fluid-grains) presenting a large discrepancy in the solid volume fraction going from pure fluid to porous media. The fluid is solved using the finite element method at a greater scale than the grain scale while the grains are solved using the discrete element method to obtain accurate representation of the local effects due to the grains configuration.
If you use MigFlow, please cite the following reference in your work:
Constant, M., Dubois, F., Lambrechts, J. and Legat, V. (2018). Implementation of an unresolved stabilised FEM-DEM model to solve immersed granular flows. _Computational Particle Mechanics_. [doi:10.1007/s40571-018-0209-4](https://doi.org/10.1007/s40571-018-0209-4).
See the [wiki](https://git.immc.ucl.ac.be/fluidparticles/migflow/wikis/home) for documented examples and installation instructions.
\ No newline at end of file
# MigFlow - Copyright (C) <2010-2018>
# <Universite catholique de Louvain (UCL), Belgium
# Universite de Montpellier, France>
#
# List of the contributors to the development of MigFlow: see AUTHORS file.
# Description and complete License: see LICENSE file.
#
# This program (MigFlow) is free software:
# you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program (see COPYING and COPYING.LESSER files). If not,
# see <http://www.gnu.org/licenses/>.
# - Try to find PETSc
# Once done this will define
#
# PETSC_INC - the PETSc include directories
# PETSC_LIBS - Link these to use PETSc
option(PETSC_DIR "petsc installation directory" NOTSET)
option(PETSC_ARCH "petsc architecture" NOTSET)
if(PETSC_DIR)
else(PETSC_DIR)
message("set PETSC_DIR to $ENV{PETSC_DIR}")
set(PETSC_DIR $ENV{PETSC_DIR} CACHE PATH "PETSc installation directory" FORCE)
endif(PETSC_DIR)
if(PETSC_ARCH)
else(PETSC_ARCH)
set(PETSC_ARCH $ENV{PETSC_ARCH} CACHE STRING "PETSc architecture" FORCE)
endif(PETSC_ARCH)
message("PETSC : ${PETSC_DIR} ${PETSC_ARCH}")
set(PETSC_LIBDIR "${PETSC_DIR}/${PETSC_ARCH}/lib")
set(PETSC_POSSIBLE_CONF_FILES
${PETSC_DIR}/${PETSC_ARCH}/conf/petscvariables
${PETSC_DIR}/${PETSC_ARCH}/lib/petsc-conf/petscvariables
${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables)
foreach(FILE ${PETSC_POSSIBLE_CONF_FILES})
if(EXISTS ${FILE})
# old-style PETSc installations (using PETSC_DIR and PETSC_ARCH)
message(STATUS "Using PETSc dir: ${PETSC_DIR}")
message(STATUS "Using PETSc arch: ${PETSC_ARCH}")
# find includes by parsing the petscvariables file
file(STRINGS ${FILE} PETSC_VARIABLES NEWLINE_CONSUME)
endif(EXISTS ${FILE})
endforeach(FILE)
set(PETSC_CFLAGS "")
if(PETSC_VARIABLES)
# try to find PETSC_CC_INCLUDES for PETSc >= 3.4
string(REGEX MATCH "PETSC_CC_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES})
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "PETSC_CC_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
${PETSC_PACKAGES_INCLUDES})
else(PETSC_PACKAGES_INCLUDES)
# try to find PETSC_PACKAGES_INCLUDES in older versions
list(APPEND PETSC_INC ${PETSC_DIR}/include)
list(APPEND PETSC_INC ${PETSC_DIR}/${PETSC_ARCH}/include)
string(REGEX MATCH "PACKAGES_INCLUDES = [^\n\r]*" PETSC_PACKAGES_INCLUDES
${PETSC_VARIABLES})
string(REPLACE "PACKAGES_INCLUDES = " "" PETSC_PACKAGES_INCLUDES
${PETSC_PACKAGES_INCLUDES})
endif(PETSC_PACKAGES_INCLUDES)
if(PETSC_PACKAGES_INCLUDES)
string(REPLACE "-I" "" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
string(REPLACE " " ";" PETSC_PACKAGES_INCLUDES ${PETSC_PACKAGES_INCLUDES})
foreach(VAR ${PETSC_PACKAGES_INCLUDES})
# seem to include unexisting directories (/usr/include/lib64)
# check to avoid warnings
if(EXISTS ${VAR})
list(APPEND PETSC_INC ${VAR})
endif(EXISTS ${VAR})
endforeach(VAR)
endif(PETSC_PACKAGES_INCLUDES)
string(REGEX MATCHALL "\nCC = [^\n\r]*" PETSC_CC ${PETSC_VARIABLES})
if(PETSC_CC)
string(REPLACE "\nCC = " "" PETSC_CC ${PETSC_CC})
string(STRIP ${PETSC_CC} PETSC_CC)
execute_process(COMMAND ${PETSC_CC} --showme:compile RESULT_VARIABLE PETSCCR OUTPUT_VARIABLE PETSCCO ERROR_QUIET)
if(NOT PETSCCR)
string(STRIP "${PETSCCO}" PETSC_CFLAGS)
endif(NOT PETSCCR)
endif(PETSC_CC)
string(REGEX MATCHALL "\nPETSC_WITH_EXTERNAL_LIB = [^\n\r]*" PETSC_LIBS ${PETSC_VARIABLES})
if(PETSC_LIBS)
string(REPLACE "\nPETSC_WITH_EXTERNAL_LIB = " "" PETSC_LIBS ${PETSC_LIBS})
string(REPLACE "\${PETSC_DIR}" "${PETSC_DIR}" PETSC_LIBS ${PETSC_LIBS})
string(REPLACE "\${PETSC_ARCH}" "${PETSC_ARCH}" PETSC_LIBS ${PETSC_LIBS})
string(STRIP ${PETSC_LIBS} PETSC_LIBS)
endif(PETSC_LIBS)
endif(PETSC_VARIABLES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PETSc DEFAULT_MSG PETSC_LIBS PETSC_INC)
mark_as_advanced(PETSC_LIBS PETSC_INC PETSC_CFLAGS)
\documentclass[12pt]{paper}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{bm}
\usepackage[a4paper,left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[dvipsnames]{xcolor}
%\makeatletter
%\newcount\bracketnum
%\newcommand\makecolorlist[1]{%
% \bracketnum0\relax
% \makecolorlist@#1,.%
% \bracketnum0\relax
%}
%\def\makecolorlist@#1,{%
% \advance\bracketnum1\relax
% \expandafter\def\csname bracketcolor\the\bracketnum\endcsname{\color{#1}}%
% \@ifnextchar.{\@gobble}{\makecolorlist@}%
%}
%\let\oldleft\left
%\let\oldright\right
%\def\left#1{%
% \global\advance\bracketnum1\relax
% \colorlet{temp}{.}%
% \csname bracketcolor\the\bracketnum\endcsname
% \oldleft#1%
% \color{temp}%
%}
%\def\right#1{%
% \colorlet{temp}{.}%
% \csname bracketcolor\the\bracketnum\endcsname
% \oldright#1%
% \global\advance\bracketnum-1\relax
% \color{temp}%
%}
%\makeatother
\usepackage[english]{babel}
\setlength{\parindent}{0pt}
%\makecolorlist{black,red,blue,ForestGreen,orange,Magenta}
\usepackage{graphics}
\newcommand{\langlC}{\thicklines\begin{picture}(7,7)
\put(1.1,2.5){\rotatebox{60}{\line(1,0){15}}}
\put(1.1,2.5){\rotatebox{300}{\line(1,0){15}}}
\end{picture}}
\newcommand{\ranglC}{\thicklines\begin{picture}(7,7)
\put(-2,2.5){\rotatebox{120}{\line(1,0){15}}}
\put(-2,2.5){\rotatebox{240}{\line(1,0){15}}}
\end{picture}}
\newcommand{\langlCp}{\thicklines\begin{picture}(7,7)
\put(1.1,2.5){\rotatebox{60}{\line(1,0){7}}}
\put(1.1,2.5){\rotatebox{300}{\line(1,0){7}}}
\end{picture}}
\newcommand{\ranglCp}{\thicklines\begin{picture}(7,7)
\put(.2,2.5){\rotatebox{120}{\line(1,0){7}}}
\put(.2,2.5){\rotatebox{240}{\line(1,0){7}}}
\end{picture}}
\newcommand{\langlen}{\Huge\langle}
\newcommand {\dphi}[2]{\dfrac{\partial\phi_{#1}}{\partial #2}}
\newcommand{\dcdt}{ \langlC\dfrac{C_k^{old}-C_k}{\Delta t}\phi_k\ranglC}
\newcommand{\dudt}{ \langlC\dfrac{U_k^{old}-U_k}{\Delta t}\phi_k\ranglC}
\newcommand{\dvdt}{ \langlC\dfrac{V_k^{old}-V_k}{\Delta t}\phi_k\ranglC}
\newcommand{\cn}{\langlCp C_k\phi_k\ranglCp}
\newcommand{\dcdx}{\langlC\dphi{k}{x}C_k\ranglC}
\newcommand{\dcdy}{\langlC\dphi{k}{y}C_k\ranglC}
\newcommand{\qn}{\langlCp Q_k\phi_k\ranglCp}
\newcommand{\pn}{\langlCp P_k\phi_k\ranglCp}
\newcommand{\dpn}[1]{\langlC\dphi{k}{#1}P_k\ranglC}
\newcommand{\un}{\langlCp U_k\phi_k\ranglCp}
\newcommand{\vn}{\langlCp V_k\phi_k\ranglCp}
\newcommand{\dudx}{\langlC \dphi{k}{x}U_k\ranglC}
\newcommand{\dudy}{\langlC \dphi{k}{y}U_k\ranglC}
\newcommand{\dvdx}{\langlC \dphi{k}{x}V_k\ranglC}