Commit de79ed05 authored by js9's avatar js9

Allowing element arrays to be 0-origin, with 0=unknown and 1=hydrogen.



git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7349 18c085ea-50e0-402c-830e-de6fd14e8384
parent 06d044d8
......@@ -1132,6 +1132,12 @@ TakeOffPolyLine(int *seg_list,int start_pt,std::vector< std::vector<int> > &ls)
// Hank Childs, Fri Feb 15 16:28:29 PST 2008
// Fix memory leak.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
// ****************************************************************************
void
......@@ -1213,23 +1219,23 @@ avtDatasetFileWriter::WritePOVRayFamily(const char *filename)
// And make a .inc file with the current atomic properties
//
ofstream atomfile("atomicproperties.inc");
atomfile << "#declare atomic_radius = array["<<MAX_ELEMENT_NUMBER<<"]\n";
atomfile << "#declare atomic_radius = array["<<MAX_ELEMENT_NUMBER+1<<"]\n";
atomfile << "{" << endl;
for (int i=0; i<MAX_ELEMENT_NUMBER; i++)
for (int i=0; i<=MAX_ELEMENT_NUMBER; i++)
{
atomfile << " " << atomic_radius[i];
if (i<MAX_ELEMENT_NUMBER-1)
if (i<MAX_ELEMENT_NUMBER)
atomfile << ",";
atomfile << endl;
}
atomfile << "};" << endl;
atomfile << endl;
atomfile << "#declare covalent_radius = array["<<MAX_ELEMENT_NUMBER<<"]\n";
atomfile << "#declare covalent_radius = array["<<MAX_ELEMENT_NUMBER+1<<"]\n";
atomfile << "{" << endl;
for (int i=0; i<MAX_ELEMENT_NUMBER; i++)
for (int i=0; i<=MAX_ELEMENT_NUMBER; i++)
{
atomfile << " " << covalent_radius[i];
if (i<MAX_ELEMENT_NUMBER-1)
if (i<MAX_ELEMENT_NUMBER)
atomfile << ",";
atomfile << endl;
}
......
This diff is collapsed.
......@@ -39,6 +39,14 @@
// Modifications:
// Jeremy Meredith, Wed Oct 17 10:32:42 EDT 2007
// Filled in some holes in atomic radii.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
#include "AtomicProperties.h"
......@@ -137,7 +145,8 @@ unsigned char old_shapelycolors[KNOWN_AMINO_ACIDS][3] = {
};
unsigned char jmolcolors[MAX_ELEMENT_NUMBER][3] = {
unsigned char jmolcolors[MAX_ELEMENT_NUMBER+1][3] = {
{ 0x20, 0x20, 0x20 }, // ?
{ 0xFF, 0xFF, 0xFF }, // H
{ 0xD9, 0xFF, 0xFF }, // He
{ 0xCC, 0x80, 0xFF }, // Li
......@@ -249,7 +258,8 @@ unsigned char jmolcolors[MAX_ELEMENT_NUMBER][3] = {
{ 0xEB, 0x00, 0x26 } // Mt
};
unsigned char rasmolcolors[MAX_ELEMENT_NUMBER][3] = {
unsigned char rasmolcolors[MAX_ELEMENT_NUMBER+1][3] = {
{ 0x20, 0x20, 0x20 }, // ?
{ 0xFF, 0xFF, 0xFF }, // H
{ 0xFF, 0xC0, 0xCB }, // He
{ 0xB2, 0x22, 0x22 }, // Li
......@@ -361,7 +371,8 @@ unsigned char rasmolcolors[MAX_ELEMENT_NUMBER][3] = {
{ 0xFF, 0x14, 0x93 } // Mt
};
float covalent_radius[MAX_ELEMENT_NUMBER] = {
float covalent_radius[MAX_ELEMENT_NUMBER+1] = {
.1f, // ? 0
0.32f, // H 1
0.93f, // He 2
1.23f, // Li 3
......@@ -473,7 +484,8 @@ float covalent_radius[MAX_ELEMENT_NUMBER] = {
.1f
};
float atomic_radius[MAX_ELEMENT_NUMBER] = {
float atomic_radius[MAX_ELEMENT_NUMBER+1] = {
.1f, // ? 0
0.79f, // H 1
0.49f, // He 2
2.05f, // Li 3
......@@ -585,7 +597,8 @@ float atomic_radius[MAX_ELEMENT_NUMBER] = {
.1f
};
const char *element_names[MAX_ELEMENT_NUMBER] = {
const char *element_names[MAX_ELEMENT_NUMBER+1] = {
"?", // 0
"H", // 1
"He", // 2
"Li", // 3
......@@ -845,11 +858,20 @@ InitializeResidueNameToLongNameMap()
residuename_to_longname["HOH"] = "Water";
}
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
//
static void
InitializeElementNameToAtomicNumberMap()
{
// These are sorted by covalent radius to make the map
// tree more balanced.
elementname_to_atomicnumber["?"] = 0;
elementname_to_atomicnumber["H"] = 1;
elementname_to_atomicnumber["Ne"] = 10;
elementname_to_atomicnumber["F"] = 9;
......@@ -962,6 +984,12 @@ InitializeAtomicPropertyMaps()
// Jeremy Meredith, Mon Aug 28 18:04:10 EDT 2006
// Sped up by skipping the map.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
int ElementNameToAtomicNumber(const char *element)
{
static char name[3];
......@@ -981,6 +1009,10 @@ int ElementNameToAtomicNumber(const char *element)
switch (name[0])
{
case '?':
{
return 0;
}
case 'A':
{
switch (name[1])
......@@ -1361,6 +1393,12 @@ int ResidueLongnameMaxlen()
return m;
}
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
static void PrintColorTablesFor_avtColorTables()
{
cout << "static const float ct_shapely_colors[] = {\n";
......@@ -1414,10 +1452,10 @@ static void PrintColorTablesFor_avtColorTables()
cout << "};\n";
cout << "static const float ct_jmol_colors[] = {\n";
for (int i=0; i<MAX_ELEMENT_NUMBER; i++)
for (int i=0; i<=MAX_ELEMENT_NUMBER; i++)
{
char s[1000];
float v = float(i)/float(MAX_ELEMENT_NUMBER-1);
float v = float(i)/float(MAX_ELEMENT_NUMBER);
float r = float(jmolcolors[i][0]) / 255.f;
float g = float(jmolcolors[i][1]) / 255.f;
float b = float(jmolcolors[i][2]) / 255.f;
......@@ -1439,10 +1477,10 @@ static void PrintColorTablesFor_avtColorTables()
cout << "};\n";
cout << "static const float ct_rasmol_colors[] = {\n";
for (int i=0; i<MAX_ELEMENT_NUMBER; i++)
for (int i=0; i<=MAX_ELEMENT_NUMBER; i++)
{
char s[1000];
float v = float(i)/float(MAX_ELEMENT_NUMBER-1);
float v = float(i)/float(MAX_ELEMENT_NUMBER);
float r = float(rasmolcolors[i][0]) / 255.f;
float g = float(rasmolcolors[i][1]) / 255.f;
float b = float(rasmolcolors[i][2]) / 255.f;
......
......@@ -43,14 +43,22 @@
#define MAX_ELEMENT_NUMBER 109
#define KNOWN_AMINO_ACIDS 23
// Modifications:
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
extern UTILITY_API unsigned char aminocolors[KNOWN_AMINO_ACIDS][3];
extern UTILITY_API unsigned char shapelycolors[KNOWN_AMINO_ACIDS][3];
extern UTILITY_API unsigned char jmolcolors[MAX_ELEMENT_NUMBER][3];
extern UTILITY_API unsigned char rasmolcolors[MAX_ELEMENT_NUMBER][3];
extern UTILITY_API float atomic_radius[MAX_ELEMENT_NUMBER];
extern UTILITY_API float covalent_radius[MAX_ELEMENT_NUMBER];
extern UTILITY_API unsigned char jmolcolors[MAX_ELEMENT_NUMBER+1][3];
extern UTILITY_API unsigned char rasmolcolors[MAX_ELEMENT_NUMBER+1][3];
extern UTILITY_API float atomic_radius[MAX_ELEMENT_NUMBER+1];
extern UTILITY_API float covalent_radius[MAX_ELEMENT_NUMBER+1];
extern UTILITY_API const char *element_names[MAX_ELEMENT_NUMBER];
extern UTILITY_API const char *element_names[MAX_ELEMENT_NUMBER+1];
extern UTILITY_API const char *residue_names[KNOWN_AMINO_ACIDS];
int UTILITY_API ElementNameToAtomicNumber(const char *element);
......
......@@ -178,6 +178,12 @@ avtProteinDataBankFileFormat::FreeUpResources(void)
// Added a simple residue type enumeration. Needed to move
// HETNAM parsing into meta-data reading instead of atom data reading.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
// ****************************************************************************
void
......@@ -229,8 +235,8 @@ avtProteinDataBankFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
avtScalarMetaData *el_smd =
new avtScalarMetaData(name_el, name_mesh, AVT_NODECENT);
el_smd->SetEnumerationType(avtScalarMetaData::ByValue);
for (int a=0; a<MAX_ELEMENT_NUMBER; a++)
el_smd->AddEnumNameValue(element_names[a], a+1);
for (int a=0; a<=MAX_ELEMENT_NUMBER; a++)
el_smd->AddEnumNameValue(element_names[a], a);
md->Add(el_smd);
// Add the compound scalars
......
......@@ -470,6 +470,10 @@ QvisColorGridWidget::mousePressEvent(QMouseEvent *e)
// Jeremy Meredith, Wed Dec 31 16:39:50 EST 2008
// Choose B/W foreground text color based on approx palette color intensity.
//
// Jeremy Meredith, Wed May 20 11:47:52 EDT 2009
// Add support for both new (1-origin) and old (0-origin) element
// color tables. Fixed a logic error, too.
//
// ****************************************************************************
void
......@@ -495,9 +499,21 @@ QvisColorGridWidget::drawItem(QPainter &paint, int index)
else
paint.setPen(QColor(0,0,0));
char txt[100];
if (numGridSquares == MAX_ELEMENT_NUMBER &&
index < MAX_ELEMENT_NUMBER)
// In 2.0 we added, at index 0, a "not a valid
// atomic number" index and color. We still
// accept the old way (109 vs 110), though.
if (numGridSquares == MAX_ELEMENT_NUMBER+1 &&
index <= MAX_ELEMENT_NUMBER)
{
// current way
sprintf(txt,"%s",element_names[index]);
}
else if (numGridSquares == MAX_ELEMENT_NUMBER &&
index < MAX_ELEMENT_NUMBER)
{
// old way
sprintf(txt,"%s",element_names[index+1]);
}
else
sprintf(txt,"%d",index);
paint.drawText(QRect(x,y,boxWidth,boxHeight),
......
......@@ -188,12 +188,17 @@ QvisElementButton::sizePolicy() const
// Jeremy Meredith, Mon Feb 11 16:46:57 EST 2008
// Allow a "-1" element number to mean "any element" wildcard.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
// ****************************************************************************
void
QvisElementButton::setElementNumber(int e)
{
if (e >= -1 && e < MAX_ELEMENT_NUMBER && number != e)
if (e >= -1 && e <= MAX_ELEMENT_NUMBER && number != e)
{
number = e;
if (e == -1)
......@@ -312,12 +317,17 @@ QvisElementButton::popupPressed()
// Jeremy Meredith, Mon Feb 11 16:46:57 EST 2008
// Allow a "-1" element number to mean "any element" wildcard.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
// ****************************************************************************
void
QvisElementButton::elementSelected(int element)
{
if (element >= -1 && element < MAX_ELEMENT_NUMBER)
if (element >= -1 && element <= MAX_ELEMENT_NUMBER)
{
number = element;
if (element == -1)
......
......@@ -157,16 +157,22 @@ QvisPeriodicTableWidget::~QvisPeriodicTableWidget()
// Jeremy Meredith, Mon Feb 11 16:46:57 EST 2008
// Default to "-1" element number in case we didn't have anything selected.
//
// Jeremy Meredith, Wed May 20 11:50:45 EDT 2009
// Fixed logic error. Was not actually defaulting to -1.
//
// ****************************************************************************
void
QvisPeriodicTableWidget::setSelectedElement(int element)
{
int index = -1;
for (index = 0; index < numGridSquares; index++)
for (int i = 0; i < numGridSquares; i++)
{
if (indexToElement(index)-1 == element)
if (indexToElement(i) == element)
{
index = i;
break;
}
}
setSelectedIndex(index);
}
......@@ -189,6 +195,10 @@ QvisPeriodicTableWidget::setSelectedElement(int element)
// Brad Whitlock, Tue Jun 3 14:22:28 PDT 2008
// Qt 4.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// Added a fake "0" element which means "unknown", and hydrogen
// now starts at 1, so we don't need to correct for 1-origin indices.
//
// ****************************************************************************
void
......@@ -202,7 +212,7 @@ QvisPeriodicTableWidget::keyPressEvent(QKeyEvent *e)
{
case Qt::Key_Escape:
// emit an empty color.
emit selectedElement(indexToElement(activeIndex()-1));
emit selectedElement(indexToElement(activeIndex()));
break;
case Qt::Key_Return:
case Qt::Key_Enter:
......@@ -257,6 +267,10 @@ QvisPeriodicTableWidget::keyPressEvent(QKeyEvent *e)
// Brad Whitlock, Tue Jun 3 15:17:24 PDT 2008
// Make the highlight more obvious on the active item.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// Added a fake "0" element which means "unknown", and hydrogen
// now starts at 1, so we don't need to correct for 1-origin indices.
//
// ****************************************************************************
void
......@@ -302,7 +316,7 @@ QvisPeriodicTableWidget::drawItem(QPainter &paint, int index)
paint.setPen(palette().color(QPalette::WindowText));
paint.drawText(QRect(x,y,boxWidth,boxHeight),
Qt::AlignHCenter | Qt::AlignVCenter,
element_names[element-1]);
element_names[element]);
if (hint)
{
paint.setFont(oldfont);
......@@ -320,6 +334,10 @@ QvisPeriodicTableWidget::drawItem(QPainter &paint, int index)
// Creation: August 11, 2006
//
// Modifications:
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
// ****************************************************************************
......@@ -329,7 +347,7 @@ QvisPeriodicTableWidget::isValidIndex(int index) const
return ((index >= 0) &&
(index < numGridSquares) &&
(indexToElement(index) <= MAX_ELEMENT_NUMBER) &&
(indexToElement(index) > 0));
(indexToElement(index) > 1));
}
// ****************************************************************************
......
......@@ -5,7 +5,7 @@
element
</Field>
<Field name="atomicNumber1" label="Second atomic number" type="intVector">
0 -1
1 -1
</Field>
<Field name="atomicNumber2" label="Second atomic number" type="intVector">
-1 -1
......
......@@ -61,7 +61,7 @@ CreateBondsAttributes::CreateBondsAttributes() :
AttributeSubject(CreateBondsAttributes::TypeMapFormatString),
elementVariable("element")
{
atomicNumber1.push_back(0);
atomicNumber1.push_back(1);
atomicNumber1.push_back(-1);
atomicNumber2.push_back(-1);
atomicNumber2.push_back(-1);
......
......@@ -154,6 +154,12 @@ avtCreateBondsFilter::Equivalent(const AttributeGroup *a)
// Support wildcards in matches, and bail out if we matched the
// atom pattern but the distances were wrong.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
// ****************************************************************************
bool
avtCreateBondsFilter::AtomsShouldBeBondedManual(float *atomicnumbers,
......@@ -188,12 +194,12 @@ avtCreateBondsFilter::AtomsShouldBeBondedManual(float *atomicnumbers,
for (int i=0; i<n; i++)
{
// a -1 in the element list means "any"
int e1 = element1[i] + 1;
int e2 = element2[i] + 1;
bool match11 = (e1 == 0) || (atomicnumbers[a1] == e1);
bool match12 = (e1 == 0) || (atomicnumbers[a2] == e1);
bool match21 = (e2 == 0) || (atomicnumbers[a1] == e2);
bool match22 = (e2 == 0) || (atomicnumbers[a2] == e2);
int e1 = element1[i];
int e2 = element2[i];
bool match11 = (e1 <= 0) || (atomicnumbers[a1] == e1);
bool match12 = (e1 <= 0) || (atomicnumbers[a2] == e1);
bool match21 = (e2 <= 0) || (atomicnumbers[a1] == e2);
bool match22 = (e2 <= 0) || (atomicnumbers[a2] == e2);
if ((match11 && match22) || (match12 && match21))
{
double dmin = minDist[i];
......
......@@ -292,6 +292,10 @@ avtMoleculeFilter::PreExecute()
// an atomic number -- this makes creating new element expressions
// to override ones in the file possible.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// Added a fake "0" element which means "unknown", and hydrogen
// now starts at 1, so we don't need to correct for 1-origin indices.
//
// ****************************************************************************
void
avtMoleculeFilter::PostExecute()
......@@ -306,7 +310,7 @@ avtMoleculeFilter::PostExecute()
it != used_values.end();
it++)
{
labels.push_back(element_names[*it - 1]);
labels.push_back(element_names[*it]);
}
}
else if (name == "restype" || (name.length()>8 && name.substr(name.length()-8)=="/restype"))
......
......@@ -484,6 +484,9 @@ avtMoleculePlot::ReleaseData(void)
// an atomic number -- this makes creating new element expressions
// to override ones in the file possible.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// Actually made change suggested by previous comment.
//
// ****************************************************************************
avtContract_p
......@@ -502,6 +505,7 @@ avtMoleculePlot::EnhanceSpecification(avtContract_p spec)
{
string pv(primaryVariable);
if (pv != "element" &&
(pv.length()<=7 || pv.substr(0,7) != "element") &&
(pv.length()<=8 || pv.substr(pv.length()-8) != "/element"))
{
added_vars.push_back("element");
......@@ -619,6 +623,11 @@ avtMoleculePlot::GetLegend(void)
// an atomic number -- this makes creating new element expressions
// to override ones in the file possible.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
// ****************************************************************************
void
......@@ -671,7 +680,7 @@ avtMoleculePlot::SetLegendRange()
if (colortablename == "Default")
colortablename = string(ct->GetDefaultDiscreteColorTable());
numcolors = 110;
numcolors = MAX_ELEMENT_NUMBER+1;
levelsLegend->SetLabelColorMap(elementColorMap);
}
......@@ -812,6 +821,12 @@ avtMoleculePlot::SetLegendRange()
// Programmer: Jeremy Meredith
// Creation: March 23, 2006
//
// Modifications:
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1.
//
// ****************************************************************************
void
avtMoleculePlot::CreateLegendColorMaps()
......@@ -824,7 +839,7 @@ avtMoleculePlot::CreateLegendColorMaps()
}
elementColorMap.clear();
for (int i=0; i<MAX_ELEMENT_NUMBER; i++)
for (int i=0; i<=MAX_ELEMENT_NUMBER; i++)
{
elementColorMap.insert(LevelColorMap::value_type(element_names[i], i));
}
......
......@@ -261,6 +261,12 @@ SetColor3ubv(const unsigned char *c)
// an atomic number -- this makes creating new element expressions
// to override ones in the file possible.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
// ****************************************************************************
void
......@@ -383,10 +389,10 @@ avtOpenGLMoleculeRenderer::DrawAtomsAsSpheres(vtkPolyData *data,
{
int element_number = 0;
if (element)
element_number = int(elementnos[i]-1);
element_number = int(elementnos[i]);
if (element_number < 0 || element_number >= MAX_ELEMENT_NUMBER)
element_number = MAX_ELEMENT_NUMBER-1;
if (element_number < 0 || element_number > MAX_ELEMENT_NUMBER)
element_number = 0;
// Determine radius
float radius = atts.GetRadiusFixed();
......@@ -516,6 +522,12 @@ avtOpenGLMoleculeRenderer::DrawAtomsAsSpheres(vtkPolyData *data,
// an atomic number -- this makes creating new element expressions
// to override ones in the file possible.
//
// Jeremy Meredith, Wed May 20 11:49:18 EDT 2009
// MAX_ELEMENT_NUMBER now means the actual max element number, not the
// total number of known elements in visit. Added a fake "0" element
// which means "unknown", and hydrogen now starts at 1. This
// also means we don't have to correct for 1-origin atomic numbers.
//
// ****************************************************************************
void
......@@ -668,11 +680,11 @@ avtOpenGLMoleculeRenderer::DrawBonds(vtkPolyData *data,
int element_number = 0;
if (element)
{
element_number = int(elementnos[atom]-1);
element_number = int(elementnos[atom]);
}
if (element_number < 0 || element_number >= MAX_ELEMENT_NUMBER)
element_number = MAX_ELEMENT_NUMBER-1;
if (element_number < 0 || element_number > MAX_ELEMENT_NUMBER)
element_number = 0;
#ifdef SHORTEN_BONDS
if (!primary_is_cell_centered &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment