<commit_before>// $Id: amber.C,v 1.6 1999/09/17 13:17:03 pmueller Exp $
// Molecular Mechanics: Amber force field class

#include <BALL/MOLMEC/AMBER/amber.h>
#include <BALL/MOLMEC/AMBER/amberStretch.h>
#include <BALL/MOLMEC/AMBER/amberBend.h>
#include <BALL/MOLMEC/AMBER/amberTorsion.h>
#include <BALL/MOLMEC/AMBER/amberNonBonded.h>
#include <BALL/MOLMEC/COMMON/assignTypes.h>

namespace BALL 
{

	const char* AmberFF::Option::NONBONDED_CUTOFF = "nonbonded_cutoff";
	const char* AmberFF::Option::VDW_CUTOFF = "vdw_cutoff";
	const char* AmberFF::Option::ELECTROSTATIC_CUTOFF = "electrostatic_cutoff";
	const char* AmberFF::Option::SCALING_VDW_1_4 = "SCAB";
	const char* AmberFF::Option::SCALING_ELECTROSTATIC_1_4 = "SCEE";
        const char* AmberFF::Option::DISTANCE_DEPENDENT_DIELECTRIC = "DDDC"; 
 
	const float AmberFF::Default::NONBONDED_CUTOFF = 20.0;
	const float AmberFF::Default::VDW_CUTOFF = 15.0;
	const float AmberFF::Default::ELECTROSTATIC_CUTOFF = 15.0;
	const float AmberFF::Default::SCALING_ELECTROSTATIC_1_4 = 0.5;
	const float AmberFF::Default::SCALING_VDW_1_4 = 0.5;
        const bool  AmberFF::Default::DISTANCE_DEPENDENT_DIELECTRIC = false;   
 
	// Default constructor
	AmberFF::AmberFF() 
			// call the base class constructor
		: ForceField()
	{
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));
	}

  // Constructor initialized with a system
  AmberFF::AmberFF(System& system)
    : ForceField()
  {
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));

    bool result = setup(system);

    if (!result)
    {
      Log.level(LogStream::ERROR) << " Force Field setup failed! " << endl;
      valid_ = false;
		}
	}

  // Constructor intialized with a system and a set of options
  AmberFF::AmberFF(System& system, const Options& new_options)
    : ForceField()
  {
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));

    bool result = setup(system, new_options);

    if (!result)
    {
      Log.level(LogStream::ERROR) << " Force Field setup failed! " << endl;
      valid_ = false;
		}
	}
 
	// copy constructor  
	AmberFF::AmberFF(const AmberFF& force_field, bool clone_deep)
		 :	ForceField( force_field, clone_deep) 
	{
		
	}

	// destructor 
	AmberFF::~AmberFF(void)
	{
	}

	// force field specific setup method BAUSTELLE
	bool AmberFF::specificSetup(void)
	{

		// check whether the system is assigned
		if (getSystem() == 0)
		{
			return false;
		}

 
		// open parameter file
		Path    path;
		String  filename(path.find("Amber/amber91.ini"));

		if (filename == "") 
		{
			Log.level(LogStream::ERROR) << "cannot open parameter file Amber/amber91.ini" << endl;
			return false;
		}

		// initialize the force field parameters
		// and retrieve the atom types
		parameters_.setFilename(filename);
		parameters_.init();

		// assign atom types: QUICK AND _VERY_ DIRTY (BAUSTELLLE)
		AssignTypeNameProcessor type_name_proc("/KM/comp-bio/BALL-data/Amber/amber91.types", false);
		getSystem()->apply(type_name_proc);
		AssignTypeProcessor type_proc(parameters_.getAtomTypes());
		getSystem()->apply(type_proc);
		
		return true;
	}
<commit_msg>modified AmberFF to use AMBER94 data instead of AMBER91<commit_after>// $Id: amber.C,v 1.7 1999/09/17 13:39:10 oliver Exp $
// Molecular Mechanics: Amber force field class

