Wiki

Clone wiki

Polarization / Home

MICCoM COPSS - Electrostatic Polarization Code

This code solves the electrostatic polarization problem involving arbitrary-shaped polarizable dielectric objects embeded in a dielectric continuum using a boundary element method (BEM). It runs in parallel and utilizes iterative solver GMRES accelerated by a kernel-independent Fast Multipole Method (FMM) with O(N) computational complexity. The code is being developed using libMesh (finite-element library) and ScalFMM (FMM library). The outputs of this code are body forces on each dielectric object and the Exodus file that can be used to visualize the distribution of surface charge densities on each object using e.g. Paraview.

Our method paper has details on the implementation and tests of this code: An O(N) and parallel approach to integral problems by a kernel-independent fast multipole method: Application to polarization and magnetization of interacting particles. If you find our work helpful, we humbly ask you to include a citation of the paper, as a means to support our continuous development of the code.

0. Access the source code

  • Please fill the form so we can add you as a user to this repository.

1. Install PETSc

  • You should have a working parallel compiler (OpenMPI or MPICH) on your machine or cluster.
  • Download PETSc's latest release at this link
  • We install PETSc by executing the following commands, then follow PETSc's on-screen instructions to finish installation.
    ./configure --download-hypre=1 --with-ssl=0 --with-debugging=no --with-pic=1 --with-shared-libraries=1 --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 --download-fblaslapack=1 --download-cmake=1 --download-metis=1 --download-parmetis=1 --download-superlu_dist=1 --download-mumps=1 --download-scalapack=1 --CC=mpicc --CXX=mpicxx --FC=mpif90 --F77=mpif77 --F90=mpif90 --CFLAGS='-fPIC -fopenmp' --CXXFLAGS='-fPIC -fopenmp' --FFLAGS='-fPIC -fopenmp' --FCFLAGS='-fPIC -fopenmp' --F90FLAGS='-fPIC -fopenmp' --F77FLAGS='-fPIC -fopenmp'
    
  • Be sure to set environmental variables PETSC_DIR and PETSC_ARCH, for example in your .bashrc file
    #!bash
    export PETSC_DIR=/Users/xikai/Softwares/petsc-3.7.4
    export PETSC_ARCH=arch-darwin-c-opt
    

2. Install libMesh

  • Download libMesh source code into your machine, for example
    cd Softwares
    git clone git://github.com/libMesh/libmesh.git 
    
  • Install libMesh

    cd libmesh
    mkdir source
    mv * source
    mkdir build
    cd build
    ../source/configure --prefix=/Users/xikai/Softwares/libmesh/build --with-methods=opt --enable-silent-rules --enable-unique-id --disable-warnings --enable-unique-ptr --enable-openmp --disable-maintainer-mode --enable-petsc-required --disable-timestamps
    make
    make install
    

  • Set the environment variable for libMesh: in your bash profile, add the libMesh directory, for example:

    #!bash
    
    export LIBMESH_DIR=~/Softwares/libmesh/build
    

3. Install ScalFMM

  • Follow instructions in the README file in /contrib/scalfmm

4. Compile the application code

  • Type make in the /src folder. It will generate the executable file.
    #!linux
    
    make
    

5. Run simulations

  • Test drive examples here. Instructions for running the application are in README in each specific example's folder.

Updated