Commit 1ae68a17 authored by graham's avatar graham
Browse files

clean out old lagrangian/molecularDynamics/molecule/tetherPotential/

parent c25546fd
......@@ -11,9 +11,6 @@ referredMolecule = referredMolecule
referredCellList = referredCellList
referredCell = referredCell
referralLists = referralLists
tetherPotential = tetherPotential
$(distribution)/distribution.C
$(reducedUnits)/reducedUnits.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*----------------------------------------------------------------------------*/
#include "tetherPotential.H"
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
tetherPotential::tetherPotential()
{}
tetherPotential::tetherPotential
(
const word& tetherPotentialName,
const word& tetherPotentialType,
const scalar springConstant
)
:
tetherPotentialName_(tetherPotentialName),
tetherPotentialType_(tetherPotentialType),
springConstant_(springConstant)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
tetherPotential::~tetherPotential()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void tetherPotential::write(Ostream& os) const
{
os << tetherPotentialName_
<< nl << tetherPotentialType_
<< nl << springConstant_
<< endl;
}
scalar tetherPotential::force(const scalar rITMag) const
{
return -springConstant_ * rITMag;
}
scalar tetherPotential::energy(const scalar rITMag) const
{
return 0.5*springConstant_*rITMag*rITMag;
}
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
Ostream& operator<<(Ostream& os, const tetherPotential& pot)
{
pot.write(os);
os.check("Ostream& operator<<(Ostream& f, const tetherPotential& pot");
return os;
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::tetherPotential
Description
SourceFiles
tetherPotentialI.H
tetherPotential.C
\*---------------------------------------------------------------------------*/
#ifndef tetherPotential_H
#define tetherPotential_H
#include "vector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class tetherPotential Declaration
\*---------------------------------------------------------------------------*/
class tetherPotential
{
// Private data
// At the moment this is hard coded to be a "harmonicSpring"
// potential. In future use templated classes virtual functions,
// function pointers and all kinds of good stuff to make this a
// generic tether force,
word tetherPotentialName_;
word tetherPotentialType_;
scalar springConstant_;
public:
// Constructors
//- Construct null
tetherPotential();
//- Construct from components
tetherPotential
(
const word& tetherPotentialName,
const word& tetherPotentialType,
const scalar springConstant_
);
// Destructor
virtual ~tetherPotential();
// Member Functions
// Access
inline const word& tetherPotentialName() const;
inline const word& tetherPotentialType() const;
inline scalar springConstant() const;
scalar force(const scalar rITMag) const;
scalar energy(const scalar rITMag) const;
// Write
virtual void write(Ostream&) const;
// IOstream Operators
friend Ostream& operator<<(Ostream&, const tetherPotential&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "tetherPotentialI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const word& tetherPotential::tetherPotentialName() const
{
return tetherPotentialName_;
}
inline const word& tetherPotential::tetherPotentialType() const
{
return tetherPotentialType_;
}
inline scalar tetherPotential::springConstant() const
{
return springConstant_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*----------------------------------------------------------------------------*/
#include "tetherPotentialList.H"
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
label tetherPotentialList::tetherPotentialIndex(const label a)
{
label index(findIndex(tetherIds_,a));
if (index == -1)
{
FatalErrorIn
(
"Foam::tetherPotentialList::tetherPotentialIndex(const label a)"
)
<< "Attempting to access a tetherPotential with an unknown id"
<< abort(FatalError);
return 0;
}
else
{
return index;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::tetherPotentialList::tetherPotentialList()
:
List<tetherPotential> ()
{}
Foam::tetherPotentialList::tetherPotentialList
(
const List<label> tetherIds
)
:
List<tetherPotential> (tetherIds.size()),
tetherIds_(tetherIds_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
tetherPotentialList::~tetherPotentialList()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void tetherPotentialList::setSizeAndTetherIds (const List<label>& tetherIds)
{
tetherIds_ = tetherIds;
setSize(tetherIds.size());
}
void tetherPotentialList::addPotential
(
const label a,
const tetherPotential& pot
)
{
(*this)[tetherPotentialIndex (a)] = pot;
}
tetherPotential& tetherPotentialList::tetherPotentialFunction (const label a)
{
return (*this)[tetherPotentialIndex (a)];
}
scalar tetherPotentialList::force (const label a, const scalar rITMag)
{
scalar f = (*this)[tetherPotentialIndex (a)].force(rITMag);
return f;
}
scalar tetherPotentialList::energy (const label a, const scalar rITMag)
{
scalar e = (*this)[tetherPotentialIndex (a)].energy(rITMag);
return e;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void tetherPotentialList::operator=(const tetherPotentialList& rhs)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"Foam::tetherPotentialList::operator="
"(const Foam::tetherPotentialList&)"
) << "Attempted assignment to self"
<< abort(FatalError);
}
List<tetherPotential>::operator=(rhs);
tetherIds_ = rhs.tetherIds();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::tetherPotentialList
Description
SourceFiles
tetherPotentialListI.H
tetherPotentialList.C
\*---------------------------------------------------------------------------*/
#ifndef tetherPotentialList_H
#define tetherPotentialList_H
#include "ListOps.H"
#include "tetherPotential.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class tetherPotentialList Declaration
\*---------------------------------------------------------------------------*/
class tetherPotentialList
:
public List<tetherPotential>
{
// Private data
List<label> tetherIds_;
// Private Member Functions
label tetherPotentialIndex(const label a);
//- Disallow default bitwise copy construct
tetherPotentialList(const tetherPotentialList&);
public:
// Constructors
//- Construct null
tetherPotentialList();
//- Construct from list of tetherIDs
tetherPotentialList(const List<label> tetherIds);
// Destructor
~tetherPotentialList();
// Member Functions
// Access
inline const List<label>& tetherIds() const;
inline label nTetherPotentials() const;
void setSizeAndTetherIds (const List<label>&);
void addPotential
(
const label a,
const tetherPotential& pot
);
tetherPotential& tetherPotentialFunction (const label a);
scalar force (const label a, const scalar rITMag);
scalar energy (const label a, const scalar rITMag);
// Member Operators
void operator=(const tetherPotentialList&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "tetherPotentialListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const List<label>& tetherPotentialList::tetherIds() const
{
return tetherIds_;
}
inline label tetherPotentialList::