#include <BALL/MOLMEC/AMBER/amber.h>
#include <BALL/MOLMEC/AMBER/amberStretch.h>
#include <BALL/MOLMEC/AMBER/amberBend.h>
#include <BALL/MOLMEC/AMBER/amberTorsion.h>
#include <BALL/MOLMEC/AMBER/amberNonBonded.h>
#include <BALL/MOLMEC/COMMON/assignTypes.h>

namespace BALL 
{

	const char* AmberFF::Option::NONBONDED_CUTOFF = "nonbonded_cutoff";
	const char* AmberFF::Option::VDW_CUTOFF = "vdw_cutoff";
	const char* AmberFF::Option::ELECTROSTATIC_CUTOFF = "electrostatic_cutoff";
	const char* AmberFF::Option::SCALING_VDW_1_4 = "SCAB";
	const char* AmberFF::Option::SCALING_ELECTROSTATIC_1_4 = "SCEE";
        const char* AmberFF::Option::DISTANCE_DEPENDENT_DIELECTRIC = "DDDC"; 
 
	const float AmberFF::Default::NONBONDED_CUTOFF = 20.0;
	const float AmberFF::Default::VDW_CUTOFF = 15.0;
	const float AmberFF::Default::ELECTROSTATIC_CUTOFF = 15.0;
	const float AmberFF::Default::SCALING_ELECTROSTATIC_1_4 = 0.5;
	const float AmberFF::Default::SCALING_VDW_1_4 = 0.5;
        const bool  AmberFF::Default::DISTANCE_DEPENDENT_DIELECTRIC = false;   
 
	// Default constructor
	AmberFF::AmberFF() 
			// call the base class constructor
		: ForceField()
	{
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));
	}

  // Constructor initialized with a system
  AmberFF::AmberFF(System& system)
    : ForceField()
  {
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));

    bool result = setup(system);

    if (!result)
    {
      Log.level(LogStream::ERROR) << " Force Field setup failed! " << endl;
      valid_ = false;
		}
	}

  // Constructor intialized with a system and a set of options
  AmberFF::AmberFF(System& system, const Options& new_options)
    : ForceField()
  {
		// set the force field name
		setName("Amber");

		// create the component list
		insertComponent(new AmberStretch( this ));
		insertComponent(new AmberBend( this ));
		insertComponent(new AmberTorsion( this ));
		insertComponent(new AmberNonBonded( this ));

    bool result = setup(system, new_options);

    if (!result)
    {
      Log.level(LogStream::ERROR) << " Force Field setup failed! " << endl;
      valid_ = false;
		}
	}
 
	// copy constructor  
	AmberFF::AmberFF(const AmberFF& force_field, bool clone_deep)
		 :	ForceField( force_field, clone_deep) 
	{
		
	}

	// destructor 
	AmberFF::~AmberFF(void)
	{
	}

	// force field specific setup method BAUSTELLE
	bool AmberFF::specificSetup(void)
	{

		// check whether the system is assigned
		if (getSystem() == 0)
		{
			return false;
		}

 
		// open parameter file
		Path    path;
		String  filename(path.find("Amber/amber94.ini"));

		if (filename == "") 
		{
			Log.level(LogStream::ERROR) << "cannot open parameter file Amber/amber94.ini" << endl;
			return false;
		}

		// initialize the force field parameters
		// and retrieve the atom types
		parameters_.setFilename(filename);
		parameters_.init();

		// assign atom types: QUICK AND _VERY_ DIRTY (BAUSTELLLE)
		AssignTypeNameProcessor type_name_proc("/KM/comp-bio/BALL-data/Amber/amber94.types", false);
		getSystem()->apply(type_name_proc);
		AssignTypeProcessor type_proc(parameters_.getAtomTypes());
		getSystem()->apply(type_proc);
		
		return true;
	}

{'fraction_non_alphanumeric': 0.1236919774617655, 'fraction_numerical': 0.012342366514623022, 'mean_word_length': 4.116678105696637, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3715602', 'n_tokens_mistral': 2876, 'n_tokens_neox': 2572, 'n_words': 570}