Skip to content

Commit

Permalink
Updated README. Forcefields are now forcefully associated to models w…
Browse files Browse the repository at this point in the history
…hen typing. Fixed - Crash when removing a forcefield when related atom type labels were being displayed. Fixed - Errors now raised when parentheses are used in place of square array brackets, and vice versa.
  • Loading branch information
t.youngs committed Nov 10, 2011
1 parent b8e025e commit f820659
Show file tree
Hide file tree
Showing 39 changed files with 529 additions and 312 deletions.
1 change: 0 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ manual.

2) Run './configure' without options use standard locations and build in the Qt GUI.
Use --prefix to specify the install location
Use --with-gui to specify a different gui (currently 'qt', 'gtk', or 'none')
Use --with-qt=framework to use native Qt installation from TrollTech on Macs,
otherwise use --with-qt=fink to use the Fink-installed version. Leave
blank to take your chances!
Expand Down
6 changes: 2 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@

<ul>
<li>Dialog widget values cannot easily bet set now - create widgets at parse time?</li>
<li>Dialogs are displayed after load when loading models from CLI, and dialog 'ghost' always appears no matter what</li>
<li>Closing a loaded forcefield while atom type names are displayed on atoms causes crash</li>
<li>Function arguments can be passed to array-requiring paths without complaint (e.g. old p.com, now a function)</li>
<li>Rebonding model also folds atoms, making --nofold irrelevant</li>
<li>Atom list update is super-slow when changing selection in big systems - This is an issue with Qt, and doesn't appear to have a resolution at present.</li>
<li>Flickering Progress Dialog, e.g. when using disordered builder on Windows</li>
<li>Model List images do not update. Can the main view be grabbed and shrunk down to icon size? Maybe in a QThread?</li>
<li>Glyph list not update on model load.</li>
<li>Model not updated when changing glyph selection?</li>
<li>Segfault in Model::regenerateIcon() from Qt's renderText (laptop)?</li>
<li>Running in console mode, relations between widgets (e.g. radio group buttons) are not honoured correctly</li>
</ul>

<h1>Current TODO</h1>

<ul>
<li>Script to silylate dangling O and Si - allow it to be done on whole model or current selection, and work in a temporary model...</li>
<li>Context-sensitivity of messages - e.g. pattern name (select pattern atoms), failed pattern creation (select bad atom)</li>
<li>Easier access (menu items?) to atom shift and reorder commands</li>
<li>Saving of movies for vibrations.</li>
Expand Down Expand Up @@ -50,6 +47,7 @@
<li>Chapter / Section on Basic View / Imaging.</li>
<li>Section on partitioning scheme files</li>
<li>New CLI option : --dialogs</li>
<li>New operator for command language: ternary if</li>
<li>New dialog code - remove defunct commands, add new variable definitions for Dialog & Widget, rename all commands to follow C++ conventions.</li>
</ul>

6 changes: 3 additions & 3 deletions data/filters/gromacs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ filter(type="exportexpression",name="Gromacs .top File", extension="top", glob="
{
++nfailed[1];
printf("Bond potential form '%s' not supported by GROMACS.\n", b.form);
writeLineF("%6i %6i 0 %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.data(1), b.data(2), b.data(3));
writeLineF("%6i %6i 0 %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.data[1], b.data[2], b.data[3]);
}
}

Expand All @@ -171,7 +171,7 @@ filter(type="exportexpression",name="Gromacs .top File", extension="top", glob="
{
++nfailed[2];
printf("Angle potential form '%s' not supported by GROMACS.\n", b.form);
writeLineF("%6i %6i %6i 0 %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.id[3], b.data(1), b.data(2), b.data(3));
writeLineF("%6i %6i %6i 0 %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.id[3], b.data[1], b.data[2], b.data[3]);
}
}

Expand All @@ -198,7 +198,7 @@ filter(type="exportexpression",name="Gromacs .top File", extension="top", glob="
{
++nfailed[3];
printf("Torsion potential form '%s' not supported by GROMACS.\n", b.form);
writeLineF("%6i %6i %6i %6i 0 %9.5f %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.id[3], b.id[4], b.data(1), b.data(2), b.data(3), b.data(4));
writeLineF("%6i %6i %6i %6i 0 %9.5f %9.5f %9.5f %9.5f\n", b.id[1], b.id[2], b.id[3], b.id[4], b.data[1], b.data[2], b.data[3], b.data[4]);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#define ATEN_VERSION_H

#define ATENVERSION "1.8"
#define ATENREVISION "1755"
#define ATENDATE "Thu 10 Nov - 09:57"
#define ATENREVISION "1756"
#define ATENDATE "Thu 10 Nov - 21:43"
#define ATENURL "http://aten.googlecode.com/svn/trunk"

#endif
18 changes: 15 additions & 3 deletions src/model/typing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,24 @@ bool Model::typeAll()
createPatterns();
if (!arePatternsValid())
{
msg.print("Atom typing cannot be performed without valid patterns.\n Check pattern definition.\n");
msg.print("Atom typing cannot be performed without valid patterns.\nCheck pattern definition, atom ordering, and bond consistency between atoms, or add the default (1*N) pattern for a quick fix.\n");
msg.exit("Model::typeAll");
return FALSE;
}
if (forcefield_ == NULL) msg.print("Typing all patterns in model '%s' (no forcefield associated -- using default)...\n", name_.get());
else msg.print("Typing all patterns in model '%s' (associated forcefield is '%s')...\n", name_.get(), forcefield_->name());

// If no forcefield is set in this model, grab it from the current default forcefield
if (forcefield_ == NULL)
{
if (aten.currentForcefield() != NULL) setForcefield(aten.currentForcefield());
else
{
msg.print("Error: No forcefield set in model, and no default forcefield is available.\n");
msg.exit("Model::typeAll");
return FALSE;
}
}
msg.print("Typing all patterns in model '%s' (associated forcefield is '%s')...\n", name_.get(), forcefield_->name());

// Assign forcefield types to atoms
for (Pattern *p = patterns_.first(); p != NULL; p = p->next)
{
Expand Down
15 changes: 11 additions & 4 deletions src/parser/aten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ StepNode *AtenVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'aten&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'Aten&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("AtenVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'aten&' function '%s'.\n", s);
msg.print("Error: Array index given to 'Aten&' function '%s'.\n", s);
msg.exit("AtenVariable::accessorSearch");
return NULL;
}
Expand All @@ -139,7 +139,7 @@ StepNode *AtenVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'aten&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'Aten&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -153,7 +153,14 @@ StepNode *AtenVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::AtenData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'Aten&' array member '%s'.\n", s);
msg.exit("AtenVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::AtenData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("AtenVariable::accessorSearch");
return result;
Expand Down
15 changes: 11 additions & 4 deletions src/parser/atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ StepNode *AtomVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'atom&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'Atom&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("AtomVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'atom&' function '%s'.\n", s);
msg.print("Error: Array index given to 'Atom&' function '%s'.\n", s);
msg.exit("AtomVariable::accessorSearch");
return NULL;
}
Expand All @@ -125,7 +125,7 @@ StepNode *AtomVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'atom&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'Atom&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -139,7 +139,14 @@ StepNode *AtomVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::AtomData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'Atom&' array member '%s'.\n", s);
msg.exit("AtomVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::AtomData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("AtomVariable::accessorSearch");
return result;
Expand Down
17 changes: 12 additions & 5 deletions src/parser/basisprimitive.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*** BasisPrimitive Variable and Array
*** src/parser/basisprimitive.cpp
*** src/parser/BasisPrimitive.cpp
Copyright T. Youngs 2007-2011
This file is part of Aten.
Expand Down Expand Up @@ -80,15 +80,15 @@ StepNode *BasisPrimitiveVariable::accessorSearch(const char *s, TreeNode *arrayi
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'basisprimitive&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'BasisPrimitive&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("BasisPrimitiveVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'basisprimitive&' function '%s'.\n", s);
msg.print("Error: Array index given to 'BasisPrimitive&' function '%s'.\n", s);
msg.exit("BasisPrimitiveVariable::accessorSearch");
return NULL;
}
Expand All @@ -97,7 +97,7 @@ StepNode *BasisPrimitiveVariable::accessorSearch(const char *s, TreeNode *arrayi
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'basisprimitive&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'BasisPrimitive&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -111,7 +111,14 @@ StepNode *BasisPrimitiveVariable::accessorSearch(const char *s, TreeNode *arrayi
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::BasisPrimitiveData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'BasisPrimitive&' array member '%s'.\n", s);
msg.exit("BasisPrimitiveVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::BasisPrimitiveData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("BasisPrimitiveVariable::accessorSearch");
return result;
Expand Down
17 changes: 12 additions & 5 deletions src/parser/basisshell.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*** BasisShell Variable and Array
*** src/parser/basisshell.cpp
*** src/parser/BasisShell.cpp
Copyright T. Youngs 2007-2011
This file is part of Aten.
Expand Down Expand Up @@ -82,15 +82,15 @@ StepNode *BasisShellVariable::accessorSearch(const char *s, TreeNode *arrayindex
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'basisshell&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'BasisShell&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("BasisShellVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'basisshell&' function '%s'.\n", s);
msg.print("Error: Array index given to 'BasisShell&' function '%s'.\n", s);
msg.exit("BasisShellVariable::accessorSearch");
return NULL;
}
Expand All @@ -99,7 +99,7 @@ StepNode *BasisShellVariable::accessorSearch(const char *s, TreeNode *arrayindex
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'basisshell&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'BasisShell&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -113,7 +113,14 @@ StepNode *BasisShellVariable::accessorSearch(const char *s, TreeNode *arrayindex
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::BasisShellData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'BasisShell&' array member '%s'.\n", s);
msg.exit("BasisShellVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::BasisShellData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("BasisShellVariable::accessorSearch");
return result;
Expand Down
15 changes: 11 additions & 4 deletions src/parser/bond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ StepNode *BondVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'bond&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'Bond&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("BondVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'bond&' function '%s'.\n", s);
msg.print("Error: Array index given to 'Bond&' function '%s'.\n", s);
msg.exit("BondVariable::accessorSearch");
return NULL;
}
Expand All @@ -100,7 +100,7 @@ StepNode *BondVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'bond&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'Bond&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -114,7 +114,14 @@ StepNode *BondVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::BondData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'Bond&' array member '%s'.\n", s);
msg.exit("BondVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::BondData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("BondVariable::accessorSearch");
return result;
Expand Down
15 changes: 11 additions & 4 deletions src/parser/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ StepNode *CellVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
i = Variable::searchAccessor(s, nFunctions, functionData);
if (i == -1)
{
msg.print("Error: Type 'cell&' has no member or function named '%s'.\n", s);
msg.print("Error: Type 'Cell&' has no member or function named '%s'.\n", s);
printAccessors();
msg.exit("CellVariable::accessorSearch");
return NULL;
}
msg.print(Messenger::Parse, "FunctionAccessor match = %i (%s)\n", i, functionData[i].name);
if (arrayindex != NULL)
{
msg.print("Error: Array index given to 'cell&' function '%s'.\n", s);
msg.print("Error: Array index given to 'Cell&' function '%s'.\n", s);
msg.exit("CellVariable::accessorSearch");
return NULL;
}
Expand All @@ -122,7 +122,7 @@ StepNode *CellVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
result->addJoinedArguments(arglist);
if (!result->checkArguments(functionData[i].arguments, functionData[i].name))
{
msg.print("Error: Syntax for 'cell&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
msg.print("Error: Syntax for 'Cell&' function '%s' is '%s(%s)'.\n", functionData[i].name, functionData[i].name, functionData[i].argText );
delete result;
result = NULL;
}
Expand All @@ -136,7 +136,14 @@ StepNode *CellVariable::accessorSearch(const char *s, TreeNode *arrayindex, Tree
msg.print("Error: Irrelevant array index provided for member '%s'.\n", accessorData[i].name);
result = NULL;
}
else result = new StepNode(i, VTypes::CellData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
// Were we given an argument list when we didn't want one?
if (arglist != NULL)
{
msg.print("Error: Argument list given to 'Cell&' array member '%s'.\n", s);
msg.exit("CellVariable::accessorSearch");
return NULL;
}
result = new StepNode(i, VTypes::CellData, arrayindex, accessorData[i].returnType, accessorData[i].isReadOnly, accessorData[i].arraySize);
}
msg.exit("CellVariable::accessorSearch");
return result;
Expand Down
Loading

0 comments on commit f820659

Please sign in to comment.