Message: Some errors and modifications to the extended/biasing/B02/ Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Some errors and modifications to the extended/biasing/B02/ 

Forum: Documentation and Examples
Date: Apr 15, 19:07
From: Yuan Hu <Yuan Hu>

Recently, I want to use Mesh Weight Window in a Parallel World to solve the deep penetration problems. And after I read the manual and examples, I decided to achieve this function based on extended/biasing/B02, which could use Importance(default) or Weight Window to solve the deep penetration problems. But when I try to switch the Importance to Weight Window (without other modifications, just comment out some lines which call Importance-related functions), there always be some errors.

After a few days trying, I found that the reason is that there are some missing lines for Weight Window. So when the exampleB02 use default Importance, it's fine, but when the exampleB02 switch to Weight Window, it will encounter errors.

Following is the original code of extended/biasing/B02/exampleB02.cc :

  G4VModularPhysicsList* physicsList = new FTFP_BERT;
  physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs,parallelName));
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelName));

And this is the modified version:

  G4VModularPhysicsList* physicsList = new FTFP_BERT;

  G4WeightWindowAlgorithm* wwAlg = new G4WeightWindowAlgorithm(1,    // upper limit factor
                                          1,    // survival factor 
                                          100); // max. number of splitting

  const G4String& name = "ParallelWP";
  physicsList->RegisterPhysics(new G4WeightWindowBiasing(&pgs, wwAlg, onBoundary, name));
  //physicsList->RegisterPhysics(new G4ImportanceBiasing(&pgs,parallelName));
  physicsList->RegisterPhysics(new G4ParallelWorldPhysics(parallelName));

Some tips for this modified version:

  Don't forget to include the corresponding head file for the new lines;
  And the 'const G4String& name = "ParallelWP";' line is necessary, otherwise the Weight Window will not assign to the geometry in Parallel World (this part has puzzled me for a long time);

And there is also a small change in extended/biasing/B02/exampleB02.cc The original code:

  pdet->CreateImportanceStore();

where the only change is adding a new line to call the Weight Window function:

  //pdet->CreateImportanceStore();
  pdet->CreateWeightWindowStore();

I hope this could be helpful to others.

 Add Message Add Message
to: "Some errors and modifications to the extended/biasing/B02/"

 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 ]