Copy and rename directory and files
First copy and rename the directory
NSAC_Comp
with the new nameMPwSLphC
:$ cd LBM_Saclay_Rech-Dev/src/kernels $ cp -r NSAC_Comp MPwSLphC
Next, rename four files which are contained inside the new directory:
$ cd MPwSLphC $ mv Index_NS_AC_Comp.h Index_MPwSLphC.h $ mv LBMScheme_NS_AC_Comp.h LBMScheme_MPwSLphC.h $ mv Models_NS_AC_Comp.h Models_MPwSLphC.h $ mv Problem_NS_AC_Comp.h Problem_MPwSLphC.h
Once it is done, edit file
Setup.h
with your favorite text editor (here example withgeany
):$ geany Setup.h&
Modify the names with the new kernel name. Below, the new lines are highlighted after the old ones:
1#ifndef SETUP_NSAC_COMP_H_ 2#define SETUP_NSAC_COMP_H_ 3#ifndef SETUP_MPWSLPHC_H_ 4#define SETUP_MPWSLPHC_H_ 5 6#include "Problem_NS_AC_Comp.h" 7#include "Problem_MPwSLphC.h" 8 9namespace PBM_NS_AC_Compo { 10struct pbm_registerer_NSAC_comp 11namespace PBM_MPwSLphC { 12struct pbm_registerer_MPwSLphC 13 14{ 15 pbm_registerer_NSAC_comp() 16 pbm_registerer_MPwSLphC() 17 { 18 register_problem<Problem, ModelParams::TagCompo>("NSAC_Comp", "base"); 19 register_problem<Problem, ModelParams::TagSansGamma>("NSAC_Comp", "sansGamma"); 20 register_problem<Problem, ModelParams::TagCompo>("MPwSLphC", "base"); 21 register_problem<Problem, ModelParams::TagSansGamma>("MPwSLphC", "sansGamma"); 22 }; 23 24}; 25 26static pbm_registerer_NSAC_comp registerer_NSAC_comp; 27static pbm_registerer_MPwSLphC registerer_MPwSLphC; 28} 29 30#endif //SETUP_NSAC_COMP_H_ 31#endif //SETUP_MPWSLPHC_H_
Modification of file
Problem_MPwSLphC.h
1#ifndef PROBLEM_NS_AC_C_H_ 2#define PROBLEM_NS_AC_C_H_ 3#ifndef PROBLEM_MPWSLPHC_H_ 4#define PROBLEM_MPWSLPHC_H_ 5 6#include "LBMScheme_NS_AC_Comp.h" 7#include "LBMScheme_MPwSLphC.h" 8 9namespace PBM_NS_AC_Compo { 10namespace PBM_MPwSLphC {
Modification file
Models_MPwSLphC.h
1#ifndef MODELS_NS_AC_C_H_ 2#define MODELS_NS_AC_C_H_ 3#ifndef MODELS_MPWSLPHC_H_ 4#define MODELS_MPWSLPHC_H_ 5 6#include "Index_NS_AC_Comp.h" 7#include "Index_MPwSLphC.h" 8 9namespace PBM_NS_AC_Compo { 10namespace PBM_MPwSLphC {
Modification file
LBMScheme_MPwSLphC.h
1#ifndef LBMSCHEME_NS_AC_C_H_ 2#define LBMSCHEME_NS_AC_C_H_ 3#ifndef LBMSCHEME_MPWSLPHC_H_ 4#define LBMSCHEME_MPWSLPHC_H_ 5 6#include "Models_NS_AC_Comp.h" 7#include "Models_MPwSLphC.h" 8 9namespace PBM_NS_AC_Compo { 10namespace PBM_MPwSLphC {
Modification file
Index_MPwSLphC.h
1#ifndef INDEX_NS_AC_C_H_ 2#define INDEX_NS_AC_C_H_ 3#ifndef INDEX_MPWSLPHC_H_ 4#define INDEX_MPWSLPHC_H_ 5 6namespace PBM_NS_AC_Compo { 7namespace PBM_MPwSLphC {
Compilation
$ cmake -DKokkos_ENABLE_OPENMP=ON -DUSE_HDF5=ON -DPROBLEM=MPwSLphC .. $ make -j 22
Section author: Alain Cartalade