LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] print to hi-level logfile
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] print to hi-level logfile


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Tue, 7 Nov 2017 09:53:09 -0500

emile,

this change should do the trick. just do:

print "some text" screen no universe yes

and "some text" should be printed to the global screen.
please try it out and let me know. i'll add it to my pull request for the next LAMMPS patch.

axel.

diff --git a/src/input.cpp b/src/input.cpp
index 3d28777..6505326 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -1175,6 +1175,7 @@ void Input::print()
 
   FILE *fp = NULL;
   int screenflag = 1;
+  int universeflag = 0;
 
   int iarg = 1;
   while (iarg < narg) {
@@ -1197,6 +1198,12 @@ void Input::print()
       else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0;
       else error->all(FLERR,"Illegal print command");
       iarg += 2;
+    } else if (strcmp(arg[iarg],"universe") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal print command");
+      if (strcmp(arg[iarg+1],"yes") == 0) universeflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) universeflag = 0;
+      else error->all(FLERR,"Illegal print command");
+      iarg += 2;
     } else error->all(FLERR,"Illegal print command");
   }
 
@@ -1208,6 +1215,8 @@ void Input::print()
       fclose(fp);
     }
   }
+  if (universeflag && (universe->me == 0) && (universe->uscreen))
+    fprintf(universe->uscreen,"%s\n",line);
 }
 
 /* ---------------------------------------------------------------------- */
[akohlmey@...3785... src]$ 


On Tue, Nov 7, 2017 at 9:26 AM, Emile Maras <e1000.3000@...24...> wrote:
Dear all,

I did not find in the documentation how to print to the hi-level logfile in multi-partition mode.

I have this issue because I am runing several neb relaxations in one lammps script and I would like to print to the hi-level logfile what each neb calculation corresponds to.

Thanks to let me know if this is doable.

Emile

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...6297....sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...12...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.