Message: Error compiling a DNA-type program not updated to version 10.2 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Error compiling a DNA-type program not updated to version 10.2 

Forum: Medical Applications
Date: 24 Mar, 2016
From: Bigot Mathilde <Bigot Mathilde>

Dear All, I recently installed Geant4.10.02.p01 and tried to run a program previously used with Geant4.10.01. As there was a great deal of changes with the DNA related code, I had a lot of errors while compiling. Using the include files and the updated example chem3, I was able to solve some problems, but some errors are still preventing me from compiling and I'd like some help.

The error message is:

/"path_to_my_pgm"/src/TimeStepAction.cc: In member function 'virtual void TimeStepAction::Save(G4MolecularConfiguration*, double, int)':
/"path_to_my_pgm"/src/TimeStepAction.cc:177:27: error: invalid use of incomplete type 'class G4MolecularConfiguration'
  G4String name = molecule->GetName();

In file included from /"path_to_g4install"/include/Geant4/G4MoleculeDefinition.hh:64:0,
                 from /"path_to_g4install"/include/Geant4/G4Molecule.hh:76,
                 from /"path_to_my_pgm"/include/TimeStepAction.hh:42,
                 from /"path_to_my_pgm"/src/TimeStepAction.cc:38:
/"path_to_g4instamm"/include/Geant4/G4MolecularDissociationTable.hh:62:7: error: forward declaration of 'class G4MolecularConfiguration'
  class G4MolecularConfiguration;

make[3] : *** [CMakeFiles/chemR.dir/src/TimeStepAction.cc.o] Erreur 1 make[2] : *** [CMakeFiles/chemR.dir/all] Erreur 2 make[1] : *** [CMakeFiles/chemR.dir/rule] Erreur 2

Here is my current version of TimeStepAction.cc:

// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // This example is provided by the Geant4-DNA collaboration // Any report or published results obtained using the Geant4-DNA software // shall cite the following Geant4-DNA collaboration publication: // Med. Phys. 37 (2010) 4692-4708 // J. Comput. Phys. 274 (2014) 841-882 // The Geant4-DNA web site is available at http://geant4-dna.org // // $Id$ // /// \file TimeStepAction.hh /// \brief Implementation of the TimeStepAction class

#include "TimeStepAction.hh"

#include "G4H2O.hh"
#include <G4Scheduler.hh>
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4MoleculeTable.hh"
#include "G4MoleculeCounter.hh"
#include "G4Molecule.hh"
#include "Analysis.hh"

#include "G4MoleculeGun.hh"
#include "DetectorConstruction.hh"
#include "G4RunManager.hh"
#include "Randomize.hh"
#include "math.h"
#include "G4PhysicalConstants.hh"

TimeStepAction::TimeStepAction() : 
    G4UserTimeStepAction()
{
  /**
   * Give to G4ITTimeStepper the user defined time steps
   * eg : from 1 picosecond to 10 picosecond, the minimum time
   * step that the TimeStepper can returned is 0.1 picosecond.
   * Those time steps are used for the chemistry of G4DNA
   */

  AddTimeStep(1*picosecond, 0.1*picosecond);
  AddTimeStep(10*picosecond, 1*picosecond);
  AddTimeStep(100*picosecond, 3*picosecond);
  AddTimeStep(1000*picosecond, 10*picosecond);
  AddTimeStep(10000*picosecond, 100*picosecond);
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

TimeStepAction::~TimeStepAction()
{
  //dtor
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

TimeStepAction::TimeStepAction(const TimeStepAction& other) :
        G4UserTimeStepAction(other)
{
  //copy ctor
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

TimeStepAction&
TimeStepAction::operator=(const TimeStepAction& rhs)
{
  if (this == &rhs) return *this; // handle self assignment
  //assignment operator
  return *this;
}

void TimeStepAction::StartProcessing() { }

void TimeStepAction::UserPreTimeStepAction() { }

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void TimeStepAction::UserPostTimeStepAction()
{
  //    G4cout << "_________________" << G4endl;
  /*
  G4cout << "Time Step : "
      << G4BestUnit(G4ITScheduler::Instance()->GetTimeStep(),
          "Time")
          << G4endl;

  G4cout <<  "End of step: "
      << G4BestUnit(G4ITScheduler::Instance()->GetGlobalTime(),
                            "Time")
      << G4endl;
   */
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void TimeStepAction::UserReactionAction(const G4Track&,
    const G4Track&,
    const std::vector<G4Track*>* /*products*/)
{
  /*
  for (int i = 0 ; i < nbProducts ; i ++)
  {
    G4cout << "Product[" << i << "] : "
        << GetMolecule(products[i])->GetName()
        << G4endl ;
  }
   */
}

void TimeStepAction::EndProcessing()
{
  double time;
  int i = 1;

  //G4Molecule* molecule = G4MoleculeTable::Instance()->GetConfiguration("H3Op");
  G4ConfigurationIterator it = G4MoleculeTable::Instance()->GetConfigurationIterator();

  while(it())
  {
    G4MolecularConfiguration* molecule = it.value();
    /*time = 1E-6 ; //en nanosecondes
    Save(molecule, time, i);

    time = 100 ; //en nanosecondes
    Save(molecule, time, i);*/

    time = 1000 ; //en nanosecondes
    Save(molecule, time, i);

    //Affichage du résultats à differents temps entre ... et 1µs.
	/*while (time < 2E3) {
        Save(molecule, time, i);
        time = (time*1.1);
        }*/
    G4cout << G4endl ;
    i++;
  }
}

void TimeStepAction::Save(G4MolecularConfiguration* molecule, double time, int i)
{
  //COUT
  long number = G4MoleculeCounter::Instance()->GetNMoleculesAtTime(molecule, time);
  G4String name = molecule->GetName();

  G4cout << " Nombre de " << name << " à " << G4BestUnit(time, "Time") << " : "<< number << G4endl ;

  //FICHIER SORTIE
  FILE* myFile;
  myFile = fopen("out.txt","a");
  fprintf (myFile, "%d %e %ld \n", i, time*1E-9, number);
  fclose (myFile);

  // NTUPLE
  /*G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
  while (number > 0) {
        analysisManager->FillNtupleDColumn(0, i);
        analysisManager->AddNtupleRow(); 
        number=number-1 ; 
        }*/
}

Thank you for your help

Bests, M. Bigot

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: Error compiling a DNA-type program not updated to version 10.2   (Bigot Mathilde - 24 Mar, 2016)
 Add Message Add Message
to: "Error compiling a DNA-type program not updated to version 10.2"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]