diff --git a/README b/README deleted file mode 100644 index a677e0a8..00000000 --- a/README +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - CFDEMcoupling - Open Source CFD-DEM coupling - - CFDEMcoupling is part of the CFDEMproject - www.cfdem.com - Christoph Goniva, christoph.goniva@cfdem.com - Copyright 2009-2012 JKU Linz - Copyright 2012- DCS Computing GmbH, Linz -------------------------------------------------------------------------------- -License - This file is part of CFDEMcoupling. - - CFDEMcoupling is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3 of the License, or (at your - option) any later version. - - CFDEMcoupling 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with CFDEMcoupling; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Description - This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS - and OpenFOAM. Note: this code is not part of OpenFOAM (see DISCLAIMER). -\*---------------------------------------------------------------------------*/ - - -CFDEM coupling provides an open source parallel coupled CFD-DEM framework -combining the strengths of LIGGGHTS DEM code and the Open Source -CFD package OpenFOAM(R)(*). The CFDEMcoupling toolbox allows to expand -standard CFD solvers of OpenFOAM(R)(*) to include a coupling to the DEM -code LIGGGHTS. In this toolbox the particle representation within the -CFD solver is organized by "cloud" classes. Key functionalities are organised -in sub-models (e.g. force models, data exchange models, etc.) which can easily -be selected and combined by dictionary settings. - -The coupled solvers run fully parallel on distributed-memory clusters. - -Features are: - -- its modular approach allows users to easily implement new models -- its MPI parallelization enables to use it for large scale problems -- the "forum"_lws on CFD-DEM gives the possibility to exchange with other - users / developers -- the use of GIT allows to easily update to the latest version -- basic documentation is provided - -The file structure: - -- "src" directory including the source files of the coupling toolbox and models -- "applications" directory including the solver files for coupled CFD-DEM simulations -- "doc" directory including the documentation of CFDEMcoupling -- "tutorials" directory including basic tutorial cases showing the functionality - - - -Details on installation are given on the "www.cfdem.com" - -The functionality of this CFD-DEM framwork is described via "tutorial cases" showing -how to use different solvers and models. - -CFDEMcoupling stands for Computational Fluid Dynamics (CFD) - -Discrete Element Method (DEM) coupling. - -CFDEMcoupling is an open-source code, distributed freely under the terms of the -GNU Public License (GPL). - -Core development of CFDEMcoupling is done by -Christoph Goniva and Christoph Kloss, both at DCS Computing GmbH, 2012 - - -\*---------------------------------------------------------------------------*/ -(*) "OpenFOAM(R)"_of is a registered trade mark of Silicon Graphics -International Corp. This offering is not affiliated, approved or endorsed by -Silicon Graphics International Corp., the producer of the OpenFOAM(R) software -and owner of the OpenFOAM(R) trademark. -\*---------------------------------------------------------------------------*/ diff --git a/doc/CFDEMcoupling_Manual.pdf b/doc/CFDEMcoupling_Manual.pdf index 6c8d547b..671a2cce 100644 Binary files a/doc/CFDEMcoupling_Manual.pdf and b/doc/CFDEMcoupling_Manual.pdf differ diff --git a/doc/CFDEMcoupling_Manual.txt b/doc/CFDEMcoupling_Manual.txt index 399ae67f..6c8df26f 100644 --- a/doc/CFDEMcoupling_Manual.txt +++ b/doc/CFDEMcoupling_Manual.txt @@ -433,6 +433,8 @@ Reasonable example settings for the "liggghtsCommands" dictionary are given in t + + diff --git a/doc/githubAccess_public.html b/doc/githubAccess_public.html index c8e5a91c..70c81f99 100644 --- a/doc/githubAccess_public.html +++ b/doc/githubAccess_public.html @@ -166,4 +166,10 @@ CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION

