This repository contains a modularized version of Penn State's CCMA Newton solver for the Poisson-Nernst-Planck system
TO COMPILE A SPECIFIC PROBLEM:
In order to compile the code, copy the desired main.cpp file to ./main.cpp
from the appropriate directory in ./problems/
and then run make
followed by executing the ``PNP'' file
e.g. cp ./problems/voltage_benchmark/main.cpp ./main.cpp make ./PNP
TO CONFIGURE THE LIBRARY: CMake is used to link the required files and libraries. To ensure proper linking, create a CMakeLists.txt file in the current directory and run ``cmake .'' to build the appropriate files.
An example CMakeLists.txt file is below:
cmake_minimum_required(VERSION 2.8)
set(PROJECT_NAME PNP) project(${PROJECT_NAME})
cmake_policy(SET CMP0004 OLD)
find_package(DOLFIN)
find_package(VTK HINTS ${VTK_DIR} $ENV{VTK_DIR} NO_MODULE QUIET)
if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug MinSizeRel Release RelWithDebInfo." FORCE) endif()
add_definitions(${DOLFIN_CXX_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${DOLFIN_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set(FASP_DIR /usr/local/faspsolver) # must be set for each new build set(FASP4NS_DIR /usr/local/fasp4ns) # must be set for each new build
set(FASP_INCLUDE_DIR ${FASP_DIR}/base/include) set(FASP4NS_INCLUDE_DIR ${FASP4NS_DIR}/include) include_directories(${DOLFIN_INCLUDE_DIRS} ${FASP_INCLUDE_DIR} ${FASP4NS_INCLUDE_DIR} ./include) include_directories(SYSTEM ${DOLFIN_3RD_PARTY_INCLUDE_DIRS})
add_executable(test_reading test_reading.cpp ./src/params.cpp ./src/domains.cpp) add_executable(test_ftof test_ftof.cpp ./src/ftof.cpp)
set(FASP_LIB ${FASP_DIR}/lib/libfasp.a) set(FASP4NS_LIB ${FASP4NS_DIR}/lib/libfasp4ns.a) target_link_libraries(test_reading ${DOLFIN_LIBRARIES} ${DOLFIN_3RD_PARTY_LIBRARIES} ${FASP_LIB} ${FASP4NS_LIB}) target_link_libraries(test_ftof ${DOLFIN_LIBRARIES} ${DOLFIN_3RD_PARTY_LIBRARIES} ${FASP_LIB} ${FASP4NS_LIB})