--- trunk/src/applications/sequentialProps/SequentialProps.cpp 2014/10/30 18:51:38 2029 +++ trunk/src/applications/sequentialProps/SequentialProps.cpp 2015/03/07 21:41:51 2071 @@ -53,6 +53,7 @@ #include "applications/sequentialProps/SequentialAnalyzer.hpp" #include "applications/sequentialProps/CenterOfMass.hpp" #include "applications/sequentialProps/ContactAngle1.hpp" +#include "applications/sequentialProps/ContactAngle2.hpp" using namespace OpenMD; @@ -105,11 +106,11 @@ int main(int argc, char* argv[]){ SimCreator creator; SimInfo* info = creator.createSim(dumpFileName, false); - SequentialAnalyzer* analyzer; + SequentialAnalyzer* analyzer = NULL; if(args_info.com_given){ analyzer = new CenterOfMass(info, dumpFileName, sele1); } else if(args_info.ca1_given){ - RealType solidZ; + RealType solidZ(0.0); if (args_info.referenceZ_given) solidZ = args_info.referenceZ_arg; else { @@ -119,7 +120,7 @@ int main(int argc, char* argv[]){ painCave.isFatal = 1; simError(); } - RealType dropletR; + RealType dropletR(0.0); if (args_info.dropletR_given) dropletR = args_info.dropletR_arg; else { @@ -131,6 +132,41 @@ int main(int argc, char* argv[]){ } analyzer = new ContactAngle1(info, dumpFileName, sele1, solidZ, dropletR); + } else if(args_info.ca2_given){ + RealType solidZ(0.0); + if (args_info.referenceZ_given) + solidZ = args_info.referenceZ_arg; + else { + sprintf( painCave.errMsg, + "--referenceZ must be set if --ca2 is used\n"); + painCave.severity = OPENMD_ERROR; + painCave.isFatal = 1; + simError(); + } + RealType threshDens(0.0); + if (args_info.threshDens_given) + threshDens = args_info.threshDens_arg; + else { + sprintf( painCave.errMsg, + "--threshDens must be set if --ca2 is used\n"); + painCave.severity = OPENMD_ERROR; + painCave.isFatal = 1; + simError(); + } + RealType bufferLength(0.0); + if (args_info.bufferLength_given) + bufferLength = args_info.bufferLength_arg; + else { + sprintf( painCave.errMsg, + "--bufferLength must be set if --ca2 is used\n"); + painCave.severity = OPENMD_ERROR; + painCave.isFatal = 1; + simError(); + } + + analyzer = new ContactAngle2(info, dumpFileName, sele1, solidZ, + threshDens, bufferLength, args_info.nbins_arg, + args_info.nbins_z_arg); } if (args_info.output_given) {