Changes in / [8006ee:994713]


Ignore:
Files:
30 added
7 deleted
293 edited

Legend:

Unmodified
Added
Removed
  • AUTHORS

    r8006ee r994713  
    1 Frederik Heber  (heber@ins.uni-bonn.de)
     1Tillmann Crueger        (crueger@ins.uni-bonn.de)
     2Daniel Dueck            (dueck@ins.uni-bonn.de)
     3Frederik Heber          (heber@ins.uni-bonn.de)
     4Saskia Metzler          (metzler@ins.uni-bonn.de)
     5Christian Neuen         (neuen@ins.uni-bonn.de)
  • COPYING

    r8006ee r994713  
    1 <<<<<<< HEAD
    2                     GNU GENERAL PUBLIC LICENSE
    3                        Version 3, 29 June 2007
    4 
    5  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
    6  Everyone is permitted to copy and distribute verbatim copies
    7  of this license document, but changing it is not allowed.
    8 
    9                             Preamble
    10 
    11   The GNU General Public License is a free, copyleft license for
    12 software and other kinds of works.
    13 
    14   The licenses for most software and other practical works are designed
    15 to take away your freedom to share and change the works.  By contrast,
    16 the GNU General Public License is intended to guarantee your freedom to
    17 share and change all versions of a program--to make sure it remains free
    18 software for all its users.  We, the Free Software Foundation, use the
    19 GNU General Public License for most of our software; it applies also to
    20 any other work released this way by its authors.  You can apply it to
    21 =======
    221                    GNU GENERAL PUBLIC LICENSE
    232                       Version 2, June 1991
     
    3817using it.  (Some other Free Software Foundation software is covered by
    3918the GNU Library General Public License instead.)  You can apply it to
    40 >>>>>>> FETCH_HEAD
    4119your programs, too.
    4220
     
    4422price.  Our General Public Licenses are designed to make sure that you
    4523have the freedom to distribute copies of free software (and charge for
    46 <<<<<<< HEAD
    47 them if you wish), that you receive source code or can get it if you
    48 want it, that you can change the software or use pieces of it in new
    49 free programs, and that you know you can do these things.
    50 
    51   To protect your rights, we need to prevent others from denying you
    52 these rights or asking you to surrender the rights.  Therefore, you have
    53 certain responsibilities if you distribute copies of the software, or if
    54 you modify it: responsibilities to respect the freedom of others.
    55 
    56   For example, if you distribute copies of such a program, whether
    57 gratis or for a fee, you must pass on to the recipients the same
    58 freedoms that you received.  You must make sure that they, too, receive
    59 or can get the source code.  And you must show them these terms so they
    60 know their rights.
    61 
    62   Developers that use the GNU GPL protect your rights with two steps:
    63 (1) assert copyright on the software, and (2) offer you this License
    64 giving you legal permission to copy, distribute and/or modify it.
    65 
    66   For the developers' and authors' protection, the GPL clearly explains
    67 that there is no warranty for this free software.  For both users' and
    68 authors' sake, the GPL requires that modified versions be marked as
    69 changed, so that their problems will not be attributed erroneously to
    70 authors of previous versions.
    71 
    72   Some devices are designed to deny users access to install or run
    73 modified versions of the software inside them, although the manufacturer
    74 can do so.  This is fundamentally incompatible with the aim of
    75 protecting users' freedom to change the software.  The systematic
    76 pattern of such abuse occurs in the area of products for individuals to
    77 use, which is precisely where it is most unacceptable.  Therefore, we
    78 have designed this version of the GPL to prohibit the practice for those
    79 products.  If such problems arise substantially in other domains, we
    80 stand ready to extend this provision to those domains in future versions
    81 of the GPL, as needed to protect the freedom of users.
    82 
    83   Finally, every program is threatened constantly by software patents.
    84 States should not allow patents to restrict development and use of
    85 software on general-purpose computers, but in those that do, we wish to
    86 avoid the special danger that patents applied to a free program could
    87 make it effectively proprietary.  To prevent this, the GPL assures that
    88 patents cannot be used to render the program non-free.
    89 
    90   The precise terms and conditions for copying, distribution and
    91 modification follow.
    92 
    93                        TERMS AND CONDITIONS
    94 
    95   0. Definitions.
    96 
    97   "This License" refers to version 3 of the GNU General Public License.
    98 
    99   "Copyright" also means copyright-like laws that apply to other kinds of
    100 works, such as semiconductor masks.
    101 
    102   "The Program" refers to any copyrightable work licensed under this
    103 License.  Each licensee is addressed as "you".  "Licensees" and
    104 "recipients" may be individuals or organizations.
    105 
    106   To "modify" a work means to copy from or adapt all or part of the work
    107 in a fashion requiring copyright permission, other than the making of an
    108 exact copy.  The resulting work is called a "modified version" of the
    109 earlier work or a work "based on" the earlier work.
    110 
    111   A "covered work" means either the unmodified Program or a work based
    112 on the Program.
    113 
    114   To "propagate" a work means to do anything with it that, without
    115 permission, would make you directly or secondarily liable for
    116 infringement under applicable copyright law, except executing it on a
    117 computer or modifying a private copy.  Propagation includes copying,
    118 distribution (with or without modification), making available to the
    119 public, and in some countries other activities as well.
    120 
    121   To "convey" a work means any kind of propagation that enables other
    122 parties to make or receive copies.  Mere interaction with a user through
    123 a computer network, with no transfer of a copy, is not conveying.
    124 
    125   An interactive user interface displays "Appropriate Legal Notices"
    126 to the extent that it includes a convenient and prominently visible
    127 feature that (1) displays an appropriate copyright notice, and (2)
    128 tells the user that there is no warranty for the work (except to the
    129 extent that warranties are provided), that licensees may convey the
    130 work under this License, and how to view a copy of this License.  If
    131 the interface presents a list of user commands or options, such as a
    132 menu, a prominent item in the list meets this criterion.
    133 
    134   1. Source Code.
    135 
    136   The "source code" for a work means the preferred form of the work
    137 for making modifications to it.  "Object code" means any non-source
    138 form of a work.
    139 
    140   A "Standard Interface" means an interface that either is an official
    141 standard defined by a recognized standards body, or, in the case of
    142 interfaces specified for a particular programming language, one that
    143 is widely used among developers working in that language.
    144 
    145   The "System Libraries" of an executable work include anything, other
    146 than the work as a whole, that (a) is included in the normal form of
    147 packaging a Major Component, but which is not part of that Major
    148 Component, and (b) serves only to enable use of the work with that
    149 Major Component, or to implement a Standard Interface for which an
    150 implementation is available to the public in source code form.  A
    151 "Major Component", in this context, means a major essential component
    152 (kernel, window system, and so on) of the specific operating system
    153 (if any) on which the executable work runs, or a compiler used to
    154 produce the work, or an object code interpreter used to run it.
    155 
    156   The "Corresponding Source" for a work in object code form means all
    157 the source code needed to generate, install, and (for an executable
    158 work) run the object code and to modify the work, including scripts to
    159 control those activities.  However, it does not include the work's
    160 System Libraries, or general-purpose tools or generally available free
    161 programs which are used unmodified in performing those activities but
    162 which are not part of the work.  For example, Corresponding Source
    163 includes interface definition files associated with source files for
    164 the work, and the source code for shared libraries and dynamically
    165 linked subprograms that the work is specifically designed to require,
    166 such as by intimate data communication or control flow between those
    167 subprograms and other parts of the work.
    168 
    169   The Corresponding Source need not include anything that users
    170 can regenerate automatically from other parts of the Corresponding
    171 Source.
    172 
    173   The Corresponding Source for a work in source code form is that
    174 same work.
    175 
    176   2. Basic Permissions.
    177 
    178   All rights granted under this License are granted for the term of
    179 copyright on the Program, and are irrevocable provided the stated
    180 conditions are met.  This License explicitly affirms your unlimited
    181 permission to run the unmodified Program.  The output from running a
    182 covered work is covered by this License only if the output, given its
    183 content, constitutes a covered work.  This License acknowledges your
    184 rights of fair use or other equivalent, as provided by copyright law.
    185 
    186   You may make, run and propagate covered works that you do not
    187 convey, without conditions so long as your license otherwise remains
    188 in force.  You may convey covered works to others for the sole purpose
    189 of having them make modifications exclusively for you, or provide you
    190 with facilities for running those works, provided that you comply with
    191 the terms of this License in conveying all material for which you do
    192 not control copyright.  Those thus making or running the covered works
    193 for you must do so exclusively on your behalf, under your direction
    194 and control, on terms that prohibit them from making any copies of
    195 your copyrighted material outside their relationship with you.
    196 
    197   Conveying under any other circumstances is permitted solely under
    198 the conditions stated below.  Sublicensing is not allowed; section 10
    199 makes it unnecessary.
    200 
    201   3. Protecting Users' Legal Rights From Anti-Circumvention Law.
    202 
    203   No covered work shall be deemed part of an effective technological
    204 measure under any applicable law fulfilling obligations under article
    205 11 of the WIPO copyright treaty adopted on 20 December 1996, or
    206 similar laws prohibiting or restricting circumvention of such
    207 measures.
    208 
    209   When you convey a covered work, you waive any legal power to forbid
    210 circumvention of technological measures to the extent such circumvention
    211 is effected by exercising rights under this License with respect to
    212 the covered work, and you disclaim any intention to limit operation or
    213 modification of the work as a means of enforcing, against the work's
    214 users, your or third parties' legal rights to forbid circumvention of
    215 technological measures.
    216 
    217   4. Conveying Verbatim Copies.
    218 
    219   You may convey verbatim copies of the Program's source code as you
    220 receive it, in any medium, provided that you conspicuously and
    221 appropriately publish on each copy an appropriate copyright notice;
    222 keep intact all notices stating that this License and any
    223 non-permissive terms added in accord with section 7 apply to the code;
    224 keep intact all notices of the absence of any warranty; and give all
    225 recipients a copy of this License along with the Program.
    226 
    227   You may charge any price or no price for each copy that you convey,
    228 and you may offer support or warranty protection for a fee.
    229 
    230   5. Conveying Modified Source Versions.
    231 
    232   You may convey a work based on the Program, or the modifications to
    233 produce it from the Program, in the form of source code under the
    234 terms of section 4, provided that you also meet all of these conditions:
    235 
    236     a) The work must carry prominent notices stating that you modified
    237     it, and giving a relevant date.
    238 
    239     b) The work must carry prominent notices stating that it is
    240     released under this License and any conditions added under section
    241     7.  This requirement modifies the requirement in section 4 to
    242     "keep intact all notices".
    243 
    244     c) You must license the entire work, as a whole, under this
    245     License to anyone who comes into possession of a copy.  This
    246     License will therefore apply, along with any applicable section 7
    247     additional terms, to the whole of the work, and all its parts,
    248     regardless of how they are packaged.  This License gives no
    249     permission to license the work in any other way, but it does not
    250     invalidate such permission if you have separately received it.
    251 
    252     d) If the work has interactive user interfaces, each must display
    253     Appropriate Legal Notices; however, if the Program has interactive
    254     interfaces that do not display Appropriate Legal Notices, your
    255     work need not make them do so.
    256 
    257   A compilation of a covered work with other separate and independent
    258 works, which are not by their nature extensions of the covered work,
    259 and which are not combined with it such as to form a larger program,
    260 in or on a volume of a storage or distribution medium, is called an
    261 "aggregate" if the compilation and its resulting copyright are not
    262 used to limit the access or legal rights of the compilation's users
    263 beyond what the individual works permit.  Inclusion of a covered work
    264 in an aggregate does not cause this License to apply to the other
    265 parts of the aggregate.
    266 
    267   6. Conveying Non-Source Forms.
    268 
    269   You may convey a covered work in object code form under the terms
    270 of sections 4 and 5, provided that you also convey the
    271 machine-readable Corresponding Source under the terms of this License,
    272 in one of these ways:
    273 
    274     a) Convey the object code in, or embodied in, a physical product
    275     (including a physical distribution medium), accompanied by the
    276     Corresponding Source fixed on a durable physical medium
    277     customarily used for software interchange.
    278 
    279     b) Convey the object code in, or embodied in, a physical product
    280     (including a physical distribution medium), accompanied by a
    281     written offer, valid for at least three years and valid for as
    282     long as you offer spare parts or customer support for that product
    283     model, to give anyone who possesses the object code either (1) a
    284     copy of the Corresponding Source for all the software in the
    285     product that is covered by this License, on a durable physical
    286     medium customarily used for software interchange, for a price no
    287     more than your reasonable cost of physically performing this
    288     conveying of source, or (2) access to copy the
    289     Corresponding Source from a network server at no charge.
    290 
    291     c) Convey individual copies of the object code with a copy of the
    292     written offer to provide the Corresponding Source.  This
    293     alternative is allowed only occasionally and noncommercially, and
    294     only if you received the object code with such an offer, in accord
    295     with subsection 6b.
    296 
    297     d) Convey the object code by offering access from a designated
    298     place (gratis or for a charge), and offer equivalent access to the
    299     Corresponding Source in the same way through the same place at no
    300     further charge.  You need not require recipients to copy the
    301     Corresponding Source along with the object code.  If the place to
    302     copy the object code is a network server, the Corresponding Source
    303     may be on a different server (operated by you or a third party)
    304     that supports equivalent copying facilities, provided you maintain
    305     clear directions next to the object code saying where to find the
    306     Corresponding Source.  Regardless of what server hosts the
    307     Corresponding Source, you remain obligated to ensure that it is
    308     available for as long as needed to satisfy these requirements.
    309 
    310     e) Convey the object code using peer-to-peer transmission, provided
    311     you inform other peers where the object code and Corresponding
    312     Source of the work are being offered to the general public at no
    313     charge under subsection 6d.
    314 
    315   A separable portion of the object code, whose source code is excluded
    316 from the Corresponding Source as a System Library, need not be
    317 included in conveying the object code work.
    318 
    319   A "User Product" is either (1) a "consumer product", which means any
    320 tangible personal property which is normally used for personal, family,
    321 or household purposes, or (2) anything designed or sold for incorporation
    322 into a dwelling.  In determining whether a product is a consumer product,
    323 doubtful cases shall be resolved in favor of coverage.  For a particular
    324 product received by a particular user, "normally used" refers to a
    325 typical or common use of that class of product, regardless of the status
    326 of the particular user or of the way in which the particular user
    327 actually uses, or expects or is expected to use, the product.  A product
    328 is a consumer product regardless of whether the product has substantial
    329 commercial, industrial or non-consumer uses, unless such uses represent
    330 the only significant mode of use of the product.
    331 
    332   "Installation Information" for a User Product means any methods,
    333 procedures, authorization keys, or other information required to install
    334 and execute modified versions of a covered work in that User Product from
    335 a modified version of its Corresponding Source.  The information must
    336 suffice to ensure that the continued functioning of the modified object
    337 code is in no case prevented or interfered with solely because
    338 modification has been made.
    339 
    340   If you convey an object code work under this section in, or with, or
    341 specifically for use in, a User Product, and the conveying occurs as
    342 part of a transaction in which the right of possession and use of the
    343 User Product is transferred to the recipient in perpetuity or for a
    344 fixed term (regardless of how the transaction is characterized), the
    345 Corresponding Source conveyed under this section must be accompanied
    346 by the Installation Information.  But this requirement does not apply
    347 if neither you nor any third party retains the ability to install
    348 modified object code on the User Product (for example, the work has
    349 been installed in ROM).
    350 
    351   The requirement to provide Installation Information does not include a
    352 requirement to continue to provide support service, warranty, or updates
    353 for a work that has been modified or installed by the recipient, or for
    354 the User Product in which it has been modified or installed.  Access to a
    355 network may be denied when the modification itself materially and
    356 adversely affects the operation of the network or violates the rules and
    357 protocols for communication across the network.
    358 
    359   Corresponding Source conveyed, and Installation Information provided,
    360 in accord with this section must be in a format that is publicly
    361 documented (and with an implementation available to the public in
    362 source code form), and must require no special password or key for
    363 unpacking, reading or copying.
    364 
    365   7. Additional Terms.
    366 
    367   "Additional permissions" are terms that supplement the terms of this
    368 License by making exceptions from one or more of its conditions.
    369 Additional permissions that are applicable to the entire Program shall
    370 be treated as though they were included in this License, to the extent
    371 that they are valid under applicable law.  If additional permissions
    372 apply only to part of the Program, that part may be used separately
    373 under those permissions, but the entire Program remains governed by
    374 this License without regard to the additional permissions.
    375 
    376   When you convey a copy of a covered work, you may at your option
    377 remove any additional permissions from that copy, or from any part of
    378 it.  (Additional permissions may be written to require their own
    379 removal in certain cases when you modify the work.)  You may place
    380 additional permissions on material, added by you to a covered work,
    381 for which you have or can give appropriate copyright permission.
    382 
    383   Notwithstanding any other provision of this License, for material you
    384 add to a covered work, you may (if authorized by the copyright holders of
    385 that material) supplement the terms of this License with terms:
    386 
    387     a) Disclaiming warranty or limiting liability differently from the
    388     terms of sections 15 and 16 of this License; or
    389 
    390     b) Requiring preservation of specified reasonable legal notices or
    391     author attributions in that material or in the Appropriate Legal
    392     Notices displayed by works containing it; or
    393 
    394     c) Prohibiting misrepresentation of the origin of that material, or
    395     requiring that modified versions of such material be marked in
    396     reasonable ways as different from the original version; or
    397 
    398     d) Limiting the use for publicity purposes of names of licensors or
    399     authors of the material; or
    400 
    401     e) Declining to grant rights under trademark law for use of some
    402     trade names, trademarks, or service marks; or
    403 
    404     f) Requiring indemnification of licensors and authors of that
    405     material by anyone who conveys the material (or modified versions of
    406     it) with contractual assumptions of liability to the recipient, for
    407     any liability that these contractual assumptions directly impose on
    408     those licensors and authors.
    409 
    410   All other non-permissive additional terms are considered "further
    411 restrictions" within the meaning of section 10.  If the Program as you
    412 received it, or any part of it, contains a notice stating that it is
    413 governed by this License along with a term that is a further
    414 restriction, you may remove that term.  If a license document contains
    415 a further restriction but permits relicensing or conveying under this
    416 License, you may add to a covered work material governed by the terms
    417 of that license document, provided that the further restriction does
    418 not survive such relicensing or conveying.
    419 
    420   If you add terms to a covered work in accord with this section, you
    421 must place, in the relevant source files, a statement of the
    422 additional terms that apply to those files, or a notice indicating
    423 where to find the applicable terms.
    424 
    425   Additional terms, permissive or non-permissive, may be stated in the
    426 form of a separately written license, or stated as exceptions;
    427 the above requirements apply either way.
    428 
    429   8. Termination.
    430 
    431   You may not propagate or modify a covered work except as expressly
    432 provided under this License.  Any attempt otherwise to propagate or
    433 modify it is void, and will automatically terminate your rights under
    434 this License (including any patent licenses granted under the third
    435 paragraph of section 11).
    436 
    437   However, if you cease all violation of this License, then your
    438 license from a particular copyright holder is reinstated (a)
    439 provisionally, unless and until the copyright holder explicitly and
    440 finally terminates your license, and (b) permanently, if the copyright
    441 holder fails to notify you of the violation by some reasonable means
    442 prior to 60 days after the cessation.
    443 
    444   Moreover, your license from a particular copyright holder is
    445 reinstated permanently if the copyright holder notifies you of the
    446 violation by some reasonable means, this is the first time you have
    447 received notice of violation of this License (for any work) from that
    448 copyright holder, and you cure the violation prior to 30 days after
    449 your receipt of the notice.
    450 
    451   Termination of your rights under this section does not terminate the
    452 licenses of parties who have received copies or rights from you under
    453 this License.  If your rights have been terminated and not permanently
    454 reinstated, you do not qualify to receive new licenses for the same
    455 material under section 10.
    456 
    457   9. Acceptance Not Required for Having Copies.
    458 
    459   You are not required to accept this License in order to receive or
    460 run a copy of the Program.  Ancillary propagation of a covered work
    461 occurring solely as a consequence of using peer-to-peer transmission
    462 to receive a copy likewise does not require acceptance.  However,
    463 nothing other than this License grants you permission to propagate or
    464 modify any covered work.  These actions infringe copyright if you do
    465 not accept this License.  Therefore, by modifying or propagating a
    466 covered work, you indicate your acceptance of this License to do so.
    467 
    468   10. Automatic Licensing of Downstream Recipients.
    469 
    470   Each time you convey a covered work, the recipient automatically
    471 receives a license from the original licensors, to run, modify and
    472 propagate that work, subject to this License.  You are not responsible
    473 for enforcing compliance by third parties with this License.
    474 
    475   An "entity transaction" is a transaction transferring control of an
    476 organization, or substantially all assets of one, or subdividing an
    477 organization, or merging organizations.  If propagation of a covered
    478 work results from an entity transaction, each party to that
    479 transaction who receives a copy of the work also receives whatever
    480 licenses to the work the party's predecessor in interest had or could
    481 give under the previous paragraph, plus a right to possession of the
    482 Corresponding Source of the work from the predecessor in interest, if
    483 the predecessor has it or can get it with reasonable efforts.
    484 
    485   You may not impose any further restrictions on the exercise of the
    486 rights granted or affirmed under this License.  For example, you may
    487 not impose a license fee, royalty, or other charge for exercise of
    488 rights granted under this License, and you may not initiate litigation
    489 (including a cross-claim or counterclaim in a lawsuit) alleging that
    490 any patent claim is infringed by making, using, selling, offering for
    491 sale, or importing the Program or any portion of it.
    492 
    493   11. Patents.
    494 
    495   A "contributor" is a copyright holder who authorizes use under this
    496 License of the Program or a work on which the Program is based.  The
    497 work thus licensed is called the contributor's "contributor version".
    498 
    499   A contributor's "essential patent claims" are all patent claims
    500 owned or controlled by the contributor, whether already acquired or
    501 hereafter acquired, that would be infringed by some manner, permitted
    502 by this License, of making, using, or selling its contributor version,
    503 but do not include claims that would be infringed only as a
    504 consequence of further modification of the contributor version.  For
    505 purposes of this definition, "control" includes the right to grant
    506 patent sublicenses in a manner consistent with the requirements of
    507 this License.
    508 
    509   Each contributor grants you a non-exclusive, worldwide, royalty-free
    510 patent license under the contributor's essential patent claims, to
    511 make, use, sell, offer for sale, import and otherwise run, modify and
    512 propagate the contents of its contributor version.
    513 
    514   In the following three paragraphs, a "patent license" is any express
    515 agreement or commitment, however denominated, not to enforce a patent
    516 (such as an express permission to practice a patent or covenant not to
    517 sue for patent infringement).  To "grant" such a patent license to a
    518 party means to make such an agreement or commitment not to enforce a
    519 patent against the party.
    520 
    521   If you convey a covered work, knowingly relying on a patent license,
    522 and the Corresponding Source of the work is not available for anyone
    523 to copy, free of charge and under the terms of this License, through a
    524 publicly available network server or other readily accessible means,
    525 then you must either (1) cause the Corresponding Source to be so
    526 available, or (2) arrange to deprive yourself of the benefit of the
    527 patent license for this particular work, or (3) arrange, in a manner
    528 consistent with the requirements of this License, to extend the patent
    529 license to downstream recipients.  "Knowingly relying" means you have
    530 actual knowledge that, but for the patent license, your conveying the
    531 covered work in a country, or your recipient's use of the covered work
    532 in a country, would infringe one or more identifiable patents in that
    533 country that you have reason to believe are valid.
    534 
    535   If, pursuant to or in connection with a single transaction or
    536 arrangement, you convey, or propagate by procuring conveyance of, a
    537 covered work, and grant a patent license to some of the parties
    538 receiving the covered work authorizing them to use, propagate, modify
    539 or convey a specific copy of the covered work, then the patent license
    540 you grant is automatically extended to all recipients of the covered
    541 work and works based on it.
    542 
    543   A patent license is "discriminatory" if it does not include within
    544 the scope of its coverage, prohibits the exercise of, or is
    545 conditioned on the non-exercise of one or more of the rights that are
    546 specifically granted under this License.  You may not convey a covered
    547 work if you are a party to an arrangement with a third party that is
    548 in the business of distributing software, under which you make payment
    549 to the third party based on the extent of your activity of conveying
    550 the work, and under which the third party grants, to any of the
    551 parties who would receive the covered work from you, a discriminatory
    552 patent license (a) in connection with copies of the covered work
    553 conveyed by you (or copies made from those copies), or (b) primarily
    554 for and in connection with specific products or compilations that
    555 contain the covered work, unless you entered into that arrangement,
    556 or that patent license was granted, prior to 28 March 2007.
    557 
    558   Nothing in this License shall be construed as excluding or limiting
    559 any implied license or other defenses to infringement that may
    560 otherwise be available to you under applicable patent law.
    561 
    562   12. No Surrender of Others' Freedom.
    563 
    564   If conditions are imposed on you (whether by court order, agreement or
    565 otherwise) that contradict the conditions of this License, they do not
    566 excuse you from the conditions of this License.  If you cannot convey a
    567 covered work so as to satisfy simultaneously your obligations under this
    568 License and any other pertinent obligations, then as a consequence you may
    569 not convey it at all.  For example, if you agree to terms that obligate you
    570 to collect a royalty for further conveying from those to whom you convey
    571 the Program, the only way you could satisfy both those terms and this
    572 License would be to refrain entirely from conveying the Program.
    573 
    574   13. Use with the GNU Affero General Public License.
    575 
    576   Notwithstanding any other provision of this License, you have
    577 permission to link or combine any covered work with a work licensed
    578 under version 3 of the GNU Affero General Public License into a single
    579 combined work, and to convey the resulting work.  The terms of this
    580 License will continue to apply to the part which is the covered work,
    581 but the special requirements of the GNU Affero General Public License,
    582 section 13, concerning interaction through a network will apply to the
    583 combination as such.
    584 
    585   14. Revised Versions of this License.
    586 
    587   The Free Software Foundation may publish revised and/or new versions of
    588 the GNU General Public License from time to time.  Such new versions will
    589 be similar in spirit to the present version, but may differ in detail to
    590 address new problems or concerns.
    591 
    592   Each version is given a distinguishing version number.  If the
    593 Program specifies that a certain numbered version of the GNU General
    594 Public License "or any later version" applies to it, you have the
    595 option of following the terms and conditions either of that numbered
    596 version or of any later version published by the Free Software
    597 Foundation.  If the Program does not specify a version number of the
    598 GNU General Public License, you may choose any version ever published
    599 by the Free Software Foundation.
    600 
    601   If the Program specifies that a proxy can decide which future
    602 versions of the GNU General Public License can be used, that proxy's
    603 public statement of acceptance of a version permanently authorizes you
    604 to choose that version for the Program.
    605 
    606   Later license versions may give you additional or different
    607 permissions.  However, no additional obligations are imposed on any
    608 author or copyright holder as a result of your choosing to follow a
    609 later version.
    610 
    611   15. Disclaimer of Warranty.
    612 
    613   THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
    614 APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
    615 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
    616 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
    617 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    618 PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
    619 IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
    620 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    621 
    622   16. Limitation of Liability.
    623 
    624   IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    625 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
    626 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
    627 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
    628 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
    629 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
    630 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
    631 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
    632 SUCH DAMAGES.
    633 
    634   17. Interpretation of Sections 15 and 16.
    635 
    636   If the disclaimer of warranty and limitation of liability provided
    637 above cannot be given local legal effect according to their terms,
    638 reviewing courts shall apply local law that most closely approximates
    639 an absolute waiver of all civil liability in connection with the
    640 Program, unless a warranty or assumption of liability accompanies a
    641 copy of the Program in return for a fee.
    642 
    643                      END OF TERMS AND CONDITIONS
    644 
    645             How to Apply These Terms to Your New Programs
    646 =======
    64724this service if you wish), that you receive source code or can get it
    64825if you want it, that you can change the software or use pieces of it
     
    909286
    910287            How to Apply These Terms to Your New Programs
    911 >>>>>>> FETCH_HEAD
    912288
    913289  If you develop a new program, and you want it to be of the greatest
     
    917293  To do so, attach the following notices to the program.  It is safest
    918294to attach them to the start of each source file to most effectively
    919 <<<<<<< HEAD
    920 state the exclusion of warranty; and each file should have at least
    921 =======
    922295convey the exclusion of warranty; and each file should have at least
    923 >>>>>>> FETCH_HEAD
    924296the "copyright" line and a pointer to where the full notice is found.
    925297
    926     <one line to give the program's name and a brief idea of what it does.>
    927     Copyright (C) <year>  <name of author>
    928 
    929 <<<<<<< HEAD
    930     This program is free software: you can redistribute it and/or modify
    931     it under the terms of the GNU General Public License as published by
    932     the Free Software Foundation, either version 3 of the License, or
    933 =======
     298    MoleCuilder - to create and alter molecular systems
     299    Copyright (C) 2010  Frederik Heber
     300
    934301    This program is free software; you can redistribute it and/or modify
    935302    it under the terms of the GNU General Public License as published by
    936303    the Free Software Foundation; either version 2 of the License, or
    937 >>>>>>> FETCH_HEAD
    938304    (at your option) any later version.
    939305
     
    944310
    945311    You should have received a copy of the GNU General Public License
    946 <<<<<<< HEAD
    947     along with this program.  If not, see <http://www.gnu.org/licenses/>.
    948 
    949 Also add information on how to contact you by electronic and paper mail.
    950 
    951   If the program does terminal interaction, make it output a short
    952 notice like this when it starts in an interactive mode:
    953 
    954     <program>  Copyright (C) <year>  <name of author>
    955     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    956 =======
    957312    along with this program; if not, write to the Free Software
    958313    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     
    964319when it starts in an interactive mode:
    965320
    966     Gnomovision version 69, Copyright (C) year  name of author
    967     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    968 >>>>>>> FETCH_HEAD
     321    MoleCuilder version ??, Copyright (C) 2010  Frederik Heber
     322    MoleCuilder comes with ABSOLUTELY NO WARRANTY; for details type
     323    `molecuilder --help-warranty'.
    969324    This is free software, and you are welcome to redistribute it
    970     under certain conditions; type `show c' for details.
     325    under certain conditions; type `molecuilder --help-redistribute'
     326    for details.
    971327
    972328The hypothetical commands `show w' and `show c' should show the appropriate
    973 <<<<<<< HEAD
    974 parts of the General Public License.  Of course, your program's commands
    975 might be different; for a GUI interface, you would use an "about box".
    976 
    977   You should also get your employer (if you work as a programmer) or school,
    978 if any, to sign a "copyright disclaimer" for the program, if necessary.
    979 For more information on this, and how to apply and follow the GNU GPL, see
    980 <http://www.gnu.org/licenses/>.
    981 
    982   The GNU General Public License does not permit incorporating your program
    983 into proprietary programs.  If your program is a subroutine library, you
    984 may consider it more useful to permit linking proprietary applications with
    985 the library.  If this is what you want to do, use the GNU Lesser General
    986 Public License instead of this License.  But first, please read
    987 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
    988 =======
    989329parts of the General Public License.  Of course, the commands you use may
    990330be called something other than `show w' and `show c'; they could even be
     
    995335necessary.  Here is a sample; alter the names:
    996336
    997   Yoyodyne, Inc., hereby disclaims all copyright interest in the program
    998   `Gnomovision' (which makes passes at compilers) written by James Hacker.
    999 
    1000   <signature of Ty Coon>, 1 April 1989
    1001   Ty Coon, President of Vice
     337  University of Bonn, hereby disclaims all copyright interest in the program
     338  `MoleCuilder' (which creates molecular systems) written by Frederik Heber.
     339
     340  Frederik Heber, 17 Aug 2010
    1002341
    1003342This General Public License does not permit incorporating your program into
     
    1006345library.  If this is what you want to do, use the GNU Library General
    1007346Public License instead of this License.
    1008 >>>>>>> FETCH_HEAD
  • README

    r8006ee r994713  
    1 <<<<<<< HEAD
    2 # Project: Molecuilder
     1# Project: MoleCuilder
    32#
    43# heber@ins.uni-bonn.de
    54
    6         Molecuilder
     5        MoleCuilder
    76
    8 ... is a tool that started as a mean to edit pcp configuration files (adding/remvoing groups of atoms, measuring bond lengths and so forth) and has grown into the many-body fragmentation test base of a new method coined BOSSANOVA (Bond Order diSSection in an ANOVA (ANalysis Of VAriance) -like fashion). It spills out configuration files for each fragment and includes joining and analyzing programs, to put together the partial energies and forces of each fragment to the total energy and forces. It allows for a complete Born-Oppenheimer molecular dynamics run.
    9 =======
    10 # Project: ParallelCarParrinello
    11 # Jan Hamaekers
    12 # Frederik Heber
    13 # 2005
    14 #
    15 # File: README
     7... is a tool that started as a mean to edit pcp configuration files (adding/
     8removing groups of atoms, measuring bond lengths and so forth), grew forth into
     9a many-body fragmentation test base of a new method coined BOSSANOVA (Bond
     10Order diSSection in an ANOVA (ANalysis Of VAriance) - like fashion). It spilled
     11out configuration files for each fragment and included joining and analyzing
     12programs, to put together the partial energies and forces of each fragment to
     13the total energy and forces. Since then it has evolved into a complete toolbox
     14for creating molecular systems and worlds.
    1615
    17         Electronic Structure PACKage
    18 
    19 Is a collection of mathematical-physical programs to calculate via various ab-initio methods
    20 such as density functional theory or Hartree-Fock electronic(-magnetic) properties including
    21 the molecular (Car&Parrinello) dynamics of a many electron system. Especially, the linear
    22 response of the system to a external magnetic field in a perturbation approach in terms of
    23 susceptibility and chemical shielding is implemented via the Density Functional Perturbation
    24 Theory. It was developed mainly by Jan Hamaekers (pcp) with additional code by Frederik Heber
    25 (dfpt part in pcp) and also Ralf Wildenhuis (Gauss) at the Institute for Numerical Simulation
    26 at the University of Bonn[1].
    27 
    28 
    29 >>>>>>> FETCH_HEAD
    3016
    3117INSTALLATION NOTES
    3218==================
    3319
    34 <<<<<<< HEAD
    3520The following packages are needed
    3621* GCC or alike
    3722* GSL (GNU Scientific Library, available at http://www.gnu.org/software/gsl)
    3823* Boost 1.4 or newer
    39 =======
    40 In general gcc or alike is needed to compile the sources, for more specific demands see the README files in the sub directory of each package part.
    4124
    4225LINKS
    4326=====
    4427[1] http://www.ins.uni-bonn.de/
    45 >>>>>>> FETCH_HEAD
  • configure.ac

    r8006ee r994713  
    33
    44AC_PREREQ(2.59)
    5 AC_INIT(Molecuilder, 1.0, heber@ins.uni-bonn.de, molecuilder)
     5AC_INIT(MoleCuilder, 1.0.0, heber@ins.uni-bonn.de, molecuilder)
    66AC_CONFIG_AUX_DIR(config)
    77AC_CONFIG_SRCDIR([src/builder.cpp])
     
    99AC_CONFIG_MACRO_DIR([m4])
    1010
    11 AM_INIT_AUTOMAKE(dist-bzip2 parallel-tests)
     11AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests])
    1212
    1313# Checks for programs.
     
    1515AC_PROG_CXX
    1616AC_PROG_CC
    17 # obselete by LT_INIT
    18 #AC_PROG_RANLIB
    1917AC_PROG_INSTALL
    2018AC_CHECK_PROG([LATEX],[latex],[latex],[:])
     
    8280fi
    8381
    84 # add replacement/saturation hydrogen or not
     82# use CppUnit TestRunner or not
    8583AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
    8684              [enable_ecut=$enableval], [enable_ecut=no])
     
    8886  AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
    8987  AC_SUBST(HAVE_ECUT)
     88fi
     89
     90# with valgrinding testsuite or not
     91AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
     92              [with_valgrind=$withval], [with_valgrind=no])
     93if test x"$with_valgrind" = xyes; then
     94  AC_CHECK_HEADER([valgrind/valgrind.h],
     95    [
     96      # check header
     97      AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
     98      # check path
     99      AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
     100      # set variables
     101      AC_SUBST(HAVE_VALGRIND_TESTSUITE)
     102      AC_SUBST(VALGRIND)
     103    ],
     104    [
     105      AC_MSG_ERROR(["Valgrind support requested but headers not available."])
     106    ]
     107  )
    90108fi
    91109
  • src/Actions/Action.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Action.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ActionHistory.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ActionHistory.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ActionRegistry.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Registry<Action>.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ActionSequence.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ActionSequenze.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MolecularVolumeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/AnalysisAction/MolecularVolumeAction.hpp

    r8006ee r994713  
    88#ifndef MOLECULARVOLUMEACTION_HPP_
    99#define MOLECULARVOLUMEACTION_HPP_
     10
     11// include config.h
     12#ifdef HAVE_CONFIG_H
     13#include <config.h>
     14#endif
    1015
    1116#include "Actions/Action.hpp"
  • src/Actions/AnalysisAction/PairCorrelationAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PairCorrelationAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    7587  ofstream output;
    7688  ofstream binoutput;
    77   std::vector< element *> elements;
     89  std::vector<const element *> elements;
    7890  string type;
    7991  Vector Point;
  • src/Actions/AnalysisAction/PairCorrelationAction.hpp

    r8006ee r994713  
    88#ifndef PAIRCORRELATIONACTION_HPP_
    99#define PAIRCORRELATIONACTION_HPP_
     10
     11// include config.h
     12#ifdef HAVE_CONFIG_H
     13#include <config.h>
     14#endif
    1015
    1116#include "Actions/Action.hpp"
  • src/Actions/AnalysisAction/PointCorrelationAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PointCorrelationAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    2133#include "World.hpp"
    2234
     35#include <cmath>
    2336#include <iostream>
    2437#include <string>
     
    7689  ofstream output;
    7790  ofstream binoutput;
    78   std::vector< element *> elements;
     91  std::vector<const element *> elements;
    7992  string type;
    8093  Vector Point;
     
    96109  cout << "Point to correlate to is  " << Point << endl;
    97110  CorrelationToPointMap *correlationmap = NULL;
    98   for(std::vector< element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
    99     cout << "element is " << (*iter)->symbol << endl;
     111  for(std::vector<const element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
     112    cout << "element is " << (*iter)->getSymbol() << endl;
    100113  std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
    101114  if (periodic)
  • src/Actions/AnalysisAction/PointCorrelationAction.hpp

    r8006ee r994713  
    88#ifndef POINTCORRELATIONACTION_HPP_
    99#define POINTCORRELATIONACTION_HPP_
     10
     11// include config.h
     12#ifdef HAVE_CONFIG_H
     13#include <config.h>
     14#endif
    1015
    1116#include "Actions/Action.hpp"
  • src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PrincipalAxisSystemAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    6476      Vector x = (*iter)->getPosition();
    6577      x -= *CenterOfGravity;
    66       const double mass = (*iter)->getType()->mass;
     78      const double mass = (*iter)->getType()->getMass();
    6779      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
    6880      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SurfaceCorrelationAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    7991  ofstream output;
    8092  ofstream binoutput;
    81   std::vector< element *> elements;
     93  std::vector<const element *> elements;
    8294  string type;
    8395  Vector Point;
     
    112124  // find biggest molecule
    113125  std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
     126  std::cout << "There are " << molecules.size() << " selected molecules." << std::endl;
    114127  LCList = new LinkedCell(Boundary, LCWidth);
    115128  FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
  • src/Actions/AtomAction/AddAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AddAction.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
    1022#include "Actions/AtomAction/AddAction.hpp"
    1123#include "Actions/ActionRegistry.hpp"
     24#include "Descriptors/AtomIdDescriptor.hpp"
    1225#include "atom.hpp"
    1326#include "element.hpp"
     
    2639#include "UIElements/Dialog.hpp"
    2740#include "Actions/ValueStorage.hpp"
     41
     42// memento to remember the state when undoing
     43
     44class AtomAddState : public ActionState {
     45public:
     46  AtomAddState(const Vector &_position, const element *_elemental, const atomId_t _id) :
     47    position(_position),
     48    elemental(_elemental),
     49    id(_id)
     50  {}
     51  Vector position;
     52  const element *elemental;
     53  atomId_t id;
     54};
    2855
    2956const char AtomAddAction::NAME[] = "add-atom";
     
    5279
    5380Action::state_ptr AtomAddAction::performCall() {
    54   element * elemental = NULL;
     81  const element * elemental = NULL;
    5582  Vector position;
    5683
     
    6390  first->setType(elemental);
    6491  first->setPosition(position);
    65   DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->name << " at " << (first->getPosition()) << "." << endl);
     92  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "." << endl);
    6693  // TODO: remove when all of World's atoms are stored.
    6794  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     
    7097    (*iter)->AddAtom(first);
    7198  }
    72   return Action::success;
     99  return Action::state_ptr(new AtomAddState(position, elemental, first->getId()));
    73100}
    74101
    75102Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) {
    76 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     103  AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
    77104
    78   return Action::failure;
    79 //  string newName = state->mol->getName();
    80 //  state->mol->setName(state->lastName);
    81 //
    82 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     105  DoLog(1) && (Log() << Verbose(1) << "Removing atom with id " << state->id << "." << endl);
     106  World::getInstance().destroyAtom(state->id);
     107
     108  return Action::state_ptr(_state);
    83109}
    84110
    85111Action::state_ptr AtomAddAction::performRedo(Action::state_ptr _state){
    86   return Action::failure;
     112  AtomAddState *state = assert_cast<AtomAddState*>(_state.get());
     113
     114  atom * first = World::getInstance().createAtom();
     115  first->setType(state->elemental);
     116  first->setPosition(state->position);
     117  DoLog(1) && (Log() << Verbose(1) << "Re-adding new atom with element " << state->elemental->getName() << " at " << state->position << "." << endl);
     118  // TODO: remove when all of World's atoms are stored.
     119  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     120  if (!molecules.empty()) {
     121    std::vector<molecule *>::iterator iter = molecules.begin();
     122    (*iter)->AddAtom(first);
     123  }
     124  if (first->getId() != state->id)
     125    if (!first->changeId(state->id))
     126      return Action::failure;
     127  return Action::state_ptr(_state);
    87128}
    88129
    89130bool AtomAddAction::canUndo() {
    90   return false;
     131  return true;
    91132}
    92133
    93134bool AtomAddAction::shouldUndo() {
    94   return false;
     135  return true;
    95136}
    96137
  • src/Actions/AtomAction/ChangeElementAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ChangeElementAction.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
    1022#include "Actions/AtomAction/ChangeElementAction.hpp"
    1123#include "Actions/ActionRegistry.hpp"
     24#include "Descriptors/AtomIdDescriptor.hpp"
    1225#include "atom.hpp"
    1326#include "element.hpp"
     
    1932
    2033#include <iostream>
     34#include <map>
    2135#include <string>
    2236
     
    2640#include "UIElements/Dialog.hpp"
    2741#include "Actions/ValueStorage.hpp"
     42
     43typedef std::map<int, const element *> ElementMap;
     44
     45// memento to remember the state when undoing
     46
     47class AtomChangeElementState : public ActionState {
     48public:
     49  AtomChangeElementState(ElementMap _Elements, const element *_elemental) :
     50    Elements(_Elements),
     51    elemental(_elemental)
     52  {}
     53  ElementMap Elements;
     54  const element *elemental;
     55};
    2856
    2957const char AtomChangeElementAction::NAME[] = "change-element";
     
    5179Action::state_ptr AtomChangeElementAction::performCall() {
    5280  atom *first = NULL;
    53   element *elemental = NULL;
     81  const element *elemental;
    5482  molecule *mol = NULL;
    5583
    5684  ValueStorage::getInstance().queryCurrentValue(NAME, elemental);
    5785
     86  // create undo state
     87  ElementMap Elements;
     88  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     89    Elements.insert(std::pair<int, const element *> (iter->second->getId(), iter->second->getType()));
     90  }
     91  AtomChangeElementState *UndoState = new AtomChangeElementState(Elements, elemental);
     92
    5893  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5994    first = iter->second;
    60     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental->symbol << "." << endl);
     95    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << *elemental << "." << endl);
    6196    mol = first->getMolecule();
    6297    first->removeFromMolecule(); // remove atom
     
    6499    mol->AddAtom(first);  // add atom to ensure correctness of formula
    65100  }
    66   return Action::success;
     101  return Action::state_ptr(UndoState);
    67102}
    68103
    69104Action::state_ptr AtomChangeElementAction::performUndo(Action::state_ptr _state) {
    70 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     105  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
     106  atom *first = NULL;
     107  molecule *mol = NULL;
    71108
    72   return Action::failure;
    73 //  string newName = state->mol->getName();
    74 //  state->mol->setName(state->lastName);
    75 //
    76 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     109  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     110    first = World::getInstance().getAtom(AtomById(iter->first));
     111    mol = first->getMolecule();
     112    first->removeFromMolecule(); // remove atom
     113    first->setType(iter->second);
     114    mol->AddAtom(first);  // add atom to ensure correctness of formula
     115  }
     116
     117  return Action::state_ptr(_state);
    77118}
    78119
    79120Action::state_ptr AtomChangeElementAction::performRedo(Action::state_ptr _state){
    80   return Action::failure;
     121  AtomChangeElementState *state = assert_cast<AtomChangeElementState*>(_state.get());
     122  atom *first = NULL;
     123  molecule *mol = NULL;
     124
     125  for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     126    first = World::getInstance().getAtom(AtomById(iter->first));
     127    mol = first->getMolecule();
     128    first->removeFromMolecule(); // remove atom
     129    first->setType(state->elemental);
     130    mol->AddAtom(first);  // add atom to ensure correctness of formula
     131  }
     132
     133  return Action::state_ptr(_state);
    81134}
    82135
    83136bool AtomChangeElementAction::canUndo() {
    84   return false;
     137  return true;
    85138}
    86139
    87140bool AtomChangeElementAction::shouldUndo() {
    88   return false;
     141  return true;
    89142}
    90143
  • src/Actions/AtomAction/RemoveAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * RemoveAction.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
     
    1123#include "Actions/ActionRegistry.hpp"
    1224#include "atom.hpp"
     25#include "AtomicInfo.hpp"
    1326#include "Descriptors/AtomDescriptor.hpp"
    1427#include "Helpers/Log.hpp"
     
    2538#include "UIElements/Dialog.hpp"
    2639#include "Actions/ValueStorage.hpp"
     40
     41// memento to remember the state when undoing
     42
     43class AtomRemoveState : public ActionState {
     44public:
     45  AtomRemoveState(std::vector<AtomicInfo> _Walkers) :
     46    Walkers(_Walkers)
     47  {}
     48  std::vector<AtomicInfo> Walkers;
     49};
    2750
    2851const char AtomRemoveAction::NAME[] = "remove-atom";
     
    5073  atom *first = NULL;
    5174
    52   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     75  // create undo state
     76  std::vector<AtomicInfo> Walkers;
     77  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     78    Walkers.push_back(AtomicInfo(*(iter->second)));
     79  }
     80  AtomRemoveState *UndoState = new AtomRemoveState(Walkers);
     81
     82  // remove all selected atoms
     83//  std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
    5384  for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
    5485    first = iter->second;
    5586    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
    56     // TODO: this is not necessary when atoms and their storing to file are handled by the World
    57     // simply try to erase in every molecule found
    58     for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
    59       (*iter)->erase(first);
    60     }
     87//    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     88//    // simply try to erase in every molecule found
     89//    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     90//      (*iter)->erase(first);
     91//    }
    6192    World::getInstance().destroyAtom(first);
    6293  }
    63   return Action::success;
     94  return Action::state_ptr(UndoState);
    6495}
    6596
    6697Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) {
    67 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
     98  AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
    6899
    69   return Action::failure;
    70 //  string newName = state->mol->getName();
    71 //  state->mol->setName(state->lastName);
    72 //
    73 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     100  size_t i=0;
     101  for (; i<state->Walkers.size(); ++i) {
     102    // re-create the atom
     103    DoLog(1) && (Log() << Verbose(1) << "Re-adding atom " << state->Walkers[i].getId() << "." << endl);
     104    atom *Walker = World::getInstance().createAtom();
     105    if (!state->Walkers[i].setAtom(*Walker)) {
     106      DoeLog(1) && (eLog() << Verbose(1) << "Failed to set id." << endl);
     107      World::getInstance().destroyAtom(Walker);
     108      break;
     109    }
     110  }
     111  if (i<state->Walkers.size()) {
     112    // remove all previous ones, too
     113    for (size_t j=0;j<i;++j)
     114      World::getInstance().destroyAtom(state->Walkers[j].getId());
     115    // and announce the failure of the undo
     116    return Action::failure;
     117  }
     118  return Action::state_ptr(_state);
    74119}
    75120
    76121Action::state_ptr AtomRemoveAction::performRedo(Action::state_ptr _state){
    77   return Action::failure;
     122  AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get());
     123
     124  // simple remove again all previously added atoms
     125  for (size_t i=0; i<state->Walkers.size(); ++i) {
     126    DoLog(1) && (Log() << Verbose(1) << "Re-removing atom " << state->Walkers[i].getId() << "." << endl);
     127    World::getInstance().destroyAtom(state->Walkers[i].getId());
     128  }
     129
     130  return Action::state_ptr(_state);
    78131}
    79132
    80133bool AtomRemoveAction::canUndo() {
    81   return false;
     134  return true;
    82135}
    83136
    84137bool AtomRemoveAction::shouldUndo() {
    85   return false;
     138  return true;
    86139}
    87140
  • src/Actions/AtomAction/RotateAroundOriginByAngleAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * RotateAroundOriginByAngleAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    1729
    1830
     31#include <cmath>
    1932#include <iostream>
    2033#include <fstream>
  • src/Actions/AtomAction/TranslateAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TranslateAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    3244class AtomTranslateState : public ActionState {
    3345public:
    34   AtomTranslateState(std::vector<atom*> _selectedAtoms, Vector &_v) :
     46  AtomTranslateState(const std::vector<atom*> &_selectedAtoms, const Vector &_v, const bool _periodic) :
    3547    selectedAtoms(_selectedAtoms),
    36     v(_v)
     48    v(_v),
     49    periodic(_periodic)
    3750  {}
    3851  std::vector<atom*> selectedAtoms;
    3952  Vector v;
     53  bool periodic;
    4054};
    4155
     
    4963{}
    5064
    51 void AtomTranslate(Vector &x) {
     65void AtomTranslate(Vector &x, bool periodic = false) {
    5266  ValueStorage::getInstance().setCurrentValue(AtomTranslateAction::NAME, x);
     67  ValueStorage::getInstance().setCurrentValue("periodic", periodic);
    5368  ActionRegistry::getInstance().getActionByName(AtomTranslateAction::NAME)->call(Action::NonInteractive);
    5469};
     
    5873
    5974  dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME));
     75  dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic"));
    6076
    6177  return dialog;
     
    6480Action::state_ptr AtomTranslateAction::performCall() {
    6581  Vector v;
     82  bool periodic = false;
     83  Box &domain = World::getInstance().getDomain();
    6684  std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms();
    6785
    6886  ValueStorage::getInstance().queryCurrentValue(NAME, v);
     87  if (!ValueStorage::getInstance().queryCurrentValue("periodic", periodic, true))
     88    periodic = false;
    6989
    7090  // TODO: use AtomSet::translate
    7191  for (std::vector<atom *>::iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) {
    7292    *(*iter) += v;
     93    if (periodic)
     94      (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition()));
    7395  }
    74   return Action::state_ptr(new AtomTranslateState(selectedAtoms, v));
     96
     97  return Action::state_ptr(new AtomTranslateState(selectedAtoms, v, periodic));
    7598}
    7699
    77100Action::state_ptr AtomTranslateAction::performUndo(Action::state_ptr _state) {
    78101  AtomTranslateState *state = assert_cast<AtomTranslateState*>(_state.get());
     102  Box &domain = World::getInstance().getDomain();
    79103
    80104  for (std::vector<atom *>::iterator iter = state->selectedAtoms.begin(); iter != state->selectedAtoms.end(); ++iter) {
    81105    *(*iter) -= state->v;
     106    if (state->periodic)
     107      (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition()));
    82108  }
    83109
    84   return Action::state_ptr(new AtomTranslateState(state->selectedAtoms, state->v));
     110  return Action::state_ptr(_state);
    85111}
    86112
    87113Action::state_ptr AtomTranslateAction::performRedo(Action::state_ptr _state){
    88114  AtomTranslateState *state = assert_cast<AtomTranslateState*>(_state.get());
     115  Box &domain = World::getInstance().getDomain();
    89116
    90117  for (std::vector<atom *>::iterator iter = state->selectedAtoms.begin(); iter != state->selectedAtoms.end(); ++iter) {
    91118    *(*iter) += state->v;
     119    if (state->periodic)
     120      (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition()));
    92121  }
    93122
    94   return Action::state_ptr(new AtomTranslateState(state->selectedAtoms, state->v));
     123  return Action::state_ptr(_state);
    95124}
    96125
  • src/Actions/AtomAction/TranslateAction.hpp

    r8006ee r994713  
    1515
    1616class AtomTranslateAction : public Action {
    17   friend void AtomTranslate(Vector &x);
     17  friend void AtomTranslate(Vector &x, bool periodic);
    1818
    1919public:
  • src/Actions/CmdAction/BondLengthTableAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BondLengthTableAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/CmdAction/ElementDbAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ElementDbAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/CmdAction/FastParsingAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * FastParsingAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    2840class CommandLineFastParsingState : public ActionState {
    2941public:
    30   CommandLineFastParsingState(bool _bool) :
    31     boolean(_bool)
     42  CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) :
     43    oldvalue(_oldvalue),
     44    newvalue(_newvalue)
    3245  {}
    33   bool boolean;
     46  bool oldvalue;
     47  bool newvalue;
    3448};
    3549
     
    5872
    5973Action::state_ptr CommandLineFastParsingAction::performCall() {
    60 
    6174  config *configuration = World::getInstance().getConfig();
    62   ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing);
     75  bool oldvalue = configuration->FastParsing;
     76  bool newvalue;
     77  ValueStorage::getInstance().queryCurrentValue(NAME, newvalue);
     78  configuration->FastParsing = newvalue;
    6379  if (configuration->FastParsing)
    6480    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
    6581  else
    6682    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    67   return Action::success;
     83  return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue));
    6884}
    6985
     
    7288
    7389  config *configuration = World::getInstance().getConfig();
    74   configuration->FastParsing = state->boolean;
     90  configuration->FastParsing = state->oldvalue;
     91  if (configuration->FastParsing)
     92    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     93  else
     94    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
    7595
    76   return Action::state_ptr(new CommandLineFastParsingState(!state->boolean));
     96  return Action::state_ptr(_state);
    7797}
    7898
    7999Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){
    80   return performUndo(_state);
     100  CommandLineFastParsingState *state = assert_cast<CommandLineFastParsingState*>(_state.get());
     101
     102  config *configuration = World::getInstance().getConfig();
     103  configuration->FastParsing = state->newvalue;
     104  if (configuration->FastParsing)
     105    DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl);
     106  else
     107    DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl);
     108
     109  return Action::state_ptr(_state);
    81110}
    82111
  • src/Actions/CmdAction/HelpAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * HelpAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/CmdAction/VerboseAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * VerboseAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    2638class CommandLineVerboseState : public ActionState {
    2739public:
    28   CommandLineVerboseState(int _verbosity) :
    29     verbosity(_verbosity)
     40  CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) :
     41    oldverbosity(_oldverbosity),
     42    newverbosity(_newverbosity)
    3043  {}
    31   int verbosity;
     44  int oldverbosity;
     45  int newverbosity;
    3246};
    3347
     
    5670
    5771Action::state_ptr CommandLineVerboseAction::performCall() {
    58   int verbosity = 2;
     72  int oldverbosity = getVerbosity();
     73  int newverbosity = 2;
    5974
    60   ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
     75  ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity);
    6176
    62   setVerbosity(verbosity);
    63   DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl);
    64   return Action::success;
     77  if (oldverbosity != newverbosity) {
     78    CommandLineVerboseState *UndoState = new CommandLineVerboseState(oldverbosity, newverbosity);
     79    setVerbosity(newverbosity);
     80    DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << oldverbosity << " to " << newverbosity << "." << endl);
     81    return Action::state_ptr(UndoState);
     82  } else {
     83    DoLog(0) && (Log() << Verbose(0) << "Verbosity remains unchanged at " << oldverbosity << "." << endl);
     84    return Action::failure;
     85  }
    6586}
    6687
     
    6889  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
    6990
    70   int verbosity = 2;
    71   ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);
     91  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->newverbosity << " to " << state->oldverbosity << "." << endl);
     92  setVerbosity(state->oldverbosity);
    7293
    73   setVerbosity(state->verbosity);
    74   return Action::state_ptr(new CommandLineVerboseState(verbosity));
     94  return Action::state_ptr(_state);
    7595}
    7696
    7797Action::state_ptr CommandLineVerboseAction::performRedo(Action::state_ptr _state){
    78   return performUndo(_state);
     98  CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get());
     99
     100  DoLog(0) && (Log() << Verbose(0) << "Setting verbosity from " << state->oldverbosity << " to " << state->newverbosity << "." << endl);
     101  setVerbosity(state->newverbosity);
     102
     103  return Action::state_ptr(_state);
    79104}
    80105
  • src/Actions/CmdAction/VersionAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * VersionAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    3749  ASSERT(dialog,"No Dialog given when filling action dialog");
    3850
    39   dialog->queryEmpty(NAME, ESPACKVersion);
     51  dialog->queryEmpty(NAME, MOLECUILDERVERSION);
    4052
    4153  return dialog;
  • src/Actions/ErrorAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ErrorAction.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/FragmentationAction/DepthFirstSearchAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * DepthFirstSearchAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/FragmentationAction/FragmentationAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * FragmentationAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/FragmentationAction/SubgraphDissectionAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SubgraphDissectionAction.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
    1022#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    1123#include "Actions/ActionRegistry.hpp"
     24#include "Descriptors/AtomIdDescriptor.hpp"
    1225#include "Descriptors/MoleculeDescriptor.hpp"
    1326
     
    1730#include "config.hpp"
    1831#include "Helpers/Log.hpp"
     32#include "Helpers/Verbose.hpp"
    1933#include "molecule.hpp"
    2034#include "stackclass.hpp"
     
    3044#include "Actions/ValueStorage.hpp"
    3145
     46// memento to remember the state when undoing
     47
     48typedef std::map< moleculeId_t, std::vector<atomId_t> > MolAtomList;
     49
     50class FragmentationSubgraphDissectionState : public ActionState {
     51public:
     52  FragmentationSubgraphDissectionState(const MolAtomList &_moleculelist) :
     53   moleculelist(_moleculelist)
     54  {}
     55  MolAtomList moleculelist;
     56};
     57
    3258const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect";
    3359
     
    3965{}
    4066
     67/** Dissects given \a *mol into connected subgraphs and inserts them as new molecules but with old atoms into \a this.
     68 */
    4169void FragmentationSubgraphDissection() {
    4270  ActionRegistry::getInstance().getActionByName(FragmentationSubgraphDissectionAction::NAME)->call(Action::NonInteractive);
     
    5482Action::state_ptr FragmentationSubgraphDissectionAction::performCall() {
    5583  DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl);
    56   // @TODO rather do the dissection afterwards
     84
     85  // first create undo state
     86  MolAtomList moleculelist;
     87  vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
     88  for (vector<molecule *>::const_iterator moliter = allmolecules.begin(); moliter != allmolecules.end(); ++moliter) {
     89    std::vector<atomId_t> atomlist;
     90    atomlist.resize((*moliter)->size());
     91    for (molecule::const_iterator atomiter = (*moliter)->begin(); atomiter != (*moliter)->end(); ++atomiter) {
     92      atomlist.push_back((*atomiter)->getId());
     93    }
     94    moleculelist.insert( std::pair< moleculeId_t, std::vector<atomId_t> > ((*moliter)->getId(), atomlist));
     95  }
     96  FragmentationSubgraphDissectionState *UndoState = new FragmentationSubgraphDissectionState(moleculelist);
     97
    5798  MoleculeListClass *molecules = World::getInstance().getMolecules();
    5899  config * const configuration = World::getInstance().getConfig();
    59100
    60101  // 0a. remove all present molecules
    61   vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
    62102  for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
    63103    molecules->erase(*MolRunner);
     
    67107  // 0b. remove all bonds and construct a molecule with all atoms
    68108  molecule *mol = World::getInstance().createMolecule();
    69   vector <atom *> allatoms = World::getInstance().getAllAtoms();
    70   for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
    71     for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
    72       delete(*BondRunner);
    73     mol->AddAtom(*AtomRunner);
     109  {
     110    vector <atom *> allatoms = World::getInstance().getAllAtoms();
     111    for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
     112      for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
     113        delete(*BondRunner);
     114      mol->AddAtom(*AtomRunner);
     115    }
    74116  }
    75117
     
    92134  delete(BackEdgeStack);
    93135  if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) {
    94     World::getInstance().destroyMolecule(mol);
     136    //World::getInstance().destroyMolecule(mol);
    95137    DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl);
    96138    return Action::failure;
    97139  }
    98 
    99   // 3. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in
    100   // the original one as parsed in)
    101   // TODO: Optimize this, when molecules just contain pointer list of global atoms!
    102 
    103   // 4a. create array of molecules to fill
    104   const int MolCount = Subgraphs->next->Count();
    105   char number[MAXSTRINGSIZE];
    106   molecule **moleculelist = new molecule *[MolCount];
     140  int FragmentCounter = Subgraphs->next->Count();
     141
     142  // TODO: When DepthFirstSearchAnalysis does not use AddCopyAtom() anymore, we don't need to delete all original atoms
     143  {
     144    // 3a. destroy the original molecule
     145    for (molecule::iterator AtomRunner = mol->begin(); !mol->empty(); AtomRunner = mol->begin())
     146      World::getInstance().destroyAtom(*AtomRunner);
     147    World::getInstance().destroyMolecule(mol);
     148    // 3b. correct fathers (AddCopyAtom sets father to original atom, which has been destroyed).
     149    vector <atom *> allatoms = World::getInstance().getAllAtoms();
     150    for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
     151      (*AtomRunner)->father = *AtomRunner;
     152    }
     153  }
     154
     155  // 4. free Leafs
    107156  MoleculeLeafClass *MolecularWalker = Subgraphs;
    108   for (int i=0;i<MolCount;i++) {
    109     MolecularWalker = MolecularWalker->next;
    110     moleculelist[i] = World::getInstance().createMolecule();
    111     moleculelist[i]->ActiveFlag = true;
    112     strncpy(moleculelist[i]->name, mol->name, MAXSTRINGSIZE);
    113     if (MolCount > 1) {
    114       sprintf(number, "-%d", i+1);
    115       strncat(moleculelist[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1);
    116     }
    117     DoLog(1) && (Log() << Verbose(1) << "MolName is " << moleculelist[i]->name << ", id is " << moleculelist[i]->getId() << endl);
    118     for (molecule::iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) {
    119       DoLog(1) && (Log() << Verbose(1) << **iter << endl);
    120     }
    121     molecules->insert(moleculelist[i]);
    122   }
    123 
    124   // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
    125   int FragmentCounter = 0;
    126   map<int, atom *> AtomToFragmentMap;
    127   MolecularWalker = Subgraphs;
    128157  while (MolecularWalker->next != NULL) {
    129     MolecularWalker = MolecularWalker->next;
    130     for (molecule::iterator iter = MolecularWalker->Leaf->begin(); !MolecularWalker->Leaf->empty(); iter = MolecularWalker->Leaf->begin()) {
    131       atom * Walker = *iter;
    132       DoLog(1) && (Log() << Verbose(1) << "Re-linking " << Walker << "..." << endl);
    133       MolecularWalker->Leaf->erase(iter);
    134       moleculelist[FragmentCounter]->AddAtom(Walker);    // counting starts at 1
    135     }
    136     FragmentCounter++;
    137   }
    138   // TODO: When DepthFirstSearchAnalysis does not use AddCopyAtom() anymore, we don't need to delete all original atoms.
    139   // 4d. destroy the original molecule
    140   for (molecule::iterator AtomRunner = mol->begin(); !mol->empty(); AtomRunner = mol->begin())
    141     World::getInstance().destroyAtom(*AtomRunner);
    142   World::getInstance().destroyMolecule(mol);
    143 
    144   // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list
    145   // TODO: check whether this is really not needed anymore
    146   // 4e. free Leafs
    147   MolecularWalker = Subgraphs;
    148   while (MolecularWalker->next != NULL) {
     158    MolecularWalker->Leaf = NULL;
    149159    MolecularWalker = MolecularWalker->next;
    150160    delete(MolecularWalker->previous);
    151161  }
     162  MolecularWalker->Leaf = NULL;
    152163  delete(MolecularWalker);
    153   delete[](moleculelist);
    154164  DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
    155165
    156   return Action::success;
     166  return Action::state_ptr(UndoState);
    157167}
    158168
    159169Action::state_ptr FragmentationSubgraphDissectionAction::performUndo(Action::state_ptr _state) {
    160 //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    161 
    162   return Action::failure;
    163 //  string newName = state->mol->getName();
    164 //  state->mol->setName(state->lastName);
    165 //
    166 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     170  FragmentationSubgraphDissectionState *state = assert_cast<FragmentationSubgraphDissectionState*>(_state.get());
     171
     172  {
     173    // remove all present molecules
     174    MoleculeListClass *molecules = World::getInstance().getMolecules();
     175    vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
     176    for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
     177      molecules->erase(*MolRunner);
     178      World::getInstance().destroyMolecule(*MolRunner);
     179    }
     180  }
     181
     182  {
     183    // construct the old state
     184    molecule *mol = NULL;
     185    for (MolAtomList::const_iterator iter = state->moleculelist.begin(); iter != state->moleculelist.end(); ++iter) {
     186      mol = World::getInstance().createMolecule();
     187      if (mol->getId() != (*iter).first)
     188        World::getInstance().changeMoleculeId(mol->getId(), (*iter).first);
     189      for (std::vector<atomId_t>::const_iterator atomiter = (*iter).second.begin(); atomiter != (*iter).second.end(); ++atomiter)
     190        mol->AddAtom(World::getInstance().getAtom(AtomById(*atomiter)));
     191    }
     192  }
     193
     194  return Action::state_ptr(_state);
    167195}
    168196
    169197Action::state_ptr FragmentationSubgraphDissectionAction::performRedo(Action::state_ptr _state){
    170   return Action::failure;
     198  return performCall();
    171199}
    172200
    173201bool FragmentationSubgraphDissectionAction::canUndo() {
    174   return false;
     202  return true;
    175203}
    176204
    177205bool FragmentationSubgraphDissectionAction::shouldUndo() {
    178   return false;
     206  return true;
    179207}
    180208
  • src/Actions/Makefile.am

    r8006ee r994713  
    118118SELECTIONACTIONSOURCE = \
    119119        SelectionAction/AllAtomsAction.cpp \
     120        SelectionAction/AllAtomsInsideCuboidAction.cpp \
     121        SelectionAction/AllAtomsInsideSphereAction.cpp \
    120122        SelectionAction/AllAtomsOfMoleculeAction.cpp \
    121123        SelectionAction/AllMoleculesAction.cpp \
     124        SelectionAction/AtomByElementAction.cpp \
    122125        SelectionAction/AtomByIdAction.cpp \
    123126        SelectionAction/ClearAllAtomsAction.cpp \
    124127        SelectionAction/ClearAllMoleculesAction.cpp \
     128        SelectionAction/MoleculeByFormulaAction.cpp \
    125129        SelectionAction/MoleculeByIdAction.cpp \
    126130        SelectionAction/MoleculeOfAtomAction.cpp \
    127131        SelectionAction/NotAllAtomsAction.cpp \
     132        SelectionAction/NotAllAtomsInsideCuboidAction.cpp \
     133        SelectionAction/NotAllAtomsInsideSphereAction.cpp \
    128134        SelectionAction/NotAllAtomsOfMoleculeAction.cpp \
    129135        SelectionAction/NotAllMoleculesAction.cpp \
     136        SelectionAction/NotAtomByElementAction.cpp \
    130137        SelectionAction/NotAtomByIdAction.cpp \
     138        SelectionAction/NotMoleculeByFormulaAction.cpp \
    131139        SelectionAction/NotMoleculeByIdAction.cpp \
    132140        SelectionAction/NotMoleculeOfAtomAction.cpp
    133141SELECTIONACTIONHEADER = \
    134142        SelectionAction/AllAtomsAction.hpp \
     143        SelectionAction/AllAtomsInsideCuboidAction.hpp \
     144        SelectionAction/AllAtomsInsideSphereAction.hpp \
    135145        SelectionAction/AllAtomsOfMoleculeAction.hpp \
    136146        SelectionAction/AllMoleculesAction.hpp \
     147        SelectionAction/AtomByElementAction.hpp \
    137148        SelectionAction/AtomByIdAction.hpp \
    138149        SelectionAction/ClearAllAtomsAction.hpp \
    139150        SelectionAction/ClearAllMoleculesAction.hpp \
     151        SelectionAction/MoleculeByFormulaAction.hpp \
    140152        SelectionAction/MoleculeByIdAction.hpp \
    141153        SelectionAction/MoleculeOfAtomAction.hpp \
    142154        SelectionAction/NotAllAtomsAction.hpp \
     155        SelectionAction/NotAllAtomsInsideCuboidAction.hpp \
     156        SelectionAction/NotAllAtomsInsideSphereAction.hpp \
    143157        SelectionAction/NotAllAtomsOfMoleculeAction.hpp \
    144158        SelectionAction/NotAllMoleculesAction.hpp \
     159        SelectionAction/NotAtomByElementAction.hpp \
    145160        SelectionAction/NotAtomByIdAction.hpp \
     161        SelectionAction/NotMoleculeByFormulaAction.hpp \
    146162        SelectionAction/NotMoleculeByIdAction.hpp \
    147163        SelectionAction/NotMoleculeOfAtomAction.cpp
     
    162178  WorldAction/InputAction.cpp \
    163179  WorldAction/OutputAction.cpp \
    164   WorldAction/RemoveSphereOfAtomsAction.cpp \
    165180  WorldAction/RepeatBoxAction.cpp \
    166181  WorldAction/ScaleBoxAction.cpp \
     
    176191  WorldAction/InputAction.hpp \
    177192  WorldAction/OutputAction.hpp \
    178   WorldAction/RemoveSphereOfAtomsAction.hpp \
    179193  WorldAction/RepeatBoxAction.hpp \
    180194  WorldAction/ScaleBoxAction.hpp \
  • src/Actions/MakroAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MakroAction.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ManipulateAtomsProcess.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ManipulateAtomsProcess.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MapOfActions.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MapOfActions.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    6779#include "Actions/ParserAction/SaveXyzAction.hpp"
    6880#include "Actions/SelectionAction/AllAtomsAction.hpp"
     81#include "Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp"
     82#include "Actions/SelectionAction/AllAtomsInsideSphereAction.hpp"
    6983#include "Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp"
    7084#include "Actions/SelectionAction/AllMoleculesAction.hpp"
     85#include "Actions/SelectionAction/AtomByElementAction.hpp"
    7186#include "Actions/SelectionAction/AtomByIdAction.hpp"
    7287#include "Actions/SelectionAction/ClearAllAtomsAction.hpp"
    7388#include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
     89#include "Actions/SelectionAction/MoleculeByFormulaAction.hpp"
    7490#include "Actions/SelectionAction/MoleculeByIdAction.hpp"
    7591#include "Actions/SelectionAction/MoleculeOfAtomAction.hpp"
    7692#include "Actions/SelectionAction/NotAllAtomsAction.hpp"
     93#include "Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp"
     94#include "Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp"
    7795#include "Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp"
    7896#include "Actions/SelectionAction/NotAllMoleculesAction.hpp"
     97#include "Actions/SelectionAction/NotAtomByElementAction.hpp"
    7998#include "Actions/SelectionAction/NotAtomByIdAction.hpp"
     99#include "Actions/SelectionAction/NotMoleculeByFormulaAction.hpp"
    80100#include "Actions/SelectionAction/NotMoleculeByIdAction.hpp"
    81101#include "Actions/SelectionAction/NotMoleculeOfAtomAction.hpp"
     
    89109#include "Actions/WorldAction/InputAction.hpp"
    90110#include "Actions/WorldAction/OutputAction.hpp"
    91 #include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
    92111#include "Actions/WorldAction/RepeatBoxAction.hpp"
    93112#include "Actions/WorldAction/ScaleBoxAction.hpp"
     
    212231  DescriptionMap["redo"] = "redo last action";
    213232  DescriptionMap["remove-atom"] = "remove a specified atom";
    214   DescriptionMap["remove-sphere"] = "remove sphere of atoms of around a specified atom";
    215233  DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis";
    216234  DescriptionMap["rotate-origin"] = "rotate selected atoms by a specific angle around origin";
     
    224242  DescriptionMap["select-all-atoms"] = "select all atoms";
    225243  DescriptionMap["select-all-molecules"] = "select all molecules";
     244  DescriptionMap["select-atom-by-element"] = "select an atom by element";
    226245  DescriptionMap["select-atom-by-id"] = "select an atom by index";
     246  DescriptionMap["select-atoms-inside-cuboid"] = "select all atoms inside a cuboid";
     247  DescriptionMap["select-atoms-inside-sphere"] = "select all atoms inside a sphere";
    227248  DescriptionMap["select-molecule-by-id"] = "select a molecule by index";
     249  DescriptionMap["select-molecule-by-formula"] = "select a molecule by chemical formula";
    228250  DescriptionMap["select-molecule-of-atom"] = "select a molecule to which a given atom belongs";
    229251  DescriptionMap["select-molecules-atoms"] = "select all atoms of a molecule";
     
    237259  DescriptionMap["unselect-all-atoms"] = "unselect all atoms";
    238260  DescriptionMap["unselect-all-molecules"] = "unselect all molecules";
     261  DescriptionMap["unselect-atom-by-element"] = "unselect an atom by element";
    239262  DescriptionMap["unselect-atom-by-id"] = "unselect an atom by index";
     263  DescriptionMap["unselect-atoms-inside-cuboid"] = "unselect all atoms inside a cuboid";
     264  DescriptionMap["unselect-atoms-inside-sphere"] = "unselect all atoms inside a sphere";
     265  DescriptionMap["unselect-molecule-by-formula"] = "unselect a molecule by chemical formula";
    240266  DescriptionMap["unselect-molecule-by-id"] = "unselect a molecule by index";
    241267  DescriptionMap["unselect-molecule-of-atom"] = "unselect a molecule to which a given atom belongs";
     
    245271  DescriptionMap["version"] = "show version";
    246272  // keys for values
     273  DescriptionMap["angle-x"] = "angle of a rotation around x axis";
     274  DescriptionMap["angle-y"] = "angle of a rotation around y axis";
     275  DescriptionMap["angle-z"] = "angle of a rotation around z axis";
    247276  DescriptionMap["bin-output-file"] = "name of the bin output file";
    248277  DescriptionMap["bin-end"] = "start of the last bin";
     
    293322  ShortFormMap["parse-xyz"] = "p";
    294323  ShortFormMap["remove-atom"] = "r";
    295   ShortFormMap["remove-sphere"] = "R";
    296324  ShortFormMap["repeat-box"] = "d";
    297325  ShortFormMap["rotate-to-pas"] = "m";
     
    310338
    311339  // value types for the actions
    312   TypeMap["add-atom"] = &typeid(element);
     340  TypeMap["add-atom"] = &typeid(const element);
    313341  TypeMap["bond-file"] = &typeid(std::string);
    314342  TypeMap["bond-table"] = &typeid(std::string);
     
    316344  TypeMap["center-in-box"] = &typeid(BoxValue);
    317345  TypeMap["change-box"] = &typeid(BoxValue);
    318   TypeMap["change-element"] = &typeid(element);
     346  TypeMap["change-element"] = &typeid(const element);
    319347  TypeMap["change-molname"] = &typeid(std::string);
    320348  TypeMap["clear-atom-selection"] = &typeid(void);
     
    338366  TypeMap["redo"] = &typeid(void);
    339367  TypeMap["remove-atom"] = &typeid(void);
    340   TypeMap["remove-sphere"] = &typeid(double);
    341368  TypeMap["repeat-box"] = &typeid(VectorValue);
    342369  TypeMap["rotate-origin"] = &typeid(double);
     
    349376  TypeMap["select-all-atoms"] = &typeid(void);
    350377  TypeMap["select-all-molecules"] = &typeid(void);
     378  TypeMap["select-atom-by-element"] = &typeid(const element);
    351379  TypeMap["select-atom-by-id"] = &typeid(atom);
     380  TypeMap["select-atoms-inside-cuboid"] = &typeid(VectorValue);
     381  TypeMap["select-atoms-inside-sphere"] = &typeid(double);
     382  TypeMap["select-molecule-by-formula"] = &typeid(std::string);
    352383  TypeMap["select-molecule-by-id"] = &typeid(molecule);
    353384  TypeMap["select-molecule-of-atom"] = &typeid(atom);
     
    362393  TypeMap["unselect-all-atoms"] = &typeid(void);
    363394  TypeMap["unselect-all-molecules"] = &typeid(void);
     395  TypeMap["unselect-atom-by-element"] = &typeid(const element);
    364396  TypeMap["unselect-atom-by-id"] = &typeid(atom);
     397  TypeMap["unselect-atoms-inside-cuboid"] = &typeid(VectorValue);
     398  TypeMap["unselect-atoms-inside-sphere"] = &typeid(double);
     399  TypeMap["unselect-molecule-by-formula"] = &typeid(std::string);
    365400  TypeMap["unselect-molecule-by-id"] = &typeid(molecule);
    366401  TypeMap["unselect-molecule-of-atom"] = &typeid(atom);
     
    370405
    371406  // value types for the values
     407  TypeMap["angle-x"] = &typeid(double);
     408  TypeMap["angle-y"] = &typeid(double);
     409  TypeMap["angle-z"] = &typeid(double);
    372410  TypeMap["bin-output-file"] = &typeid(std::string);
    373411  TypeMap["bin-end"] = &typeid(double);
     
    378416  TypeMap["distances"] = &typeid(VectorValue);
    379417  TypeMap["DoRotate"] = &typeid(bool);
    380   TypeMap["element"] = &typeid(element);
    381   TypeMap["elements"] = &typeid(std::vector<element *>);
     418  TypeMap["element"] = &typeid(const element);
     419  TypeMap["elements"] = &typeid(std::vector<const element *>);
    382420  TypeMap["end-step"] = &typeid(int);
    383421  TypeMap["id-mapping"] = &typeid(bool);
     
    408446  TypeEnumMap[&typeid(atom)] = Atom;
    409447  TypeEnumMap[&typeid(std::vector<atom *>)] = ListOfAtoms;
    410   TypeEnumMap[&typeid(element)] = Element;
    411   TypeEnumMap[&typeid(std::vector<element *>)] = ListOfElements;
     448  TypeEnumMap[&typeid(const element)] = Element;
     449  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElements;
    412450
    413451  // default values for any action that needs one (always string!)
     
    468506  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-atoms") );
    469507  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-molecules") );
     508  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atom-by-element") );
    470509  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atom-by-id") );
     510  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atoms-inside-cuboid") );
     511  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atoms-inside-sphere") );
    471512  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-by-id") );
     513  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-by-formula") );
    472514  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-of-atom") );
    473515  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecules-atoms") );
    474516  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-all-atoms") );
    475517  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-all-molecules") );
     518  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-atom-by-element") );
    476519  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-atom-by-id") );
     520  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-atoms-inside-cuboid") );
     521  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-atoms-inside-sphere") );
     522  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-molecule-by-formula") );
    477523  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-molecule-by-id") );
    478524  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-molecule-of-atom") );
     
    489535  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "input") );
    490536  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "output") );
    491   MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "remove-sphere") );
    492537  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "repeat-box") );
    493538  MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "scale-box") );
     
    528573  generic.insert("redo");
    529574  generic.insert("remove-atom");
    530   generic.insert("remove-sphere");
    531575  generic.insert("repeat-box");
    532576  generic.insert("rotate-origin");
     
    539583  generic.insert("select-all-atoms");
    540584  generic.insert("select-all-molecules");
     585  generic.insert("select-atom-by-element");
    541586  generic.insert("select-atom-by-id");
     587  generic.insert("select-atoms-inside-cuboid");
     588  generic.insert("select-atoms-inside-sphere");
    542589  generic.insert("select-molecule-by-id");
     590  generic.insert("select-molecule-by-formula");
    543591  generic.insert("select-molecule-of-atom");
    544592  generic.insert("select-molecules-atoms");
     
    552600  generic.insert("unselect-all-atoms");
    553601  generic.insert("unselect-all-molecules");
     602  generic.insert("unselect-atom-by-element");
    554603  generic.insert("unselect-atom-by-id");
     604  generic.insert("unselect-atoms-inside-cuboid");
     605  generic.insert("unselect-atoms-inside-sphere");
     606  generic.insert("unselect-molecule-by-formula");
    555607  generic.insert("unselect-molecule-by-id");
    556608  generic.insert("unselect-molecule-of-atom");
     
    564616
    565617    // hidden arguments
     618  hidden.insert("angle-x");
     619  hidden.insert("angle-y");
     620  hidden.insert("angle-z");
    566621  hidden.insert("bin-end");
    567622  hidden.insert("bin-output-file");
     
    595650}
    596651
     652bool MapOfActions::isCurrentValuePresent(const char *name) const
     653{
     654  return (CurrentValue.find(name) != CurrentValue.end());
     655}
     656
    597657void MapOfActions::queryCurrentValue(const char * name, class atom * &_T)
    598658{
     
    608668}
    609669
    610 void MapOfActions::queryCurrentValue(const char * name, class element * &_T)  {
     670void MapOfActions::queryCurrentValue(const char * name, const element * &_T)  {
    611671  int Z = -1;
    612   if (typeid( element ) == *TypeMap[name]) {
     672  if (typeid(const element ) == *TypeMap[name]) {
    613673    if (CurrentValue.find(name) == CurrentValue.end())
    614674      throw MissingValueException(__FILE__, __LINE__);
     
    692752}
    693753
    694 void MapOfActions::queryCurrentValue(const char * name, std::vector<element *>&_T)
     754void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T)
    695755{
    696756  int Z = -1;
    697   element *elemental = NULL;
    698   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     757  const element *elemental = NULL;
     758  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    699759    if (CurrentValue.find(name) == CurrentValue.end())
    700760      throw MissingValueException(__FILE__, __LINE__);
     
    744804}
    745805
    746 void MapOfActions::setCurrentValue(const char * name, class element * &_T)
    747 {
    748   if (typeid( element ) == *TypeMap[name]) {
     806void MapOfActions::setCurrentValue(const char * name, const element * &_T)
     807{
     808  if (typeid(const element ) == *TypeMap[name]) {
    749809    std::ostringstream stream;
    750     stream << _T->Z;
     810    stream << _T->getAtomicNumber();
    751811    CurrentValue[name] = stream.str();
    752812  } else
     
    804864}
    805865
    806 void MapOfActions::setCurrentValue(const char * name, std::vector<element *>&_T)
    807 {
    808   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     866void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T)
     867{
     868  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    809869    std::ostringstream stream;
    810     for (std::vector<element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
    811       stream << (*iter)->Z << " ";
     870    for (std::vector<const element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
     871      stream << (*iter)->getAtomicNumber() << " ";
    812872    }
    813873    CurrentValue[name] = stream.str();
     
    873933  new SelectionClearAllMoleculesAction();
    874934  new SelectionAllAtomsAction();
     935  new SelectionAllAtomsInsideCuboidAction();
     936  new SelectionAllAtomsInsideSphereAction();
    875937  new SelectionAllAtomsOfMoleculeAction();
    876938  new SelectionAllMoleculesAction();
     939  new SelectionAtomByElementAction();
    877940  new SelectionAtomByIdAction();
    878941  new SelectionMoleculeByIdAction();
     942  new SelectionMoleculeByFormulaAction();
    879943  new SelectionMoleculeOfAtomAction();
    880944  new SelectionNotAllAtomsAction();
     945  new SelectionNotAllAtomsInsideCuboidAction();
     946  new SelectionNotAllAtomsInsideSphereAction();
    881947  new SelectionNotAllAtomsOfMoleculeAction();
    882948  new SelectionNotAllMoleculesAction();
     949  new SelectionNotAtomByElementAction();
    883950  new SelectionNotAtomByIdAction();
     951  new SelectionNotMoleculeByFormulaAction();
    884952  new SelectionNotMoleculeByIdAction();
    885953  new SelectionNotMoleculeOfAtomAction();
     
    895963  new WorldInputAction();
    896964  new WorldOutputAction();
    897   new WorldRemoveSphereOfAtomsAction();
    898965  new WorldRepeatBoxAction();
    899966  new WorldScaleBoxAction();
  • src/Actions/MapOfActions.hpp

    r8006ee r994713  
    163163  void populateActions();
    164164
     165  bool isCurrentValuePresent(const char *name) const;
    165166  void queryCurrentValue(const char * name, class atom * &_T);
    166   void queryCurrentValue(const char * name, class element * &_T);
     167  void queryCurrentValue(const char * name, const element * &_T);
    167168  void queryCurrentValue(const char * name, class molecule * &_T);
    168169  void queryCurrentValue(const char * name, class Box &_T);
    169170  void queryCurrentValue(const char * name, class Vector &_T);
    170171  void queryCurrentValue(const char * name, std::vector<atom *>&_T);
    171   void queryCurrentValue(const char * name, std::vector<element *>&_T);
     172  void queryCurrentValue(const char * name, std::vector<const element *>&_T);
    172173  void queryCurrentValue(const char * name, std::vector<molecule *>&_T);
    173174  template<typename T> void queryCurrentValue(const char * name, T &_T)
     
    198199
    199200  void setCurrentValue(const char * name, class atom * &_T);
    200   void setCurrentValue(const char * name, class element * &_T);
     201  void setCurrentValue(const char * name, const element * &_T);
    201202  void setCurrentValue(const char * name, class molecule * &_T);
    202203  void setCurrentValue(const char * name, class Box &_T);
    203204  void setCurrentValue(const char * name, class Vector &_T);
    204205  void setCurrentValue(const char * name, std::vector<atom *>&_T);
    205   void setCurrentValue(const char * name, std::vector<element *>&_T);
     206  void setCurrentValue(const char * name, std::vector<const element *>&_T);
    206207  void setCurrentValue(const char * name, std::vector<molecule *>&_T);
    207208  template<class T> void setCurrentValue(const char * name, T &_T)
  • src/Actions/MethodAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MethodAction.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/BondFileAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BondFileAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/ChangeNameAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ChangeNameAction.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/FillWithMoleculeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * FillWithMoleculeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * LinearInterpolationofTrajectoriesAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * RotateAroundSelfByAngleAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * RotateToPrincipalAxisSystemAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    8597      Vector x = (*iter)->getPosition();
    8698      x -= *CenterOfGravity;
    87       const double mass = (*iter)->getType()->mass;
     99      const double mass = (*iter)->getType()->getMass();
    88100      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
    89101      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
     
    136148      Vector x = (*iter)->getPosition();
    137149      x -= *CenterOfGravity;
    138       const double mass = (*iter)->getType()->mass;
     150      const double mass = (*iter)->getType()->getMass();
    139151      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
    140152      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
  • src/Actions/MoleculeAction/SaveAdjacencyAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SaveAdjacencyAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/SaveBondsAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SaveBondsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/SaveTemperatureAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SaveTemperatureAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/SuspendInWaterAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SuspendInWaterAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/MoleculeAction/VerletIntegrationAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * VerletIntegrationAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ParserAction/LoadXyzAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * LoadXyzAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    7486  input.open(filename.c_str());
    7587  if (!input.fail()) {
    76     // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include
    77     set <atom*> UniqueList;
    78     {
    79       vector<atom *> ListBefore = World::getInstance().getAllAtoms();
    80       for (vector<atom *>::iterator runner = ListBefore.begin();runner != ListBefore.end(); ++runner)
    81         UniqueList.insert(*runner);
    82     }
    8388    XyzParser parser; // briefly instantiate a parser which is removed at end of focus
    8489    parser.load(&input);
    85     {
    86       vector<atom *> ListAfter = World::getInstance().getAllAtoms();
    87       pair< set<atom *>::iterator, bool > Inserter;
    88       if (UniqueList.size() != ListAfter.size()) { // only create if new atoms have been parsed
    89         MoleculeListClass *molecules = World::getInstance().getMolecules();
    90         molecule *mol = World::getInstance().createMolecule();
    91         molecules->insert(mol);
    92         for (vector<atom *>::iterator runner = ListAfter.begin(); runner != ListAfter.end(); ++runner) {
    93           Inserter = UniqueList.insert(*runner);
    94           if (Inserter.second) { // if not present, then new (just parsed) atom, add ...
    95             cout << "Adding new atom " << **runner << " to new mol." << endl;
    96             mol->AddAtom(*runner);
    97           }
    98         }
    99         mol->doCountAtoms();
    100       } else {
    101         cout << "No atoms parsed?" << endl;
    102       }
    103     }
    10490  } else {
    10591    DoeLog(1) && (eLog() << Verbose(1) << "Could not open file " << filename << "." << endl);
  • src/Actions/ParserAction/SaveXyzAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SaveXyzAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/Process.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Process.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/AllAtomsAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AllAtomsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/AllAtomsOfMoleculeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AllAtomsOfMoleculeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/AllMoleculesAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AllMoleculesAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/AtomByIdAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AtomByIdAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/ClearAllAtomsAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ClearAllAtomsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/ClearAllMoleculesAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ClearAllMoleculesAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/MoleculeByIdAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeByIdAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/MoleculeOfAtomAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeOfAtomAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotAllAtomsAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotAllAtomsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotAllAtomsOfMoleculeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotAllAtomsOfMoleculeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotAllMoleculesAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotAllMoleculesAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotAtomByIdAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotAtomByIdAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotMoleculeByIdAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotMoleculeByIdAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/SelectionAction/NotMoleculeOfAtomAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotMoleculeOfAtomAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ConvexEnvelopeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NonConvexEnvelopeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/ValueStorage.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ValueStorage.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    821
    922#include "ValueStorage.hpp"
    1023#include "Patterns/Singleton_impl.hpp"
    1124
    12 ValueStorage::ValueStorage() {};
     25ValueStorage::ValueStorage() :
     26  MapOfActions_instance(MapOfActions::getInstance())
     27{};
    1328
    1429ValueStorage::~ValueStorage() {};
  • src/Actions/ValueStorage.hpp

    r8006ee r994713  
    88#ifndef VALUESTORAGE_HPP_
    99#define VALUESTORAGE_HPP_
    10 
    1110
    1211#include "Actions/MapOfActions.hpp"
     
    2221
    2322public:
    24   template <typename T> void queryCurrentValue(const char *name, T &_T) {
    25     MapOfActions::getInstance().queryCurrentValue(name, _T);
    26   }
    27   template <typename T> void setCurrentValue(const char *name, T &_T) {
    28     MapOfActions::getInstance().setCurrentValue(name, _T);
     23  /** Gets a value from the storage
     24   * If the value is not present, an ASSERT is thrown unless optional is set to true.
     25   * \param _T key of value
     26   * \param optional whether this value is optional, i.e. may actually not be in the storage (i.e. may return false in this case).
     27   * \return true - value present, false - value not present (only given when optional set to true)
     28   */
     29  template <typename T> bool queryCurrentValue(const char *name, T &_T, const bool optional = false) {
     30    if (optional) {
     31      if (!MapOfActions_instance.isCurrentValuePresent(name))
     32        return false;
     33    }
     34    MapOfActions_instance.queryCurrentValue(name, _T);
     35    return true;
    2936  }
    3037
     38  /** Sets a value in the storage.
     39   * \param name key of value
     40   * \param _T value
     41   */
     42  template <typename T> void setCurrentValue(const char *name, T &_T) {
     43    MapOfActions_instance.setCurrentValue(name, _T);
     44  }
     45
     46  /** Obtain a descriptive text for a given key.
     47   * \param actionname key
     48   * \return text describing the key's contents
     49   */
    3150  std::string getDescription(std::string actionname);
    3251
     
    3453  ValueStorage();
    3554  ~ValueStorage();
     55
     56  MapOfActions &MapOfActions_instance;
    3657};
    3758
  • src/Actions/WorldAction/AddEmptyBoundaryAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AddEmptyBoundaryAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/BoundInBoxAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoundInBoxAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/CenterInBoxAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CenterInBoxAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CenterOnEdgeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/ChangeBoxAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ChangeBoxAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/InputAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * InputAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/OutputAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * OutputAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/RepeatBoxAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * RepeatBoxAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/ScaleBoxAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ScaleBoxAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SetDefaultNameAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    6274
    6375  defaultname = World::getInstance().getDefaultName();
     76  WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname);
    6477  ValueStorage::getInstance().queryCurrentValue(NAME, defaultname);
    6578
    6679  World::getInstance().setDefaultName(defaultname);
    6780  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    68   return Action::success;
     81  return Action::state_ptr(UndoState);
    6982}
    7083
     
    7487  string newName = World::getInstance().getDefaultName();
    7588  World::getInstance().setDefaultName(state->lastName);
     89  DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl);
    7690
    7791  return Action::state_ptr(new WorldSetDefaultNameState(newName));
  • src/Actions/WorldAction/SetGaussianBasisAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SetGaussianBasisAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Actions/WorldAction/SetOutputFormatsAction.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SetOutputFormatsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/BoundaryLineSet.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoundaryLineSet.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "BoundaryLineSet.hpp"
  • src/BoundaryMaps.hpp

    r8006ee r994713  
    2222typedef std::map <int, int> IndexToIndex;
    2323
     24// ============= TesselPoint maps ======================== //
     25typedef std::pair < double, class TesselPoint * > TesselPointDistancePair;
     26typedef std::multimap < double, class TesselPoint * > TesselPointDistanceMap;
     27typedef std::pair < TesselPointDistanceMap::iterator, bool > TesselPointDistanceTestPair;
     28
     29typedef std::list <TesselPoint *> TesselPointList;
     30typedef std::set <TesselPoint *> TesselPointSet;
     31
     32typedef std::list<std::list <TesselPoint *> *> ListOfTesselPointList;
     33
     34// ============= BoundaryPointSet maps ======================== //
    2435typedef std::map < int, class BoundaryPointSet * > PointMap;
    2536typedef std::set < class BoundaryPointSet * > PointSet;
     
    2839typedef std::pair < PointMap::iterator, bool > PointTestPair;
    2940
    30 typedef std::list <class CandidateForTesselation *> CandidateList;
    31 typedef std::map <class BoundaryLineSet *, class CandidateForTesselation *> CandidateMap;
     41typedef std::multimap <double, class BoundaryPointSet * > DistanceToPointMap;
     42typedef std::pair <double, class BoundaryPointSet * > DistanceToPointPair;
    3243
     44// ============= BoundaryLineSet maps ======================== //
    3345typedef std::multimap < int, class BoundaryLineSet * > LineMap;
    3446typedef std::set < class BoundaryLineSet * > LineSet;
     
    3749typedef std::pair < LineMap::iterator, bool > LineTestPair;
    3850
     51// ============= BoundaryTriangleSet maps ======================== //
    3952typedef std::map < int, class BoundaryTriangleSet * > TriangleMap;
    4053typedef std::set < class BoundaryTriangleSet * > TriangleSet;
     
    4356typedef std::pair < TriangleMap::iterator, bool > TriangleTestPair;
    4457
     58// ============= BoundaryPolygonSet maps ======================== //
    4559typedef std::map < int, class BoundaryPolygonSet * > PolygonMap;
    4660typedef std::set < class BoundaryPolygonSet * > PolygonSet;
    4761typedef std::list < class BoundaryPolygonSet * > PolygonList;
    4862
    49 typedef std::multimap <double, class BoundaryPointSet * > DistanceToPointMap;
    50 typedef std::pair <double, class BoundaryPointSet * > DistanceToPointPair;
     63// ============= CandidateForTesselation maps ======================== //
     64typedef std::list <class CandidateForTesselation *> CandidateList;
     65typedef std::map <class BoundaryLineSet *, class CandidateForTesselation *> CandidateMap;
     66
     67// ============= Various maps ======================== //
     68typedef std::map <double, TesselPointDistancePair > Boundaries;
     69typedef std::pair<double, TesselPointDistancePair > BoundariesPair;
     70typedef std::pair< Boundaries::iterator, bool> BoundariesTestPair;
    5171
    5272typedef std::multimap <double, std::pair < PointMap::iterator, PointMap::iterator> > DistanceMultiMap;
    5373typedef std::pair <double, std::pair < PointMap::iterator, PointMap::iterator> > DistanceMultiMapPair;
    54 
    55 typedef std::list <TesselPoint *> TesselPointList;
    56 typedef std::set <TesselPoint *> TesselPointSet;
    57 
    58 typedef std::list<std::list <TesselPoint *> *> ListOfTesselPointList;
    5974
    6075enum centers {Opt, OtherOpt};
  • src/BoundaryPointSet.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoundaryPointSet.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "BoundaryPointSet.hpp"
  • src/BoundaryPolygonSet.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoundaryPolygonSet.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "BoundaryPolygonSet.hpp"
  • src/BoundaryTriangleSet.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoundaryTriangleSet.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "BoundaryTriangleSet.hpp"
  • src/Box.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Box.cpp
     
    613 */
    714
    8 //#include "Helpers/MemDebug.hpp"
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    921
    1022#include "Box.hpp"
  • src/CandidateForTesselation.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CandidateForTesselation.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "CandidateForTesselation.hpp"
  • src/CommandLineParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CommandLineParser.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/ConfigFileBuffer.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ConfigFileBuffer.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "ConfigFileBuffer.hpp"
  • src/Descriptors/AtomDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AtomDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/AtomIdDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AtomIdDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/AtomSelectionDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AtomSelectionDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "Descriptors/AtomSelectionDescriptor.hpp"
  • src/Descriptors/AtomTypeDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AtomTypeDescriptor_impl.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/MoleculeDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/MoleculeFormulaDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeFormulaDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "MoleculeFormulaDescriptor.hpp"
  • src/Descriptors/MoleculeIdDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeIdDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/MoleculeNameDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeNameDescriptor.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "MoleculeNameDescriptor.hpp"
  • src/Descriptors/MoleculePtrDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculePtrDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Descriptors/MoleculeSelectionDescriptor.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeSelectionDescriptor.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "Descriptors/MoleculeSelectionDescriptor.hpp"
  • src/Exceptions/CustomException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CustomException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Exceptions/IllegalTypeException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * IllegalTypeException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "IllegalTypeException.hpp"
  • src/Exceptions/LinearDependenceException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * LinearDependenceException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Exceptions/MathException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MathException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Exceptions/MissingValueException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MissingValueException.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "MissingValueException.hpp"
  • src/Exceptions/NotInvertibleException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * NotInvertibleException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "NotInvertibleException.hpp"
  • src/Exceptions/ParseError.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ParseError.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "ParseError.hpp"
  • src/Exceptions/SkewException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SkewException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Exceptions/ZeroVectorException.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ZeroVectorException.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Formula.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Formula.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
     21
    822#include "Formula.hpp"
    923
     
    4761  for(const_iterator iter=end();iter!=begin();){
    4862    --iter;
    49     sstr << (*iter).first->symbol;
     63    sstr << (*iter).first->getSymbol();
    5064    if((*iter).second>1)
    5165      sstr << (*iter).second;
     
    146160
    147161bool Formula::hasElement(const string &shorthand) const{
    148   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     162  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    149163  return hasElement(element);
    150164}
     
    167181
    168182void Formula::operator+=(const string &shorthand){
    169   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     183  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    170184  operator+=(element);
    171185}
     
    198212
    199213void Formula::operator-=(const string &shorthand){
    200   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     214  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    201215  operator-=(element);
    202216}
     
    220234
    221235void Formula::addElements(const string &shorthand,unsigned int count){
    222   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     236  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    223237  addElements(element,count);
    224238}
     
    252266
    253267const unsigned int Formula::operator[](string shorthand) const{
    254   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     268  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    255269  return operator[](element);
    256270}
     
    380394result_type
    381395Formula::_iterator<result_type>::operator*(){
    382   element *element = World::getInstance().getPeriode()->FindElement(pos+1);
     396  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
    383397  ASSERT(element,"Element with position of iterator not found");
    384398  return make_pair(element,(*set)[pos]);
     
    390404  // no one can keep this value around, so a static is ok to avoid temporaries
    391405  static value_type value=make_pair(reinterpret_cast<element*>(0),0); // no default constructor for std::pair
    392   element *element = World::getInstance().getPeriode()->FindElement(pos+1);
     406  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
    393407  ASSERT(element,"Element with position of iterator not found");
    394408  value = make_pair(element,(*set)[pos]);
  • src/Helpers/Assert.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Assert.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "Helpers/Assert.hpp"
  • src/Helpers/Info.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Info.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Helpers/Log.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * log.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    1830void setVerbosity(int verbosityLevel) {
    1931  logger::getInstance().setVerbosity(verbosityLevel);
     32}
     33
     34/**
     35 * Gets verbosity for the error logger and the standard logger.
     36 *
     37 * \param int verbosity level
     38 */
     39int getVerbosity() {
     40  return logger::getInstance().getVerbosity();
    2041}
    2142
  • src/Helpers/Log.hpp

    r8006ee r994713  
    1515class errorLogger & eLog();
    1616void setVerbosity(int verbosityLevel);
     17int getVerbosity();
    1718bool DoLog(int verbose);
    1819bool DoeLog(int verbose);
  • src/Helpers/Makefile.am

    r8006ee r994713  
    7272        echo "" >  unity.cpp; \
    7373        list='$(HELPERSSOURCE)'; for file in $$list; do \
    74           echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     74          if [ "$$file" != "MemDebug.cpp" ]; then \
     75                  echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     76                fi; \
    7577        done;
    7678       
  • src/Helpers/MemDebug.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MemDebug.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820// NDEBUG implies NO_MEMDEBUG
  • src/Helpers/Verbose.cpp

    r8006ee r994713  
    1 using namespace std;
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
     8/** \file Verbose.cpp
     9 *
     10 * Function implementations for the class Verbose.
     11 *
     12 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    218
    319#include "Helpers/MemDebug.hpp"
     
    622#include "Helpers/Verbose.hpp"
    723#include <iostream>
     24
     25using namespace std;
    826
    927/** Prints the tabs according to verbosity stored in the temporary constructed class.
  • src/Helpers/errorlogger.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * errorLogger.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    4153void errorLogger::setVerbosity(int verbosityLevel) {
    4254  verbosity = verbosityLevel;
     55}
     56
     57/**
     58 * Gets the verbosity.
     59 *
     60 * \return verbosity level
     61 */
     62int errorLogger::getVerbosity()
     63{
     64  return verbosity;
    4365}
    4466
  • src/Helpers/errorlogger.hpp

    r8006ee r994713  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
     27  static int getVerbosity();
    2728
    2829protected:
  • src/Helpers/helpers.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file helpers.cpp
    29 *
    310 * Implementation of some auxiliary functions for memory dis-/allocation and so on
    411 */
     12
     13// include config.h
     14#ifdef HAVE_CONFIG_H
     15#include <config.h>
     16#endif
    517
    618#include "Helpers/MemDebug.hpp"
  • src/Helpers/logger.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * logger.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    4456
    4557/**
     58 * Gets the verbosity.
     59 *
     60 * \return verbosity level
     61 */
     62int logger::getVerbosity()
     63{
     64  return verbosity;
     65}
     66
     67/**
    4668 * Operator for the Binary(arg) call.
    4769 * Constructs temporary a Verbose class object, wherein the Binary is stored.
  • src/Helpers/logger.hpp

    r8006ee r994713  
    2525  static bool DoOutput();
    2626  static void setVerbosity(int verbosityLevel);
     27  static int getVerbosity();
    2728
    2829protected:
  • src/LinearAlgebra/Line.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Line.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/Matrix.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Matrix.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "LinearAlgebra/Matrix.hpp"
     
    108122}
    109123
     124void Matrix::rotation(const double x, const double y, const double z)
     125{
     126  set(0,0, cos(y)*cos(z));
     127  set(0,1, cos(z)*sin(x)*sin(y) - cos(x)*sin(z));
     128  set(0,2, cos(x)*cos(z)*sin(y) + sin(x) * sin(z));
     129  set(1,0, cos(y)*sin(z));
     130  set(1,1, cos(x)*cos(z) + sin(x)*sin(y)*sin(z));
     131  set(1,2, -cos(z)*sin(x) + cos(x)*sin(y)*sin(z));
     132  set(2,0, -sin(y));
     133  set(2,1, cos(y)*sin(x));
     134  set(2,2, cos(x)*cos(y));
     135}
     136
    110137Matrix &Matrix::operator=(const Matrix &src){
    111138  if(&src!=this){
     
    213240
    214241
    215 void Matrix::transpose()
     242Matrix &Matrix::transpose()
    216243{
    217244  double tmp;
     
    219246    for (int j=i+1;j<NDIM;j++) {
    220247      tmp = at(j,i);
     248      at(j,i) = at(i,j);
    221249      at(i,j) = tmp;
    222       at(j,i) = tmp;
    223     }
     250    }
     251  return *this;
    224252}
    225253
     
    253281  gsl_eigen_symmv_free(T);
    254282  gsl_matrix_memcpy(content->content, evec);
     283  gsl_matrix_free(evec);
    255284  Vector evalues(gsl_vector_get(eval,0), gsl_vector_get(eval,1), gsl_vector_get(eval,2));
     285  gsl_vector_free(eval);
    256286  return evalues;
    257287}
     
    315345
    316346Vector operator*(const Matrix &mat,const Vector &vec){
    317   gsl_vector *res = gsl_vector_calloc(NDIM);
    318   gsl_blas_dgemv( CblasNoTrans, 1.0, mat.content->content, vec.content->content, 0.0, res);
    319   VectorContent *content = new VectorContent();
    320   content->content = res;
    321   return Vector(content);
     347  Vector res;
     348  gsl_blas_dgemv( CblasNoTrans, 1.0, mat.content->content, vec.content->content, 0.0, res.content->content);
     349  return res;
    322350}
    323351
  • src/LinearAlgebra/Matrix.hpp

    r8006ee r994713  
    5454   */
    5555  void zero();
     56
     57  /**
     58   * Sets all matrix corresponding to a rotation matrix,
     59   * first around the x-, then the y-, finally the z-axis
     60   * with given angles.
     61   */
     62  void rotation(const double x, const double y, const double z);
    5663
    5764  /**
     
    113120   */
    114121  Matrix transpose() const;
    115   void transpose();
     122  Matrix &transpose();
    116123
    117124  // operators
  • src/LinearAlgebra/Plane.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Plane.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/Space.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Space.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/Vector.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file vector.cpp
    29 *
     
    411 *
    512 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    618
    719#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/VectorInterface.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * VectorInterface.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "VectorInterface.hpp"
  • src/LinearAlgebra/gslmatrix.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * gslmatrix.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/gslvector.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * gslvector.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/linearsystemofequations.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * linearsystemofequations.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/LinearAlgebra/vector_ops.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * vector_ops.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Makefile.am

    r8006ee r994713  
    66ATOMSOURCE = \
    77  atom.cpp \
     8  AtomicInfo.cpp \
    89  atom_atominfo.cpp \
    910  atom_bondedparticle.cpp \
     
    1617ATOMHEADER = \
    1718  atom.hpp \
     19  AtomicInfo.hpp \
    1820  atom_atominfo.hpp \
    1921  atom_bondedparticle.hpp \
     
    7779  Descriptors/AtomIdDescriptor.cpp \
    7880  Descriptors/AtomSelectionDescriptor.cpp \
     81  Descriptors/AtomShapeDescriptor.cpp \
    7982  Descriptors/AtomTypeDescriptor.cpp \
    8083  Descriptors/MoleculeDescriptor.cpp \
     
    8992  Descriptors/AtomIdDescriptor.hpp \
    9093  Descriptors/AtomSelectionDescriptor.hpp \
     94  Descriptors/AtomShapeDescriptor.hpp \
    9195  Descriptors/AtomTypeDescriptor.hpp \
    9296  Descriptors/MoleculeDescriptor.hpp \
     
    371375
    372376$(srcdir)/version.c: $(srcdir)/.git-version
    373         echo "const char *ESPACKVersion = \"$(PACKAGE_NAME) -- git version: "`cat $(srcdir)/.git-version`"\";" > $@
     377        echo "const char *MOLECUILDERVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";" > $@
    374378
    375379
    376380unity.cpp: ${MOLECUILDERSOURCE} ${MOLECUILDERHEADER}
    377         echo "" >  unity.cpp; \
     381        echo "#include \"$(srcdir)/Helpers/MemDebug.cpp\"" >  unity.cpp; \
    378382        list='$(MOLECUILDERSOURCE)'; for file in $$list; do \
    379           echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
     383        echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \
    380384        done; \
    381385        subdirs='$(SUBDIRS)';for directory in $$subdirs; do\
  • src/Parser/ChangeTracker.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ChangeTracker.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
     21
    922#include "Parser/ChangeTracker.hpp"
    1023#include "Patterns/Singleton_impl.hpp"
  • src/Parser/FormatParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * FormatParser.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Parser/FormatParserStorage.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file FormatParserStorage.cpp
    29 *
     
    512 *
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include <iostream>
  • src/Parser/MpqcParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MpqcParser.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "MpqcParser.hpp"
  • src/Parser/PcpParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PcpParser.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
     21
    822#include <iostream>
    923#include <iomanip>
    1024
     25//#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    1126#include "atom.hpp"
    1227#include "config.hpp"
     
    349364  // 4. dissect the molecule into connected subgraphs
    350365  // don't do this here ...
    351   //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
     366  //FragmentationSubgraphDissection();
    352367  //delete(mol);
    353368
     
    490505  PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0;
    491506  for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
    492     PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->NoValenceOrbitals;
     507    PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals();
    493508  }
    494509  cout << PlaneWaveSpecifics.MaxPsiDouble << endl;
     
    525540  // insert all found elements into the map
    526541  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
    527     Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->Z, 1));
     542    Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1));
    528543    if (!Inserter.second) // increase if present
    529544      Inserter.first->second += 1;
     
    540555    const element * const elemental = World::getInstance().getPeriode()->FindElement(iter->first);
    541556    ZtoIndexMap.insert( pair<int,int> (iter->first, counter) );
    542     *file << "Ion_Type" << counter++ << "\t" << iter->second << "\t" << elemental->Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << elemental->mass << "\t" << elemental->name << "\t" << elemental->symbol <<endl;
     557    *file << "Ion_Type" << counter++ << "\t" << iter->second << "\t" << elemental->getAtomicNumber() << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << elemental->getMass() << "\t" << elemental->getName() << "\t" << elemental->getSymbol() <<endl;
    543558  }
    544559}
     
    556571  int nr = 0;
    557572  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
    558     Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->Z, 1) );
     573    Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1) );
    559574    if (!Inserter.second)
    560575      Inserter.first->second += 1;
    561     const int Z = (*AtomRunner)->getType()->Z;
     576    const int Z = (*AtomRunner)->getType()->getAtomicNumber();
    562577    *file << "Ion_Type" << ZtoIndexMap[Z] << "_" << ZtoCountMap[Z] << "\t"  << fixed << setprecision(9) << showpoint;
    563578    *file << (*AtomRunner)->at(0) << "\t" << (*AtomRunner)->at(1) << "\t" << (*AtomRunner)->at(2);
  • src/Parser/TremoloParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TremoloParser.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/Parser/XyzParser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * XyzParser.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    5163  newmol = World::getInstance().createMolecule();
    5264  newmol->ActiveFlag = true;
     65  // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include
    5366  World::getInstance().getMolecules()->insert(newmol);
    5467  for (int i = 0; i < numberOfAtoms; i++) {
     
    8699  vector<atom*> atoms = World::getInstance().getAllAtoms();
    87100  for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
    88     *file << noshowpoint << (*it)->getType()->symbol << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
     101    *file << noshowpoint << (*it)->getType()->getSymbol() << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
    89102  }
    90103}
  • src/Patterns/ObservedContainer_impl.hpp

    r8006ee r994713  
    186186}
    187187
     188/************ Explicit instantiation ***************/
     189
     190#define CONSTRUCT_OBSERVEDCONTAINER(name) \
     191    template ObservedContainer< name >& ObservedContainer< name >::operator=(const ObservedContainer< name >&); \
     192    template ObservedContainer< name >::iterator ObservedContainer< name >::begin(); \
     193    template ObservedContainer< name >::const_iterator ObservedContainer< name >::begin() const; \
     194    template ObservedContainer< name >::iterator ObservedContainer< name >::end(); \
     195    template ObservedContainer< name >::const_iterator ObservedContainer< name >::end() const; \
     196    template ObservedContainer< name >::reverse_iterator ObservedContainer< name >::rbegin(); \
     197    template ObservedContainer< name >::const_reverse_iterator ObservedContainer< name >::rbegin() const; \
     198    template ObservedContainer< name >::reverse_iterator ObservedContainer< name >::rend(); \
     199    template ObservedContainer< name >::const_reverse_iterator ObservedContainer< name >::rend() const; \
     200    template bool ObservedContainer< name >::empty() const; \
     201    template size_t ObservedContainer< name >::size() const; \
     202    template size_t ObservedContainer< name >::max_size() const; \
     203    template ObservedContainer< name >::mapped_type &ObservedContainer< name >::operator[](const key_type&); \
     204    template std::pair<ObservedContainer< name >::iterator,bool> ObservedContainer< name >::insert (const value_type&); \
     205    template size_t ObservedContainer< name >::erase ( const key_type& x ); \
     206    template void ObservedContainer< name >::clear(); \
     207    template ObservedContainer< name >::iterator ObservedContainer< name >::find ( const key_type& x ); \
     208    template ObservedContainer< name >::const_iterator ObservedContainer< name >::find ( const key_type& x ) const; \
     209    template size_t ObservedContainer< name >::count ( const key_type& x ) const; \
     210    template ObservedContainer< name >::internal_iterator ObservedContainer< name >::begin_internal(); \
     211    template ObservedContainer< name >::reverse_internal_iterator ObservedContainer< name >::rbegin_internal(); \
     212    template ObservedContainer< name >::internal_iterator ObservedContainer< name >::end_internal(); \
     213    template ObservedContainer< name >::reverse_internal_iterator ObservedContainer< name >::rend_internal(); \
     214
    188215#endif /* OBSERVEDCONTAINER_IMPL_HPP_ */
  • src/Patterns/Observer.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Observer.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
    1022#include "Observer.hpp"
    11 
    1223
    1324#include <iostream>
  • src/PointCloud.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PointCloud.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "PointCloud.hpp"
  • src/Shapes/BaseShapes.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BaseShapes_impl.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
     21
    822#include "Shapes/BaseShapes.hpp"
    923#include "Shapes/BaseShapes_impl.hpp"
    1024
     25#include <cmath>
     26
     27#include "Helpers/Assert.hpp"
    1128#include "LinearAlgebra/Vector.hpp"
    1229
     
    1431  return point.NormSquared()<=1;
    1532}
     33
     34
     35/**
     36 * algorithm taken from http://www.cgafaq.info/wiki/Evenly_distributed_points_on_sphere
     37 * \param N number of points on surface
     38 */
     39std::vector<Vector> Sphere_impl::getHomogeneousPointsOnSurface(const int N) const {
     40  std::vector<Vector> PointsOnSurface;
     41
     42  const double dlength = M_PI*(3.-sqrt(5.));
     43  double length = 0;
     44  const double dz = 2.0/N;
     45  double z = 1. - dz/2.;
     46  Vector point;
     47  for (int ka = 0; ka<N; ka++){
     48    const double r = sqrt(1.-z*z);
     49    point.Zero();
     50    point[0] = cos(length)*r;
     51    point[1] = sin(length)*r;
     52    point[2] = z;
     53    PointsOnSurface.push_back(point);
     54    z = z - dz;
     55    length = length + dlength;
     56  }
     57
     58  ASSERT(PointsOnSurface.size() == N, "Sphere_impl::getHomogeneousPointsOnSurface() did not create enough points.");
     59  return PointsOnSurface;
     60}
     61
    1662
    1763Shape Sphere(){
     
    2167
    2268bool Cuboid_impl::isInside(const Vector &point){
    23   return point[0]<=1 && point[1]<=1 && point[2]<=1;
     69  return (point[0]>=0 && point[0]<=1) && (point[1]>=0 && point[1]<=1) && (point[2]>=0 && point[2]<=1);
     70}
     71
     72/**
     73 * \param N number of points on surface
     74 */
     75std::vector<Vector> Cuboid_impl::getHomogeneousPointsOnSurface(const int N) const {
     76  std::vector<Vector> PointsOnSurface;
     77  ASSERT(false, "Cuboid_impl::getHomogeneousPointsOnSurface() not implemented yet");
     78  return PointsOnSurface;
    2479}
    2580
    2681Shape Cuboid(){
    27   Shape::impl_ptr impl = Shape::impl_ptr(new Sphere_impl());
     82  Shape::impl_ptr impl = Shape::impl_ptr(new Cuboid_impl());
    2883  return Shape(impl);
    2984}
  • src/Shapes/BaseShapes_impl.hpp

    r8006ee r994713  
    1313class Sphere_impl : public Shape_impl {
    1414  virtual bool isInside(const Vector &point);
     15  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    1516};
    1617
    1718class Cuboid_impl : public Shape_impl {
    1819  virtual bool isInside(const Vector &point);
     20  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    1921};
    2022
  • src/Shapes/Shape.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Shape.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
     21
    822#include "Shape.hpp"
    923#include "Shape_impl.hpp"
     24
     25
     26#include "Helpers/Assert.hpp"
     27#include "LinearAlgebra/Vector.hpp"
    1028
    1129Shape::Shape(const Shape& src) :
     
    1735bool Shape::isInside(const Vector &point) const{
    1836  return impl->isInside(point);
     37}
     38
     39std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const {
     40  return impl->getHomogeneousPointsOnSurface(N);
    1941}
    2042
     
    6587}
    6688
     89std::vector<Vector> AndShape_impl::getHomogeneousPointsOnSurface(const int N) const {
     90  std::vector<Vector> PointsOnSurface_lhs = lhs->getHomogeneousPointsOnSurface(N);
     91  std::vector<Vector> PointsOnSurface_rhs = rhs->getHomogeneousPointsOnSurface(N);
     92  std::vector<Vector> PointsOnSurface;
     93
     94  for (std::vector<Vector>::const_iterator iter = PointsOnSurface_lhs.begin(); iter != PointsOnSurface_lhs.end(); ++iter) {
     95    if (rhs->isInside(*iter))
     96      PointsOnSurface.push_back(*iter);
     97  }
     98  for (std::vector<Vector>::const_iterator iter = PointsOnSurface_rhs.begin(); iter != PointsOnSurface_rhs.end(); ++iter) {
     99    if (lhs->isInside(*iter))
     100      PointsOnSurface.push_back(*iter);
     101  }
     102
     103  return PointsOnSurface;
     104}
     105
     106
    67107Shape operator&&(const Shape &lhs,const Shape &rhs){
    68108  Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs)));
     
    80120bool OrShape_impl::isInside(const Vector &point){
    81121  return rhs->isInside(point) || lhs->isInside(point);
     122}
     123
     124std::vector<Vector> OrShape_impl::getHomogeneousPointsOnSurface(const int N) const {
     125  std::vector<Vector> PointsOnSurface_lhs = lhs->getHomogeneousPointsOnSurface(N);
     126  std::vector<Vector> PointsOnSurface_rhs = rhs->getHomogeneousPointsOnSurface(N);
     127  std::vector<Vector> PointsOnSurface;
     128
     129  for (std::vector<Vector>::const_iterator iter = PointsOnSurface_lhs.begin(); iter != PointsOnSurface_lhs.end(); ++iter) {
     130    if (!rhs->isInside(*iter))
     131      PointsOnSurface.push_back(*iter);
     132  }
     133  for (std::vector<Vector>::const_iterator iter = PointsOnSurface_rhs.begin(); iter != PointsOnSurface_rhs.end(); ++iter) {
     134    if (!lhs->isInside(*iter))
     135      PointsOnSurface.push_back(*iter);
     136  }
     137
     138  return PointsOnSurface;
    82139}
    83140
     
    99156}
    100157
     158std::vector<Vector> NotShape_impl::getHomogeneousPointsOnSurface(const int N) const {
     159  // surfaces are the same, only normal direction is different
     160  return arg->getHomogeneousPointsOnSurface(N);
     161}
     162
    101163Shape operator!(const Shape &arg){
    102164  Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg)));
  • src/Shapes/Shape.hpp

    r8006ee r994713  
    1010
    1111#include <boost/shared_ptr.hpp>
     12
     13#include <vector>
    1214
    1315class Vector;
     
    2527
    2628  bool isInside(const Vector &point) const;
     29  std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    2730
    2831  Shape &operator=(const Shape& rhs);
  • src/Shapes/ShapeOps.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ShapeOps.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "Shapes/ShapeOps.hpp"
     
    2539}
    2640
     41std::vector<Vector> Resize_impl::getHomogeneousPointsOnSurface(const int N) const {
     42  std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
     43  for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
     44    *iter *= size;
     45  }
     46  return PointsOnSurface;
     47}
     48
     49
    2750Shape resize(const Shape &arg,double size){
    2851  Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size));
     
    4063bool Translate_impl::isInside(const Vector& point){
    4164  return arg->isInside(point-offset);
     65}
     66
     67std::vector<Vector> Translate_impl::getHomogeneousPointsOnSurface(const int N) const {
     68  std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
     69  for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
     70    *iter += offset;
     71  }
     72  return PointsOnSurface;
    4273}
    4374
     
    6899}
    69100
     101std::vector<Vector> Stretch_impl::getHomogeneousPointsOnSurface(const int N) const {
     102  std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
     103  for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
     104    (*iter).ScaleAll(reciFactors);
     105  }
     106  return PointsOnSurface;
     107}
     108
    70109Shape stretch(const Shape &arg, const Vector &factors){
    71110  Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors));
     
    87126}
    88127
     128std::vector<Vector> Transform_impl::getHomogeneousPointsOnSurface(const int N) const {
     129  std::vector<Vector> PointsOnSurface = arg->getHomogeneousPointsOnSurface(N);
     130  for(std::vector<Vector>::iterator iter = PointsOnSurface.begin(); iter != PointsOnSurface.end(); ++iter) {
     131    *iter = transformation * (*iter);
     132  }
     133  return PointsOnSurface;
     134}
     135
    89136Shape transform(const Shape &arg, const Matrix &transformation){
    90137  Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation));
  • src/Shapes/ShapeOps_impl.hpp

    r8006ee r994713  
    1919  virtual ~Resize_impl();
    2020  virtual bool isInside(const Vector& point);
     21  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    2122private:
    2223  Shape::impl_ptr arg;
     
    3031  virtual ~Translate_impl();
    3132  virtual bool isInside(const Vector& point);
     33  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    3234private:
    3335  Shape::impl_ptr arg;
     
    4143  virtual ~Stretch_impl();
    4244  virtual bool isInside(const Vector& point);
     45  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    4346private:
    4447  Shape::impl_ptr arg;
     
    5356  virtual ~Transform_impl();
    5457  virtual bool isInside(const Vector& point);
     58  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    5559private:
    5660  Shape::impl_ptr arg;
  • src/Shapes/Shape_impl.hpp

    r8006ee r994713  
    99#define SHAPE_IMPL_HPP_
    1010
     11#include <vector>
     12
    1113#include "Shapes/Shape.hpp"
     14
     15class Vector;
    1216
    1317class Shape_impl {
     
    1620  virtual ~Shape_impl(){};
    1721  virtual bool isInside(const Vector &point)=0;
     22  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const=0;
    1823};
    1924
     
    2328    return true;
    2429  }
     30  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {
     31    std::vector<Vector> PointsOnSurface;
     32    return PointsOnSurface;
     33  }
    2534};
    2635
     
    2837  virtual bool isInside(const Vector &point){
    2938    return false;
     39  }
     40  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const {
     41    std::vector<Vector> PointsOnSurface;
     42    return PointsOnSurface;
    3043  }
    3144};
     
    3649  virtual ~AndShape_impl();
    3750  virtual bool isInside(const Vector &point);
     51  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    3852private:
    3953  Shape::impl_ptr lhs;
     
    4660  virtual ~OrShape_impl();
    4761  virtual bool isInside(const Vector &point);
     62  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    4863private:
    4964  Shape::impl_ptr lhs;
     
    5671  virtual ~NotShape_impl();
    5772  virtual bool isInside(const Vector &point);
     73  virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const;
    5874private:
    5975  Shape::impl_ptr arg;
  • src/TesselPoint.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TesselPoint.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "TesselPoint.hpp"
  • src/ThermoStatContainer.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ThermoStatContainer.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include <cstring>
  • src/UIElements/CommandLineUI/CommandLineDialog.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CommandLineDialog.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/CommandLineUI/CommandLineStatusIndicator.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CommandLineStatusIndicator.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/CommandLineUI/CommandLineUIFactory.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CommandLineUIFactory.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CommandLineWindow.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Dialog.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Dialog.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Dialog.hpp

    r8006ee r994713  
    255255    virtual void setResult();
    256256  protected:
    257     element * tmp;
     257    const element * tmp;
    258258  };
    259259
     
    265265    virtual void setResult();
    266266  protected:
    267     element *temp;
    268     std::vector<element *> tmp;
     267    const element *temp;
     268    std::vector<const element *> tmp;
    269269  };
    270270
  • src/UIElements/MainWindow.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Window.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/ActionMenuItem.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ActionMenuItem.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/DisplayMenuItem.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * DisplayMenuItem.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/Menu.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * Menu.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/MenuItem.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MenuItem.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/QT4/QTMenu.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTMenu.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Menu/QT4/QTMenu.hpp"
    921
    1022#include <Qt/qaction.h>
     23
     24#include "Helpers/MemDebug.hpp"
     25
    1126#include "Menu/MenuItem.hpp"
    1227
  • src/UIElements/Menu/SeperatorItem.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SeperatorItem.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/SubMenuItem.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SubMenuItem.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Menu/TextMenu.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TextMenu.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/QT4/QTDialog.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTDialog.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "UIElements/QT4/QTDialog.hpp"
     
    554566  {
    555567    stringstream sstr;
    556     sstr << (*iter).first << "\t" << (*iter).second->name;
     568    sstr << (*iter).first << "\t" << (*iter).second->getName();
    557569    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
    558570  }
     
    589601  {
    590602    stringstream sstr;
    591     sstr << (*iter).first << "\t" << (*iter).second->name;
     603    sstr << (*iter).first << "\t" << (*iter).second->getName();
    592604    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
    593605  }
     
    816828}
    817829
    818 ElementQTQueryPipe::ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox) :
     830ElementQTQueryPipe::ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox) :
    819831  content(_content),
    820832  dialog(_dialog),
     
    832844}
    833845
    834 ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
     846ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
    835847  content(_content),
    836848  dialog(_dialog),
     
    844856  QVariant data = theBox->itemData(newIndex);
    845857  int idx = data.toInt();
    846   element *elemental = World::getInstance().getPeriode()->FindElement(idx);
     858  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
    847859  if(elemental)
    848860    (*content).push_back(elemental);
  • src/UIElements/QT4/QTDialog.hpp

    r8006ee r994713  
    451451  Q_OBJECT
    452452public:
    453   ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox);
     453  ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox);
    454454  virtual ~ElementQTQueryPipe();
    455455
     
    458458
    459459private:
    460   element **content;
     460  const element **content;
    461461  QTDialog *dialog;
    462462  QComboBox *theBox;
     
    466466  Q_OBJECT
    467467public:
    468   ElementsQTQueryPipe(std::vector<element *>*_content, QTDialog *_dialog, QComboBox *_theBox);
     468  ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox);
    469469  virtual ~ElementsQTQueryPipe();
    470470
     
    473473
    474474private:
    475   std::vector<element *>*content;
     475  std::vector<const element *>*content;
    476476  QTDialog *dialog;
    477477  QComboBox *theBox;
  • src/UIElements/QT4/QTMainWindow.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTMainWindow.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "QTMainWindow.hpp"
     
    1931#include<boost/bind.hpp>
    2032
     33#include "Helpers/MemDebug.hpp"
     34
    2135#include "atom.hpp"
    2236#include "molecule.hpp"
     
    3246#include "Views/QT4/QTMoleculeView.hpp"
    3347#include "Views/QT4/QTStatusBar.hpp"
    34 #include "Helpers/MemDebug.hpp"
    35 
    3648
    3749using namespace std;
  • src/UIElements/QT4/QTUIFactory.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTUIFactory.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include <iostream>
    921#include <cassert>
    1022
    11 using namespace std;
     23#include <qapplication.h>
    1224
    13 #include <qapplication.h>
    1425
    1526#include "UIElements/QT4/QTUIFactory.hpp"
    1627#include "UIElements/QT4/QTMainWindow.hpp"
    1728#include "UIElements/QT4/QTDialog.hpp"
     29
     30#include "Helpers/MemDebug.hpp"
     31
    1832#include "version.h"
    1933#include "defs.hpp"
    20 #include "Helpers/MemDebug.hpp"
     34
     35using namespace std;
    2136
    2237QTUIFactory::QTUIFactory() :
     
    2641  argv = new char*[1];
    2742  argv[0] = new char[256];
    28   strcpy(argv[0],ESPACKVersion);
     43  strcpy(argv[0],MOLECUILDERVERSION);
    2944  app = new QApplication(argc,argv);
    3045}
  • src/UIElements/TextUI/TextDialog.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TextDialog.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    569581  bool badInput=false;
    570582  bool aborted = false;
    571   element * temp = NULL;
     583  const element * temp = NULL;
    572584  do{
    573585    badInput = false;
  • src/UIElements/TextUI/TextStatusIndicator.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TextStatusIndicator.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/TextUI/TextUIFactory.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TextUIFactory.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "UIElements/TextUI/TextUIFactory.hpp"
  • src/UIElements/TextUI/TextWindow.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TextWindow.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    5668  new SeperatorItem(main_menu);
    5769
    58   Action* undoAction = ActionRegistry::getInstance().getActionByName("Undo");
     70  Action* undoAction = ActionRegistry::getInstance().getActionByName("undo");
    5971  new ActionMenuItem('u',"Undo last operation",main_menu,undoAction);
    6072
    61   Action* redoAction = ActionRegistry::getInstance().getActionByName("Redo");
     73  Action* redoAction = ActionRegistry::getInstance().getActionByName("redo");
    6274  new ActionMenuItem('r',"Redo last operation",main_menu,redoAction);
    6375
  • src/UIElements/UIFactory.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * UIFactory.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Views/MethodStringView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MethodStringView.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Views/QT4/GLMoleculeView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * GLMoleculeView.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "GLMoleculeView.hpp"
     21
     22#include "Helpers/MemDebug.hpp"
    923
    1024GLMoleculeView::GLMoleculeView(QWidget *parent) :
  • src/UIElements/Views/QT4/QTMoleculeView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTMoleculeView.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Views/QT4/QTMoleculeView.hpp"
    921
    1022#include <iostream>
     23
     24#include "Helpers/MemDebug.hpp"
     25
    1126#include "molecule.hpp"
    12 
    1327
    1428using namespace std;
  • src/UIElements/Views/QT4/QTStatusBar.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTStatusBar.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include <sstream>
     
    1325
    1426#include "QTStatusBar.hpp"
     27
     28#include "Helpers/MemDebug.hpp"
     29
    1530#include "World.hpp"
    1631#include "Helpers/helpers.hpp"
     
    2136  QStatusBar(_parent),
    2237  Observer("QTStatusBar"),
    23   parent(_parent),
    2438  atomCount(World::getInstance().numAtoms()),
    25   moleculeCount(World::getInstance().numMolecules())
     39  moleculeCount(World::getInstance().numMolecules()),
     40  parent(_parent)
    2641{
    2742  World::getInstance().signOn(this);
  • src/UIElements/Views/QT4/QTWorldView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * QTWorldView.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Views/QT4/QTWorldView.hpp"
    921
    1022#include <iostream>
    1123
     24#include "Helpers/MemDebug.hpp"
     25
    1226#include "atom.hpp"
     27#include "Formula.hpp"
    1328#include "molecule.hpp"
    1429
     
    2035// these attributes are skiped so far
    2136const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX;
    22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms"/*,"Formula"*/,"Center"/*,"Size"*/};
     37const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms","Formula"/*,"Size"*/};
    2338
    2439QTWorldView::QTWorldView(QWidget * _parent) :
     
    6176    const int index = (*iter)->IndexNr;
    6277    QTableWidgetItem *indexWidget = new QTableWidgetItem();
    63     // there probably is an easier method to convert ints to QStrings... but i didn't find it
    64     stringstream idxsstr;
    65     idxsstr << index;
    66     indexWidget->setText(QString(idxsstr.str().c_str()));
     78    indexWidget->setText(QString::number(index));
    6779    indexWidget->setData(Qt::UserRole,QVariant(index));
    6880    setVerticalHeaderItem(i,indexWidget);
     
    7587    const int atomCount = (*iter)->getAtomCount();
    7688    QTableWidgetItem *countWidget= new QTableWidgetItem();
    77     stringstream countsstr;
    78     countsstr << atomCount;
    79     countWidget->setText(QString(countsstr.str().c_str()));
     89    countWidget->setText(QString::number(atomCount));
    8090    countWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    8191    setItem(i,ATOMS,countWidget);
    8292
    83     const Vector center = (*iter)->Center;
    84     QTableWidgetItem *centerWidget = new QTableWidgetItem();
    85     stringstream centersstr;
    86     centersstr << center;
    87     centerWidget->setText(QString(centersstr.str().c_str()));
    88     setItem(i,CENTER,centerWidget);
    89     centerWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
     93    const Formula formula = (*iter)->getFormula();
     94    QTableWidgetItem *formulaWidget= new QTableWidgetItem();
     95    formulaWidget->setText(QString(formula.toString().c_str()));
     96    formulaWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
     97    setItem(i,ATOMS,formulaWidget);
    9098
    9199    molSelection[i]=nameWidget->isSelected();
  • src/UIElements/Views/QT4/QTWorldView.hpp

    r8006ee r994713  
    2828
    2929  static const int COLUMNCOUNT;
    30   enum {NAME,ATOMS,CENTER,COLUMNTYPES_MAX} COLUMNTYPES;
     30  enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES;
    3131  static const char *COLUMNNAMES[];
    3232
  • src/UIElements/Views/StreamStringView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * StreamStringView.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Views/StringView.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * StringView.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/UIElements/Views/View.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * View.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/World.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * World.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    141153void World::destroyMolecule(molecule* mol){
    142154  OBSERVE;
     155  ASSERT(mol,"Molecule that was meant to be destroyed did not exist");
    143156  destroyMolecule(mol->getId());
    144157}
     
    202215      atoms.erase(oldId);
    203216      atoms.insert(pair<atomId_t,atom*>(newId,target));
     217      return true;
     218    }
     219    else{
     220      return false;
     221    }
     222  }
     223}
     224
     225bool World::changeMoleculeId(moleculeId_t oldId, moleculeId_t newId, molecule* target){
     226  OBSERVE;
     227  // in case this call did not originate from inside the atom, we redirect it,
     228  // to also let it know that it has changed
     229  if(!target){
     230    target = molecules[oldId];
     231    ASSERT(target,"Molecule with that ID not found");
     232    return target->changeId(newId);
     233  }
     234  else{
     235    if(reserveMoleculeId(newId)){
     236      molecules.erase(oldId);
     237      molecules.insert(pair<moleculeId_t,molecule*>(newId,target));
    204238      return true;
    205239    }
     
    704738    selectedMolecules(this),
    705739    currMoleculeId(0),
     740    lastMoleculePoolSize(0),
     741    numMoleculeDefragSkips(0),
    706742    molecules_deprecated(new MoleculeListClass(this))
    707743{
     
    740776CONSTRUCT_SINGLETON(World)
    741777
     778CONSTRUCT_OBSERVEDCONTAINER(World::AtomSTLSet)
     779
     780CONSTRUCT_OBSERVEDCONTAINER(World::MoleculeSTLSet)
     781
    742782/******************************* deprecated Legacy Stuff ***********************/
    743783
  • src/World.hpp

    r8006ee r994713  
    7272template<typename> friend class AtomsCalculation;
    7373public:
     74  // some typedefs for the CONSTRUCT_... macros (no "," allows in a single parameter name)
     75  typedef std::map<atomId_t,atom*> AtomSTLSet;
     76  typedef std::map<moleculeId_t,molecule*> MoleculeSTLSet;
    7477
    7578  // Types for Atom and Molecule structures
    76   typedef ObservedContainer<std::map<atomId_t,atom*> > AtomSet;
    77   typedef ObservedContainer<std::map<moleculeId_t,molecule*> > MoleculeSet;
     79  typedef ObservedContainer< AtomSTLSet > AtomSet;
     80  typedef ObservedContainer< MoleculeSTLSet > MoleculeSet;
    7881
    7982  typedef ATOMSET(std::vector) AtomComposite;
     
    217220   */
    218221  bool changeAtomId(atomId_t oldId, atomId_t newId, atom* target=0);
     222
     223  /**
     224   * used when changing an molecule Id.
     225   * Unless you are calling this method from inside an moleucle don't fiddle with the third parameter.
     226   *
     227   * Return value indicates wether the change could be done or not.
     228   */
     229  bool changeMoleculeId(moleculeId_t oldId, moleculeId_t newId, molecule* target=0);
    219230
    220231  /**
  • src/analysis_bonds.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * analysis_bonds.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    138150        molecule::iterator Runner = (*MolRunner)->begin();
    139151        for(;Runner!=(*MolRunner)->end();++Runner){
    140           if (((*Walker)->getType()->Z  == 8) && ((*Runner)->getType()->Z  == 8)) {
     152          if (((*Walker)->getType()->getAtomicNumber()  == 8) && ((*Runner)->getType()->getAtomicNumber()  == 8)) {
    141153            // check distance
    142154            const double distance = (*Runner)->DistanceSquared(*(*Walker));
     
    152164                atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Runner);
    153165                // if hydrogen, check angle to be greater(!) than 30 degrees
    154                 if (OtherAtom->getType()->Z == 1) {
     166                if (OtherAtom->getType()->getAtomicNumber() == 1) {
    155167                  const double angle = CalculateAngle(OtherAtom->getPosition(), (*Runner)->getPosition(), (*Walker)->getPosition());
    156168                  OtherHydrogenFlag = OtherHydrogenFlag && (angle > M_PI*(30./180.) + MYEPSILON);
     
    177189                for (BondList::const_iterator BondRunner = (*Walker)->ListOfBonds.begin(); BondRunner != (*Walker)->ListOfBonds.end(); BondRunner++) {
    178190                  atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Walker);
    179                   if (OtherAtom->getType()->Z == 1) {
     191                  if (OtherAtom->getType()->getAtomicNumber() == 1) {
    180192                    // check angle
    181193                    if (CheckHydrogenBridgeBondAngle(*Walker, OtherAtom, *Runner)) {
     
    215227          if (((OtherAtom->getType() == first) || (OtherAtom->getType() == second)) && (theAtom->nr < OtherAtom->nr)) {
    216228            count++;
    217             DoLog(1) && (Log() << Verbose(1) << first->name << "-" << second->name << " bond found between " << *Walker << " and " << *OtherAtom << "." << endl);
     229            DoLog(1) && (Log() << Verbose(1) << *first << "-" << *second << " bond found between " << *Walker << " and " << *OtherAtom << "." << endl);
    218230          }
    219231        }
     
    262274        if (result) { // check results
    263275          count++;
    264           DoLog(1) && (Log() << Verbose(1) << first->name << "-" << second->name << "-" << third->name << " bond found at " << *Walker << "." << endl);
     276          DoLog(1) && (Log() << Verbose(1) << *first << "-" << *second << "-" << *third << " bond found at " << *Walker << "." << endl);
    265277        }
    266278      }
  • src/analysis_correlation.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * analysis.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    3345 * \return Map of doubles with values the pair of the two atoms.
    3446 */
    35 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements)
     47PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements)
    3648{
    3749  Info FunctionInfo(__func__);
     
    4860
    4961  // create all possible pairs of elements
    50   set <pair<element *, element *> > PairsOfElements;
     62  set <pair<const element *,const element *> > PairsOfElements;
    5163  if (elements.size() >= 2) {
    52     for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
    53       for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
     64    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
     65      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
    5466        if (type1 != type2) {
    55           PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
    56           DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
     67          PairsOfElements.insert( make_pair(*type1,*type2) );
     68          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
    5769        }
    5870  } else if (elements.size() == 1) { // one to all are valid
    59     element *elemental = *elements.begin();
    60     PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
    61     PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
     71    const element *elemental = *elements.begin();
     72    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
     73    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
    6274  } else { // all elements valid
    6375    PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
     
    7486          DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
    7587          if ((*iter)->getId() < (*runner)->getId()){
    76             for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
     88            for (set <pair<const element *, const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
    7789              if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
    7890                distance = domain.periodicDistance((*iter)->getPosition(),(*runner)->getPosition());
     
    95107 * \return Map of doubles with values the pair of the two atoms.
    96108 */
    97 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const int ranges[NDIM] )
     109PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] )
    98110{
    99111  Info FunctionInfo(__func__);
     
    115127
    116128  // create all possible pairs of elements
    117   set <pair<element *, element *> > PairsOfElements;
     129  set <pair<const element *,const element *> > PairsOfElements;
    118130  if (elements.size() >= 2) {
    119     for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
    120       for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
     131    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
     132      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
    121133        if (type1 != type2) {
    122           PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
    123           DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
     134          PairsOfElements.insert( make_pair(*type1,*type2) );
     135          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
    124136        }
    125137  } else if (elements.size() == 1) { // one to all are valid
    126     element *elemental = *elements.begin();
    127     PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
    128     PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
     138    const element *elemental = *elements.begin();
     139    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
     140    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
    129141  } else { // all elements valid
    130142    PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
     
    149161                  DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
    150162                  if ((*iter)->getId() < (*runner)->getId()){
    151                     for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
     163                    for (set <pair<const element *,const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
    152164                      if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
    153165                        periodicOtherX = FullInverseMatrix * ((*runner)->getPosition()); // x now in [0,1)^3
     
    178190 * \return Map of dobules with values as pairs of atom and the vector
    179191 */
    180 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point )
     192CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point )
    181193{
    182194  Info FunctionInfo(__func__);
     
    196208    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    197209      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    198       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     210      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    199211        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    200212          distance = domain.periodicDistance((*iter)->getPosition(),*point);
     
    215227 * \return Map of dobules with values as pairs of atom and the vector
    216228 */
    217 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point, const int ranges[NDIM] )
     229CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] )
    218230{
    219231  Info FunctionInfo(__func__);
     
    237249    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    238250      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    239       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     251      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    240252        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    241253          periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
     
    263275 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
    264276 */
    265 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
     277CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
    266278{
    267279  Info FunctionInfo(__func__);
     
    284296    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    285297      DoLog(3) && (Log() << Verbose(3) << "\tCurrent atom is " << *(*iter) << "." << endl);
    286       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     298      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    287299        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    288300          TriangleIntersectionList Intersections((*iter)->getPosition(),Surface,LC);
     
    309321 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
    310322 */
    311 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
     323CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
    312324{
    313325  Info FunctionInfo(__func__);
     
    335347    for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
    336348      DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
    337       for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
     349      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
    338350        if ((*type == NULL) || ((*iter)->getType() == *type)) {
    339351          periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
  • src/analysis_correlation.hpp

    r8006ee r994713  
    1818#endif
    1919
     20#include <cmath>
    2021#include <fstream>
    2122
     
    4647/********************************************** declarations *******************************/
    4748
    48 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements);
    49 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point );
    50 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC );
    51 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const int ranges[NDIM] );
    52 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point, const int ranges[NDIM] );
    53 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] );
     49PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements);
     50CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point );
     51CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC );
     52PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] );
     53CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] );
     54CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] );
    5455int GetBin ( const double value, const double BinWidth, const double BinStart );
    5556void OutputCorrelation( ofstream * const file, const BinPairMap * const map );
  • src/analyzer.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file analyzer.cpp
    29 *
     
    815//============================ INCLUDES ===========================
    916
     17// include config.h
     18#ifdef HAVE_CONFIG_H
     19#include <config.h>
     20#endif
     21
    1022#include "Helpers/MemDebug.hpp"
    1123
     
    1729#include "periodentafel.hpp"
    1830#include "Helpers/Verbose.hpp"
    19 
    20 // include config.h
    21 #ifdef HAVE_CONFIG_H
    22 #include <config.h>
    23 #endif
    24 
    2531
    2632//============================== MAIN =============================
  • src/atom.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file atom.cpp
    29 *
     
    411 *
    512 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    618
    719#include "Helpers/MemDebug.hpp"
     
    168180bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const
    169181{
    170   AtomNo[getType()->Z]++;  // increment number
     182  AtomNo[getType()->getAtomicNumber()]++;  // increment number
    171183  if (out != NULL) {
    172184    const element *elemental = getType();
    173185    cout << "Looking for atom with element " << *elemental << endl;
    174186    ASSERT(elementLookup.there.find(elemental)!=elementLookup.there.end(),"Type of this atom was not in the formula upon enumeration");
    175     *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental->Z] << "\t"  << fixed << setprecision(9) << showpoint;
     187    *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[elemental->getAtomicNumber()] << "\t"  << fixed << setprecision(9) << showpoint;
    176188    *out << at(0) << "\t" << at(1) << "\t" << at(2);
    177189    *out << "\t" << FixedIon;
     
    194206{
    195207  if (out != NULL) {
    196     *out << getType()->symbol << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;
     208    *out << getType()->getSymbol() << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;
    197209    return true;
    198210  } else
     
    209221bool atom::OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const
    210222{
    211   AtomNo[getType()->Z]++;
    212   if (out != NULL) {
    213     *out << "Ion_Type" << ElementNo[getType()->Z] << "_" << AtomNo[getType()->Z] << "\t"  << fixed << setprecision(9) << showpoint;
     223  AtomNo[getType()->getAtomicNumber()]++;
     224  if (out != NULL) {
     225    *out << "Ion_Type" << ElementNo[getType()->getAtomicNumber()] << "_" << AtomNo[getType()->getAtomicNumber()] << "\t"  << fixed << setprecision(9) << showpoint;
    214226    *out << Trajectory.R.at(step)[0] << "\t" << Trajectory.R.at(step)[1] << "\t" << Trajectory.R.at(step)[2];
    215227    *out << "\t" << FixedIon;
     
    232244{
    233245  if (out != NULL) {
    234     *out << getType()->symbol << "\t";
     246    *out << getType()->getSymbol() << "\t";
    235247    *out << Trajectory.R.at(step)[0] << "\t";
    236248    *out << Trajectory.R.at(step)[1] << "\t";
     
    250262  Vector recentered(getPosition());
    251263  recentered -= *center;
    252   *out << "\t\t" << getType()->symbol << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;
     264  *out << "\t\t" << getType()->getSymbol() << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;
    253265  if (AtomNo != NULL)
    254266    *AtomNo++;
     
    344356}
    345357
     358/** Makes the atom be contained in the new molecule \a *_mol.
     359 * Uses atom::removeFromMolecule() to delist from old molecule.
     360 * \param *_mol pointer to new molecule
     361 */
    346362void atom::setMolecule(molecule *_mol){
    347363  // take this atom from the old molecule
     
    353369}
    354370
    355 molecule* atom::getMolecule(){
     371/** Returns pointer to the molecule which atom belongs to.
     372 * \return containing molecule
     373 */
     374molecule* atom::getMolecule() const {
    356375  return mol;
    357376}
    358377
     378/** Erases the atom in atom::mol's list of atoms and sets it to zero.
     379 */
    359380void atom::removeFromMolecule(){
    360381  if(mol){
  • src/atom.hpp

    r8006ee r994713  
    9292
    9393   void setMolecule(molecule*);
    94    molecule* getMolecule();
     94   molecule* getMolecule() const;
    9595   void removeFromMolecule();
    9696
  • src/atom_atominfo.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_atominfo.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "Helpers/MemDebug.hpp"
    921
  • src/atom_bondedparticle.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_bondedparticle.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    152164  NoBonds = CountBonds();
    153165  //Log() << Verbose(3) << "Walker " << *this << ": " << (int)this->type->NoValenceOrbitals << " > " << NoBonds << "?" << endl;
    154   if ((int)(getType()->NoValenceOrbitals) > NoBonds) { // we have a mismatch, check all bonding partners for mismatch
     166  if ((int)(getType()->getNoValenceOrbitals()) > NoBonds) { // we have a mismatch, check all bonding partners for mismatch
    155167    for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); (++Runner)) {
    156168      OtherWalker = (*Runner)->GetOtherAtom(this);
    157169      OtherNoBonds = OtherWalker->CountBonds();
    158170      //Log() << Verbose(3) << "OtherWalker " << *OtherWalker << ": " << (int)OtherWalker->type->NoValenceOrbitals << " > " << OtherNoBonds << "?" << endl;
    159       if ((int)(OtherWalker->getType()->NoValenceOrbitals) > OtherNoBonds) { // check if possible candidate
     171      if ((int)(OtherWalker->getType()->getNoValenceOrbitals()) > OtherNoBonds) { // check if possible candidate
    160172        if ((CandidateBond == NULL) || (ListOfBonds.size() > OtherWalker->ListOfBonds.size())) { // pick the one with fewer number of bonds first
    161173          CandidateBond = (*Runner);
  • src/atom_bondedparticleinfo.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_bondedparticleinfo.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/atom_graphnode.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_graphnode.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/atom_graphnodeinfo.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_graphnodeinfo.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/atom_particleinfo.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_particleinfo.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/atom_trajectoryparticle.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_trajectoryparticle.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    3850{
    3951  for (int i=NDIM;i--;)
    40     *temperature += getType()->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
     52    *temperature += getType()->getMass() * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];
    4153};
    4254
     
    6577  for(int d=0;d<NDIM;d++) {
    6678    Trajectory.U.at(Step)[d] -= CoGVelocity->at(d);
    67     *ActualTemp += 0.5 * getType()->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
     79    *ActualTemp += 0.5 * getType()->getMass() * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];
    6880  }
    6981};
     
    113125    Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d];
    114126    Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]);     // s(t) = s(0) + v * deltat + 1/2 a * deltat^2
    115     Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->mass);     // F = m * a and s =
     127    Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->getMass());     // F = m * a and s =
    116128  }
    117129  // Update U
    118130  for (int d=0; d<NDIM; d++) {
    119131    Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d];
    120     Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->mass); // v = F/m * t
     132    Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->getMass()); // v = F/m * t
    121133  }
    122134  // Update R (and F)
     
    137149void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const
    138150{
    139   *TotalMass += getType()->mass;  // sum up total mass
     151  *TotalMass += getType()->getMass();  // sum up total mass
    140152  for(int d=0;d<NDIM;d++) {
    141     TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->mass;
     153    TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->getMass();
    142154  }
    143155};
     
    154166    for (int d=0; d<NDIM; d++) {
    155167      U[d] *= ScaleTempFactor;
    156       *ekin += 0.5*getType()->mass * U[d]*U[d];
     168      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    157169    }
    158170};
     
    170182    for (int d=0; d<NDIM; d++) {
    171183      *G += U[d] * F[d];
    172       *E += U[d]*U[d]*getType()->mass;
     184      *E += U[d]*U[d]*getType()->getMass();
    173185    }
    174186};
     
    185197  if (FixedIon == 0) // even FixedIon moves, only not by other's forces
    186198    for (int d=0; d<NDIM; d++) {
    187       U[d] += configuration->Deltat/getType()->mass * ( (G_over_E) * (U[d]*getType()->mass) );
    188       *ekin += getType()->mass * U[d]*U[d];
     199      U[d] += configuration->Deltat/getType()->getMass() * ( (G_over_E) * (U[d]*getType()->getMass()) );
     200      *ekin += getType()->getMass() * U[d]*U[d];
    189201    }
    190202};
     
    198210void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
    199211{
    200   double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
     212  double sigma  = sqrt(configuration->Thermostats->TargetTemp/getType()->getMass()); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
    201213  Vector &U = Trajectory.U.at(Step);
    202214  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     
    211223    }
    212224    for (int d=0; d<NDIM; d++)
    213       *ekin += 0.5*getType()->mass * U[d]*U[d];
     225      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    214226  }
    215227};
     
    227239    for (int d=0; d<NDIM; d++) {
    228240      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
    229       *ekin += 0.5*getType()->mass * U[d]*U[d];
     241      *ekin += 0.5*getType()->getMass() * U[d]*U[d];
    230242    }
    231243  }
     
    241253  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    242254    for (int d=0; d<NDIM; d++) {
    243       *delta_alpha += U[d]*U[d]*getType()->mass;
     255      *delta_alpha += U[d]*U[d]*getType()->getMass();
    244256    }
    245257  }
     
    256268  if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
    257269    for (int d=0; d<NDIM; d++) {
    258         U[d] += configuration->Deltat/getType()->mass * (configuration->Thermostats->alpha * (U[d] * getType()->mass));
    259         *ekin += (0.5*getType()->mass) * U[d]*U[d];
     270        U[d] += configuration->Deltat/getType()->getMass() * (configuration->Thermostats->alpha * (U[d] * getType()->getMass()));
     271        *ekin += (0.5*getType()->getMass()) * U[d]*U[d];
    260272      }
    261273  }
  • src/atom_trajectoryparticle.hpp

    r8006ee r994713  
    2020#include <fstream>
    2121
    22 #include <gsl/gsl_inline.h>
    2322#include <gsl/gsl_randist.h>
    2423
  • src/atom_trajectoryparticleinfo.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atom_trajectoryparticleinfo.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/bond.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file bond.cpp
    29 *
     
    411 *
    512 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    618
    719#include "Helpers/MemDebug.hpp"
     
    5163{
    5264  if ((left != NULL) && (right != NULL)) {
    53     if ((left->getType() != NULL) && (left->getType()->Z == 1))
     65    if ((left->getType() != NULL) && (left->getType()->getAtomicNumber() == 1))
    5466      HydrogenBond++;
    55     if ((right->getType() != NULL) && (right->getType()->Z == 1))
     67    if ((right->getType() != NULL) && (right->getType()->getAtomicNumber() == 1))
    5668      HydrogenBond++;
    5769  }
  • src/bondgraph.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * bondgraph.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    132144
    133145  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    134     if ((*iter)->getType()->CovalentRadius > max_distance)
    135       max_distance = (*iter)->getType()->CovalentRadius;
     146    if ((*iter)->getType()->getCovalentRadius() > max_distance)
     147      max_distance = (*iter)->getType()->getCovalentRadius();
    136148  }
    137149  max_distance *= 2.;
     
    149161void BondGraph::CovalentMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem)
    150162{
    151   MinDistance = OtherWalker->getType()->CovalentRadius + Walker->getType()->CovalentRadius;
     163  MinDistance = OtherWalker->getType()->getCovalentRadius() + Walker->getType()->getCovalentRadius();
    152164  MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
    153165  MaxDistance = MinDistance + BondThreshold;
     
    170182    CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);
    171183  } else {
    172     MinDistance = GetBondLength(Walker->getType()->Z-1, OtherWalker->getType()->Z-1);
     184    MinDistance = GetBondLength(Walker->getType()->getAtomicNumber()-1, OtherWalker->getType()->getAtomicNumber()-1);
    173185    MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem;
    174186    MaxDistance = MinDistance + BondThreshold;
  • src/boundary.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file boundary.cpp
    29 *
    310 * Implementations and super-function for envelopes
    411 */
     12
     13// include config.h
     14#ifdef HAVE_CONFIG_H
     15#include <config.h>
     16#endif
    517
    618#include "Helpers/MemDebug.hpp"
     
    193205      }
    194206    DoLog(1) && (Log() << Verbose(1) << "Inserting " << **iter << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl);
    195       BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, (*iter))));
     207      BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, TesselPointDistancePair (radius, (*iter))));
    196208      if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity
    197209        DoLog(2) && (Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl);
     
    705717  // sum up the atomic masses
    706718  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    707       totalmass += (*iter)->getType()->mass;
     719      totalmass += (*iter)->getType()->getMass();
    708720  }
    709721  DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl);
     
    804816  // Center filler at origin
    805817  filler->CenterEdge(&Inserter);
    806   filler->Center.Zero();
    807818  const int FillerCount = filler->getAtomCount();
    808819  DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl);
  • src/boundary.hpp

    r8006ee r994713  
    11#ifndef BOUNDARY_HPP_
    22#define BOUNDARY_HPP_
    3 
    4 using namespace std;
    53
    64/*********************************************** includes ***********************************/
     
    1816
    1917#include "defs.hpp"
     18#include "BoundaryMaps.hpp"
    2019
    2120/****************************************** forward declarations *****************************/
    2221
    23 class atom;
    2422class BoundaryPointSet;
    2523class BoundaryLineSet;
     
    3028class MoleculeListClass;
    3129class Tesselation;
     30class TesselPoint;
    3231class Vector;
    3332
     
    3837enum { SingleStepWidth=10 };
    3938
    40 typedef std::pair < double, class atom* > DistancePair;
    41 typedef std::multimap < double, class atom* > DistanceMap;
    42 typedef std::pair < DistanceMap::iterator, bool> DistanceTestPair;
    43 
    44 typedef std::map <double, DistancePair > Boundaries;
    45 typedef std::pair<double, DistancePair > BoundariesPair;
    46 typedef std::pair< Boundaries::iterator, bool> BoundariesTestPair;
    47 
    4839/********************************************** declarations *******************************/
    4940
     
    5243void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename);
    5344Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol);
    54 void FindNextSuitablePoint(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
    5545bool FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LC, const double RADIUS, const char *tempbasename);
    5646Boundaries *GetBoundaryPoints(const molecule *mol, Tesselation *&TesselStruct);
  • src/builder.cpp

    r8006ee r994713  
    1 /** \file builder.cpp
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
     8 /** \file builder.cpp
    29 *
    310 *  date: Jan 1, 2007
    411 *  author: heber
     12 *
     13 */
     14
     15/*! \page Copyright notice
     16 *
     17 *  MoleCuilder - to create and alter molecular systems
     18 *  Copyright (C) 2010  University Bonn. All rights reserved.
    519 *
    620 */
     
    5367 *
    5468 */
     69
     70// include config.h
     71#ifdef HAVE_CONFIG_H
     72#include <config.h>
     73#endif
    5574
    5675#include "Helpers/MemDebug.hpp"
     
    127146  std::string BondGraphFileName("\n");
    128147
    129   // print version check whether arguments are present at all
    130   cout << ESPACKVersion << endl;
     148  // print version check and copyright notice
     149  cout << MOLECUILDERVERSION << endl;
     150  cout << "MoleCuilder comes with ABSOLUTELY NO WARRANTY; for details type" << endl;
     151  cout << "`molecuilder --help-warranty'." << endl;
     152  cout << "`MoleCuilder - to create and alter molecular systems." << endl;
     153  cout << "Copyright (C) 2010  University Bonn. All rights reserved." << endl;
    131154
    132155  setVerbosity(0);
     
    166189      #else
    167190        DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl);
    168         cout << ESPACKVersion << endl;
     191        cout << MOLECUILDERVERSION << endl;
    169192        UIFactory::registerFactory(new TextUIFactory::description());
    170193        UIFactory::makeUserInterface("Text");
  • src/config.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file config.cpp
    29 *
     
    512 */
    613
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
     18
    719#include "Helpers/MemDebug.hpp"
    820
     
    1022#include <cstring>
    1123
     24//#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
    1225#include "atom.hpp"
    1326#include "bond.hpp"
     
    471484      ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical);
    472485      elementhash[i] = periode->FindElement(Z);
    473       DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl);
     486      DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->getAtomicNumber() << " with " << No[i] << " ions." << endl);
    474487      NoAtoms += No[i];
    475488    }
     
    851864  // 4. dissect the molecule into connected subgraphs
    852865  // don't do this here ...
    853   //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);
     866  //FragmentationSubgraphDissection();
    854867  //delete(mol);
    855868
     
    13391352    AtomNo = 0;
    13401353    for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) {
    1341       sprintf(name, "%2s%2d",(*iter)->getType()->symbol, elementNo[(*iter)->getType()->Z]);
    1342       elementNo[(*iter)->getType()->Z] = (elementNo[(*iter)->getType()->Z]+1) % 100;   // confine to two digits
     1354      sprintf(name, "%2s%2d",(*iter)->getType()->getSymbol().c_str(), elementNo[(*iter)->getType()->getAtomicNumber()]);
     1355      elementNo[(*iter)->getType()->getAtomicNumber()] = (elementNo[(*iter)->getType()->getAtomicNumber()]+1) % 100;   // confine to two digits
    13431356      fprintf(f,
    13441357             "ATOM %6u %-4s %4s%c%4u    %8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s%2s\n",
     
    13511364             (*iter)->at(1),                 /* position Y in Angstroem */
    13521365             (*iter)->at(2),                 /* position Z in Angstroem */
    1353              (double)(*iter)->getType()->Valence,         /* occupancy */
    1354              (double)(*iter)->getType()->NoValenceOrbitals,          /* temperature factor */
     1366             (double)(*iter)->getType()->getValence(),         /* occupancy */
     1367             (double)(*iter)->getType()->getNoValenceOrbitals(),          /* temperature factor */
    13551368             "0",            /* segment identifier */
    1356              (*iter)->getType()->symbol,    /* element symbol */
     1369             (*iter)->getType()->getSymbol().c_str(),    /* element symbol */
    13571370             "0");           /* charge */
    13581371      AtomNo++;
     
    13921405  AtomNo = 0;
    13931406  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    1394     sprintf(name, "%2s%2d",(*iter)->getType()->symbol, elementNo[(*iter)->getType()->Z]);
    1395     elementNo[(*iter)->getType()->Z] = (elementNo[(*iter)->getType()->Z]+1) % 100;   // confine to two digits
     1407    sprintf(name, "%2s%2d",(*iter)->getType()->getSymbol().c_str(), elementNo[(*iter)->getType()->getAtomicNumber()]);
     1408    elementNo[(*iter)->getType()->getAtomicNumber()] = (elementNo[(*iter)->getType()->getAtomicNumber()]+1) % 100;   // confine to two digits
    13961409    fprintf(f,
    13971410           "ATOM %6u %-4s %4s%c%4u    %8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s%2s\n",
     
    14041417           (*iter)->at(1),                 /* position Y in Angstroem */
    14051418           (*iter)->at(2),                 /* position Z in Angstroem */
    1406            (double)(*iter)->getType()->Valence,         /* occupancy */
    1407            (double)(*iter)->getType()->NoValenceOrbitals,          /* temperature factor */
     1419           (double)(*iter)->getType()->getValence(),         /* occupancy */
     1420           (double)(*iter)->getType()->getNoValenceOrbitals(),          /* temperature factor */
    14081421           "0",            /* segment identifier */
    1409            (*iter)->getType()->symbol,    /* element symbol */
     1422           (*iter)->getType()->getSymbol().c_str(),    /* element symbol */
    14101423           "0");           /* charge */
    14111424    AtomNo++;
     
    14511464    *output << 0 << "\t";
    14521465    *output << (*iter)->at(0) << "\t" << (*iter)->at(1) << "\t" << (*iter)->at(2) << "\t";
    1453     *output << static_cast<double>((*iter)->getType()->Valence) << "\t";
    1454     *output << (*iter)->getType()->symbol << "\t";
     1466    *output << static_cast<double>((*iter)->getType()->getValence()) << "\t";
     1467    *output << (*iter)->getType()->getSymbol() << "\t";
    14551468    for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)
    14561469      *output << (*runner)->GetOtherAtom(*iter)->nr << "\t";
     
    15231536        *output << MolCounter+1 << "\t";
    15241537        *output << (*iter)->at(0) << "\t" << (*iter)->at(1) << "\t" << (*iter)->at(2) << "\t";
    1525         *output << (double)(*iter)->getType()->Valence << "\t";
    1526         *output << (*iter)->getType()->symbol << "\t";
     1538        *output << (double)(*iter)->getType()->getValence() << "\t";
     1539        *output << (*iter)->getType()->getSymbol() << "\t";
    15271540        for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)
    15281541          *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ] << "\t";
     
    15861599    for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) {
    15871600      src[N++] = (*ListRunner)->IndexNr;
    1588       (*ListRunner)->Translate(&(*ListRunner)->Center);
    15891601    }
    15901602    mol = World::getInstance().createMolecule();
    15911603    mol->SetNameFromFilename(ConfigFileName);
    1592     molecules->SimpleMultiMerge(mol, src, N);
    15931604    //mol->CalculateOrbitals(*this);
    15941605    delete[](src);
  • src/datacreator.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file datacreator.cpp
    29 *
     
    613
    714//============================ INCLUDES ===========================
     15
     16// include config.h
     17#ifdef HAVE_CONFIG_H
     18#include <config.h>
     19#endif
    820
    921#include "Helpers/MemDebug.hpp"
  • src/defs.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * defs.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
     20#include "Helpers/MemDebug.hpp"
    721
    822#include "defs.hpp"
  • src/element.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file element.cpp
    29 *
     
    512 */
    613
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
     18
    719#include "Helpers/MemDebug.hpp"
    820
     
    1022#include <fstream>
    1123
     24#include "Helpers/Assert.hpp"
    1225#include "element.hpp"
    1326
     
    2336  VanDerWaalsRadius(0),
    2437        Z(-1),
    25         previous(NULL),
    26         next(NULL),
    27         sort(NULL),
    2838        Valence(0),
    2939        NoValenceOrbitals(0)
     
    3141};
    3242
     43element::element(const element &src) :
     44  mass(src.mass),
     45  CovalentRadius(src.CovalentRadius),
     46  VanDerWaalsRadius(src.VanDerWaalsRadius),
     47  Z(src.Z),
     48  Valence(src.Valence),
     49  NoValenceOrbitals(src.NoValenceOrbitals),
     50  name(src.name),
     51  symbol(src.symbol)
     52{
     53  period = src.period;
     54  group = src.group;
     55  block = src.block;
     56}
     57
    3358/** Destructor of class element.
    3459 */
    3560element::~element() {};
     61
     62element &element::operator=(const element &src){
     63  if(this!=&src){
     64    mass=src.mass;
     65    CovalentRadius=src.CovalentRadius;
     66    VanDerWaalsRadius=src.VanDerWaalsRadius;
     67    Z=src.Z;
     68    Valence=src.Valence;
     69    NoValenceOrbitals=src.NoValenceOrbitals;
     70    name=src.name;
     71    symbol=src.symbol;
     72    period = src.period;
     73    group = src.group;
     74    block = src.block;
     75  }
     76  return *this;
     77}
    3678
    3779/** Prints element data to \a *out.
     
    66108}
    67109
    68 string element::getSymbol() const{
    69   return string(symbol);
     110double element::getMass() const
     111{
     112  return mass;
    70113}
    71114
    72 std::string element::getName() const{
    73   return string(name);
     115double element::getCovalentRadius() const
     116{
     117  return CovalentRadius;
     118}
     119
     120double element::getVanDerWaalsRadius() const
     121{
     122  return VanDerWaalsRadius;
     123}
     124
     125int element::getAtomicNumber() const
     126{
     127  return Z;
     128}
     129
     130double element::getValence() const
     131{
     132  return Valence;
     133}
     134
     135int element::getNoValenceOrbitals() const
     136{
     137  return NoValenceOrbitals;
     138}
     139
     140double element::getHBondDistance(const int i) const
     141{
     142  ASSERT((i>=0) && (i<3), "Access to element::HBondDistance out of bounds.");
     143  return HBondDistance[i];
     144}
     145
     146double element::getHBondAngle(const int i) const
     147{
     148  ASSERT((i>=0) && (i<3), "Access to element::HBondAngle out of bounds.");
     149  return HBondAngle[i];
     150}
     151
     152string &element::getSymbol(){
     153  return symbol;
     154}
     155
     156const string &element::getSymbol() const{
     157  return symbol;
     158}
     159
     160void element::setSymbol(const std::string &temp)
     161{
     162  symbol = temp;
     163}
     164
     165std::string &element::getName(){
     166  return name;
     167}
     168
     169const std::string &element::getName() const{
     170  return name;
     171}
     172
     173void element::setName(const std::string &temp)
     174{
     175  name = temp;
    74176}
    75177
  • src/element.hpp

    r8006ee r994713  
    2222#include "types.hpp"
    2323
     24class periodentafel;
     25
    2426/********************************************** declarations *******************************/
    2527
     
    2830 */
    2931class element {
     32  friend class periodentafel;
    3033  public:
     34    element();
     35    element(const element&);
     36    ~element();
     37
     38    element &operator=(const element&);
     39
     40    // accessor functions
     41    atomicNumber_t getNumber() const;
     42    double getMass() const;
     43    double getCovalentRadius() const;
     44    double getVanDerWaalsRadius() const;
     45    int getAtomicNumber() const;
     46    double getValence() const;
     47    int getNoValenceOrbitals() const;
     48    double getHBondDistance(const int i) const;
     49    double getHBondAngle(const int i) const;
     50
     51    std::string &getSymbol();
     52    const std::string &getSymbol() const;
     53    void setSymbol(const std::string &temp);
     54
     55    std::string &getName();
     56    const std::string &getName() const;
     57    void setName(const std::string &temp);
     58
     59    //> print element entries to screen
     60    bool Output(std::ostream * const out) const;
     61    bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
     62
     63  private:
    3164    double mass;    //!< mass in g/mol
    3265    double CovalentRadius;  //!< covalent radius
    3366    double VanDerWaalsRadius;  //!< can-der-Waals radius
    3467    int Z;          //!< atomic number
    35     char name[64];  //!< atom name, i.e. "Hydrogren"
    36     char symbol[3]; //!< short form of the atom, i.e. "H"
    37     char period[8];    //!< period: n quantum number
    38     char group[8];    //!< group: l quantum number
    39     char block[8];    //!< block: l quantum number
    40     element *previous;  //!< previous item in list
    41     element *next;  //!< next element in list
    42     int *sort;      //!< sorc criteria
     68    std::string period;    //!< period: n quantum number
     69    std::string group;    //!< group: l quantum number
     70    std::string block;    //!< block: l quantum number
    4371    double Valence;   //!< number of valence electrons for this element
    4472    int NoValenceOrbitals;  //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
     
    4674    double HBondAngle[NDIM];     //!< typical angle for one, two, three bonded hydrogen (in degrees)
    4775
    48   element();
    49   ~element();
    50 
    51   // accessor functions
    52   atomicNumber_t getNumber() const;
    53   std::string getSymbol() const;
    54   std::string getName() const;
    55 
    56   //> print element entries to screen
    57   bool Output(std::ostream * const out) const;
    58   bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
    59 
    60   private:
     76    std::string name;  //!< atom name, i.e. "Hydrogen"
     77    std::string symbol; //!< short form of the atom, i.e. "H"
    6178};
    6279
  • src/elements_db.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * elements_db.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/ellipsoid.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ellipsoid.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/graph.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file graph.cpp
    29 *
     
    411 *
    512 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    618
    719#include "Helpers/MemDebug.hpp"
  • src/joiner.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file joiner.cpp
    29 *
     
    714
    815//============================ INCLUDES ===========================
     16
     17// include config.h
     18#ifdef HAVE_CONFIG_H
     19#include <config.h>
     20#endif
    921
    1022#include "Helpers/MemDebug.hpp"
  • src/leastsquaremin.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * leastsquaremin.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/linkedcell.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file linkedcell.cpp
    29 *
     
    411 *
    512 */
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    618
    719#include "Helpers/MemDebug.hpp"
     
    2335LinkedCell::LinkedCell() :
    2436  LC(NULL),
    25   index(-1),
    26   RADIUS(0.)
     37  RADIUS(0.),
     38  index(-1)
    2739{
    2840  for(int i=0;i<NDIM;i++)
     
    3749 */
    3850LinkedCell::LinkedCell(const PointCloud * const set, const double radius) :
     51  LC(NULL),
    3952  RADIUS(radius),
    40   LC(NULL),
    4153  index(-1)
    4254{
     
    113125 */
    114126LinkedCell::LinkedCell(LinkedNodes *set, const double radius) :
     127  LC(NULL),
    115128  RADIUS(radius),
    116   LC(NULL),
    117129  index(-1)
    118130{
  • src/molecule.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file molecules.cpp
    29 *
     
    512 */
    613
     14// include config.h
    715#ifdef HAVE_CONFIG_H
    816#include <config.h>
     
    8997}
    9098
     99bool molecule::changeId(moleculeId_t newId){
     100  // first we move ourselves in the world
     101  // the world lets us know if that succeeded
     102  if(World::getInstance().changeMoleculeId(id,newId,this)){
     103    id = newId;
     104    return true;
     105  }
     106  else{
     107    return false;
     108  }
     109}
     110
     111
    91112moleculeId_t molecule::getId(){
    92113  return id;
     
    213234    pointer->sort = &pointer->nr;
    214235    if (pointer->getType() != NULL) {
    215       formula += pointer->getType();
    216       if (pointer->getType()->Z != 1)
     236      if (pointer->getType()->getAtomicNumber() != 1)
    217237        NoNonHydrogen++;
    218238      if(pointer->getName() == "Unknown"){
    219239        stringstream sstr;
    220         sstr << pointer->getType()->symbol << pointer->nr+1;
     240        sstr << pointer->getType()->getSymbol() << pointer->nr+1;
    221241        pointer->setName(sstr.str());
    222242      }
     
    239259  if (pointer != NULL) {
    240260    atom *walker = pointer->clone();
    241     formula += walker->getType();
    242261    walker->setName(pointer->getName());
    243262    walker->nr = last_atom++;  // increase number within molecule
    244263    insert(walker);
    245     if ((pointer->getType() != NULL) && (pointer->getType()->Z != 1))
     264    if ((pointer->getType() != NULL) && (pointer->getType()->getAtomicNumber() != 1))
    246265      NoNonHydrogen++;
    247266    retval=walker;
     
    329348  // get typical bond length and store as scale factor for later
    330349  ASSERT(TopOrigin->getType() != NULL, "AddHydrogenReplacementAtom: element of TopOrigin is not given.");
    331   BondRescale = TopOrigin->getType()->HBondDistance[TopBond->BondDegree-1];
     350  BondRescale = TopOrigin->getType()->getHBondDistance(TopBond->BondDegree-1);
    332351  if (BondRescale == -1) {
    333352    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     
    346365      FirstOtherAtom->AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity
    347366      FirstOtherAtom->FixedIon = TopReplacement->FixedIon;
    348       if (TopReplacement->getType()->Z == 1) { // neither rescale nor replace if it's already hydrogen
     367      if (TopReplacement->getType()->getAtomicNumber() == 1) { // neither rescale nor replace if it's already hydrogen
    349368        FirstOtherAtom->father = TopReplacement;
    350369        BondRescale = bondlength;
     
    415434      FirstOtherAtom->father = NULL;  // we are just an added hydrogen with no father
    416435      SecondOtherAtom->father = NULL;  //  we are just an added hydrogen with no father
    417       bondangle = TopOrigin->getType()->HBondAngle[1];
     436      bondangle = TopOrigin->getType()->getHBondAngle(1);
    418437      if (bondangle == -1) {
    419438        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     
    491510
    492511      // create correct coordination for the three atoms
    493       alpha = (TopOrigin->getType()->HBondAngle[2])/180.*M_PI/2.;  // retrieve triple bond angle from database
     512      alpha = (TopOrigin->getType()->getHBondAngle(2))/180.*M_PI/2.;  // retrieve triple bond angle from database
    494513      l = BondRescale;        // desired bond length
    495514      b = 2.*l*sin(alpha);    // base length of isosceles triangle
     
    699718  atom1->RegisterBond(Binder);
    700719  atom2->RegisterBond(Binder);
    701   if ((atom1->getType() != NULL) && (atom1->getType()->Z != 1) && (atom2->getType() != NULL) && (atom2->getType()->Z != 1))
     720  if ((atom1->getType() != NULL) && (atom1->getType()->getAtomicNumber() != 1) && (atom2->getType() != NULL) && (atom2->getType()->getAtomicNumber() != 1))
    702721    NoNonBonds++;
    703722
     
    765784};
    766785
    767 /** Removes atom from molecule list and deletes it.
     786/** Removes atom from molecule list and removes all of its bonds.
    768787 * \param *pointer atom to be removed
    769788 * \return true - succeeded, false - atom not found in list
     
    773792  ASSERT(pointer, "Null pointer passed to molecule::RemoveAtom().");
    774793  OBSERVE;
    775   formula-=pointer->getType();
    776794  RemoveBonds(pointer);
    777795  erase(pointer);
     
    787805  if (pointer == NULL)
    788806    return false;
    789   formula-=pointer->getType();
    790807  erase(pointer);
    791808  return true;
     
    798815{
    799816  for (molecule::iterator iter = begin(); !empty(); iter = begin())
    800       erase(iter);
     817    erase(*iter);
    801818  return empty();
    802819};
     
    895912        ElementNo[i] = 0;
    896913      }
    897       SetIndexedArrayForEachAtomTo ( ElementNo, &element::Z, &AbsoluteValue, 1);
     914      for(molecule::iterator iter = begin(); iter != end(); ++iter) {
     915        ElementNo[(*iter)->getType()->getAtomicNumber()] = 1;
     916      }
    898917      int current=1;
    899918      for (int i=0;i<MAX_ELEMENTS;++i) {
     
    969988  for (molecule::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
    970989    (*iter)->nr = i;   // update number in molecule (for easier referencing in FragmentMolecule lateron)
    971     if ((*iter)->getType()->Z != 1) // count non-hydrogen atoms whilst at it
     990    if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it
    972991      NoNonHydrogen++;
    973992    stringstream sstr;
    974     sstr << (*iter)->getType()->symbol << (*iter)->nr+1;
     993    sstr << (*iter)->getType()->getSymbol() << (*iter)->nr+1;
    975994    (*iter)->setName(sstr.str());
    976995    DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->getName() << "." << endl);
     
    978997  }
    979998  return res;
    980 };
    981 
    982 /** Determines whether two molecules actually contain the same atoms and coordination.
    983  * \param *out output stream for debugging
    984  * \param *OtherMolecule the molecule to compare this one to
    985  * \param threshold upper limit of difference when comparing the coordination.
    986  * \return NULL - not equal, otherwise an allocated (molecule::AtomCount) permutation map of the atom numbers (which corresponds to which)
    987  */
    988 int * molecule::IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold)
    989 {
    990   int flag;
    991   double *Distances = NULL, *OtherDistances = NULL;
    992   Vector CenterOfGravity, OtherCenterOfGravity;
    993   size_t *PermMap = NULL, *OtherPermMap = NULL;
    994   int *PermutationMap = NULL;
    995   bool result = true; // status of comparison
    996 
    997   DoLog(3) && (Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl);
    998   /// first count both their atoms and elements and update lists thereby ...
    999   //Log() << Verbose(0) << "Counting atoms, updating list" << endl;
    1000 
    1001   /// ... and compare:
    1002   /// -# AtomCount
    1003   if (result) {
    1004     if (getAtomCount() != OtherMolecule->getAtomCount()) {
    1005       DoLog(4) && (Log() << Verbose(4) << "AtomCounts don't match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl);
    1006       result = false;
    1007     } else Log() << Verbose(4) << "AtomCounts match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl;
    1008   }
    1009   /// -# Formula
    1010   if (result) {
    1011     if (formula != OtherMolecule->formula) {
    1012       DoLog(4) && (Log() << Verbose(4) << "Formulas don't match: " << formula << " == " << OtherMolecule->formula << endl);
    1013       result = false;
    1014     } else Log() << Verbose(4) << "Formulas match: " << formula << " == " << OtherMolecule->formula << endl;
    1015   }
    1016   /// then determine and compare center of gravity for each molecule ...
    1017   if (result) {
    1018     DoLog(5) && (Log() << Verbose(5) << "Calculating Centers of Gravity" << endl);
    1019     DeterminePeriodicCenter(CenterOfGravity);
    1020     OtherMolecule->DeterminePeriodicCenter(OtherCenterOfGravity);
    1021     DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: " << CenterOfGravity << endl);
    1022     DoLog(5) && (Log() << Verbose(5) << "Other Center of Gravity: " << OtherCenterOfGravity << endl);
    1023     if (CenterOfGravity.DistanceSquared(OtherCenterOfGravity) > threshold*threshold) {
    1024       DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl);
    1025       result = false;
    1026     }
    1027   }
    1028 
    1029   /// ... then make a list with the euclidian distance to this center for each atom of both molecules
    1030   if (result) {
    1031     DoLog(5) && (Log() << Verbose(5) << "Calculating distances" << endl);
    1032     Distances = new double[getAtomCount()];
    1033     OtherDistances = new double[getAtomCount()];
    1034     SetIndexedArrayForEachAtomTo ( Distances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
    1035     SetIndexedArrayForEachAtomTo ( OtherDistances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
    1036     for(int i=0;i<getAtomCount();i++) {
    1037       Distances[i] = 0.;
    1038       OtherDistances[i] = 0.;
    1039     }
    1040 
    1041     /// ... sort each list (using heapsort (o(N log N)) from GSL)
    1042     DoLog(5) && (Log() << Verbose(5) << "Sorting distances" << endl);
    1043     PermMap = new size_t[getAtomCount()];
    1044     OtherPermMap = new size_t[getAtomCount()];
    1045     for(int i=0;i<getAtomCount();i++) {
    1046       PermMap[i] = 0;
    1047       OtherPermMap[i] = 0;
    1048     }
    1049     gsl_heapsort_index (PermMap, Distances, getAtomCount(), sizeof(double), CompareDoubles);
    1050     gsl_heapsort_index (OtherPermMap, OtherDistances, getAtomCount(), sizeof(double), CompareDoubles);
    1051     PermutationMap = new int[getAtomCount()];
    1052     for(int i=0;i<getAtomCount();i++)
    1053       PermutationMap[i] = 0;
    1054     DoLog(5) && (Log() << Verbose(5) << "Combining Permutation Maps" << endl);
    1055     for(int i=getAtomCount();i--;)
    1056       PermutationMap[PermMap[i]] = (int) OtherPermMap[i];
    1057 
    1058     /// ... and compare them step by step, whether the difference is individually(!) below \a threshold for all
    1059     DoLog(4) && (Log() << Verbose(4) << "Comparing distances" << endl);
    1060     flag = 0;
    1061     for (int i=0;i<getAtomCount();i++) {
    1062       DoLog(5) && (Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " <<  threshold << endl);
    1063       if (fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) > threshold*threshold)
    1064         flag = 1;
    1065     }
    1066 
    1067     // free memory
    1068     delete[](PermMap);
    1069     delete[](OtherPermMap);
    1070     delete[](Distances);
    1071     delete[](OtherDistances);
    1072     if (flag) { // if not equal
    1073       delete[](PermutationMap);
    1074       result = false;
    1075     }
    1076   }
    1077   /// return pointer to map if all distances were below \a threshold
    1078   DoLog(3) && (Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl);
    1079   if (result) {
    1080     DoLog(3) && (Log() << Verbose(3) << "Result: Equal." << endl);
    1081     return PermutationMap;
    1082   } else {
    1083     DoLog(3) && (Log() << Verbose(3) << "Result: Not equal." << endl);
    1084     return NULL;
    1085   }
    1086999};
    10871000
  • src/molecule.hpp

    r8006ee r994713  
    104104    double BondDistance;  //!< typical bond distance used in CreateAdjacencyList() and furtheron
    105105    bool ActiveFlag;    //!< in a MoleculeListClass used to discern active from inactive molecules
    106     Vector Center;      //!< Center of molecule in a global box
     106    //Vector Center;      //!< Center of molecule in a global box
    107107    int IndexNr;        //!< index of molecule in a MoleculeListClass
    108108    char name[MAXSTRINGSIZE];         //!< arbitrary name
     
    141141  bool hasElement(const std::string&) const;
    142142
     143  virtual bool changeId(atomId_t newId);
    143144
    144145  iterator begin();
     
    324325
    325326  // Recognize doubly appearing molecules in a list of them
    326   int * IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold);
    327327  int * GetFatherSonAtomicMap(molecule *OtherMolecule);
    328328
     
    368368  void Enumerate(ostream *out);
    369369  void Output(ofstream *out);
    370   void DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration);
    371370  int CountAllAtoms() const;
    372371
     
    379378  void parseXYZIntoMolecule();
    380379  void eraseMolecule();
    381 
    382 
    383   // merging of molecules
    384   bool SimpleMerge(molecule *mol, molecule *srcmol);
    385   bool SimpleAdd(molecule *mol, molecule *srcmol);
    386   bool SimpleMultiMerge(molecule *mol, int *src, int N);
    387   bool SimpleMultiAdd(molecule *mol, int *src, int N);
    388   bool ScatterMerge(molecule *mol, int *src, int N);
    389   bool EmbedMerge(molecule *mol, molecule *srcmol);
    390380
    391381  private:
  • src/molecule_dynamics.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * molecule_dynamics.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/molecule_fragmentation.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * molecule_fragmentation.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    451463      for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    452464    #ifdef ADDHYDROGEN
    453         if ((*iter)->getType()->Z != 1) // skip hydrogen
     465        if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen
    454466    #endif
    455467        {
     
    471483    for(molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    472484  #ifdef ADDHYDROGEN
    473       if ((*iter)->getType()->Z != 1) // skip hydrogen
     485      if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen
    474486  #endif
    475487      {
     
    880892  for (KeySet::iterator runner = Leaf->begin(); runner != Leaf->end(); runner++) {
    881893    Runner = FindAtom((*runner));
    882     if (Runner->getType()->Z != 1) { // skip all those added hydrogens when re-filling snake stack
     894    if (Runner->getType()->getAtomicNumber() != 1) { // skip all those added hydrogens when re-filling snake stack
    883895      if (ShortestPathList[(*runner)] > SP) {  // remove the oldest one with longest shortest path
    884896        SP = ShortestPathList[(*runner)];
     
    969981    ++iter;
    970982#ifdef ADDHYDROGEN
    971     while ((iter != Leaf->end()) && ((*iter)->getType()->Z == 1)){ // skip added hydrogen
     983    while ((iter != Leaf->end()) && ((*iter)->getType()->getAtomicNumber() == 1)){ // skip added hydrogen
    972984      iter++;
    973985    }
     
    13471359        if ((RestrictedKeySet.find(OtherWalker->nr) != RestrictedKeySet.end())
    13481360  #ifdef ADDHYDROGEN
    1349          && (OtherWalker->getType()->Z != 1)
     1361         && (OtherWalker->getType()->getAtomicNumber() != 1)
    13501362  #endif
    13511363                                                              ) {  // skip hydrogens and restrict to fragment
  • src/molecule_geometry.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * molecule_geometry.cpp
     
    613 */
    714
     15// include config.h
    816#ifdef HAVE_CONFIG_H
    917#include <config.h>
    1018#endif
    1119
     20#include "Helpers/MemDebug.hpp"
     21
    1222#include "Helpers/helpers.hpp"
    1323#include "Helpers/Log.hpp"
    14 #include "Helpers/MemDebug.hpp"
    1524#include "Helpers/Verbose.hpp"
    1625#include "LinearAlgebra/Line.hpp"
     
    104113    (*max) += (*min);
    105114    Translate(min);
    106     Center.Zero();
    107115  }
    108116  delete(min);
     
    118126  int Num = 0;
    119127  molecule::const_iterator iter = begin();  // start at first in list
     128  Vector Center;
    120129
    121130  Center.Zero();
    122 
    123131  if (iter != end()) {   //list not empty?
    124132    for (; iter != end(); ++iter) {  // continue with second if present
     
    128136    Center.Scale(-1./(double)Num); // divide through total number (and sign for direction)
    129137    Translate(&Center);
    130     Center.Zero();
    131138  }
    132139};
     
    179186  if (iter != end()) {   //list not empty?
    180187    for (; iter != end(); ++iter) {  // continue with second if present
    181       Num += (*iter)->getType()->mass;
    182       tmp = (*iter)->getType()->mass * (*iter)->getPosition();
     188      Num += (*iter)->getType()->getMass();
     189      tmp = (*iter)->getType()->getMass() * (*iter)->getPosition();
    183190      (*a) += tmp;
    184191    }
     
    197204void molecule::CenterPeriodic()
    198205{
    199   DeterminePeriodicCenter(Center);
     206  Vector NewCenter;
     207  DeterminePeriodicCenter(NewCenter);
     208  // go through all atoms
     209  BOOST_FOREACH(atom* iter, atoms){
     210    *iter -= NewCenter;
     211  }
    200212};
    201213
     
    207219void molecule::CenterAtVector(Vector *newcenter)
    208220{
    209   Center = *newcenter;
     221  // go through all atoms
     222  BOOST_FOREACH(atom* iter, atoms){
     223    *iter -= *newcenter;
     224  }
    210225};
    211226
     
    277292  bool flag;
    278293  Vector Testvector, Translationvector;
     294  Vector Center;
    279295
    280296  do {
     
    283299    for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    284300#ifdef ADDHYDROGEN
    285       if ((*iter)->getType()->Z != 1) {
     301      if ((*iter)->getType()->getAtomicNumber() != 1) {
    286302#endif
    287303        Testvector = inversematrix * (*iter)->getPosition();
     
    308324        // now also change all hydrogens
    309325        for (BondList::const_iterator Runner = (*iter)->ListOfBonds.begin(); Runner != (*iter)->ListOfBonds.end(); (++Runner)) {
    310           if ((*Runner)->GetOtherAtom((*iter))->getType()->Z == 1) {
     326          if ((*Runner)->GetOtherAtom((*iter))->getType()->getAtomicNumber() == 1) {
    311327            Testvector = inversematrix * (*Runner)->GetOtherAtom((*iter))->getPosition();
    312328            Testvector += Translationvector;
     
    322338
    323339  Center.Scale(1./static_cast<double>(getAtomCount()));
     340  CenterAtVector(&Center);
    324341};
    325342
  • src/molecule_graph.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * molecule_graph.cpp
     
    613 */
    714
     15// include config.h
    816#ifdef HAVE_CONFIG_H
    917#include <config.h>
     
    737745        OtherAtom = (*Runner)->GetOtherAtom(Walker);
    738746#ifdef ADDHYDROGEN
    739         if (OtherAtom->getType()->Z != 1) {
     747        if (OtherAtom->getType()->getAtomicNumber() != 1) {
    740748#endif
    741749        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
  • src/molecule_pointcloud.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * molecule_pointcloud.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/moleculelist.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file MoleculeListClass.cpp
    29 *
     
    512 */
    613
     14// include config.h
    715#ifdef HAVE_CONFIG_H
    816#include <config.h>
     
    4452MoleculeListClass::MoleculeListClass(World *_world) :
    4553  Observable("MoleculeListClass"),
    46   world(_world),
    47   MaxIndex(1)
     54  MaxIndex(1),
     55  world(_world)
    4856{};
    4957
     
    193201      }
    194202      // Center and size
    195       (*out) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;
     203      Vector *Center = (*ListRunner)->DetermineCenterOfAll();
     204      (*out) << "\t" << *Center << "\t" << sqrt(size) << endl;
     205      delete(Center);
    196206    }
    197207  }
     
    210220};
    211221
    212 /** Simple merge of two molecules into one.
    213  * \param *mol destination molecule
    214  * \param *srcmol source molecule
    215  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    216  */
    217 bool MoleculeListClass::SimpleMerge(molecule *mol, molecule *srcmol)
    218 {
    219   if (srcmol == NULL)
    220     return false;
    221 
    222   // put all molecules of src into mol
    223   for (molecule::iterator iter = srcmol->begin(); !srcmol->empty(); iter=srcmol->begin()) {
    224     atom * const Walker = *iter;
    225     srcmol->UnlinkAtom(Walker);
    226     mol->AddAtom(Walker);
    227   }
    228 
    229   // remove src
    230   ListOfMolecules.remove(srcmol);
    231   World::getInstance().destroyMolecule(srcmol);
    232   return true;
    233 };
    234 
    235 /** Simple add of one molecules into another.
    236  * \param *mol destination molecule
    237  * \param *srcmol source molecule
    238  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    239  */
    240 bool MoleculeListClass::SimpleAdd(molecule *mol, molecule *srcmol)
    241 {
    242   if (srcmol == NULL)
    243     return false;
    244 
    245   // put all molecules of src into mol
    246   atom *Walker = NULL;
    247   for (molecule::iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {
    248     Walker = mol->AddCopyAtom((*iter));
    249     Walker->father = Walker;
    250   }
    251 
    252   return true;
    253 };
    254 
    255 /** Simple merge of a given set of molecules into one.
    256  * \param *mol destination molecule
    257  * \param *src index of set of source molecule
    258  * \param N number of source molecules
    259  * \return true - merge successful, false - some merges failed (probably due to non-existant indices)
    260  */
    261 bool MoleculeListClass::SimpleMultiMerge(molecule *mol, int *src, int N)
    262 {
    263   bool status = true;
    264   // check presence of all source molecules
    265   for (int i=0;i<N;i++) {
    266     molecule *srcmol = ReturnIndex(src[i]);
    267     status = status && SimpleMerge(mol, srcmol);
    268   }
    269   insert(mol);
    270   return status;
    271 };
    272 
    273 /** Simple add of a given set of molecules into one.
    274  * \param *mol destination molecule
    275  * \param *src index of set of source molecule
    276  * \param N number of source molecules
    277  * \return true - merge successful, false - some merges failed (probably due to non-existant indices)
    278  */
    279 bool MoleculeListClass::SimpleMultiAdd(molecule *mol, int *src, int N)
    280 {
    281   bool status = true;
    282   // check presence of all source molecules
    283   for (int i=0;i<N;i++) {
    284     molecule *srcmol = ReturnIndex(src[i]);
    285     status = status && SimpleAdd(mol, srcmol);
    286   }
    287   return status;
    288 };
    289 
    290 /** Scatter merge of a given set of molecules into one.
    291  * Scatter merge distributes the molecules in such a manner that they don't overlap.
    292  * \param *mol destination molecule
    293  * \param *src index of set of source molecule
    294  * \param N number of source molecules
    295  * \return true - merge successful, false - merge failed (probably due to non-existant indices
    296  * \TODO find scatter center for each src molecule
    297  */
    298 bool MoleculeListClass::ScatterMerge(molecule *mol, int *src, int N)
    299 {
    300   // check presence of all source molecules
    301   for (int i=0;i<N;i++) {
    302     // get pointer to src molecule
    303     molecule *srcmol = ReturnIndex(src[i]);
    304     if (srcmol == NULL)
    305       return false;
    306   }
    307   // adapt each Center
    308   for (int i=0;i<N;i++) {
    309     // get pointer to src molecule
    310     molecule *srcmol = ReturnIndex(src[i]);
    311     //srcmol->Center.Zero();
    312     srcmol->Translate(&srcmol->Center);
    313   }
    314   // perform a simple multi merge
    315   SimpleMultiMerge(mol, src, N);
    316   return true;
    317 };
    318 
    319 /** Embedding merge of a given set of molecules into one.
    320  * Embedding merge inserts one molecule into the other.
    321  * \param *mol destination molecule (fixed one)
    322  * \param *srcmol source molecule (variable one, where atoms are taken from)
    323  * \return true - merge successful, false - merge failed (probably due to non-existant indices)
    324  * \TODO linked cell dimensions for boundary points has to be as big as inner diameter!
    325  */
    326 bool MoleculeListClass::EmbedMerge(molecule *mol, molecule *srcmol)
    327 {
    328   LinkedCell *LCList = NULL;
    329   Tesselation *TesselStruct = NULL;
    330   if ((srcmol == NULL) || (mol == NULL)) {
    331     DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl);
    332     return false;
    333   }
    334 
    335   // calculate envelope for *mol
    336   LCList = new LinkedCell(mol, 8.);
    337   FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL);
    338   if (TesselStruct == NULL) {
    339     DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl);
    340     return false;
    341   }
    342   delete(LCList);
    343   LCList = new LinkedCell(TesselStruct, 8.);  // re-create with boundary points only!
    344 
    345   // prepare index list for bonds
    346   atom ** CopyAtoms = new atom*[srcmol->getAtomCount()];
    347   for(int i=0;i<srcmol->getAtomCount();i++)
    348     CopyAtoms[i] = NULL;
    349 
    350   // for each of the source atoms check whether we are in- or outside and add copy atom
    351   int nr=0;
    352   for (molecule::const_iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) {
    353     DoLog(2) && (Log() << Verbose(2) << "INFO: Current Walker is " << **iter << "." << endl);
    354     if (!TesselStruct->IsInnerPoint((*iter)->getPosition(), LCList)) {
    355       CopyAtoms[(*iter)->nr] = (*iter)->clone();
    356       mol->AddAtom(CopyAtoms[(*iter)->nr]);
    357       nr++;
    358     } else {
    359       // do nothing
    360     }
    361   }
    362   DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.");
    363 
    364   // go through all bonds and add as well
    365   for(molecule::iterator AtomRunner = srcmol->begin(); AtomRunner != srcmol->end(); ++AtomRunner)
    366     for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner)
    367       if ((*BondRunner)->leftatom == *AtomRunner) {
    368         DoLog(3) && (Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[(*BondRunner)->leftatom->nr] << " and " << *CopyAtoms[(*BondRunner)->rightatom->nr]<< "." << endl);
    369         mol->AddBond(CopyAtoms[(*BondRunner)->leftatom->nr], CopyAtoms[(*BondRunner)->rightatom->nr], (*BondRunner)->BondDegree);
    370       }
    371   delete(LCList);
    372   return true;
    373 };
    374222
    375223/** Simple output of the pointers in ListOfMolecules.
     
    499347    for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) {
    500348      //Log() << Verbose(1) << "(*iter): " << *(*iter) << " with first bond " << *((*iter)->ListOfBonds.begin()) << "." << endl;
    501       if (((*iter)->getType()->Z == 1) && (((*iter)->father == NULL)
    502           || ((*iter)->father->getType()->Z != 1))) { // if it's a hydrogen
     349      if (((*iter)->getType()->getAtomicNumber() == 1) && (((*iter)->father == NULL)
     350          || ((*iter)->father->getType()->getAtomicNumber() != 1))) { // if it's a hydrogen
    503351        for (molecule::const_iterator runner = (*ListRunner)->begin(); runner != (*ListRunner)->end(); ++runner) {
    504352          //Log() << Verbose(2) << "Runner: " << *(*runner) << " with first bond " << *((*iter)->ListOfBonds.begin()) << "." << endl;
    505353          // 3. take every other hydrogen that is the not the first and not bound to same bonding partner
    506354          Binder = *((*runner)->ListOfBonds.begin());
    507           if (((*runner)->getType()->Z == 1) && ((*runner)->nr > (*iter)->nr) && (Binder->GetOtherAtom((*runner)) != Binder->GetOtherAtom((*iter)))) { // (hydrogens have only one bonding partner!)
     355          if (((*runner)->getType()->getAtomicNumber() == 1) && ((*runner)->nr > (*iter)->nr) && (Binder->GetOtherAtom((*runner)) != Binder->GetOtherAtom((*iter)))) { // (hydrogens have only one bonding partner!)
    508356            // 4. evaluate the morse potential for each matrix component and add up
    509357            distance = (*runner)->distance(*(*iter));
     
    744592};
    745593
    746 /** Dissects given \a *mol into connected subgraphs and inserts them as new molecules but with old atoms into \a this.
    747  * \param *out output stream for debugging
    748  * \param *periode periodentafel
    749  * \param *configuration config with BondGraph
    750  */
    751 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration)
    752 {
    753   // 0a. remove all present molecules
    754   vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
    755   for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
    756     erase(*MolRunner);
    757     World::getInstance().destroyMolecule(*MolRunner);
    758   }
    759   // 0b. remove all bonds and construct a molecule with all atoms
    760   molecule *mol = World::getInstance().createMolecule();
    761   vector <atom *> allatoms = World::getInstance().getAllAtoms();
    762   for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
    763     for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
    764       delete(*BondRunner);
    765     mol->AddAtom(*AtomRunner);
    766   }
    767 
    768   // 1. dissect the molecule into connected subgraphs
    769   if (configuration->BG != NULL) {
    770     if (!configuration->BG->ConstructBondGraph(mol)) {
    771       World::getInstance().destroyMolecule(mol);
    772       DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl);
    773       return;
    774     }
    775   } else {
    776     DoeLog(1) && (eLog()<< Verbose(1) << "There is no BondGraph class present to create bonds." << endl);
    777     return;
    778   }
    779 
    780   // 2. scan for connected subgraphs
    781   MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
    782   class StackClass<bond *> *BackEdgeStack = NULL;
    783   Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
    784   delete(BackEdgeStack);
    785   if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) {
    786     World::getInstance().destroyMolecule(mol);
    787     DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl);
    788     return;
    789   }
    790 
    791   // 3. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in
    792   // the original one as parsed in)
    793   // TODO: Optimize this, when molecules just contain pointer list of global atoms!
    794 
    795   // 4a. create array of molecules to fill
    796   const int MolCount = Subgraphs->next->Count();
    797   char number[MAXSTRINGSIZE];
    798   molecule **molecules = new molecule *[MolCount];
    799   MoleculeLeafClass *MolecularWalker = Subgraphs;
    800   for (int i=0;i<MolCount;i++) {
    801     MolecularWalker = MolecularWalker->next;
    802     molecules[i] = World::getInstance().createMolecule();
    803     molecules[i]->ActiveFlag = true;
    804     strncpy(molecules[i]->name, mol->name, MAXSTRINGSIZE);
    805     if (MolCount > 1) {
    806       sprintf(number, "-%d", i+1);
    807       strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1);
    808     }
    809     DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << ", id is " << molecules[i]->getId() << endl);
    810     for (molecule::iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) {
    811       DoLog(1) && (Log() << Verbose(1) << **iter << endl);
    812     }
    813     insert(molecules[i]);
    814   }
    815 
    816   // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
    817   int FragmentCounter = 0;
    818   map<int, atom *> AtomToFragmentMap;
    819   MolecularWalker = Subgraphs;
    820   while (MolecularWalker->next != NULL) {
    821     MolecularWalker = MolecularWalker->next;
    822     for (molecule::iterator iter = MolecularWalker->Leaf->begin(); !MolecularWalker->Leaf->empty(); iter = MolecularWalker->Leaf->begin()) {
    823       atom * Walker = *iter;
    824       DoLog(1) && (Log() << Verbose(1) << "Re-linking " << Walker << "..." << endl);
    825       MolecularWalker->Leaf->erase(iter);
    826       molecules[FragmentCounter]->AddAtom(Walker);    // counting starts at 1
    827     }
    828     FragmentCounter++;
    829   }
    830   World::getInstance().destroyMolecule(mol);
    831 
    832   // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list
    833   // TODO: check whether this is really not needed anymore
    834   // 4e. free Leafs
    835   MolecularWalker = Subgraphs;
    836   while (MolecularWalker->next != NULL) {
    837     MolecularWalker = MolecularWalker->next;
    838     delete(MolecularWalker->previous);
    839   }
    840   delete(MolecularWalker);
    841   delete[](molecules);
    842   DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
    843 };
    844 
    845594/** Count all atoms in each molecule.
    846595 * \return number of atoms in the MoleculeListClass.
     
    1087836        if (AtomMask[Father->nr]) // apply mask
    1088837#ifdef ADDHYDROGEN
    1089           if ((*iter)->getType()->Z != 1) // skip hydrogen
     838          if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen
    1090839#endif
    1091840          RootStack[FragmentCounter].push_front((*iter)->nr);
  • src/parser.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file parsing.cpp
    29 *
     
    714// ======================================= INCLUDES ==========================================
    815
    9 #include "Helpers/MemDebug.hpp"
    10 
    11 #include <cstring>
    12 
    13 #include "Helpers/helpers.hpp"
    14 #include "parser.hpp"
    15 #include "Helpers/Verbose.hpp"
    16 
    1716// include config.h
    1817#ifdef HAVE_CONFIG_H
    1918#include <config.h>
    2019#endif
     20
     21#include "Helpers/MemDebug.hpp"
     22
     23#include <cstring>
     24
     25#include "Helpers/helpers.hpp"
     26#include "parser.hpp"
     27#include "Helpers/Verbose.hpp"
    2128
    2229// ======================================= FUNCTIONS ==========================================
  • src/periodentafel.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/** \file periodentafel.cpp
    29 *
     
    512 */
    613
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
     18
    719#include "Helpers/MemDebug.hpp"
    8 
    9 using namespace std;
    1020
    1121#include <iomanip>
     
    3444  {
    3545    stringstream input(elementsDB,ios_base::in);
    36     bool status = LoadElementsDatabase(&input);
     46    bool status = LoadElementsDatabase(input);
    3747    ASSERT(status,  "General element initialization failed");
    3848  }
     
    7282 * \return iterator to added element
    7383 */
    74 periodentafel::iterator periodentafel::AddElement(element * const pointer)
     84periodentafel::iterator periodentafel::AddElement(element * pointer)
    7585{
    7686  atomicNumber_t Z = pointer->getNumber();
    7787  ASSERT(!elements.count(Z), "Element is already present.");
    78   pointer->sort = &pointer->Z;
    7988  if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS)
    8089    DoeLog(0) && (eLog() << Verbose(0) << "Invalid Z number!\n");
     
    8695 * \param *pointer element to be removed
    8796 */
    88 size_t periodentafel::RemoveElement(element * const pointer)
     97size_t periodentafel::RemoveElement(const element * pointer)
    8998{
    9099  return RemoveElement(pointer->getNumber());
     
    114123 * \return pointer to element or NULL if not found
    115124 */
    116 element * const periodentafel::FindElement(atomicNumber_t Z) const
     125const element * periodentafel::FindElement(atomicNumber_t Z) const
    117126{
    118127  const_iterator res = elements.find(Z);
     
    125134 * \return pointer to element
    126135 */
    127 element * const periodentafel::FindElement(const string &shorthand) const
     136const element * periodentafel::FindElement(const string &shorthand) const
    128137{
    129138  element *res = 0;
     
    140149 * \return desired element or NULL
    141150 */
    142 element * const periodentafel::AskElement() const
    143 {
    144   element * walker = NULL;
     151const element * periodentafel::AskElement() const
     152{
     153  const element * walker = NULL;
    145154  int Z;
    146155  do {
     
    155164 * \return pointer to either present or newly created element
    156165 */
    157 element * const periodentafel::EnterElement()
     166const element * periodentafel::EnterElement()
    158167{
    159168  atomicNumber_t Z = 0;
    160169  DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
    161170  cin >> Z;
    162   element * const res = FindElement(Z);
     171  const element *res = FindElement(Z);
    163172  if (!res) {
    164173    // TODO: make this using the constructor
     
    169178    cin >> tmp->mass;
    170179    DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl);
    171     cin >> tmp->name;
     180    cin >> tmp->getName();
    172181    DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl);
    173     cin >> tmp->symbol;
     182    cin >> tmp->getSymbol();
    174183    AddElement(tmp);
    175184    return tmp;
     
    180189
    181190/******************** Access to iterators ****************************/
    182 periodentafel::const_iterator periodentafel::begin(){
     191periodentafel::const_iterator periodentafel::begin() const{
    183192  return elements.begin();
    184193}
    185194
    186 periodentafel::const_iterator periodentafel::end(){
     195periodentafel::const_iterator periodentafel::end() const{
    187196  return elements.end();
    188197}
    189198
    190 periodentafel::reverse_iterator periodentafel::rbegin(){
     199periodentafel::reverse_iterator periodentafel::rbegin() const{
    191200  return reverse_iterator(elements.end());
    192201}
    193202
    194 periodentafel::reverse_iterator periodentafel::rend(){
     203periodentafel::reverse_iterator periodentafel::rend() const{
    195204  return reverse_iterator(elements.begin());
    196205}
     
    228237  if (!input.fail())
    229238    DoLog(0) && (Log() << Verbose(0) << "Using " << filename << " as elements database." << endl);
    230   status = status && LoadElementsDatabase(&input);
     239  status = status && LoadElementsDatabase(input);
    231240  input.close();
    232241  input.clear();
     
    287296 * \return true - parsing successful, false - something went wrong
    288297 */
    289 bool periodentafel::LoadElementsDatabase(istream *input)
     298bool periodentafel::LoadElementsDatabase(istream &input)
    290299{
    291300  bool status = true;
    292   int counter = 0;
    293   pair< std::map<atomicNumber_t,element*>::iterator, bool > InserterTest;
    294   if (!(*input).fail()) {
    295     (*input).getline(header1, MAXSTRINGSIZE);
    296     (*input).getline(header2, MAXSTRINGSIZE); // skip first two header lines
     301  string header1tmp,header2tmp;
     302  // first parse into a map, so we can revert to old status in case something goes wront
     303  map<atomicNumber_t,element*> parsedElements;
     304  if (!input.fail()) {
     305    getline(input,header1tmp);
     306    getline(input,header2tmp); // skip first two header lines
     307    //cout << "First header: " << header1tmp << endl;
     308    //cout << "Second header: " << header2tmp << endl;
    297309    DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
    298     while (!(*input).eof()) {
     310    while (!input.eof()) {
    299311      element *neues = new element;
    300       (*input) >> neues->name;
    301       //(*input) >> ws;
    302       (*input) >> neues->symbol;
    303       //(*input) >> ws;
    304       (*input) >> neues->period;
    305       //(*input) >> ws;
    306       (*input) >> neues->group;
    307       //(*input) >> ws;
    308       (*input) >> neues->block;
    309       //(*input) >> ws;
    310       (*input) >> neues->Z;
    311       //(*input) >> ws;
    312       (*input) >> neues->mass;
    313       //(*input) >> ws;
    314       (*input) >> neues->CovalentRadius;
    315       //(*input) >> ws;
    316       (*input) >> neues->VanDerWaalsRadius;
    317       //(*input) >> ws;
    318       (*input) >> ws;
     312      input >> neues->name;
     313      //(*input) >> ws;
     314      input >> neues->symbol;
     315      //(*input) >> ws;
     316      input >> neues->period;
     317      //(*input) >> ws;
     318      input >> neues->group;
     319      //(*input) >> ws;
     320      input >> neues->block;
     321      //(*input) >> ws;
     322      input >> neues->Z;
     323      //(*input) >> ws;
     324      input >> neues->mass;
     325      //(*input) >> ws;
     326      input >> neues->CovalentRadius;
     327      //(*input) >> ws;
     328      input >> neues->VanDerWaalsRadius;
     329      //(*input) >> ws;
     330      input >> ws;
    319331      //neues->Output((ofstream *)&cout);
    320332      if ((neues->getNumber() > 0) && (neues->getNumber() < MAX_ELEMENTS)) {
    321         if (elements.count(neues->getNumber())) {// if element already present, remove and delete old one (i.e. replace it)
    322           //cout << neues->symbol << " is present already." << endl;
    323           element * const Elemental = FindElement(neues->getNumber());
    324           ASSERT(Elemental != NULL, "element should be present but is not??");
    325           *Elemental = *neues;
    326           delete(neues);
    327           neues = Elemental;
    328         } else {
    329           InserterTest = elements.insert(pair <atomicNumber_t,element*> (neues->getNumber(), neues));
    330           ASSERT(InserterTest.second, "Could not insert new element into periodentafel on LoadElementsDatabase().");
    331         }
    332         DoLog(0) && (Log() << Verbose(0) << " " << elements[neues->getNumber()]->symbol);
    333         counter++;
     333        parsedElements[neues->Z] = neues;
     334        DoLog(0) && (Log() << Verbose(0) << " " << *neues);
    334335      } else {
    335336        DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl);
     
    337338        delete(neues);
    338339      }
     340      // when the input is in failed state, we most likely just read garbage
     341      if(input.fail()) {
     342        DoeLog(2) && (eLog() << Verbose(2) << "Error parsing elements db." << endl);
     343        status = false;
     344        break;
     345      }
    339346    }
    340347    DoLog(0) && (Log() << Verbose(0) << endl);
     
    344351  }
    345352
    346   if (counter == 0)
     353  if (!parsedElements.size())
    347354    status = false;
     355
     356  if(status){
     357    for(map<atomicNumber_t,element*>::iterator iter=parsedElements.begin();
     358                                               iter!=parsedElements.end();
     359                                               ++iter){
     360      if (elements.count(iter->first)) {
     361        // if element already present, replace the old one
     362        // pointer to old element might still be in use, so we have to replace into the old element
     363        *(elements[iter->first])=*iter->second;
     364        delete(iter->second);
     365      }
     366      else {
     367        // no such element in periodentafel... we can just insert
     368        elements[iter->first] = iter->second;
     369      }
     370    }
     371    // all went well.. we now copy the header
     372    strncpy(header1,header1tmp.c_str(),MAXSTRINGSIZE);
     373    header1[MAXSTRINGSIZE-1]=0;
     374    strncpy(header2,header2tmp.c_str(),MAXSTRINGSIZE);
     375    header2[MAXSTRINGSIZE-1]=0;
     376  }
    348377
    349378  return status;
  • src/periodentafel.hpp

    r8006ee r994713  
    4343  ~periodentafel();
    4444
    45   iterator AddElement(element * const pointer);
    46   size_t RemoveElement(element * const pointer);
     45  iterator AddElement(element * pointer);
     46  size_t RemoveElement(const element * pointer);
    4747  size_t RemoveElement(atomicNumber_t);
    4848  void CleanupPeriodtable();
    49   element * const FindElement(atomicNumber_t) const;
    50   element * const FindElement(const std::string &shorthand) const;
    51   element * const AskElement() const;
    52   element * const EnterElement();
     49  const element * FindElement(atomicNumber_t) const;
     50  const element * FindElement(const std::string &shorthand) const;
     51  const element * AskElement() const;
     52  const element * EnterElement();
    5353
    54   const_iterator begin();
    55   const_iterator end();
    56   reverse_iterator rbegin();
    57   reverse_iterator rend();
     54  const_iterator begin() const;
     55  const_iterator end() const;
     56  reverse_iterator rbegin() const;
     57  reverse_iterator rend() const;
    5858  bool Output(std::ostream * const output) const;
    5959  bool LoadPeriodentafel(const char * const path);
     
    6262  private:
    6363
    64   bool LoadElementsDatabase(std::istream *input);
     64  bool LoadElementsDatabase(std::istream &input);
    6565  bool LoadValenceDatabase(std::istream *input);
    6666  bool LoadOrbitalsDatabase(std::istream *input);
  • src/tesselation.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * tesselation.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
  • src/tesselationhelpers.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TesselationHelpers.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    165177  Center += helper[1] * b;
    166178  Center += helper[2] * c;
    167   Center.Scale(1./(helper[0]+helper[1]+helper[2]));
     179  if (fabs(helper[0]+helper[1]+helper[2]) > MYEPSILON)
     180    Center.Scale(1./(helper[0]+helper[1]+helper[2]));
    168181  Log() << Verbose(1) << "INFO: Center (2nd algo) is at " << Center << "." << endl;
    169182};
  • src/triangleintersectionlist.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * triangleintersectionlist.cpp
     
    815 *      Author: heber
    916 */
     17
     18// include config.h
     19#ifdef HAVE_CONFIG_H
     20#include <config.h>
     21#endif
    1022
    1123#include "Helpers/MemDebug.hpp"
  • src/unittests/ActOnAllUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ActOnAllUnitTest.cpp
     
    512 *      Author: FrederikHeber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/ActionSequenceTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ActionSequenzTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include <cppunit/CompilerOutputter.h>
  • src/unittests/AnalysisCorrelationToPointUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AnalysisCorrelationToPointUnitTest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
     
    4658
    4759  // construct element list
    48   std::vector<element *> elements;
     60  std::vector<const element *> elements;
    4961  hydrogen = World::getInstance().getPeriode()->FindElement(1);
    5062  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
  • src/unittests/AnalysisCorrelationToPointUnitTest.hpp

    r8006ee r994713  
    3737      std::vector<molecule *> allMolecules;
    3838      molecule *TestMolecule;
    39       element *hydrogen;
     39      const element *hydrogen;
    4040
    4141      CorrelationToPointMap *pointmap;
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AnalysisCorrelationToSurfaceUnitTest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp

    r8006ee r994713  
    4545      std::vector<molecule *> allMolecules;
    4646      molecule *TestSurfaceMolecule;
    47       element *hydrogen;
    48       element *carbon;
    49       std::vector<element *> elements;
     47      const element *hydrogen;
     48      const element *carbon;
     49      std::vector<const element *> elements;
    5050
    5151      CorrelationToSurfaceMap *surfacemap;
  • src/unittests/AnalysisPairCorrelationUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * AnalysisPairCorrelationUnitTest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
     
    4961
    5062  // construct element list
    51   std::vector<element *> elements;
     63  std::vector<const element *> elements;
    5264  hydrogen = World::getInstance().getPeriode()->FindElement(1);
    5365  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
  • src/unittests/AnalysisPairCorrelationUnitTest.hpp

    r8006ee r994713  
    3737      std::vector<molecule *> allMolecules;
    3838      molecule *TestMolecule;
    39       element *hydrogen;
     39      const element *hydrogen;
    4040
    4141      PairCorrelationMap *correlationmap;
  • src/unittests/AtomDescriptorTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * DescriptorUnittest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "AtomDescriptorTest.hpp"
  • src/unittests/BoxUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * BoxUnittest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "BoxUnittest.hpp"
  • src/unittests/CacheableTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CacheableTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "CacheableTest.hpp"
  • src/unittests/CountBondsUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CountBondsUnitTest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    819
    920using namespace std;
  • src/unittests/FormulaUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * FormulaUnittest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "FormulaUnittest.hpp"
  • src/unittests/LineUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * LineUnittest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "LineUnittest.hpp"
  • src/unittests/LinkedCellUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * LinkedCellUnitTest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/Makefile.am

    r8006ee r994713  
    1616  atomsCalculationTest \
    1717  AtomDescriptorTest \
     18  BaseShapesUnitTest \
    1819  BondGraphUnitTest \
    1920  BoxUnittest \
     
    7374  AtomDescriptorTest.cpp \
    7475  atomsCalculationTest.cpp \
     76  BaseShapesUnittest.cpp \
    7577  bondgraphunittest.cpp \
    7678  BoxUnittest.cpp \
     
    111113  AtomDescriptorTest.hpp \
    112114  atomsCalculationTest.hpp \
     115  BaseShapesUnittest.hpp \
    113116  bondgraphunittest.hpp \
    114117  BoxUnittest.hpp \
     
    164167AtomDescriptorTest_LDADD = ${ALLLIBS}
    165168
     169BaseShapesUnitTest_SOURCES = UnitTestMain.cpp BaseShapesUnittest.cpp BaseShapesUnittest.hpp
     170BaseShapesUnitTest_LDADD = ${ALLLIBS}
     171
    166172BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp
    167173BondGraphUnitTest_LDADD = ${ALLLIBS}
  • src/unittests/MapofActionsTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * analysisbondsunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/MatrixUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MatrixUnittest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include <cppunit/CompilerOutputter.h>
    921#include <cppunit/extensions/TestFactoryRegistry.h>
    1022#include <cppunit/ui/text/TestRunner.h>
     23
     24#include <cmath>
    1125
    1226#include "MatrixUnittest.hpp"
     
    151165    }
    152166  }
     167}
     168
     169void MatrixUnittest::TransposeTest(){
     170  Matrix res;
     171
     172  // transpose of unit is unit
     173  res.one();
     174  (const Matrix)res.transpose();
     175  CPPUNIT_ASSERT_EQUAL(res,*one);
     176
     177  // transpose of transpose is same matrix
     178  res.zero();
     179  res.set(2,2, 1.);
     180  CPPUNIT_ASSERT_EQUAL(res.transpose().transpose(),res);
    153181}
    154182
     
    225253}
    226254
     255void MatrixUnittest::RotationTest(){
     256  Matrix res;
     257  Matrix inverse;
     258
     259  // zero rotation angles yields unity matrix
     260  res.rotation(0,0,0);
     261  CPPUNIT_ASSERT_EQUAL(*one, res);
     262
     263  // arbitrary rotation matrix has det = 1
     264  res.rotation(M_PI/3.,1.,M_PI/7.);
     265  CPPUNIT_ASSERT(fabs(fabs(res.determinant()) -1.) < MYEPSILON);
     266
     267  // inverse is rotation matrix with negative angles
     268  res.rotation(M_PI/3.,0.,0.);
     269  inverse.rotation(-M_PI/3.,0.,0.);
     270  CPPUNIT_ASSERT_EQUAL(*one, res * inverse);
     271
     272  // ... or transposed
     273  res.rotation(M_PI/3.,0.,0.);
     274  CPPUNIT_ASSERT_EQUAL(inverse, ((const Matrix) res).transpose());
     275}
    227276
    228277void MatrixUnittest::InvertTest(){
  • src/unittests/MatrixUnittest.hpp

    r8006ee r994713  
    1919  CPPUNIT_TEST ( VectorTest );
    2020  CPPUNIT_TEST ( OperationTest );
     21  CPPUNIT_TEST ( TransposeTest );
     22  CPPUNIT_TEST ( RotationTest );
    2123  CPPUNIT_TEST ( InvertTest );
    2224  CPPUNIT_TEST ( DeterminantTest );
     
    3133  void VectorTest();
    3234  void OperationTest();
     35  void TransposeTest();
     36  void RotationTest();
    3337  void InvertTest();
    3438  void DeterminantTest();
  • src/unittests/MoleculeDescriptorTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * MoleculeDescriptorTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "MoleculeDescriptorTest.hpp"
  • src/unittests/ObserverTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ObserverTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "ObserverTest.hpp"
  • src/unittests/ParserUnitTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ParserUnitTest.cpp
     
    512 *      Author: metzler
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "ParserUnitTest.hpp"
  • src/unittests/PlaneUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * PlaneUnittest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "PlaneUnittest.hpp"
  • src/unittests/ShapeUnittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * ShapeUnittest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820#include "ShapeUnittest.hpp"
    921
     
    1224#include <cppunit/ui/text/TestRunner.h>
    1325
     26#include <cmath>
     27
    1428#ifdef HAVE_TESTRUNNER
    1529#include "UnitTestMain.hpp"
     
    1832#include "LinearAlgebra/Vector.hpp"
    1933#include "Shapes/Shape.hpp"
     34
     35#include "Shapes/BaseShapes.hpp"
    2036
    2137// Registers the fixture into the 'registry'
     
    179195
    180196}
     197
    181198void ShapeUnittest::operatorTest(){
    182199  {
  • src/unittests/SingletonTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * SingletonTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "SingletonTest.hpp"
  • src/unittests/TestRunnerMain.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * TestRunnerMain.cpp
  • src/unittests/UnitTestMain.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * UnitTestMain.cpp
  • src/unittests/analysisbondsunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * analysisbondsunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/atomsCalculationTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * atomsCalculationTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "atomsCalculationTest.hpp"
  • src/unittests/bondgraphunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * bondgraphunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/gslmatrixsymmetricunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * gslmatrixunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/gslmatrixunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * gslmatrixunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/gslvectorunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * gslvectorunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/infounittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * InfoUnitTest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/linearsystemofequationsunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * linearsystemofequationsunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/listofbondsunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * listofbondsunittest.cpp
     
    512 *      Author: user
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/logunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * logunittest.cpp
    310 */
    411
     12
     13// include config.h
     14#ifdef HAVE_CONFIG_H
     15#include <config.h>
     16#endif
    517
    618using namespace std;
  • src/unittests/manipulateAtomsTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * manipulateAtomsTest.cpp
     
    512 *      Author: crueger
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "manipulateAtomsTest.hpp"
  • src/unittests/memoryallocatorunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * memoryallocatorunittest.cpp
     10 *
    311 */
    412
     13
     14// include config.h
     15#ifdef HAVE_CONFIG_H
     16#include <config.h>
     17#endif
    518
    619using namespace std;
  • src/unittests/memoryusageobserverunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * memoryusageobserverunittest.cpp
    310 */
    411
     12
     13// include config.h
     14#ifdef HAVE_CONFIG_H
     15#include <config.h>
     16#endif
    517
    618using namespace std;
  • src/unittests/periodentafelTest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * periodentafelTest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
     19
    820using namespace std;
    921
     
    1123#include <cppunit/extensions/TestFactoryRegistry.h>
    1224#include <cppunit/ui/text/TestRunner.h>
     25
     26#include <sstream>
     27#include <iostream>
    1328
    1429#include "Helpers/Assert.hpp"
     
    6782{
    6883  // reload all databases
    69   CPPUNIT_ASSERT(tafel->LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)) && "General element initialization failed");
     84  stringstream elementsDBstream(elementsDB,ios_base::in);
     85  CPPUNIT_ASSERT(tafel->LoadElementsDatabase(elementsDBstream) && "General element initialization failed");
    7086  CPPUNIT_ASSERT(tafel->LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)) && "Valence entry of element initialization failed");
    7187  CPPUNIT_ASSERT(tafel->LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)) && "Orbitals entry of element initialization failed");
  • src/unittests/periodentafelTest.hpp

    r8006ee r994713  
    3131private:
    3232
    33       element *hydrogen;
    34       element *carbon;
     33      const element *hydrogen;
     34      const element *carbon;
    3535      periodentafel *tafel;
    3636
  • src/unittests/stackclassunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * stackclassunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * tesselation_boundarytriangleunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/tesselation_insideoutsideunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * tesselation_insideoutsideunittest.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820using namespace std;
  • src/unittests/tesselationunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * tesselationunittest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    819
    920using namespace std;
  • src/unittests/vectorunittest.cpp

    r8006ee r994713  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * unittest.cpp
     
    613 */
    714
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    819
    920using namespace std;
  • src/version.h

    r8006ee r994713  
    22#define VERSION_H_
    33
    4 extern const char *ESPACKVersion;
     4extern const char *MOLECUILDERVERSION;
    55
    66#endif /* VERSION_H_ */
  • test_all.sh

    r8006ee r994713  
    11#!/bin/bash
    22
    3 optimizations=("-O0"\
     3optimizations=("-g3"\
     4               "-O0"\
    45               "-O1"\
    56               "-O2"\
     
    4950}
    5051
     52function logdate()
     53{
     54  echo -e "Launched on `date`.\n\n" >> $logfile 2>&1;
     55}
     56
     57
    5158while getopts “ho:f:j:scO:t:p:” OPTION
    5259do
     
    105112function configure(){
    106113  echo "Configuring";
    107   CXXFLAGS="$2" $1/configure --prefix=$PWD >> $logfile 2>&1;
     114  $1/configure $3 --prefix=$PWD CXXFLAGS="-Wall $2" >> $logfile 2>&1;
    108115}
    109116
     
    134141    then
    135142      echo -n "    $test: " >> $outfile;
    136       valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
     143      valgrind -v --leak-check=full --leak-resolution=high --show-reachable=yes --error-exitcode=255 $test >> $logfile 2>&1;
    137144      if [ $? ]
    138145      then
     
    149156function test(){
    150157
    151   echo "Testing with \"$2\"";
     158  echo "Testing with \"$2 $3\"";
    152159  echo "" >> $logfile;
    153160  echo "" >> $logfile;
    154161  echo "" >> $logfile;
    155   echo "Testing with \"$2\"" >> $logfile;
    156 
    157   echo -n "  Configuring: " >> $outfile;
    158   if configure "$1" "$2"
     162  echo "Testing with \"$2 $3\"" >> $logfile;
     163
     164  if [ x"$2" == x"-g3" ]
     165  then
     166    valgrind="--with-valgrind"
     167  else
     168    valgrind="--without-valgrind"
     169  fi
     170  echo -n "  Configuring $valgrind: " >> $outfile;
     171  if configure "$1" "$2 $3" "$valgrind"
    159172  then
    160173    echo "OK" >> $outfile;
     
    201214
    202215function run(){
    203   echo "Testing with \"$1\":" >> $outfile;
     216  echo "Testing with \"$1 $2\":" >> $outfile;
    204217  testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
    205218  basedir=$PWD;
    206219  cd $testdir;
    207   test "$basedir" "$1";
     220  test "$basedir" "$1" "$2";
    208221  cd $basedir;
    209222  rm -rf $testdir;
     
    220233  for option in "${options[@]}"
    221234  do
    222     run "$optimization $option";
     235    run "$optimization" "$option";
    223236  done
    224237done
  • tests/regression/Makefile.am

    r8006ee r994713  
    11AUTOM4TE = autom4te
    2 EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in regression
     2EXTRA_DIST = \
     3        testsuite*.at \
     4        $(TESTSUITE) \
     5        atlocal.in \
     6        molecuider.in \
     7        Analysis \
     8        Domain \
     9        Filling \
     10        Fragmentation \
     11        Graph \
     12        Molecules \
     13        Simple_configuration \
     14        Tesselation
    315TESTSUITE = $(srcdir)/testsuite
    416
  • tests/regression/Simple_configuration/5/pre/test.conf

    r8006ee r994713  
    2828OutSrcStep      5       # Output "restart" data every ..th step
    2929TargetTemp      0.000950045     # Target temperature
    30 MaxPsiStep      0       # number of Minimisation steps per state (0 - default)
     30MaxPsiStep      3       # number of Minimisation steps per state (0 - default)
    3131EpsWannier      1e-07   # tolerance value for spread minimisation of orbitals
    3232
     
    3535RelEpsTotalE    1e-07   # relative change in total energy
    3636RelEpsKineticE  1e-05   # relative change in kinetic energy
    37 MaxMinStopStep  0       # check every ..th steps
    38 MaxMinGapStopStep       0       # check every ..th steps
     37MaxMinStopStep  1       # check every ..th steps
     38MaxMinGapStopStep       1       # check every ..th steps
    3939
    4040# Values specifying when to stop for INIT, otherwise same as above
     
    4242InitRelEpsTotalE        1e-05   # relative change in total energy
    4343InitRelEpsKineticE      0.0001  # relative change in kinetic energy
    44 InitMaxMinStopStep      0       # check every ..th steps
    45 InitMaxMinGapStopStep   0       # check every ..th steps
     44InitMaxMinStopStep      1       # check every ..th steps
     45InitMaxMinGapStopStep   1       # check every ..th steps
    4646
    4747BoxLength                       # (Length of a unit cell)
     
    5454Level0Factor    2       # factor by which node number increases from S to 0 level
    5555RiemannTensor   0       # (Use metric)
    56 PsiType         0       # 0 - doubly occupied, 1 - SpinUp,SpinDown
     56PsiType         1       # 0 - doubly occupied, 1 - SpinUp,SpinDown
    5757MaxPsiDouble    0       # here: specifying both maximum number of SpinUp- and -Down-states
    5858PsiMaxNoUp      0       # here: specifying maximum number of SpinUp-states
    59 PsiMaxNoDown    0       # here: specifying maximum number of SpinDown-states
     59PsiMaxNoDown    1       # here: specifying maximum number of SpinDown-states
    6060AddPsis         0       # Additional unoccupied Psis for bandgap determination
    6161
  • tests/regression/Simple_configuration/8/post/test.xyz-sorted

    r8006ee r994713  
    22C       8.53279 4.15859 3.53589
    33C       9.78209 3.27519 3.53589
     4H       0.758602        0       0
     5H       0.758602        0       1.00857
     6H       0.758602        0       11.4286
     7H       0.758602        0       12.4371
     8H       0.758602        0       14.2857
     9H       0.758602        0       15.2943
     10H       0.758602        0       17.1429
     11H       0.758602        0       18.1514
     12H       0.758602        0       2.85714
     13H       0.758602        0       3.86571
     14H       0.758602        0       5.71429
     15H       0.758602        0       6.72285
     16H       0.758602        0       8.57143
     17H       0.758602        0       9.58
     18H       0.758602        11.4286 0
     19H       0.758602        11.4286 1.00857
     20H       0.758602        11.4286 11.4286
     21H       0.758602        11.4286 12.4371
     22H       0.758602        11.4286 14.2857
     23H       0.758602        11.4286 15.2943
     24H       0.758602        11.4286 17.1429
     25H       0.758602        11.4286 18.1514
     26H       0.758602        11.4286 2.85714
     27H       0.758602        11.4286 3.86571
     28H       0.758602        11.4286 5.71429
     29H       0.758602        11.4286 6.72285
     30H       0.758602        11.4286 8.57143
     31H       0.758602        11.4286 9.58
     32H       0.758602        14.2857 0
     33H       0.758602        14.2857 1.00857
     34H       0.758602        14.2857 11.4286
     35H       0.758602        14.2857 12.4371
     36H       0.758602        14.2857 14.2857
     37H       0.758602        14.2857 15.2943
     38H       0.758602        14.2857 17.1429
     39H       0.758602        14.2857 18.1514
     40H       0.758602        14.2857 2.85714
     41H       0.758602        14.2857 3.86571
     42H       0.758602        14.2857 5.71429
     43H       0.758602        14.2857 6.72285
     44H       0.758602        14.2857 8.57143
     45H       0.758602        14.2857 9.58
     46H       0.758602        17.1429 0
     47H       0.758602        17.1429 1.00857
     48H       0.758602        17.1429 11.4286
     49H       0.758602        17.1429 12.4371
     50H       0.758602        17.1429 14.2857
     51H       0.758602        17.1429 15.2943
     52H       0.758602        17.1429 17.1429
     53H       0.758602        17.1429 18.1514
     54H       0.758602        17.1429 2.85714
     55H       0.758602        17.1429 3.86571
     56H       0.758602        17.1429 5.71429
     57H       0.758602        17.1429 6.72285
     58H       0.758602        17.1429 8.57143
     59H       0.758602        17.1429 9.58
     60H       0.758602        2.85714 0
     61H       0.758602        2.85714 1.00857
     62H       0.758602        2.85714 11.4286
     63H       0.758602        2.85714 12.4371
     64H       0.758602        2.85714 14.2857
     65H       0.758602        2.85714 15.2943
     66H       0.758602        2.85714 17.1429
     67H       0.758602        2.85714 18.1514
    468H       0.758602        2.85714 2.85714
    569H       0.758602        2.85714 3.86571
    670H       0.758602        2.85714 5.71429
     71H       0.758602        2.85714 6.72285
     72H       0.758602        2.85714 8.57143
     73H       0.758602        2.85714 9.58
     74H       0.758602        5.71429 0
     75H       0.758602        5.71429 1.00857
     76H       0.758602        5.71429 11.4286
     77H       0.758602        5.71429 12.4371
     78H       0.758602        5.71429 14.2857
     79H       0.758602        5.71429 15.2943
     80H       0.758602        5.71429 17.1429
     81H       0.758602        5.71429 18.1514
    782H       0.758602        5.71429 2.85714
    883H       0.758602        5.71429 3.86571
     84H       0.758602        5.71429 5.71429
     85H       0.758602        5.71429 6.72285
     86H       0.758602        5.71429 8.57143
     87H       0.758602        5.71429 9.58
     88H       0.758602        8.57143 0
     89H       0.758602        8.57143 1.00857
     90H       0.758602        8.57143 11.4286
     91H       0.758602        8.57143 12.4371
     92H       0.758602        8.57143 14.2857
     93H       0.758602        8.57143 15.2943
     94H       0.758602        8.57143 17.1429
     95H       0.758602        8.57143 18.1514
     96H       0.758602        8.57143 2.85714
     97H       0.758602        8.57143 3.86571
     98H       0.758602        8.57143 5.71429
     99H       0.758602        8.57143 6.72285
     100H       0.758602        8.57143 8.57143
     101H       0.758602        8.57143 9.58
    9102H       10.672  3.90454 3.53589
    10103H       12.1872 0       0
    11104H       12.1872 0       1.00857
     105H       12.1872 0       11.4286
     106H       12.1872 0       12.4371
     107H       12.1872 0       14.2857
     108H       12.1872 0       15.2943
     109H       12.1872 0       17.1429
     110H       12.1872 0       18.1514
    12111H       12.1872 0       2.85714
    13112H       12.1872 0       3.86571
    14113H       12.1872 0       5.71429
    15114H       12.1872 0       6.72285
     115H       12.1872 0       8.57143
     116H       12.1872 0       9.58
     117H       12.1872 11.4286 0
     118H       12.1872 11.4286 1.00857
     119H       12.1872 11.4286 11.4286
     120H       12.1872 11.4286 12.4371
     121H       12.1872 11.4286 14.2857
     122H       12.1872 11.4286 15.2943
     123H       12.1872 11.4286 17.1429
     124H       12.1872 11.4286 18.1514
     125H       12.1872 11.4286 2.85714
     126H       12.1872 11.4286 3.86571
     127H       12.1872 11.4286 5.71429
     128H       12.1872 11.4286 6.72285
     129H       12.1872 11.4286 8.57143
     130H       12.1872 11.4286 9.58
     131H       12.1872 14.2857 0
     132H       12.1872 14.2857 1.00857
     133H       12.1872 14.2857 11.4286
     134H       12.1872 14.2857 12.4371
     135H       12.1872 14.2857 14.2857
     136H       12.1872 14.2857 15.2943
     137H       12.1872 14.2857 17.1429
     138H       12.1872 14.2857 18.1514
     139H       12.1872 14.2857 2.85714
     140H       12.1872 14.2857 3.86571
     141H       12.1872 14.2857 5.71429
     142H       12.1872 14.2857 6.72285
     143H       12.1872 14.2857 8.57143
     144H       12.1872 14.2857 9.58
     145H       12.1872 17.1429 0
     146H       12.1872 17.1429 1.00857
     147H       12.1872 17.1429 11.4286
     148H       12.1872 17.1429 12.4371
     149H       12.1872 17.1429 14.2857
     150H       12.1872 17.1429 15.2943
     151H       12.1872 17.1429 17.1429
     152H       12.1872 17.1429 18.1514
     153H       12.1872 17.1429 2.85714
     154H       12.1872 17.1429 3.86571
     155H       12.1872 17.1429 5.71429
     156H       12.1872 17.1429 6.72285
     157H       12.1872 17.1429 8.57143
     158H       12.1872 17.1429 9.58
    16159H       12.1872 2.85714 0
    17160H       12.1872 2.85714 1.00857
     161H       12.1872 2.85714 11.4286
     162H       12.1872 2.85714 12.4371
     163H       12.1872 2.85714 14.2857
     164H       12.1872 2.85714 15.2943
     165H       12.1872 2.85714 17.1429
     166H       12.1872 2.85714 18.1514
    18167H       12.1872 2.85714 5.71429
    19168H       12.1872 2.85714 6.72285
     169H       12.1872 2.85714 8.57143
     170H       12.1872 2.85714 9.58
    20171H       12.1872 5.71429 0
    21172H       12.1872 5.71429 1.00857
     173H       12.1872 5.71429 11.4286
     174H       12.1872 5.71429 12.4371
     175H       12.1872 5.71429 14.2857
     176H       12.1872 5.71429 15.2943
     177H       12.1872 5.71429 17.1429
     178H       12.1872 5.71429 18.1514
    22179H       12.1872 5.71429 2.85714
    23180H       12.1872 5.71429 3.86571
    24181H       12.1872 5.71429 5.71429
    25182H       12.1872 5.71429 6.72285
     183H       12.1872 5.71429 8.57143
     184H       12.1872 5.71429 9.58
     185H       12.1872 8.57143 0
     186H       12.1872 8.57143 1.00857
     187H       12.1872 8.57143 11.4286
     188H       12.1872 8.57143 12.4371
     189H       12.1872 8.57143 14.2857
     190H       12.1872 8.57143 15.2943
     191H       12.1872 8.57143 17.1429
     192H       12.1872 8.57143 18.1514
     193H       12.1872 8.57143 2.85714
     194H       12.1872 8.57143 3.86571
     195H       12.1872 8.57143 5.71429
     196H       12.1872 8.57143 6.72285
     197H       12.1872 8.57143 8.57143
     198H       12.1872 8.57143 9.58
     199H       15.0443 0       0
     200H       15.0443 0       1.00857
     201H       15.0443 0       11.4286
     202H       15.0443 0       12.4371
     203H       15.0443 0       14.2857
     204H       15.0443 0       15.2943
     205H       15.0443 0       17.1429
     206H       15.0443 0       18.1514
     207H       15.0443 0       2.85714
     208H       15.0443 0       3.86571
     209H       15.0443 0       5.71429
     210H       15.0443 0       6.72285
     211H       15.0443 0       8.57143
     212H       15.0443 0       9.58
     213H       15.0443 11.4286 0
     214H       15.0443 11.4286 1.00857
     215H       15.0443 11.4286 11.4286
     216H       15.0443 11.4286 12.4371
     217H       15.0443 11.4286 14.2857
     218H       15.0443 11.4286 15.2943
     219H       15.0443 11.4286 17.1429
     220H       15.0443 11.4286 18.1514
     221H       15.0443 11.4286 2.85714
     222H       15.0443 11.4286 3.86571
     223H       15.0443 11.4286 5.71429
     224H       15.0443 11.4286 6.72285
     225H       15.0443 11.4286 8.57143
     226H       15.0443 11.4286 9.58
     227H       15.0443 14.2857 0
     228H       15.0443 14.2857 1.00857
     229H       15.0443 14.2857 11.4286
     230H       15.0443 14.2857 12.4371
     231H       15.0443 14.2857 14.2857
     232H       15.0443 14.2857 15.2943
     233H       15.0443 14.2857 17.1429
     234H       15.0443 14.2857 18.1514
     235H       15.0443 14.2857 2.85714
     236H       15.0443 14.2857 3.86571
     237H       15.0443 14.2857 5.71429
     238H       15.0443 14.2857 6.72285
     239H       15.0443 14.2857 8.57143
     240H       15.0443 14.2857 9.58
     241H       15.0443 17.1429 0
     242H       15.0443 17.1429 1.00857
     243H       15.0443 17.1429 11.4286
     244H       15.0443 17.1429 12.4371
     245H       15.0443 17.1429 14.2857
     246H       15.0443 17.1429 15.2943
     247H       15.0443 17.1429 17.1429
     248H       15.0443 17.1429 18.1514
     249H       15.0443 17.1429 2.85714
     250H       15.0443 17.1429 3.86571
     251H       15.0443 17.1429 5.71429
     252H       15.0443 17.1429 6.72285
     253H       15.0443 17.1429 8.57143
     254H       15.0443 17.1429 9.58
     255H       15.0443 2.85714 0
     256H       15.0443 2.85714 1.00857
     257H       15.0443 2.85714 11.4286
     258H       15.0443 2.85714 12.4371
     259H       15.0443 2.85714 14.2857
     260H       15.0443 2.85714 15.2943
     261H       15.0443 2.85714 17.1429
     262H       15.0443 2.85714 18.1514
     263H       15.0443 2.85714 2.85714
     264H       15.0443 2.85714 3.86571
     265H       15.0443 2.85714 5.71429
     266H       15.0443 2.85714 6.72285
     267H       15.0443 2.85714 8.57143
     268H       15.0443 2.85714 9.58
     269H       15.0443 5.71429 0
     270H       15.0443 5.71429 1.00857
     271H       15.0443 5.71429 11.4286
     272H       15.0443 5.71429 12.4371
     273H       15.0443 5.71429 14.2857
     274H       15.0443 5.71429 15.2943
     275H       15.0443 5.71429 17.1429
     276H       15.0443 5.71429 18.1514
     277H       15.0443 5.71429 2.85714
     278H       15.0443 5.71429 3.86571
     279H       15.0443 5.71429 5.71429
     280H       15.0443 5.71429 6.72285
     281H       15.0443 5.71429 8.57143
     282H       15.0443 5.71429 9.58
     283H       15.0443 8.57143 0
     284H       15.0443 8.57143 1.00857
     285H       15.0443 8.57143 11.4286
     286H       15.0443 8.57143 12.4371
     287H       15.0443 8.57143 14.2857
     288H       15.0443 8.57143 15.2943
     289H       15.0443 8.57143 17.1429
     290H       15.0443 8.57143 18.1514
     291H       15.0443 8.57143 2.85714
     292H       15.0443 8.57143 3.86571
     293H       15.0443 8.57143 5.71429
     294H       15.0443 8.57143 6.72285
     295H       15.0443 8.57143 8.57143
     296H       15.0443 8.57143 9.58
     297H       17.9015 0       0
     298H       17.9015 0       1.00857
     299H       17.9015 0       11.4286
     300H       17.9015 0       12.4371
     301H       17.9015 0       14.2857
     302H       17.9015 0       15.2943
     303H       17.9015 0       17.1429
     304H       17.9015 0       18.1514
     305H       17.9015 0       2.85714
     306H       17.9015 0       3.86571
     307H       17.9015 0       5.71429
     308H       17.9015 0       6.72285
     309H       17.9015 0       8.57143
     310H       17.9015 0       9.58
     311H       17.9015 11.4286 0
     312H       17.9015 11.4286 1.00857
     313H       17.9015 11.4286 11.4286
     314H       17.9015 11.4286 12.4371
     315H       17.9015 11.4286 14.2857
     316H       17.9015 11.4286 15.2943
     317H       17.9015 11.4286 17.1429
     318H       17.9015 11.4286 18.1514
     319H       17.9015 11.4286 2.85714
     320H       17.9015 11.4286 3.86571
     321H       17.9015 11.4286 5.71429
     322H       17.9015 11.4286 6.72285
     323H       17.9015 11.4286 8.57143
     324H       17.9015 11.4286 9.58
     325H       17.9015 14.2857 0
     326H       17.9015 14.2857 1.00857
     327H       17.9015 14.2857 11.4286
     328H       17.9015 14.2857 12.4371
     329H       17.9015 14.2857 14.2857
     330H       17.9015 14.2857 15.2943
     331H       17.9015 14.2857 17.1429
     332H       17.9015 14.2857 18.1514
     333H       17.9015 14.2857 2.85714
     334H       17.9015 14.2857 3.86571
     335H       17.9015 14.2857 5.71429
     336H       17.9015 14.2857 6.72285
     337H       17.9015 14.2857 8.57143
     338H       17.9015 14.2857 9.58
     339H       17.9015 17.1429 0
     340H       17.9015 17.1429 1.00857
     341H       17.9015 17.1429 11.4286
     342H       17.9015 17.1429 12.4371
     343H       17.9015 17.1429 14.2857
     344H       17.9015 17.1429 15.2943
     345H       17.9015 17.1429 17.1429
     346H       17.9015 17.1429 18.1514
     347H       17.9015 17.1429 2.85714
     348H       17.9015 17.1429 3.86571
     349H       17.9015 17.1429 5.71429
     350H       17.9015 17.1429 6.72285
     351H       17.9015 17.1429 8.57143
     352H       17.9015 17.1429 9.58
     353H       17.9015 2.85714 0
     354H       17.9015 2.85714 1.00857
     355H       17.9015 2.85714 11.4286
     356H       17.9015 2.85714 12.4371
     357H       17.9015 2.85714 14.2857
     358H       17.9015 2.85714 15.2943
     359H       17.9015 2.85714 17.1429
     360H       17.9015 2.85714 18.1514
     361H       17.9015 2.85714 2.85714
     362H       17.9015 2.85714 3.86571
     363H       17.9015 2.85714 5.71429
     364H       17.9015 2.85714 6.72285
     365H       17.9015 2.85714 8.57143
     366H       17.9015 2.85714 9.58
     367H       17.9015 5.71429 0
     368H       17.9015 5.71429 1.00857
     369H       17.9015 5.71429 11.4286
     370H       17.9015 5.71429 12.4371
     371H       17.9015 5.71429 14.2857
     372H       17.9015 5.71429 15.2943
     373H       17.9015 5.71429 17.1429
     374H       17.9015 5.71429 18.1514
     375H       17.9015 5.71429 2.85714
     376H       17.9015 5.71429 3.86571
     377H       17.9015 5.71429 5.71429
     378H       17.9015 5.71429 6.72285
     379H       17.9015 5.71429 8.57143
     380H       17.9015 5.71429 9.58
     381H       17.9015 8.57143 0
     382H       17.9015 8.57143 1.00857
     383H       17.9015 8.57143 11.4286
     384H       17.9015 8.57143 12.4371
     385H       17.9015 8.57143 14.2857
     386H       17.9015 8.57143 15.2943
     387H       17.9015 8.57143 17.1429
     388H       17.9015 8.57143 18.1514
     389H       17.9015 8.57143 2.85714
     390H       17.9015 8.57143 3.86571
     391H       17.9015 8.57143 5.71429
     392H       17.9015 8.57143 6.72285
     393H       17.9015 8.57143 8.57143
     394H       17.9015 8.57143 9.58
    26395H       3.61574 0       0
    27396H       3.61574 0       1.00857
     397H       3.61574 0       11.4286
     398H       3.61574 0       12.4371
     399H       3.61574 0       14.2857
     400H       3.61574 0       15.2943
     401H       3.61574 0       17.1429
     402H       3.61574 0       18.1514
    28403H       3.61574 0       2.85714
    29404H       3.61574 0       3.86571
    30405H       3.61574 0       5.71429
    31406H       3.61574 0       6.72285
     407H       3.61574 0       8.57143
     408H       3.61574 0       9.58
     409H       3.61574 11.4286 0
     410H       3.61574 11.4286 1.00857
     411H       3.61574 11.4286 11.4286
     412H       3.61574 11.4286 12.4371
     413H       3.61574 11.4286 14.2857
     414H       3.61574 11.4286 15.2943
     415H       3.61574 11.4286 17.1429
     416H       3.61574 11.4286 18.1514
     417H       3.61574 11.4286 2.85714
     418H       3.61574 11.4286 3.86571
     419H       3.61574 11.4286 5.71429
     420H       3.61574 11.4286 6.72285
     421H       3.61574 11.4286 8.57143
     422H       3.61574 11.4286 9.58
     423H       3.61574 14.2857 0
     424H       3.61574 14.2857 1.00857
     425H       3.61574 14.2857 11.4286
     426H       3.61574 14.2857 12.4371
     427H       3.61574 14.2857 14.2857
     428H       3.61574 14.2857 15.2943
     429H       3.61574 14.2857 17.1429
     430H       3.61574 14.2857 18.1514
     431H       3.61574 14.2857 2.85714
     432H       3.61574 14.2857 3.86571
     433H       3.61574 14.2857 5.71429
     434H       3.61574 14.2857 6.72285
     435H       3.61574 14.2857 8.57143
     436H       3.61574 14.2857 9.58
     437H       3.61574 17.1429 0
     438H       3.61574 17.1429 1.00857
     439H       3.61574 17.1429 11.4286
     440H       3.61574 17.1429 12.4371
     441H       3.61574 17.1429 14.2857
     442H       3.61574 17.1429 15.2943
     443H       3.61574 17.1429 17.1429
     444H       3.61574 17.1429 18.1514
     445H       3.61574 17.1429 2.85714
     446H       3.61574 17.1429 3.86571
     447H       3.61574 17.1429 5.71429
     448H       3.61574 17.1429 6.72285
     449H       3.61574 17.1429 8.57143
     450H       3.61574 17.1429 9.58
    32451H       3.61574 2.85714 0
    33452H       3.61574 2.85714 1.00857
     453H       3.61574 2.85714 11.4286
     454H       3.61574 2.85714 12.4371
     455H       3.61574 2.85714 14.2857
     456H       3.61574 2.85714 15.2943
     457H       3.61574 2.85714 17.1429
     458H       3.61574 2.85714 18.1514
    34459H       3.61574 2.85714 2.85714
    35460H       3.61574 2.85714 3.86571
     
    37462H       3.61574 2.85714 6.72285
    38463H       3.61574 2.85714 8.57143
     464H       3.61574 2.85714 9.58
    39465H       3.61574 5.71429 0
    40466H       3.61574 5.71429 1.00857
     467H       3.61574 5.71429 11.4286
     468H       3.61574 5.71429 12.4371
     469H       3.61574 5.71429 14.2857
     470H       3.61574 5.71429 15.2943
     471H       3.61574 5.71429 17.1429
     472H       3.61574 5.71429 18.1514
    41473H       3.61574 5.71429 2.85714
    42474H       3.61574 5.71429 3.86571
     
    44476H       3.61574 5.71429 6.72285
    45477H       3.61574 5.71429 8.57143
     478H       3.61574 5.71429 9.58
     479H       3.61574 8.57143 0
    46480H       3.61574 8.57143 1.00857
     481H       3.61574 8.57143 11.4286
     482H       3.61574 8.57143 12.4371
     483H       3.61574 8.57143 14.2857
     484H       3.61574 8.57143 15.2943
     485H       3.61574 8.57143 17.1429
     486H       3.61574 8.57143 18.1514
    47487H       3.61574 8.57143 2.85714
    48488H       3.61574 8.57143 3.86571
    49489H       3.61574 8.57143 5.71429
     490H       3.61574 8.57143 6.72285
     491H       3.61574 8.57143 8.57143
     492H       3.61574 8.57143 9.58
    50493H       6.39363 3.90454 3.53589
    51494H       6.47289 0       0
    52495H       6.47289 0       1.00857
     496H       6.47289 0       11.4286
     497H       6.47289 0       12.4371
     498H       6.47289 0       14.2857
     499H       6.47289 0       15.2943
     500H       6.47289 0       17.1429
     501H       6.47289 0       18.1514
    53502H       6.47289 0       2.85714
    54503H       6.47289 0       3.86571
     
    57506H       6.47289 0       8.57143
    58507H       6.47289 0       9.58
     508H       6.47289 11.4286 0
     509H       6.47289 11.4286 1.00857
     510H       6.47289 11.4286 11.4286
     511H       6.47289 11.4286 12.4371
     512H       6.47289 11.4286 14.2857
     513H       6.47289 11.4286 15.2943
     514H       6.47289 11.4286 17.1429
     515H       6.47289 11.4286 18.1514
     516H       6.47289 11.4286 2.85714
     517H       6.47289 11.4286 3.86571
     518H       6.47289 11.4286 5.71429
     519H       6.47289 11.4286 6.72285
     520H       6.47289 11.4286 8.57143
     521H       6.47289 11.4286 9.58
     522H       6.47289 14.2857 0
     523H       6.47289 14.2857 1.00857
     524H       6.47289 14.2857 11.4286
     525H       6.47289 14.2857 12.4371
     526H       6.47289 14.2857 14.2857
     527H       6.47289 14.2857 15.2943
     528H       6.47289 14.2857 17.1429
     529H       6.47289 14.2857 18.1514
     530H       6.47289 14.2857 2.85714
     531H       6.47289 14.2857 3.86571
     532H       6.47289 14.2857 5.71429
     533H       6.47289 14.2857 6.72285
     534H       6.47289 14.2857 8.57143
     535H       6.47289 14.2857 9.58
     536H       6.47289 17.1429 0
     537H       6.47289 17.1429 1.00857
     538H       6.47289 17.1429 11.4286
     539H       6.47289 17.1429 12.4371
     540H       6.47289 17.1429 14.2857
     541H       6.47289 17.1429 15.2943
     542H       6.47289 17.1429 17.1429
     543H       6.47289 17.1429 18.1514
     544H       6.47289 17.1429 2.85714
     545H       6.47289 17.1429 3.86571
     546H       6.47289 17.1429 5.71429
     547H       6.47289 17.1429 6.72285
     548H       6.47289 17.1429 8.57143
     549H       6.47289 17.1429 9.58
    59550H       6.47289 2.85714 0
     551H       6.47289 2.85714 11.4286
     552H       6.47289 2.85714 12.4371
     553H       6.47289 2.85714 14.2857
     554H       6.47289 2.85714 15.2943
     555H       6.47289 2.85714 17.1429
     556H       6.47289 2.85714 18.1514
    60557H       6.47289 2.85714 6.72285
    61558H       6.47289 2.85714 8.57143
     
    63560H       6.47289 5.71429 0
    64561H       6.47289 5.71429 1.00857
     562H       6.47289 5.71429 11.4286
     563H       6.47289 5.71429 12.4371
     564H       6.47289 5.71429 14.2857
     565H       6.47289 5.71429 15.2943
     566H       6.47289 5.71429 17.1429
     567H       6.47289 5.71429 18.1514
    65568H       6.47289 5.71429 5.71429
    66569H       6.47289 5.71429 6.72285
     
    69572H       6.47289 8.57143 0
    70573H       6.47289 8.57143 1.00857
     574H       6.47289 8.57143 11.4286
     575H       6.47289 8.57143 12.4371
     576H       6.47289 8.57143 14.2857
     577H       6.47289 8.57143 15.2943
     578H       6.47289 8.57143 17.1429
     579H       6.47289 8.57143 18.1514
    71580H       6.47289 8.57143 2.85714
    72581H       6.47289 8.57143 3.86571
    73582H       6.47289 8.57143 5.71429
    74583H       6.47289 8.57143 6.72285
     584H       6.47289 8.57143 8.57143
     585H       6.47289 8.57143 9.58
    75586H       7.28359 2.64589 2.64589
    76587H       7.28359 2.64589 4.42589
     
    79590H       9.33003 0       0
    80591H       9.33003 0       1.00857
     592H       9.33003 0       11.4286
     593H       9.33003 0       12.4371
     594H       9.33003 0       14.2857
     595H       9.33003 0       15.2943
     596H       9.33003 0       17.1429
     597H       9.33003 0       18.1514
    81598H       9.33003 0       2.85714
    82599H       9.33003 0       3.86571
     
    84601H       9.33003 0       6.72285
    85602H       9.33003 0       8.57143
     603H       9.33003 0       9.58
     604H       9.33003 11.4286 0
     605H       9.33003 11.4286 1.00857
     606H       9.33003 11.4286 11.4286
     607H       9.33003 11.4286 12.4371
     608H       9.33003 11.4286 14.2857
     609H       9.33003 11.4286 15.2943
     610H       9.33003 11.4286 17.1429
     611H       9.33003 11.4286 18.1514
     612H       9.33003 11.4286 2.85714
     613H       9.33003 11.4286 3.86571
     614H       9.33003 11.4286 5.71429
     615H       9.33003 11.4286 6.72285
     616H       9.33003 11.4286 8.57143
     617H       9.33003 11.4286 9.58
     618H       9.33003 14.2857 0
     619H       9.33003 14.2857 1.00857
     620H       9.33003 14.2857 11.4286
     621H       9.33003 14.2857 12.4371
     622H       9.33003 14.2857 14.2857
     623H       9.33003 14.2857 15.2943
     624H       9.33003 14.2857 17.1429
     625H       9.33003 14.2857 18.1514
     626H       9.33003 14.2857 2.85714
     627H       9.33003 14.2857 3.86571
     628H       9.33003 14.2857 5.71429
     629H       9.33003 14.2857 6.72285
     630H       9.33003 14.2857 8.57143
     631H       9.33003 14.2857 9.58
     632H       9.33003 17.1429 0
     633H       9.33003 17.1429 1.00857
     634H       9.33003 17.1429 11.4286
     635H       9.33003 17.1429 12.4371
     636H       9.33003 17.1429 14.2857
     637H       9.33003 17.1429 15.2943
     638H       9.33003 17.1429 17.1429
     639H       9.33003 17.1429 18.1514
     640H       9.33003 17.1429 2.85714
     641H       9.33003 17.1429 3.86571
     642H       9.33003 17.1429 5.71429
     643H       9.33003 17.1429 6.72285
     644H       9.33003 17.1429 8.57143
     645H       9.33003 17.1429 9.58
    86646H       9.33003 2.85714 0
     647H       9.33003 2.85714 11.4286
     648H       9.33003 2.85714 12.4371
     649H       9.33003 2.85714 14.2857
     650H       9.33003 2.85714 15.2943
     651H       9.33003 2.85714 17.1429
     652H       9.33003 2.85714 18.1514
    87653H       9.33003 2.85714 6.72285
    88654H       9.33003 2.85714 8.57143
    89655H       9.33003 2.85714 9.58
    90656H       9.33003 5.71429 0
     657H       9.33003 5.71429 11.4286
     658H       9.33003 5.71429 12.4371
     659H       9.33003 5.71429 14.2857
     660H       9.33003 5.71429 15.2943
     661H       9.33003 5.71429 17.1429
     662H       9.33003 5.71429 18.1514
    91663H       9.33003 5.71429 6.72285
    92664H       9.33003 5.71429 8.57143
     
    94666H       9.33003 8.57143 0
    95667H       9.33003 8.57143 1.00857
     668H       9.33003 8.57143 11.4286
     669H       9.33003 8.57143 12.4371
     670H       9.33003 8.57143 14.2857
     671H       9.33003 8.57143 15.2943
     672H       9.33003 8.57143 17.1429
     673H       9.33003 8.57143 18.1514
    96674H       9.33003 8.57143 2.85714
    97675H       9.33003 8.57143 3.86571
    98676H       9.33003 8.57143 5.71429
    99677H       9.33003 8.57143 6.72285
     678H       9.33003 8.57143 8.57143
     679H       9.33003 8.57143 9.58
    100680H       9.78209 2.64589 2.64589
    101681H       9.78209 2.64589 4.42589
     682O       0       0       0.504284
     683O       0       0       11.9329
     684O       0       0       14.79
     685O       0       0       17.6471
     686O       0       0       3.36143
     687O       0       0       6.21857
     688O       0       0       9.07571
     689O       0       11.4286 0.504284
     690O       0       11.4286 11.9329
     691O       0       11.4286 14.79
     692O       0       11.4286 17.6471
     693O       0       11.4286 3.36143
     694O       0       11.4286 6.21857
     695O       0       11.4286 9.07571
     696O       0       14.2857 0.504284
     697O       0       14.2857 11.9329
     698O       0       14.2857 14.79
     699O       0       14.2857 17.6471
     700O       0       14.2857 3.36143
     701O       0       14.2857 6.21857
     702O       0       14.2857 9.07571
     703O       0       17.1429 0.504284
     704O       0       17.1429 11.9329
     705O       0       17.1429 14.79
     706O       0       17.1429 17.6471
     707O       0       17.1429 3.36143
     708O       0       17.1429 6.21857
     709O       0       17.1429 9.07571
     710O       0       2.85714 0.504284
     711O       0       2.85714 11.9329
     712O       0       2.85714 14.79
     713O       0       2.85714 17.6471
     714O       0       2.85714 3.36143
     715O       0       2.85714 6.21857
     716O       0       2.85714 9.07571
     717O       0       5.71429 0.504284
     718O       0       5.71429 11.9329
     719O       0       5.71429 14.79
     720O       0       5.71429 17.6471
     721O       0       5.71429 3.36143
     722O       0       5.71429 6.21857
     723O       0       5.71429 9.07571
     724O       0       8.57143 0.504284
     725O       0       8.57143 11.9329
     726O       0       8.57143 14.79
     727O       0       8.57143 17.6471
     728O       0       8.57143 3.36143
     729O       0       8.57143 6.21857
     730O       0       8.57143 9.07571
    102731O       11.4286 0       0.504284
     732O       11.4286 0       11.9329
     733O       11.4286 0       14.79
     734O       11.4286 0       17.6471
    103735O       11.4286 0       3.36143
    104736O       11.4286 0       6.21857
     737O       11.4286 0       9.07571
     738O       11.4286 11.4286 0.504284
     739O       11.4286 11.4286 11.9329
     740O       11.4286 11.4286 14.79
     741O       11.4286 11.4286 17.6471
     742O       11.4286 11.4286 3.36143
     743O       11.4286 11.4286 6.21857
     744O       11.4286 11.4286 9.07571
     745O       11.4286 14.2857 0.504284
     746O       11.4286 14.2857 11.9329
     747O       11.4286 14.2857 14.79
     748O       11.4286 14.2857 17.6471
     749O       11.4286 14.2857 3.36143
     750O       11.4286 14.2857 6.21857
     751O       11.4286 14.2857 9.07571
     752O       11.4286 17.1429 0.504284
     753O       11.4286 17.1429 11.9329
     754O       11.4286 17.1429 14.79
     755O       11.4286 17.1429 17.6471
     756O       11.4286 17.1429 3.36143
     757O       11.4286 17.1429 6.21857
     758O       11.4286 17.1429 9.07571
    105759O       11.4286 2.85714 0.504284
     760O       11.4286 2.85714 11.9329
     761O       11.4286 2.85714 14.79
     762O       11.4286 2.85714 17.6471
    106763O       11.4286 2.85714 6.21857
    107764O       11.4286 2.85714 9.07571
    108765O       11.4286 5.71429 0.504284
     766O       11.4286 5.71429 11.9329
     767O       11.4286 5.71429 14.79
     768O       11.4286 5.71429 17.6471
    109769O       11.4286 5.71429 6.21857
     770O       11.4286 5.71429 9.07571
     771O       11.4286 8.57143 0.504284
     772O       11.4286 8.57143 11.9329
     773O       11.4286 8.57143 14.79
     774O       11.4286 8.57143 17.6471
    110775O       11.4286 8.57143 3.36143
     776O       11.4286 8.57143 6.21857
     777O       11.4286 8.57143 9.07571
     778O       14.2857 0       0.504284
     779O       14.2857 0       11.9329
     780O       14.2857 0       14.79
     781O       14.2857 0       17.6471
     782O       14.2857 0       3.36143
     783O       14.2857 0       6.21857
     784O       14.2857 0       9.07571
     785O       14.2857 11.4286 0.504284
     786O       14.2857 11.4286 11.9329
     787O       14.2857 11.4286 14.79
     788O       14.2857 11.4286 17.6471
     789O       14.2857 11.4286 3.36143
     790O       14.2857 11.4286 6.21857
     791O       14.2857 11.4286 9.07571
     792O       14.2857 14.2857 0.504284
     793O       14.2857 14.2857 11.9329
     794O       14.2857 14.2857 14.79
     795O       14.2857 14.2857 17.6471
     796O       14.2857 14.2857 3.36143
     797O       14.2857 14.2857 6.21857
     798O       14.2857 14.2857 9.07571
     799O       14.2857 17.1429 0.504284
     800O       14.2857 17.1429 11.9329
     801O       14.2857 17.1429 14.79
     802O       14.2857 17.1429 17.6471
     803O       14.2857 17.1429 3.36143
     804O       14.2857 17.1429 6.21857
     805O       14.2857 17.1429 9.07571
     806O       14.2857 2.85714 0.504284
     807O       14.2857 2.85714 11.9329
     808O       14.2857 2.85714 14.79
     809O       14.2857 2.85714 17.6471
     810O       14.2857 2.85714 3.36143
     811O       14.2857 2.85714 6.21857
     812O       14.2857 2.85714 9.07571
     813O       14.2857 5.71429 0.504284
     814O       14.2857 5.71429 11.9329
     815O       14.2857 5.71429 14.79
     816O       14.2857 5.71429 17.6471
     817O       14.2857 5.71429 3.36143
     818O       14.2857 5.71429 6.21857
     819O       14.2857 5.71429 9.07571
     820O       14.2857 8.57143 0.504284
     821O       14.2857 8.57143 11.9329
     822O       14.2857 8.57143 14.79
     823O       14.2857 8.57143 17.6471
     824O       14.2857 8.57143 3.36143
     825O       14.2857 8.57143 6.21857
     826O       14.2857 8.57143 9.07571
     827O       17.1429 0       0.504284
     828O       17.1429 0       11.9329
     829O       17.1429 0       14.79
     830O       17.1429 0       17.6471
     831O       17.1429 0       3.36143
     832O       17.1429 0       6.21857
     833O       17.1429 0       9.07571
     834O       17.1429 11.4286 0.504284
     835O       17.1429 11.4286 11.9329
     836O       17.1429 11.4286 14.79
     837O       17.1429 11.4286 17.6471
     838O       17.1429 11.4286 3.36143
     839O       17.1429 11.4286 6.21857
     840O       17.1429 11.4286 9.07571
     841O       17.1429 14.2857 0.504284
     842O       17.1429 14.2857 11.9329
     843O       17.1429 14.2857 14.79
     844O       17.1429 14.2857 17.6471
     845O       17.1429 14.2857 3.36143
     846O       17.1429 14.2857 6.21857
     847O       17.1429 14.2857 9.07571
     848O       17.1429 17.1429 0.504284
     849O       17.1429 17.1429 11.9329
     850O       17.1429 17.1429 14.79
     851O       17.1429 17.1429 17.6471
     852O       17.1429 17.1429 3.36143
     853O       17.1429 17.1429 6.21857
     854O       17.1429 17.1429 9.07571
     855O       17.1429 2.85714 0.504284
     856O       17.1429 2.85714 11.9329
     857O       17.1429 2.85714 14.79
     858O       17.1429 2.85714 17.6471
     859O       17.1429 2.85714 3.36143
     860O       17.1429 2.85714 6.21857
     861O       17.1429 2.85714 9.07571
     862O       17.1429 5.71429 0.504284
     863O       17.1429 5.71429 11.9329
     864O       17.1429 5.71429 14.79
     865O       17.1429 5.71429 17.6471
     866O       17.1429 5.71429 3.36143
     867O       17.1429 5.71429 6.21857
     868O       17.1429 5.71429 9.07571
     869O       17.1429 8.57143 0.504284
     870O       17.1429 8.57143 11.9329
     871O       17.1429 8.57143 14.79
     872O       17.1429 8.57143 17.6471
     873O       17.1429 8.57143 3.36143
     874O       17.1429 8.57143 6.21857
     875O       17.1429 8.57143 9.07571
    111876O       2.85714 0       0.504284
     877O       2.85714 0       11.9329
     878O       2.85714 0       14.79
     879O       2.85714 0       17.6471
    112880O       2.85714 0       3.36143
    113881O       2.85714 0       6.21857
     882O       2.85714 0       9.07571
     883O       2.85714 11.4286 0.504284
     884O       2.85714 11.4286 11.9329
     885O       2.85714 11.4286 14.79
     886O       2.85714 11.4286 17.6471
     887O       2.85714 11.4286 3.36143
     888O       2.85714 11.4286 6.21857
     889O       2.85714 11.4286 9.07571
     890O       2.85714 14.2857 0.504284
     891O       2.85714 14.2857 11.9329
     892O       2.85714 14.2857 14.79
     893O       2.85714 14.2857 17.6471
     894O       2.85714 14.2857 3.36143
     895O       2.85714 14.2857 6.21857
     896O       2.85714 14.2857 9.07571
     897O       2.85714 17.1429 0.504284
     898O       2.85714 17.1429 11.9329
     899O       2.85714 17.1429 14.79
     900O       2.85714 17.1429 17.6471
     901O       2.85714 17.1429 3.36143
     902O       2.85714 17.1429 6.21857
     903O       2.85714 17.1429 9.07571
    114904O       2.85714 2.85714 0.504284
     905O       2.85714 2.85714 11.9329
     906O       2.85714 2.85714 14.79
     907O       2.85714 2.85714 17.6471
    115908O       2.85714 2.85714 3.36143
    116909O       2.85714 2.85714 6.21857
     910O       2.85714 2.85714 9.07571
    117911O       2.85714 5.71429 0.504284
     912O       2.85714 5.71429 11.9329
     913O       2.85714 5.71429 14.79
     914O       2.85714 5.71429 17.6471
    118915O       2.85714 5.71429 3.36143
    119916O       2.85714 5.71429 6.21857
     917O       2.85714 5.71429 9.07571
     918O       2.85714 8.57143 0.504284
     919O       2.85714 8.57143 11.9329
     920O       2.85714 8.57143 14.79
     921O       2.85714 8.57143 17.6471
    120922O       2.85714 8.57143 3.36143
     923O       2.85714 8.57143 6.21857
     924O       2.85714 8.57143 9.07571
    121925O       5.71429 0       0.504284
     926O       5.71429 0       11.9329
     927O       5.71429 0       14.79
     928O       5.71429 0       17.6471
    122929O       5.71429 0       3.36143
    123930O       5.71429 0       6.21857
    124931O       5.71429 0       9.07571
     932O       5.71429 11.4286 0.504284
     933O       5.71429 11.4286 11.9329
     934O       5.71429 11.4286 14.79
     935O       5.71429 11.4286 17.6471
     936O       5.71429 11.4286 3.36143
     937O       5.71429 11.4286 6.21857
     938O       5.71429 11.4286 9.07571
     939O       5.71429 14.2857 0.504284
     940O       5.71429 14.2857 11.9329
     941O       5.71429 14.2857 14.79
     942O       5.71429 14.2857 17.6471
     943O       5.71429 14.2857 3.36143
     944O       5.71429 14.2857 6.21857
     945O       5.71429 14.2857 9.07571
     946O       5.71429 17.1429 0.504284
     947O       5.71429 17.1429 11.9329
     948O       5.71429 17.1429 14.79
     949O       5.71429 17.1429 17.6471
     950O       5.71429 17.1429 3.36143
     951O       5.71429 17.1429 6.21857
     952O       5.71429 17.1429 9.07571
    125953O       5.71429 2.85714 0.504284
     954O       5.71429 2.85714 11.9329
     955O       5.71429 2.85714 14.79
     956O       5.71429 2.85714 17.6471
    126957O       5.71429 2.85714 6.21857
    127958O       5.71429 2.85714 9.07571
    128959O       5.71429 5.71429 0.504284
     960O       5.71429 5.71429 11.9329
     961O       5.71429 5.71429 14.79
     962O       5.71429 5.71429 17.6471
    129963O       5.71429 5.71429 6.21857
    130964O       5.71429 5.71429 9.07571
    131965O       5.71429 8.57143 0.504284
     966O       5.71429 8.57143 11.9329
     967O       5.71429 8.57143 14.79
     968O       5.71429 8.57143 17.6471
    132969O       5.71429 8.57143 3.36143
    133970O       5.71429 8.57143 6.21857
     971O       5.71429 8.57143 9.07571
    134972O       8.57143 0       0.504284
     973O       8.57143 0       11.9329
     974O       8.57143 0       14.79
     975O       8.57143 0       17.6471
    135976O       8.57143 0       3.36143
    136977O       8.57143 0       6.21857
    137978O       8.57143 0       9.07571
     979O       8.57143 11.4286 0.504284
     980O       8.57143 11.4286 11.9329
     981O       8.57143 11.4286 14.79
     982O       8.57143 11.4286 17.6471
     983O       8.57143 11.4286 3.36143
     984O       8.57143 11.4286 6.21857
     985O       8.57143 11.4286 9.07571
     986O       8.57143 14.2857 0.504284
     987O       8.57143 14.2857 11.9329
     988O       8.57143 14.2857 14.79
     989O       8.57143 14.2857 17.6471
     990O       8.57143 14.2857 3.36143
     991O       8.57143 14.2857 6.21857
     992O       8.57143 14.2857 9.07571
     993O       8.57143 17.1429 0.504284
     994O       8.57143 17.1429 11.9329
     995O       8.57143 17.1429 14.79
     996O       8.57143 17.1429 17.6471
     997O       8.57143 17.1429 3.36143
     998O       8.57143 17.1429 6.21857
     999O       8.57143 17.1429 9.07571
    1381000O       8.57143 2.85714 0.504284
     1001O       8.57143 2.85714 11.9329
     1002O       8.57143 2.85714 14.79
     1003O       8.57143 2.85714 17.6471
    1391004O       8.57143 2.85714 9.07571
    1401005O       8.57143 5.71429 0.504284
     1006O       8.57143 5.71429 11.9329
     1007O       8.57143 5.71429 14.79
     1008O       8.57143 5.71429 17.6471
    1411009O       8.57143 5.71429 9.07571
    1421010O       8.57143 8.57143 0.504284
     1011O       8.57143 8.57143 11.9329
     1012O       8.57143 8.57143 14.79
     1013O       8.57143 8.57143 17.6471
    1431014O       8.57143 8.57143 3.36143
    1441015O       8.57143 8.57143 6.21857
    145 144
     1016O       8.57143 8.57143 9.07571
  • tests/regression/atlocal.in

    r8006ee r994713  
    11prefix='@prefix@'
    22exec_prefix='@prefix@'
    3 topdir='@topdir@'
     3topdir='@abs_top_builddir@'
    44bindir='@bindir@'
     5valgrind='@VALGRIND@'
  • tests/regression/molecuilder.in

    r8006ee r994713  
    33# wrapper for testing molecuilder
    44
    5 . ../../atconfig
     5. ../../atlocal
    66
    7 "${abs_top_builddir}/src/molecuilder" \
    8         ${1+"$@"}
     7if test ! -z ${valgrind}
     8then
     9G_SLICE=always-malloc G_DEBUG=gc-friendly \
     10libtool --mode=execute \
     11${valgrind} -v \
     12--log-file=valgrind.log \
     13--xml=yes \
     14--xml-file=valgrind.err \
     15--time-stamp=yes \
     16--error-exitcode=255 \
     17--leak-check=full \
     18--leak-resolution=high \
     19--num-callers=20 \
     20--track-origins=yes \
     21--show-reachable=yes \
     22"${topdir}/src/molecuilder" \
     23${1+"$@"}
     24else
     25"${topdir}/src/molecuilder" \
     26${1+"$@"}
     27fi
     28
    929status=$?
    1030
  • tests/regression/testsuite-analysis.at

    r8006ee r994713  
    3939AT_KEYWORDS([analysis])
    4040AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Analysis/4/pre/test.conf .], 0)
    41 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --select-all-molecules --unselect-molecule-by-id 207 --surface-correlation --elements 1 --output-file output.csv --bin-output-file bin_output.csv --bin-start 0 --bin-width 1. --bin-end 20 --molecule-by-id 207], 0, [stdout], [stderr])
     41AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --select-all-molecules --unselect-molecule-by-formula C3H8 --surface-correlation --elements 1 --output-file output.csv --bin-output-file bin_output.csv --bin-start 0 --bin-width 1. --bin-end 20 --molecule-by-id 1], 0, [stdout], [stderr])
    4242AT_CHECK([fgrep "Begin of CorrelationToSurface" stdout], 0, [ignore], [ignore])
    4343#AT_CHECK([file=output.csv; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Analysis/4/post/$file], 0, [ignore], [ignore])
  • tests/regression/testsuite-graph.at

    r8006ee r994713  
    1616AT_CLEANUP
    1717
     18AT_SETUP([Graph - subgraph dissection with Undo/Redo])
     19AT_KEYWORDS([graph])
     20AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0)
     21AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I], 0, [stdout], [stderr])
     22AT_CHECK([fgrep "I scanned 31 molecules." stdout], 0, [ignore], [ignore])
     23AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0)
     24AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --undo], 0, [stdout], [stderr])
     25AT_CHECK([fgrep "I scanned 31 molecules." stdout], 0, [ignore], [ignore])
     26AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0)
     27AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --undo --redo], 0, [stdout], [stderr])
     28AT_CHECK([grep -c "I scanned 31 molecules." stdout], 0, [2
     29], [ignore])
     30AT_CLEANUP
     31
  • tests/regression/testsuite-simple_configuration.at

    r8006ee r994713  
    3131AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore])
    3232AT_CLEANUP
     33AT_SETUP([Simple configuration - adding atom with Undo/Redo])
     34AT_KEYWORDS([configuration])
     35AT_CHECK([../../molecuilder -i empty.conf -o pcp -a 1 --position "10., 10., 10." --undo], 0, [ignore], [ignore])
     36AT_CHECK([file=empty.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     37AT_CHECK([../../molecuilder -i test.conf -o mpqc pcp xyz -a 1 --position "10., 10., 10." --undo --redo], 0, [ignore], [ignore])
     38AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     39AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     40AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore])
     41AT_CLEANUP
    3342
    3443# 4. change the element
     
    3746AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
    3847AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore])
     48AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
     49AT_CLEANUP
     50AT_SETUP([Simple configuration - Changing element with Undo/Redo])
     51AT_KEYWORDS([configuration])
     52AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
     53AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore])
     54AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])
     55AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0)
     56AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore])
    3957AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])
    4058AT_CLEANUP
     
    4866AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    4967AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
     68AT_CLEANUP
     69AT_SETUP([Simple configuration - Atom removal with Undo/Redo])
     70AT_KEYWORDS([configuration])
     71AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
     72AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo], 0, [ignore], [ignore])
     73AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/$file], 0, [ignore], [ignore])
     74AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0)
     75AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo --redo], 0, [ignore], [ignore])
     76AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore])
    5077AT_CLEANUP
    5178
     
    7299AT_CLEANUP
    73100
    74 # 8. Removing sphere of atoms
     101# 8. Removing _shape_ of atoms
    75102AT_SETUP([Simple configuration - Removing sphere of atoms])
    76103AT_KEYWORDS([configuration])
    77 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.* .], 0)
    78 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o xyz -R 7. --position "7.283585982, 3.275186040, 3.535886037"], 0, [stdout], [stderr])
    79 AT_CHECK([sort -n test.xyz | grep -v "Created by" >test.xyz-sorted], 0, [ignore], [ignore])
    80 AT_CHECK([sort -n ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/test.xyz  | grep -v "Created by" >${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/test.xyz-sorted], 0, [ignore], [ignore])
     104AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0)
     105AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r], 0, [stdout], [stderr])
     106AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
     107AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     108AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0)
     109AT_CHECK([../../molecuilder -i test-sphere.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r], 0, [stdout], [stderr])
     110AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
     111AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     112AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
     113AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     114AT_CLEANUP
     115AT_SETUP([Simple configuration - Removing sphere of atoms with Undo/Redo])
     116AT_KEYWORDS([configuration])
     117AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     118AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
     119AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     120AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0)
     121AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
     122AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
     123AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     124AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     125AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr])
     126AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     127AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0)
     128AT_CHECK([../../molecuilder -i test-sphere.xyz --select-all-atoms --unselect-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr])
     129AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
     130AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     131AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
     132AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     133AT_CLEANUP
     134
     135AT_SETUP([Simple configuration - Removing cuboid of atoms])
     136AT_KEYWORDS([configuration])
     137AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0)
     138AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr])
     139AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore])
     140AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     141AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
     142AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr])
     143AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
     144AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     145AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
     146AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     147AT_CLEANUP
     148AT_SETUP([Simple configuration - Removing cuboid of atoms with Undo/Redo])
     149AT_KEYWORDS([configuration])
     150AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     151AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
     152AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     153AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0)
     154AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
     155AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore])
     156AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     157AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0)
     158AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr])
     159AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore])
     160AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0)
     161AT_CHECK([../../molecuilder -i test-cuboid.xyz --select-all-atoms --unselect-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo --redo], 0, [stdout], [stderr])
     162AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore])
     163AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
     164AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
    81165AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore])
    82166AT_CLEANUP
  • tests/regression/testsuite-standard_options.at

    r8006ee r994713  
    55AT_CHECK([pwd],[ignore],[ignore])
    66AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
    7 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
     7AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
     8AT_CLEANUP
     9AT_SETUP([Standard Options - verbosity with Undo/Redo])
     10AT_KEYWORDS([options])
     11AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore])
     12AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore])
     13AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore])
     14AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore])
    815AT_CLEANUP
    916
     
    5360AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore])
    5461AT_CLEANUP
     62AT_SETUP([Standard Options - fast trajectories with Undo/Redo])
     63AT_KEYWORDS([options])
     64AT_CHECK([../../molecuilder -i test.conf -n 1 --undo], 0, [stdout], [stderr])
     65AT_CHECK([fgrep "I will parse trajectories." stdout], 0, [ignore], [ignore])
     66AT_CHECK([../../molecuilder -i test.conf -n 1 --undo --redo], 0, [stdout], [stderr])
     67AT_CHECK([grep -c "I won't parse trajectories" stdout], 0, 2
     68, [ignore])
     69AT_CLEANUP
    5570
    5671# 7. molecule default name
     
    6075AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
    6176AT_CLEANUP
     77AT_SETUP([Standard Options - molecule default name with Undo/Redo])
     78AT_KEYWORDS([options])
     79AT_CHECK([../../molecuilder -i test.conf -X test --undo], 0, [stdout], [stderr])
     80AT_CHECK([fgrep "Default name of new molecules set to none." stdout], 0, [ignore], [ignore])
     81AT_CHECK([../../molecuilder -i test.conf -X test --undo --redo], 0, [stdout], [stderr])
     82AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore])
     83AT_CLEANUP
  • tests/regression/testsuite.at

    r8006ee r994713  
    77AT_TESTED(diff fgrep grep)
    88
     9# Use colored output with new-enough Autotest.
     10m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS])
    911
    1012m4_include(testsuite-standard_options.at)
Note: See TracChangeset for help on using the changeset viewer.