(see http://stackoverflow.com/questions/3777075/https-github-access)

+

c) If you face the error: "Agent admitted failure to sign using the key. Permission denied (publickey).", after ssh -T git@github.com +

+

please type: "ssh-add" +

+

(see: https://help.github.com/articles/error-agent-admitted-failure-to-sign) +

diff --git a/doc/githubAccess_public.pdf b/doc/githubAccess_public.pdf index 65743b85..cbd54c63 100644 Binary files a/doc/githubAccess_public.pdf and b/doc/githubAccess_public.pdf differ diff --git a/doc/githubAccess_public.txt b/doc/githubAccess_public.txt index 0b5695ed..ffc055cb 100644 --- a/doc/githubAccess_public.txt +++ b/doc/githubAccess_public.txt @@ -150,3 +150,9 @@ please use: env GIT_SSL_NO_VERIFY=true git clone https://github... (see http://stackoverflow.com/questions/3777075/https-github-access) + +[c)] If you face the error: "Agent admitted failure to sign using the key. Permission denied (publickey).", after ssh -T git@github.com + +please type: "ssh-add" + +(see: https://help.github.com/articles/error-agent-admitted-failure-to-sign) diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index d1578924..e2411291 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -20,18 +20,33 @@ $(forceModels)/forceModel/forceModel.C $(forceModels)/forceModel/newForceModel.C $(forceModels)/noDrag/noDrag.C $(forceModels)/DiFeliceDrag/DiFeliceDrag.C +$(forceModels)/DiFeliceDragNLift/DiFeliceDragNLift.C $(forceModels)/GidaspowDrag/GidaspowDrag.C $(forceModels)/SchillerNaumannDrag/SchillerNaumannDrag.C $(forceModels)/Archimedes/Archimedes.C $(forceModels)/ArchimedesIB/ArchimedesIB.C $(forceModels)/interface/interface.C $(forceModels)/ShirgaonkarIB/ShirgaonkarIB.C +$(forceModels)/fieldTimeAverage/fieldTimeAverage.C +$(forceModels)/fieldBound/fieldBound.C +$(forceModels)/volWeightedAverage/volWeightedAverage.C +$(forceModels)/totalMomentumExchange/totalMomentumExchange.C $(forceModels)/KochHillDrag/KochHillDrag.C +$(forceModels)/BeetstraDrag/multiphaseFlowBasic/multiphaseFlowBasic.C +$(forceModels)/BeetstraDrag/BeetstraDrag.C +$(forceModels)/LaEuScalarLiquid/LaEuScalarLiquid.C $(forceModels)/LaEuScalarTemp/LaEuScalarTemp.C +$(forceModels)/LaEuScalarDust/LaEuScalarDust.C $(forceModels)/virtualMassForce/virtualMassForce.C $(forceModels)/gradPForce/gradPForce.C +$(forceModels)/gradULiftForce/gradULiftForce.C $(forceModels)/viscForce/viscForce.C $(forceModels)/MeiLift/MeiLift.C +$(forceModels)/KochHillDragNLift/KochHillDragNLift.C +$(forceModels)/solidsPressureForce/solidsPressureForce.C +$(forceModels)/periodicPressure/periodicPressure.C +$(forceModels)/periodicPressureControl/periodicPressureControl.C +$(forceModels)/averageSlipVel/averageSlipVel.C $(forceModelsMS)/forceModelMS/forceModelMS.C $(forceModelsMS)/forceModelMS/newForceModelMS.C @@ -42,6 +57,7 @@ $(IOModels)/IOModel/newIOModel.C $(IOModels)/noIO/noIO.C $(IOModels)/basicIO/basicIO.C $(IOModels)/trackIO/trackIO.C +$(IOModels)/sophIO/sophIO.C $(voidFractionModels)/voidFractionModel/voidFractionModel.C $(voidFractionModels)/voidFractionModel/newVoidFractionModel.C @@ -60,20 +76,22 @@ $(locateModels)/turboEngineSearch/turboEngineSearch.C $(locateModels)/turboEngineSearchM2M/turboEngineSearchM2M.C $(locateModels)/engineSearchIB/engineSearchIB.C - $(meshMotionModels)/meshMotionModel/meshMotionModel.C $(meshMotionModels)/meshMotionModel/newMeshMotionModel.C $(meshMotionModels)/noMeshMotion/noMeshMotion.C +$(meshMotionModels)/DEMdrivenMeshMotion/DEMdrivenMeshMotion.C $(momCoupleModels)/momCoupleModel/momCoupleModel.C $(momCoupleModels)/momCoupleModel/newMomCoupleModel.C $(momCoupleModels)/explicitCouple/explicitCouple.C +$(momCoupleModels)/explicitCoupleSource/explicitCoupleSource.C $(momCoupleModels)/implicitCouple/implicitCouple.C $(momCoupleModels)/noCouple/noCouple.C $(regionModels)/regionModel/regionModel.C $(regionModels)/regionModel/newRegionModel.C $(regionModels)/allRegion/allRegion.C +$(regionModels)/differentialRegion/differentialRegion.C $(dataExchangeModels)/dataExchangeModel/dataExchangeModel.C $(dataExchangeModels)/dataExchangeModel/newDataExchangeModel.C diff --git a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H index cfb5bcbd..57ad0d8a 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H @@ -1,4 +1,4 @@ -word CFDEMversion="cfdem-2.4.4"; +word CFDEMversion="cfdem-2.4.5"; word compatibleLIGGGHTSversion="2.0.4"; Info << "\nCFDEMcoupling version: " << CFDEMversion << "\n" << endl; diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C index 65901cfa..e43a1c77 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.C @@ -230,18 +230,24 @@ Foam::cfdemCloud::cfdemCloud Foam::cfdemCloud::~cfdemCloud() { clockM().evalPar(); - free(positions_); - free(velocities_); - free(impForces_); - free(expForces_); - free(DEMForces_); - free(radii_); - free(voidfractions_); - free(cellIDs_); - free(particleWeights_); - free(particleVolumes_); + free2D(positions_); + free2D(velocities_); + free2D(impForces_); + free2D(expForces_); + free2D(DEMForces_); + free2D(radii_); + free2D(voidfractions_); + free2D(cellIDs_); + free2D(particleWeights_); + free2D(particleVolumes_); } // * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * // +inline void Foam::cfdemCloud::free2D(double** array) +{ + free(array[0]); + free(array); +} + void Foam::cfdemCloud::getDEMdata() { dataExchangeM().getData("radius","scalar-atom",radii_); diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H index e4972bb4..fdeba373 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloud.H @@ -165,6 +165,8 @@ protected: autoPtr* liggghtsCommand_; // Private member functions + inline void free2D(double**); + virtual void getDEMdata(); virtual void giveDEMdata(); diff --git a/src/lagrangian/cfdemParticle/etc/bashrc b/src/lagrangian/cfdemParticle/etc/bashrc index e5fd1c8b..6ef0466b 100755 --- a/src/lagrangian/cfdemParticle/etc/bashrc +++ b/src/lagrangian/cfdemParticle/etc/bashrc @@ -107,6 +107,9 @@ alias cfdemCompM2M='bash $CFDEM_SRC_DIR/etc/compileM2Mlib.sh' #- shortcut to test basic tutorials alias cfdemTestTUT='bash $CFDEM_SRC_DIR/etc/testTutorials.sh' +#- recursive touch of current directory +alias touchRec='find ./* -exec touch {} \;' + #- shortcut to run liggghts in serial cfdemLiggghts() { $CFDEM_LIGGGHTS_SRC_DIR/lmp_$CFDEM_LIGGGHTS_MAKEFILE_NAME < $1; } export -f cfdemLiggghts diff --git a/src/lagrangian/cfdemParticle/etc/functions.sh b/src/lagrangian/cfdemParticle/etc/functions.sh index 57df6e6b..dd9563fb 100755 --- a/src/lagrangian/cfdemParticle/etc/functions.sh +++ b/src/lagrangian/cfdemParticle/etc/functions.sh @@ -313,6 +313,8 @@ parCFDDEMrun() if [ $debugMode == "on" ]; then debugMode="valgrind" + elif [ $debugMode == "strict" ]; then + debugMode="valgrind --leak-check=full -v --trace-children=yes --track-origins=yes" else debugMode="" fi diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C index 82805a0b..ead3bd54 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.C @@ -62,13 +62,16 @@ basicIO::basicIO : IOModel(dict,sm), //propsDict_(dict.subDict(typeName + "Props")), - dirName_("particles"), + dirName_("lagrangian"), path_("dev/null"), + m2mComm_(false), lagPath_("dev/null") { + if (particleCloud_.dataExchangeM().myType()=="twoWayM2M"){m2mComm_=true;} //typeName did not work + Info << "particleCloud_.dataExchangeM().typeName=" << particleCloud_.dataExchangeM().myType() << endl; + //if (propsDict_.found("dirName")) dirName_=word(propsDict_.lookup("dirName")); path_ = buildFilePath(dirName_); - } @@ -87,9 +90,13 @@ void basicIO::dumpDEMdata() const if (time_.outputTime()) { // make time directory - lagPath_=createTimeDir(path_); - lagPath_=createTimeDir(fileName(lagPath_/"lagrangian")); - + if (m2mComm_) lagPath_=buildFilePath(dirName_); + else + { + lagPath_=createTimeDir(path_); + lagPath_=createTimeDir(fileName(lagPath_/"lagrangian")); + } + // stream data to file streamDataToPath(lagPath_, particleCloud_.positions(), particleCloud_.numberOfParticles(), "positions","vector","Cloud","0"); streamDataToPath(lagPath_, particleCloud_.velocities(), particleCloud_.numberOfParticles(), "v","vector","vectorField",""); @@ -102,11 +109,19 @@ void basicIO::dumpDEMdata() const fileName basicIO::buildFilePath(word dirName) const { // create file structure - fileName path("."/dirName); - mkDir(path,0777); - mkDir(fileName(path/"constant"),0777); - OFstream* stubFile = new OFstream(fileName(path/"particles.foam")); - delete stubFile; + fileName path(""); + if(m2mComm_) + { + path=fileName(particleCloud_.mesh().time().path()/particleCloud_.mesh().time().timeName()/dirName/"particleCloud"); + mkDir(path,0777); + } else + { + path=fileName("."/dirName); + mkDir(path,0777); + mkDir(fileName(path/"constant"),0777); + OFstream* stubFile = new OFstream(fileName(path/"particles.foam")); + delete stubFile; + } return path; } diff --git a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.H b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.H index 41fadcd6..f5f3d0c9 100644 --- a/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.H +++ b/src/lagrangian/cfdemParticle/subModels/IOModel/basicIO/basicIO.H @@ -40,6 +40,7 @@ SourceFiles #define basicIO_H #include "IOModel.H" +#include "dataExchangeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,6 +64,8 @@ private: fileName path_; + bool m2mComm_; + // Member Functions fileName buildFilePath(word) const; diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C index 62f44e4f..4346715e 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.C @@ -135,7 +135,7 @@ void Foam::dataExchangeModel::allocateArray int length ) const { - // allocate and init double array + // allocate and init int array array = new int[length]; for (int i=0; imemory->destroy(tmpI_); + lmp->memory->destroy(tmp_); + delete lmp2foam_; + delete lmp2foam_vec_; + delete foam2lmp_vec_; + delete lmp; } @@ -191,21 +196,14 @@ void twoWayM2M::getData { double **tata_ = (double **) lammps_extract_atom(lmp,charName); lmp2foam_vec_->exchange(&(tata_[0][0]), &(field[0][0])); - //for (int i = 0; i < nlocal_foam_; i++) - // Pout << "hihi getData: " << name <<"=" << field[i][0]<<","<0){ - tmp_ = (double *) lammps_extract_atom(lmp,charName); - /*}else{ - // might use the fct from dataExchangeModel mother class - tmp_=new double[1]; - tmp_[0]=0; - }*/ + //tmp_ = (double *) lammps_extract_atom(lmp,charName); // funct nicht? + double *tmp_ = (double *) lammps_extract_atom(lmp,charName); + //if(nlocal_lammps_>0) + // for (int i = 0; i < nlocal_lammps_; i++) + // Pout << couplingStep_ << "st tmp_[" << i << "]=" << tmp_[i] << " - "<exchange(tmp_, &(field[0][0])); - //for (int i = 0; i < nlocal_foam_; i++) - // Pout << name <<"[0][i]=" << field[0][i] <memory->grow(array, len, width, "m2m:data"); + for (int i = 0; i < len; i++) + for (int j = 0; j < width; j++) + array[i][j] = initVal; } void Foam::twoWayM2M::allocateArray @@ -275,7 +278,11 @@ void Foam::twoWayM2M::allocateArray const char* length ) const { - allocate_external_double(array, width,max(particleCloud_.numberOfParticles(),1),initVal,lmp); + int len = max(particleCloud_.numberOfParticles(),1); + lmp->memory->grow(array, len, width, "m2m:data"); + for (int i = 0; i < len; i++) + for (int j = 0; j < width; j++) + array[i][j] = initVal; } //============ @@ -288,8 +295,11 @@ void Foam::twoWayM2M::allocateArray int length ) const { - //if(length==-1) then LIGGGHTS uses own length data - allocate_external_int(array, width,max(length,1),initVal,lmp); + int len = max(length,1); + lmp->memory->grow(array, len, width, "m2m:data"); + for (int i = 0; i < len; i++) + for (int j = 0; j < width; j++) + array[i][j] = initVal; } void Foam::twoWayM2M::allocateArray @@ -300,9 +310,32 @@ void Foam::twoWayM2M::allocateArray const char* length ) const { - allocate_external_int(array, width,max(particleCloud_.numberOfParticles(),1),initVal,lmp); + int len = max(particleCloud_.numberOfParticles(),1); + lmp->memory->grow(array, len, width, "m2m:data"); + for (int i = 0; i < len; i++) + for (int j = 0; j < width; j++) + array[i][j] = initVal; } //============ +// double * +void Foam::twoWayM2M::allocateArray(double*& array, double initVal, int length) const +{ + int len = max(length,1); + lmp->memory->grow(array, len, "m2m:data"); + for (int i = 0; i < len; i++) + array[i] = initVal; +} +//============== +// int * +void Foam::twoWayM2M::allocateArray(int*& array, int initVal, int length) const +{ + int len = max(length,1); + lmp->memory->grow(array, len, "m2m:data"); + for (int i = 0; i < len; i++) + array[i] = initVal; +} +//============== + bool Foam::twoWayM2M::couple() const { @@ -381,48 +414,29 @@ void Foam::twoWayM2M::syncIDs() const // get data from lammps nlocal_lammps_ = *((int *) lammps_extract_global(lmp,"nlocal")); - int* id_lammps_sync; - double** pos_lammps_sync; + int* id_lammps_sync=NULL; + double** pos_lammps_sync=NULL; if(firstRun_) { // IDs for vectors - if(nlocal_lammps_>0){ - id_lammps_ = (int *) lammps_extract_atom(lmp,"id"); - }else{ - // might use the fct from dataExchangeModel mother class - id_lammps_=new int[1]; - id_lammps_[0]=0; - } + id_lammps_ = (int *) lammps_extract_atom(lmp,"id"); - //delete [] id_lammps_vec_; - Foam::dataExchangeModel::allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); + allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); for (int i = 0; i < nlocal_lammps_; i++) for (int j=0;j<3;j++) id_lammps_vec_[i*3+j] = id_lammps_[i]*3+j; - Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_lammps_); // do I need this??? - if(nlocal_lammps_>0){ - pos_lammps_ = (double **) lammps_extract_atom(lmp,"x"); - }else{ - // might use the fct from dataExchangeModel mother class - pos_lammps_ = new double*[1]; - pos_lammps_[0] = new double [1]; - pos_lammps_[0][0] = 0; - } + pos_lammps_ = (double **) lammps_extract_atom(lmp,"x"); } else { - // re-arrange data using map - //Foam::dataExchangeModel::allocateArray(id_lammps_sync,-1.,nlocal_lammps_); // probably not necessary - if(nlocal_lammps_>0){ - id_lammps_sync = (int *) lammps_extract_atom(lmp,"id"); - }else{ - // might use the fct from dataExchangeModel mother class - id_lammps_sync=new int[1]; - id_lammps_sync[0]=10; - } - //extract_save(id_lammps_sync,"id"); // in future it should look like this!!! - Foam::dataExchangeModel::allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); + // re-arrange data using map + + // make a copy of id array + id_lammps_sync = (int *) lammps_extract_atom(lmp,"id"); + + // genereate vector IDs + allocateArray(id_lammps_vec_,0,nlocal_lammps_*3); for (int i = 0; i < nlocal_lammps_; i++) for (int j=0;j<3;j++) id_lammps_vec_[i*3+j] = id_lammps_sync[i]*3+j; @@ -433,31 +447,18 @@ void Foam::twoWayM2M::syncIDs() const foam2lmp_vec_->setup(nlocal_foam_*3,id_foam_vec_,nlocal_lammps_*3,id_lammps_vec_); // map data according to last TS - Foam::dataExchangeModel::allocateArray(id_lammps_,0,nlocal_foam_); - lmp2foam_->exchange(id_lammps_sync, id_lammps_); + allocateArray(tmpI_,-1.,nlocal_foam_); + lmp2foam_->exchange(id_lammps_sync, tmpI_); + for(int i=0;i0){ - pos_lammps_sync = (double **) lammps_extract_atom(lmp,"x"); - }else{ - // might use the fct from dataExchangeModel mother class - pos_lammps_sync = new double*[1]; - pos_lammps_sync[0] = new double [3]; - pos_lammps_sync[0][0] = 0; - pos_lammps_sync[0][1] = 0; - pos_lammps_sync[0][2] = 0; - } - // find better solution here!!! - //Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_foam_); - //lmp2foam_vec_->exchange(&(pos_lammps_sync[0][0]), &(pos_lammps_[0][0])); - double** gugu; - Foam::dataExchangeModel::allocateArray(gugu,-1.,3*nlocal_foam_,1); - Foam::dataExchangeModel::allocateArray(pos_lammps_,-1.,3,nlocal_foam_); - lmp2foam_vec_->exchange(&(pos_lammps_sync[0][0]), &(gugu[0][0])); - - // conversion of array (should not be necessary if above problem is solved) - for (int i = 0; i < nlocal_foam_; i++) - for (int j = 0; j < 3; j++) - pos_lammps_[i][j]=gugu[0][i*3+j]; + // get access to "x" + pos_lammps_sync = (double **) lammps_extract_atom(lmp,"x"); + allocateArray(tmp_,-1.,nlocal_foam_*3); + lmp2foam_vec_->exchange(pos_lammps_sync[0], tmp_); + for(int i=0;i0) + for (int i = 0; i < nlocal_foam_; i++) + Pout << couplingStep_ << "st pos:" <<"=" << pos_lammps_[i][0]<<","<