Changes in / [8006ee:994713]
- Files:
-
- 30 added
- 7 deleted
- 293 edited
Legend:
- Unmodified
- Added
- Removed
-
AUTHORS
r8006ee r994713 1 Frederik Heber (heber@ins.uni-bonn.de) 1 Tillmann Crueger (crueger@ins.uni-bonn.de) 2 Daniel Dueck (dueck@ins.uni-bonn.de) 3 Frederik Heber (heber@ins.uni-bonn.de) 4 Saskia Metzler (metzler@ins.uni-bonn.de) 5 Christian Neuen (neuen@ins.uni-bonn.de) -
COPYING
r8006ee r994713 1 <<<<<<< HEAD2 GNU GENERAL PUBLIC LICENSE3 Version 3, 29 June 20074 5 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>6 Everyone is permitted to copy and distribute verbatim copies7 of this license document, but changing it is not allowed.8 9 Preamble10 11 The GNU General Public License is a free, copyleft license for12 software and other kinds of works.13 14 The licenses for most software and other practical works are designed15 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 to17 share and change all versions of a program--to make sure it remains free18 software for all its users. We, the Free Software Foundation, use the19 GNU General Public License for most of our software; it applies also to20 any other work released this way by its authors. You can apply it to21 =======22 1 GNU GENERAL PUBLIC LICENSE 23 2 Version 2, June 1991 … … 38 17 using it. (Some other Free Software Foundation software is covered by 39 18 the GNU Library General Public License instead.) You can apply it to 40 >>>>>>> FETCH_HEAD41 19 your programs, too. 42 20 … … 44 22 price. Our General Public Licenses are designed to make sure that you 45 23 have the freedom to distribute copies of free software (and charge for 46 <<<<<<< HEAD47 them if you wish), that you receive source code or can get it if you48 want it, that you can change the software or use pieces of it in new49 free programs, and that you know you can do these things.50 51 To protect your rights, we need to prevent others from denying you52 these rights or asking you to surrender the rights. Therefore, you have53 certain responsibilities if you distribute copies of the software, or if54 you modify it: responsibilities to respect the freedom of others.55 56 For example, if you distribute copies of such a program, whether57 gratis or for a fee, you must pass on to the recipients the same58 freedoms that you received. You must make sure that they, too, receive59 or can get the source code. And you must show them these terms so they60 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 License64 giving you legal permission to copy, distribute and/or modify it.65 66 For the developers' and authors' protection, the GPL clearly explains67 that there is no warranty for this free software. For both users' and68 authors' sake, the GPL requires that modified versions be marked as69 changed, so that their problems will not be attributed erroneously to70 authors of previous versions.71 72 Some devices are designed to deny users access to install or run73 modified versions of the software inside them, although the manufacturer74 can do so. This is fundamentally incompatible with the aim of75 protecting users' freedom to change the software. The systematic76 pattern of such abuse occurs in the area of products for individuals to77 use, which is precisely where it is most unacceptable. Therefore, we78 have designed this version of the GPL to prohibit the practice for those79 products. If such problems arise substantially in other domains, we80 stand ready to extend this provision to those domains in future versions81 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 of85 software on general-purpose computers, but in those that do, we wish to86 avoid the special danger that patents applied to a free program could87 make it effectively proprietary. To prevent this, the GPL assures that88 patents cannot be used to render the program non-free.89 90 The precise terms and conditions for copying, distribution and91 modification follow.92 93 TERMS AND CONDITIONS94 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 of100 works, such as semiconductor masks.101 102 "The Program" refers to any copyrightable work licensed under this103 License. Each licensee is addressed as "you". "Licensees" and104 "recipients" may be individuals or organizations.105 106 To "modify" a work means to copy from or adapt all or part of the work107 in a fashion requiring copyright permission, other than the making of an108 exact copy. The resulting work is called a "modified version" of the109 earlier work or a work "based on" the earlier work.110 111 A "covered work" means either the unmodified Program or a work based112 on the Program.113 114 To "propagate" a work means to do anything with it that, without115 permission, would make you directly or secondarily liable for116 infringement under applicable copyright law, except executing it on a117 computer or modifying a private copy. Propagation includes copying,118 distribution (with or without modification), making available to the119 public, and in some countries other activities as well.120 121 To "convey" a work means any kind of propagation that enables other122 parties to make or receive copies. Mere interaction with a user through123 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 visible127 feature that (1) displays an appropriate copyright notice, and (2)128 tells the user that there is no warranty for the work (except to the129 extent that warranties are provided), that licensees may convey the130 work under this License, and how to view a copy of this License. If131 the interface presents a list of user commands or options, such as a132 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 work137 for making modifications to it. "Object code" means any non-source138 form of a work.139 140 A "Standard Interface" means an interface that either is an official141 standard defined by a recognized standards body, or, in the case of142 interfaces specified for a particular programming language, one that143 is widely used among developers working in that language.144 145 The "System Libraries" of an executable work include anything, other146 than the work as a whole, that (a) is included in the normal form of147 packaging a Major Component, but which is not part of that Major148 Component, and (b) serves only to enable use of the work with that149 Major Component, or to implement a Standard Interface for which an150 implementation is available to the public in source code form. A151 "Major Component", in this context, means a major essential component152 (kernel, window system, and so on) of the specific operating system153 (if any) on which the executable work runs, or a compiler used to154 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 all157 the source code needed to generate, install, and (for an executable158 work) run the object code and to modify the work, including scripts to159 control those activities. However, it does not include the work's160 System Libraries, or general-purpose tools or generally available free161 programs which are used unmodified in performing those activities but162 which are not part of the work. For example, Corresponding Source163 includes interface definition files associated with source files for164 the work, and the source code for shared libraries and dynamically165 linked subprograms that the work is specifically designed to require,166 such as by intimate data communication or control flow between those167 subprograms and other parts of the work.168 169 The Corresponding Source need not include anything that users170 can regenerate automatically from other parts of the Corresponding171 Source.172 173 The Corresponding Source for a work in source code form is that174 same work.175 176 2. Basic Permissions.177 178 All rights granted under this License are granted for the term of179 copyright on the Program, and are irrevocable provided the stated180 conditions are met. This License explicitly affirms your unlimited181 permission to run the unmodified Program. The output from running a182 covered work is covered by this License only if the output, given its183 content, constitutes a covered work. This License acknowledges your184 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 not187 convey, without conditions so long as your license otherwise remains188 in force. You may convey covered works to others for the sole purpose189 of having them make modifications exclusively for you, or provide you190 with facilities for running those works, provided that you comply with191 the terms of this License in conveying all material for which you do192 not control copyright. Those thus making or running the covered works193 for you must do so exclusively on your behalf, under your direction194 and control, on terms that prohibit them from making any copies of195 your copyrighted material outside their relationship with you.196 197 Conveying under any other circumstances is permitted solely under198 the conditions stated below. Sublicensing is not allowed; section 10199 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 technological204 measure under any applicable law fulfilling obligations under article205 11 of the WIPO copyright treaty adopted on 20 December 1996, or206 similar laws prohibiting or restricting circumvention of such207 measures.208 209 When you convey a covered work, you waive any legal power to forbid210 circumvention of technological measures to the extent such circumvention211 is effected by exercising rights under this License with respect to212 the covered work, and you disclaim any intention to limit operation or213 modification of the work as a means of enforcing, against the work's214 users, your or third parties' legal rights to forbid circumvention of215 technological measures.216 217 4. Conveying Verbatim Copies.218 219 You may convey verbatim copies of the Program's source code as you220 receive it, in any medium, provided that you conspicuously and221 appropriately publish on each copy an appropriate copyright notice;222 keep intact all notices stating that this License and any223 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 all225 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 to233 produce it from the Program, in the form of source code under the234 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 modified237 it, and giving a relevant date.238 239 b) The work must carry prominent notices stating that it is240 released under this License and any conditions added under section241 7. This requirement modifies the requirement in section 4 to242 "keep intact all notices".243 244 c) You must license the entire work, as a whole, under this245 License to anyone who comes into possession of a copy. This246 License will therefore apply, along with any applicable section 7247 additional terms, to the whole of the work, and all its parts,248 regardless of how they are packaged. This License gives no249 permission to license the work in any other way, but it does not250 invalidate such permission if you have separately received it.251 252 d) If the work has interactive user interfaces, each must display253 Appropriate Legal Notices; however, if the Program has interactive254 interfaces that do not display Appropriate Legal Notices, your255 work need not make them do so.256 257 A compilation of a covered work with other separate and independent258 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 an261 "aggregate" if the compilation and its resulting copyright are not262 used to limit the access or legal rights of the compilation's users263 beyond what the individual works permit. Inclusion of a covered work264 in an aggregate does not cause this License to apply to the other265 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 terms270 of sections 4 and 5, provided that you also convey the271 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 product275 (including a physical distribution medium), accompanied by the276 Corresponding Source fixed on a durable physical medium277 customarily used for software interchange.278 279 b) Convey the object code in, or embodied in, a physical product280 (including a physical distribution medium), accompanied by a281 written offer, valid for at least three years and valid for as282 long as you offer spare parts or customer support for that product283 model, to give anyone who possesses the object code either (1) a284 copy of the Corresponding Source for all the software in the285 product that is covered by this License, on a durable physical286 medium customarily used for software interchange, for a price no287 more than your reasonable cost of physically performing this288 conveying of source, or (2) access to copy the289 Corresponding Source from a network server at no charge.290 291 c) Convey individual copies of the object code with a copy of the292 written offer to provide the Corresponding Source. This293 alternative is allowed only occasionally and noncommercially, and294 only if you received the object code with such an offer, in accord295 with subsection 6b.296 297 d) Convey the object code by offering access from a designated298 place (gratis or for a charge), and offer equivalent access to the299 Corresponding Source in the same way through the same place at no300 further charge. You need not require recipients to copy the301 Corresponding Source along with the object code. If the place to302 copy the object code is a network server, the Corresponding Source303 may be on a different server (operated by you or a third party)304 that supports equivalent copying facilities, provided you maintain305 clear directions next to the object code saying where to find the306 Corresponding Source. Regardless of what server hosts the307 Corresponding Source, you remain obligated to ensure that it is308 available for as long as needed to satisfy these requirements.309 310 e) Convey the object code using peer-to-peer transmission, provided311 you inform other peers where the object code and Corresponding312 Source of the work are being offered to the general public at no313 charge under subsection 6d.314 315 A separable portion of the object code, whose source code is excluded316 from the Corresponding Source as a System Library, need not be317 included in conveying the object code work.318 319 A "User Product" is either (1) a "consumer product", which means any320 tangible personal property which is normally used for personal, family,321 or household purposes, or (2) anything designed or sold for incorporation322 into a dwelling. In determining whether a product is a consumer product,323 doubtful cases shall be resolved in favor of coverage. For a particular324 product received by a particular user, "normally used" refers to a325 typical or common use of that class of product, regardless of the status326 of the particular user or of the way in which the particular user327 actually uses, or expects or is expected to use, the product. A product328 is a consumer product regardless of whether the product has substantial329 commercial, industrial or non-consumer uses, unless such uses represent330 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 install334 and execute modified versions of a covered work in that User Product from335 a modified version of its Corresponding Source. The information must336 suffice to ensure that the continued functioning of the modified object337 code is in no case prevented or interfered with solely because338 modification has been made.339 340 If you convey an object code work under this section in, or with, or341 specifically for use in, a User Product, and the conveying occurs as342 part of a transaction in which the right of possession and use of the343 User Product is transferred to the recipient in perpetuity or for a344 fixed term (regardless of how the transaction is characterized), the345 Corresponding Source conveyed under this section must be accompanied346 by the Installation Information. But this requirement does not apply347 if neither you nor any third party retains the ability to install348 modified object code on the User Product (for example, the work has349 been installed in ROM).350 351 The requirement to provide Installation Information does not include a352 requirement to continue to provide support service, warranty, or updates353 for a work that has been modified or installed by the recipient, or for354 the User Product in which it has been modified or installed. Access to a355 network may be denied when the modification itself materially and356 adversely affects the operation of the network or violates the rules and357 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 publicly361 documented (and with an implementation available to the public in362 source code form), and must require no special password or key for363 unpacking, reading or copying.364 365 7. Additional Terms.366 367 "Additional permissions" are terms that supplement the terms of this368 License by making exceptions from one or more of its conditions.369 Additional permissions that are applicable to the entire Program shall370 be treated as though they were included in this License, to the extent371 that they are valid under applicable law. If additional permissions372 apply only to part of the Program, that part may be used separately373 under those permissions, but the entire Program remains governed by374 this License without regard to the additional permissions.375 376 When you convey a copy of a covered work, you may at your option377 remove any additional permissions from that copy, or from any part of378 it. (Additional permissions may be written to require their own379 removal in certain cases when you modify the work.) You may place380 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 you384 add to a covered work, you may (if authorized by the copyright holders of385 that material) supplement the terms of this License with terms:386 387 a) Disclaiming warranty or limiting liability differently from the388 terms of sections 15 and 16 of this License; or389 390 b) Requiring preservation of specified reasonable legal notices or391 author attributions in that material or in the Appropriate Legal392 Notices displayed by works containing it; or393 394 c) Prohibiting misrepresentation of the origin of that material, or395 requiring that modified versions of such material be marked in396 reasonable ways as different from the original version; or397 398 d) Limiting the use for publicity purposes of names of licensors or399 authors of the material; or400 401 e) Declining to grant rights under trademark law for use of some402 trade names, trademarks, or service marks; or403 404 f) Requiring indemnification of licensors and authors of that405 material by anyone who conveys the material (or modified versions of406 it) with contractual assumptions of liability to the recipient, for407 any liability that these contractual assumptions directly impose on408 those licensors and authors.409 410 All other non-permissive additional terms are considered "further411 restrictions" within the meaning of section 10. If the Program as you412 received it, or any part of it, contains a notice stating that it is413 governed by this License along with a term that is a further414 restriction, you may remove that term. If a license document contains415 a further restriction but permits relicensing or conveying under this416 License, you may add to a covered work material governed by the terms417 of that license document, provided that the further restriction does418 not survive such relicensing or conveying.419 420 If you add terms to a covered work in accord with this section, you421 must place, in the relevant source files, a statement of the422 additional terms that apply to those files, or a notice indicating423 where to find the applicable terms.424 425 Additional terms, permissive or non-permissive, may be stated in the426 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 expressly432 provided under this License. Any attempt otherwise to propagate or433 modify it is void, and will automatically terminate your rights under434 this License (including any patent licenses granted under the third435 paragraph of section 11).436 437 However, if you cease all violation of this License, then your438 license from a particular copyright holder is reinstated (a)439 provisionally, unless and until the copyright holder explicitly and440 finally terminates your license, and (b) permanently, if the copyright441 holder fails to notify you of the violation by some reasonable means442 prior to 60 days after the cessation.443 444 Moreover, your license from a particular copyright holder is445 reinstated permanently if the copyright holder notifies you of the446 violation by some reasonable means, this is the first time you have447 received notice of violation of this License (for any work) from that448 copyright holder, and you cure the violation prior to 30 days after449 your receipt of the notice.450 451 Termination of your rights under this section does not terminate the452 licenses of parties who have received copies or rights from you under453 this License. If your rights have been terminated and not permanently454 reinstated, you do not qualify to receive new licenses for the same455 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 or460 run a copy of the Program. Ancillary propagation of a covered work461 occurring solely as a consequence of using peer-to-peer transmission462 to receive a copy likewise does not require acceptance. However,463 nothing other than this License grants you permission to propagate or464 modify any covered work. These actions infringe copyright if you do465 not accept this License. Therefore, by modifying or propagating a466 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 automatically471 receives a license from the original licensors, to run, modify and472 propagate that work, subject to this License. You are not responsible473 for enforcing compliance by third parties with this License.474 475 An "entity transaction" is a transaction transferring control of an476 organization, or substantially all assets of one, or subdividing an477 organization, or merging organizations. If propagation of a covered478 work results from an entity transaction, each party to that479 transaction who receives a copy of the work also receives whatever480 licenses to the work the party's predecessor in interest had or could481 give under the previous paragraph, plus a right to possession of the482 Corresponding Source of the work from the predecessor in interest, if483 the predecessor has it or can get it with reasonable efforts.484 485 You may not impose any further restrictions on the exercise of the486 rights granted or affirmed under this License. For example, you may487 not impose a license fee, royalty, or other charge for exercise of488 rights granted under this License, and you may not initiate litigation489 (including a cross-claim or counterclaim in a lawsuit) alleging that490 any patent claim is infringed by making, using, selling, offering for491 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 this496 License of the Program or a work on which the Program is based. The497 work thus licensed is called the contributor's "contributor version".498 499 A contributor's "essential patent claims" are all patent claims500 owned or controlled by the contributor, whether already acquired or501 hereafter acquired, that would be infringed by some manner, permitted502 by this License, of making, using, or selling its contributor version,503 but do not include claims that would be infringed only as a504 consequence of further modification of the contributor version. For505 purposes of this definition, "control" includes the right to grant506 patent sublicenses in a manner consistent with the requirements of507 this License.508 509 Each contributor grants you a non-exclusive, worldwide, royalty-free510 patent license under the contributor's essential patent claims, to511 make, use, sell, offer for sale, import and otherwise run, modify and512 propagate the contents of its contributor version.513 514 In the following three paragraphs, a "patent license" is any express515 agreement or commitment, however denominated, not to enforce a patent516 (such as an express permission to practice a patent or covenant not to517 sue for patent infringement). To "grant" such a patent license to a518 party means to make such an agreement or commitment not to enforce a519 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 anyone523 to copy, free of charge and under the terms of this License, through a524 publicly available network server or other readily accessible means,525 then you must either (1) cause the Corresponding Source to be so526 available, or (2) arrange to deprive yourself of the benefit of the527 patent license for this particular work, or (3) arrange, in a manner528 consistent with the requirements of this License, to extend the patent529 license to downstream recipients. "Knowingly relying" means you have530 actual knowledge that, but for the patent license, your conveying the531 covered work in a country, or your recipient's use of the covered work532 in a country, would infringe one or more identifiable patents in that533 country that you have reason to believe are valid.534 535 If, pursuant to or in connection with a single transaction or536 arrangement, you convey, or propagate by procuring conveyance of, a537 covered work, and grant a patent license to some of the parties538 receiving the covered work authorizing them to use, propagate, modify539 or convey a specific copy of the covered work, then the patent license540 you grant is automatically extended to all recipients of the covered541 work and works based on it.542 543 A patent license is "discriminatory" if it does not include within544 the scope of its coverage, prohibits the exercise of, or is545 conditioned on the non-exercise of one or more of the rights that are546 specifically granted under this License. You may not convey a covered547 work if you are a party to an arrangement with a third party that is548 in the business of distributing software, under which you make payment549 to the third party based on the extent of your activity of conveying550 the work, and under which the third party grants, to any of the551 parties who would receive the covered work from you, a discriminatory552 patent license (a) in connection with copies of the covered work553 conveyed by you (or copies made from those copies), or (b) primarily554 for and in connection with specific products or compilations that555 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 limiting559 any implied license or other defenses to infringement that may560 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 or565 otherwise) that contradict the conditions of this License, they do not566 excuse you from the conditions of this License. If you cannot convey a567 covered work so as to satisfy simultaneously your obligations under this568 License and any other pertinent obligations, then as a consequence you may569 not convey it at all. For example, if you agree to terms that obligate you570 to collect a royalty for further conveying from those to whom you convey571 the Program, the only way you could satisfy both those terms and this572 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 have577 permission to link or combine any covered work with a work licensed578 under version 3 of the GNU Affero General Public License into a single579 combined work, and to convey the resulting work. The terms of this580 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 the583 combination as such.584 585 14. Revised Versions of this License.586 587 The Free Software Foundation may publish revised and/or new versions of588 the GNU General Public License from time to time. Such new versions will589 be similar in spirit to the present version, but may differ in detail to590 address new problems or concerns.591 592 Each version is given a distinguishing version number. If the593 Program specifies that a certain numbered version of the GNU General594 Public License "or any later version" applies to it, you have the595 option of following the terms and conditions either of that numbered596 version or of any later version published by the Free Software597 Foundation. If the Program does not specify a version number of the598 GNU General Public License, you may choose any version ever published599 by the Free Software Foundation.600 601 If the Program specifies that a proxy can decide which future602 versions of the GNU General Public License can be used, that proxy's603 public statement of acceptance of a version permanently authorizes you604 to choose that version for the Program.605 606 Later license versions may give you additional or different607 permissions. However, no additional obligations are imposed on any608 author or copyright holder as a result of your choosing to follow a609 later version.610 611 15. Disclaimer of Warranty.612 613 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY614 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT615 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY616 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,617 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR618 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM619 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF620 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 WRITING625 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS626 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY627 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE628 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF629 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD630 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 OF632 SUCH DAMAGES.633 634 17. Interpretation of Sections 15 and 16.635 636 If the disclaimer of warranty and limitation of liability provided637 above cannot be given local legal effect according to their terms,638 reviewing courts shall apply local law that most closely approximates639 an absolute waiver of all civil liability in connection with the640 Program, unless a warranty or assumption of liability accompanies a641 copy of the Program in return for a fee.642 643 END OF TERMS AND CONDITIONS644 645 How to Apply These Terms to Your New Programs646 =======647 24 this service if you wish), that you receive source code or can get it 648 25 if you want it, that you can change the software or use pieces of it … … 909 286 910 287 How to Apply These Terms to Your New Programs 911 >>>>>>> FETCH_HEAD912 288 913 289 If you develop a new program, and you want it to be of the greatest … … 917 293 To do so, attach the following notices to the program. It is safest 918 294 to attach them to the start of each source file to most effectively 919 <<<<<<< HEAD920 state the exclusion of warranty; and each file should have at least921 =======922 295 convey the exclusion of warranty; and each file should have at least 923 >>>>>>> FETCH_HEAD924 296 the "copyright" line and a pointer to where the full notice is found. 925 297 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 934 301 This program is free software; you can redistribute it and/or modify 935 302 it under the terms of the GNU General Public License as published by 936 303 the Free Software Foundation; either version 2 of the License, or 937 >>>>>>> FETCH_HEAD938 304 (at your option) any later version. 939 305 … … 944 310 945 311 You should have received a copy of the GNU General Public License 946 <<<<<<< HEAD947 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 short952 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 =======957 312 along with this program; if not, write to the Free Software 958 313 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA … … 964 319 when it starts in an interactive mode: 965 320 966 Gnomovision version 69, Copyright (C) year name of author967 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'. 969 324 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. 971 327 972 328 The hypothetical commands `show w' and `show c' should show the appropriate 973 <<<<<<< HEAD974 parts of the General Public License. Of course, your program's commands975 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, see980 <http://www.gnu.org/licenses/>.981 982 The GNU General Public License does not permit incorporating your program983 into proprietary programs. If your program is a subroutine library, you984 may consider it more useful to permit linking proprietary applications with985 the library. If this is what you want to do, use the GNU Lesser General986 Public License instead of this License. But first, please read987 <http://www.gnu.org/philosophy/why-not-lgpl.html>.988 =======989 329 parts of the General Public License. Of course, the commands you use may 990 330 be called something other than `show w' and `show c'; they could even be … … 995 335 necessary. Here is a sample; alter the names: 996 336 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 1002 341 1003 342 This General Public License does not permit incorporating your program into … … 1006 345 library. If this is what you want to do, use the GNU Library General 1007 346 Public License instead of this License. 1008 >>>>>>> FETCH_HEAD -
README
r8006ee r994713 1 <<<<<<< HEAD 2 # Project: Molecuilder 1 # Project: MoleCuilder 3 2 # 4 3 # heber@ins.uni-bonn.de 5 4 6 Mole cuilder5 MoleCuilder 7 6 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/ 8 removing groups of atoms, measuring bond lengths and so forth), grew forth into 9 a many-body fragmentation test base of a new method coined BOSSANOVA (Bond 10 Order diSSection in an ANOVA (ANalysis Of VAriance) - like fashion). It spilled 11 out configuration files for each fragment and included joining and analyzing 12 programs, to put together the partial energies and forces of each fragment to 13 the total energy and forces. Since then it has evolved into a complete toolbox 14 for creating molecular systems and worlds. 16 15 17 Electronic Structure PACKage18 19 Is a collection of mathematical-physical programs to calculate via various ab-initio methods20 such as density functional theory or Hartree-Fock electronic(-magnetic) properties including21 the molecular (Car&Parrinello) dynamics of a many electron system. Especially, the linear22 response of the system to a external magnetic field in a perturbation approach in terms of23 susceptibility and chemical shielding is implemented via the Density Functional Perturbation24 Theory. It was developed mainly by Jan Hamaekers (pcp) with additional code by Frederik Heber25 (dfpt part in pcp) and also Ralf Wildenhuis (Gauss) at the Institute for Numerical Simulation26 at the University of Bonn[1].27 28 29 >>>>>>> FETCH_HEAD30 16 31 17 INSTALLATION NOTES 32 18 ================== 33 19 34 <<<<<<< HEAD35 20 The following packages are needed 36 21 * GCC or alike 37 22 * GSL (GNU Scientific Library, available at http://www.gnu.org/software/gsl) 38 23 * 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.41 24 42 25 LINKS 43 26 ===== 44 27 [1] http://www.ins.uni-bonn.de/ 45 >>>>>>> FETCH_HEAD -
configure.ac
r8006ee r994713 3 3 4 4 AC_PREREQ(2.59) 5 AC_INIT(Mole cuilder, 1.0, heber@ins.uni-bonn.de, molecuilder)5 AC_INIT(MoleCuilder, 1.0.0, heber@ins.uni-bonn.de, molecuilder) 6 6 AC_CONFIG_AUX_DIR(config) 7 7 AC_CONFIG_SRCDIR([src/builder.cpp]) … … 9 9 AC_CONFIG_MACRO_DIR([m4]) 10 10 11 AM_INIT_AUTOMAKE( dist-bzip2 parallel-tests)11 AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests]) 12 12 13 13 # Checks for programs. … … 15 15 AC_PROG_CXX 16 16 AC_PROG_CC 17 # obselete by LT_INIT18 #AC_PROG_RANLIB19 17 AC_PROG_INSTALL 20 18 AC_CHECK_PROG([LATEX],[latex],[latex],[:]) … … 82 80 fi 83 81 84 # add replacement/saturation hydrogen or not82 # use CppUnit TestRunner or not 85 83 AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]), 86 84 [enable_ecut=$enableval], [enable_ecut=no]) … … 88 86 AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."]) 89 87 AC_SUBST(HAVE_ECUT) 88 fi 89 90 # with valgrinding testsuite or not 91 AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]), 92 [with_valgrind=$withval], [with_valgrind=no]) 93 if 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 ) 90 108 fi 91 109 -
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 1 8 /* 2 9 * Action.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ActionHistory.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Registry<Action>.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ActionSequenze.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MolecularVolumeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" -
src/Actions/AnalysisAction/MolecularVolumeAction.hpp
r8006ee r994713 8 8 #ifndef MOLECULARVOLUMEACTION_HPP_ 9 9 #define MOLECULARVOLUMEACTION_HPP_ 10 11 // include config.h 12 #ifdef HAVE_CONFIG_H 13 #include <config.h> 14 #endif 10 15 11 16 #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 1 8 /* 2 9 * PairCorrelationAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 75 87 ofstream output; 76 88 ofstream binoutput; 77 std::vector< element *> elements;89 std::vector<const element *> elements; 78 90 string type; 79 91 Vector Point; -
src/Actions/AnalysisAction/PairCorrelationAction.hpp
r8006ee r994713 8 8 #ifndef PAIRCORRELATIONACTION_HPP_ 9 9 #define PAIRCORRELATIONACTION_HPP_ 10 11 // include config.h 12 #ifdef HAVE_CONFIG_H 13 #include <config.h> 14 #endif 10 15 11 16 #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 1 8 /* 2 9 * PointCorrelationAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 21 33 #include "World.hpp" 22 34 35 #include <cmath> 23 36 #include <iostream> 24 37 #include <string> … … 76 89 ofstream output; 77 90 ofstream binoutput; 78 std::vector< element *> elements;91 std::vector<const element *> elements; 79 92 string type; 80 93 Vector Point; … … 96 109 cout << "Point to correlate to is " << Point << endl; 97 110 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; 100 113 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 101 114 if (periodic) -
src/Actions/AnalysisAction/PointCorrelationAction.hpp
r8006ee r994713 8 8 #ifndef POINTCORRELATIONACTION_HPP_ 9 9 #define POINTCORRELATIONACTION_HPP_ 10 11 // include config.h 12 #ifdef HAVE_CONFIG_H 13 #include <config.h> 14 #endif 10 15 11 16 #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 1 8 /* 2 9 * PrincipalAxisSystemAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 64 76 Vector x = (*iter)->getPosition(); 65 77 x -= *CenterOfGravity; 66 const double mass = (*iter)->getType()-> mass;78 const double mass = (*iter)->getType()->getMass(); 67 79 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 68 80 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 1 8 /* 2 9 * SurfaceCorrelationAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 79 91 ofstream output; 80 92 ofstream binoutput; 81 std::vector< element *> elements;93 std::vector<const element *> elements; 82 94 string type; 83 95 Vector Point; … … 112 124 // find biggest molecule 113 125 std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules(); 126 std::cout << "There are " << molecules.size() << " selected molecules." << std::endl; 114 127 LCList = new LinkedCell(Boundary, LCWidth); 115 128 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 1 8 /* 2 9 * AddAction.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 10 22 #include "Actions/AtomAction/AddAction.hpp" 11 23 #include "Actions/ActionRegistry.hpp" 24 #include "Descriptors/AtomIdDescriptor.hpp" 12 25 #include "atom.hpp" 13 26 #include "element.hpp" … … 26 39 #include "UIElements/Dialog.hpp" 27 40 #include "Actions/ValueStorage.hpp" 41 42 // memento to remember the state when undoing 43 44 class AtomAddState : public ActionState { 45 public: 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 }; 28 55 29 56 const char AtomAddAction::NAME[] = "add-atom"; … … 52 79 53 80 Action::state_ptr AtomAddAction::performCall() { 54 element * elemental = NULL;81 const element * elemental = NULL; 55 82 Vector position; 56 83 … … 63 90 first->setType(elemental); 64 91 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); 66 93 // TODO: remove when all of World's atoms are stored. 67 94 std::vector<molecule *> molecules = World::getInstance().getAllMolecules(); … … 70 97 (*iter)->AddAtom(first); 71 98 } 72 return Action::s uccess;99 return Action::state_ptr(new AtomAddState(position, elemental, first->getId())); 73 100 } 74 101 75 102 Action::state_ptr AtomAddAction::performUndo(Action::state_ptr _state) { 76 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());103 AtomAddState *state = assert_cast<AtomAddState*>(_state.get()); 77 104 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); 83 109 } 84 110 85 111 Action::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); 87 128 } 88 129 89 130 bool AtomAddAction::canUndo() { 90 return false;131 return true; 91 132 } 92 133 93 134 bool AtomAddAction::shouldUndo() { 94 return false;135 return true; 95 136 } 96 137 -
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 1 8 /* 2 9 * ChangeElementAction.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 10 22 #include "Actions/AtomAction/ChangeElementAction.hpp" 11 23 #include "Actions/ActionRegistry.hpp" 24 #include "Descriptors/AtomIdDescriptor.hpp" 12 25 #include "atom.hpp" 13 26 #include "element.hpp" … … 19 32 20 33 #include <iostream> 34 #include <map> 21 35 #include <string> 22 36 … … 26 40 #include "UIElements/Dialog.hpp" 27 41 #include "Actions/ValueStorage.hpp" 42 43 typedef std::map<int, const element *> ElementMap; 44 45 // memento to remember the state when undoing 46 47 class AtomChangeElementState : public ActionState { 48 public: 49 AtomChangeElementState(ElementMap _Elements, const element *_elemental) : 50 Elements(_Elements), 51 elemental(_elemental) 52 {} 53 ElementMap Elements; 54 const element *elemental; 55 }; 28 56 29 57 const char AtomChangeElementAction::NAME[] = "change-element"; … … 51 79 Action::state_ptr AtomChangeElementAction::performCall() { 52 80 atom *first = NULL; 53 element *elemental = NULL;81 const element *elemental; 54 82 molecule *mol = NULL; 55 83 56 84 ValueStorage::getInstance().queryCurrentValue(NAME, elemental); 57 85 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 58 93 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 59 94 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); 61 96 mol = first->getMolecule(); 62 97 first->removeFromMolecule(); // remove atom … … 64 99 mol->AddAtom(first); // add atom to ensure correctness of formula 65 100 } 66 return Action::s uccess;101 return Action::state_ptr(UndoState); 67 102 } 68 103 69 104 Action::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; 71 108 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); 77 118 } 78 119 79 120 Action::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); 81 134 } 82 135 83 136 bool AtomChangeElementAction::canUndo() { 84 return false;137 return true; 85 138 } 86 139 87 140 bool AtomChangeElementAction::shouldUndo() { 88 return false;141 return true; 89 142 } 90 143 -
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 1 8 /* 2 9 * RemoveAction.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 … … 11 23 #include "Actions/ActionRegistry.hpp" 12 24 #include "atom.hpp" 25 #include "AtomicInfo.hpp" 13 26 #include "Descriptors/AtomDescriptor.hpp" 14 27 #include "Helpers/Log.hpp" … … 25 38 #include "UIElements/Dialog.hpp" 26 39 #include "Actions/ValueStorage.hpp" 40 41 // memento to remember the state when undoing 42 43 class AtomRemoveState : public ActionState { 44 public: 45 AtomRemoveState(std::vector<AtomicInfo> _Walkers) : 46 Walkers(_Walkers) 47 {} 48 std::vector<AtomicInfo> Walkers; 49 }; 27 50 28 51 const char AtomRemoveAction::NAME[] = "remove-atom"; … … 50 73 atom *first = NULL; 51 74 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(); 53 84 for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) { 54 85 first = iter->second; 55 86 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 World57 // simply try to erase in every molecule found58 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 // } 61 92 World::getInstance().destroyAtom(first); 62 93 } 63 return Action::s uccess;94 return Action::state_ptr(UndoState); 64 95 } 65 96 66 97 Action::state_ptr AtomRemoveAction::performUndo(Action::state_ptr _state) { 67 // ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());98 AtomRemoveState *state = assert_cast<AtomRemoveState*>(_state.get()); 68 99 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); 74 119 } 75 120 76 121 Action::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); 78 131 } 79 132 80 133 bool AtomRemoveAction::canUndo() { 81 return false;134 return true; 82 135 } 83 136 84 137 bool AtomRemoveAction::shouldUndo() { 85 return false;138 return true; 86 139 } 87 140 -
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 1 8 /* 2 9 * RotateAroundOriginByAngleAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 17 29 18 30 31 #include <cmath> 19 32 #include <iostream> 20 33 #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 1 8 /* 2 9 * TranslateAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 32 44 class AtomTranslateState : public ActionState { 33 45 public: 34 AtomTranslateState( std::vector<atom*> _selectedAtoms, Vector &_v) :46 AtomTranslateState(const std::vector<atom*> &_selectedAtoms, const Vector &_v, const bool _periodic) : 35 47 selectedAtoms(_selectedAtoms), 36 v(_v) 48 v(_v), 49 periodic(_periodic) 37 50 {} 38 51 std::vector<atom*> selectedAtoms; 39 52 Vector v; 53 bool periodic; 40 54 }; 41 55 … … 49 63 {} 50 64 51 void AtomTranslate(Vector &x ) {65 void AtomTranslate(Vector &x, bool periodic = false) { 52 66 ValueStorage::getInstance().setCurrentValue(AtomTranslateAction::NAME, x); 67 ValueStorage::getInstance().setCurrentValue("periodic", periodic); 53 68 ActionRegistry::getInstance().getActionByName(AtomTranslateAction::NAME)->call(Action::NonInteractive); 54 69 }; … … 58 73 59 74 dialog->queryVector(NAME, false, ValueStorage::getInstance().getDescription(NAME)); 75 dialog->queryBoolean("periodic", ValueStorage::getInstance().getDescription("periodic")); 60 76 61 77 return dialog; … … 64 80 Action::state_ptr AtomTranslateAction::performCall() { 65 81 Vector v; 82 bool periodic = false; 83 Box &domain = World::getInstance().getDomain(); 66 84 std::vector<atom *> selectedAtoms = World::getInstance().getSelectedAtoms(); 67 85 68 86 ValueStorage::getInstance().queryCurrentValue(NAME, v); 87 if (!ValueStorage::getInstance().queryCurrentValue("periodic", periodic, true)) 88 periodic = false; 69 89 70 90 // TODO: use AtomSet::translate 71 91 for (std::vector<atom *>::iterator iter = selectedAtoms.begin(); iter != selectedAtoms.end(); ++iter) { 72 92 *(*iter) += v; 93 if (periodic) 94 (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition())); 73 95 } 74 return Action::state_ptr(new AtomTranslateState(selectedAtoms, v)); 96 97 return Action::state_ptr(new AtomTranslateState(selectedAtoms, v, periodic)); 75 98 } 76 99 77 100 Action::state_ptr AtomTranslateAction::performUndo(Action::state_ptr _state) { 78 101 AtomTranslateState *state = assert_cast<AtomTranslateState*>(_state.get()); 102 Box &domain = World::getInstance().getDomain(); 79 103 80 104 for (std::vector<atom *>::iterator iter = state->selectedAtoms.begin(); iter != state->selectedAtoms.end(); ++iter) { 81 105 *(*iter) -= state->v; 106 if (state->periodic) 107 (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition())); 82 108 } 83 109 84 return Action::state_ptr( new AtomTranslateState(state->selectedAtoms, state->v));110 return Action::state_ptr(_state); 85 111 } 86 112 87 113 Action::state_ptr AtomTranslateAction::performRedo(Action::state_ptr _state){ 88 114 AtomTranslateState *state = assert_cast<AtomTranslateState*>(_state.get()); 115 Box &domain = World::getInstance().getDomain(); 89 116 90 117 for (std::vector<atom *>::iterator iter = state->selectedAtoms.begin(); iter != state->selectedAtoms.end(); ++iter) { 91 118 *(*iter) += state->v; 119 if (state->periodic) 120 (*iter)->setPosition(domain.WrapPeriodically((*iter)->getPosition())); 92 121 } 93 122 94 return Action::state_ptr( new AtomTranslateState(state->selectedAtoms, state->v));123 return Action::state_ptr(_state); 95 124 } 96 125 -
src/Actions/AtomAction/TranslateAction.hpp
r8006ee r994713 15 15 16 16 class AtomTranslateAction : public Action { 17 friend void AtomTranslate(Vector &x );17 friend void AtomTranslate(Vector &x, bool periodic); 18 18 19 19 public: -
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 1 8 /* 2 9 * BondLengthTableAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ElementDbAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * FastParsingAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 28 40 class CommandLineFastParsingState : public ActionState { 29 41 public: 30 CommandLineFastParsingState(bool _bool) : 31 boolean(_bool) 42 CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) : 43 oldvalue(_oldvalue), 44 newvalue(_newvalue) 32 45 {} 33 bool boolean; 46 bool oldvalue; 47 bool newvalue; 34 48 }; 35 49 … … 58 72 59 73 Action::state_ptr CommandLineFastParsingAction::performCall() { 60 61 74 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; 63 79 if (configuration->FastParsing) 64 80 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 65 81 else 66 82 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 67 return Action::s uccess;83 return Action::state_ptr(new CommandLineFastParsingState(oldvalue, newvalue)); 68 84 } 69 85 … … 72 88 73 89 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); 75 95 76 return Action::state_ptr( new CommandLineFastParsingState(!state->boolean));96 return Action::state_ptr(_state); 77 97 } 78 98 79 99 Action::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); 81 110 } 82 111 -
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 1 8 /* 2 9 * HelpAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * VerboseAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 26 38 class CommandLineVerboseState : public ActionState { 27 39 public: 28 CommandLineVerboseState(int _verbosity) : 29 verbosity(_verbosity) 40 CommandLineVerboseState(const int _oldverbosity, const int _newverbosity) : 41 oldverbosity(_oldverbosity), 42 newverbosity(_newverbosity) 30 43 {} 31 int verbosity; 44 int oldverbosity; 45 int newverbosity; 32 46 }; 33 47 … … 56 70 57 71 Action::state_ptr CommandLineVerboseAction::performCall() { 58 int verbosity = 2; 72 int oldverbosity = getVerbosity(); 73 int newverbosity = 2; 59 74 60 ValueStorage::getInstance().queryCurrentValue(NAME, verbosity);75 ValueStorage::getInstance().queryCurrentValue(NAME, newverbosity); 61 76 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 } 65 86 } 66 87 … … 68 89 CommandLineVerboseState *state = assert_cast<CommandLineVerboseState*>(_state.get()); 69 90 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); 72 93 73 setVerbosity(state->verbosity); 74 return Action::state_ptr(new CommandLineVerboseState(verbosity)); 94 return Action::state_ptr(_state); 75 95 } 76 96 77 97 Action::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); 79 104 } 80 105 -
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 1 8 /* 2 9 * VersionAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 37 49 ASSERT(dialog,"No Dialog given when filling action dialog"); 38 50 39 dialog->queryEmpty(NAME, ESPACKVersion);51 dialog->queryEmpty(NAME, MOLECUILDERVERSION); 40 52 41 53 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 1 8 /* 2 9 * ErrorAction.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * DepthFirstSearchAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * FragmentationAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SubgraphDissectionAction.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 10 22 #include "Actions/FragmentationAction/SubgraphDissectionAction.hpp" 11 23 #include "Actions/ActionRegistry.hpp" 24 #include "Descriptors/AtomIdDescriptor.hpp" 12 25 #include "Descriptors/MoleculeDescriptor.hpp" 13 26 … … 17 30 #include "config.hpp" 18 31 #include "Helpers/Log.hpp" 32 #include "Helpers/Verbose.hpp" 19 33 #include "molecule.hpp" 20 34 #include "stackclass.hpp" … … 30 44 #include "Actions/ValueStorage.hpp" 31 45 46 // memento to remember the state when undoing 47 48 typedef std::map< moleculeId_t, std::vector<atomId_t> > MolAtomList; 49 50 class FragmentationSubgraphDissectionState : public ActionState { 51 public: 52 FragmentationSubgraphDissectionState(const MolAtomList &_moleculelist) : 53 moleculelist(_moleculelist) 54 {} 55 MolAtomList moleculelist; 56 }; 57 32 58 const char FragmentationSubgraphDissectionAction::NAME[] = "subgraph-dissect"; 33 59 … … 39 65 {} 40 66 67 /** Dissects given \a *mol into connected subgraphs and inserts them as new molecules but with old atoms into \a this. 68 */ 41 69 void FragmentationSubgraphDissection() { 42 70 ActionRegistry::getInstance().getActionByName(FragmentationSubgraphDissectionAction::NAME)->call(Action::NonInteractive); … … 54 82 Action::state_ptr FragmentationSubgraphDissectionAction::performCall() { 55 83 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 57 98 MoleculeListClass *molecules = World::getInstance().getMolecules(); 58 99 config * const configuration = World::getInstance().getConfig(); 59 100 60 101 // 0a. remove all present molecules 61 vector<molecule *> allmolecules = World::getInstance().getAllMolecules();62 102 for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) { 63 103 molecules->erase(*MolRunner); … … 67 107 // 0b. remove all bonds and construct a molecule with all atoms 68 108 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 } 74 116 } 75 117 … … 92 134 delete(BackEdgeStack); 93 135 if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) { 94 World::getInstance().destroyMolecule(mol);136 //World::getInstance().destroyMolecule(mol); 95 137 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl); 96 138 return Action::failure; 97 139 } 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 107 156 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;128 157 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; 149 159 MolecularWalker = MolecularWalker->next; 150 160 delete(MolecularWalker->previous); 151 161 } 162 MolecularWalker->Leaf = NULL; 152 163 delete(MolecularWalker); 153 delete[](moleculelist);154 164 DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl); 155 165 156 return Action::s uccess;166 return Action::state_ptr(UndoState); 157 167 } 158 168 159 169 Action::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); 167 195 } 168 196 169 197 Action::state_ptr FragmentationSubgraphDissectionAction::performRedo(Action::state_ptr _state){ 170 return Action::failure;198 return performCall(); 171 199 } 172 200 173 201 bool FragmentationSubgraphDissectionAction::canUndo() { 174 return false;202 return true; 175 203 } 176 204 177 205 bool FragmentationSubgraphDissectionAction::shouldUndo() { 178 return false;206 return true; 179 207 } 180 208 -
src/Actions/Makefile.am
r8006ee r994713 118 118 SELECTIONACTIONSOURCE = \ 119 119 SelectionAction/AllAtomsAction.cpp \ 120 SelectionAction/AllAtomsInsideCuboidAction.cpp \ 121 SelectionAction/AllAtomsInsideSphereAction.cpp \ 120 122 SelectionAction/AllAtomsOfMoleculeAction.cpp \ 121 123 SelectionAction/AllMoleculesAction.cpp \ 124 SelectionAction/AtomByElementAction.cpp \ 122 125 SelectionAction/AtomByIdAction.cpp \ 123 126 SelectionAction/ClearAllAtomsAction.cpp \ 124 127 SelectionAction/ClearAllMoleculesAction.cpp \ 128 SelectionAction/MoleculeByFormulaAction.cpp \ 125 129 SelectionAction/MoleculeByIdAction.cpp \ 126 130 SelectionAction/MoleculeOfAtomAction.cpp \ 127 131 SelectionAction/NotAllAtomsAction.cpp \ 132 SelectionAction/NotAllAtomsInsideCuboidAction.cpp \ 133 SelectionAction/NotAllAtomsInsideSphereAction.cpp \ 128 134 SelectionAction/NotAllAtomsOfMoleculeAction.cpp \ 129 135 SelectionAction/NotAllMoleculesAction.cpp \ 136 SelectionAction/NotAtomByElementAction.cpp \ 130 137 SelectionAction/NotAtomByIdAction.cpp \ 138 SelectionAction/NotMoleculeByFormulaAction.cpp \ 131 139 SelectionAction/NotMoleculeByIdAction.cpp \ 132 140 SelectionAction/NotMoleculeOfAtomAction.cpp 133 141 SELECTIONACTIONHEADER = \ 134 142 SelectionAction/AllAtomsAction.hpp \ 143 SelectionAction/AllAtomsInsideCuboidAction.hpp \ 144 SelectionAction/AllAtomsInsideSphereAction.hpp \ 135 145 SelectionAction/AllAtomsOfMoleculeAction.hpp \ 136 146 SelectionAction/AllMoleculesAction.hpp \ 147 SelectionAction/AtomByElementAction.hpp \ 137 148 SelectionAction/AtomByIdAction.hpp \ 138 149 SelectionAction/ClearAllAtomsAction.hpp \ 139 150 SelectionAction/ClearAllMoleculesAction.hpp \ 151 SelectionAction/MoleculeByFormulaAction.hpp \ 140 152 SelectionAction/MoleculeByIdAction.hpp \ 141 153 SelectionAction/MoleculeOfAtomAction.hpp \ 142 154 SelectionAction/NotAllAtomsAction.hpp \ 155 SelectionAction/NotAllAtomsInsideCuboidAction.hpp \ 156 SelectionAction/NotAllAtomsInsideSphereAction.hpp \ 143 157 SelectionAction/NotAllAtomsOfMoleculeAction.hpp \ 144 158 SelectionAction/NotAllMoleculesAction.hpp \ 159 SelectionAction/NotAtomByElementAction.hpp \ 145 160 SelectionAction/NotAtomByIdAction.hpp \ 161 SelectionAction/NotMoleculeByFormulaAction.hpp \ 146 162 SelectionAction/NotMoleculeByIdAction.hpp \ 147 163 SelectionAction/NotMoleculeOfAtomAction.cpp … … 162 178 WorldAction/InputAction.cpp \ 163 179 WorldAction/OutputAction.cpp \ 164 WorldAction/RemoveSphereOfAtomsAction.cpp \165 180 WorldAction/RepeatBoxAction.cpp \ 166 181 WorldAction/ScaleBoxAction.cpp \ … … 176 191 WorldAction/InputAction.hpp \ 177 192 WorldAction/OutputAction.hpp \ 178 WorldAction/RemoveSphereOfAtomsAction.hpp \179 193 WorldAction/RepeatBoxAction.hpp \ 180 194 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 1 8 /* 2 9 * MakroAction.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ManipulateAtomsProcess.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MapOfActions.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 67 79 #include "Actions/ParserAction/SaveXyzAction.hpp" 68 80 #include "Actions/SelectionAction/AllAtomsAction.hpp" 81 #include "Actions/SelectionAction/AllAtomsInsideCuboidAction.hpp" 82 #include "Actions/SelectionAction/AllAtomsInsideSphereAction.hpp" 69 83 #include "Actions/SelectionAction/AllAtomsOfMoleculeAction.hpp" 70 84 #include "Actions/SelectionAction/AllMoleculesAction.hpp" 85 #include "Actions/SelectionAction/AtomByElementAction.hpp" 71 86 #include "Actions/SelectionAction/AtomByIdAction.hpp" 72 87 #include "Actions/SelectionAction/ClearAllAtomsAction.hpp" 73 88 #include "Actions/SelectionAction/ClearAllMoleculesAction.hpp" 89 #include "Actions/SelectionAction/MoleculeByFormulaAction.hpp" 74 90 #include "Actions/SelectionAction/MoleculeByIdAction.hpp" 75 91 #include "Actions/SelectionAction/MoleculeOfAtomAction.hpp" 76 92 #include "Actions/SelectionAction/NotAllAtomsAction.hpp" 93 #include "Actions/SelectionAction/NotAllAtomsInsideCuboidAction.hpp" 94 #include "Actions/SelectionAction/NotAllAtomsInsideSphereAction.hpp" 77 95 #include "Actions/SelectionAction/NotAllAtomsOfMoleculeAction.hpp" 78 96 #include "Actions/SelectionAction/NotAllMoleculesAction.hpp" 97 #include "Actions/SelectionAction/NotAtomByElementAction.hpp" 79 98 #include "Actions/SelectionAction/NotAtomByIdAction.hpp" 99 #include "Actions/SelectionAction/NotMoleculeByFormulaAction.hpp" 80 100 #include "Actions/SelectionAction/NotMoleculeByIdAction.hpp" 81 101 #include "Actions/SelectionAction/NotMoleculeOfAtomAction.hpp" … … 89 109 #include "Actions/WorldAction/InputAction.hpp" 90 110 #include "Actions/WorldAction/OutputAction.hpp" 91 #include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"92 111 #include "Actions/WorldAction/RepeatBoxAction.hpp" 93 112 #include "Actions/WorldAction/ScaleBoxAction.hpp" … … 212 231 DescriptionMap["redo"] = "redo last action"; 213 232 DescriptionMap["remove-atom"] = "remove a specified atom"; 214 DescriptionMap["remove-sphere"] = "remove sphere of atoms of around a specified atom";215 233 DescriptionMap["repeat-box"] = "create periodic copies of the simulation box per axis"; 216 234 DescriptionMap["rotate-origin"] = "rotate selected atoms by a specific angle around origin"; … … 224 242 DescriptionMap["select-all-atoms"] = "select all atoms"; 225 243 DescriptionMap["select-all-molecules"] = "select all molecules"; 244 DescriptionMap["select-atom-by-element"] = "select an atom by element"; 226 245 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"; 227 248 DescriptionMap["select-molecule-by-id"] = "select a molecule by index"; 249 DescriptionMap["select-molecule-by-formula"] = "select a molecule by chemical formula"; 228 250 DescriptionMap["select-molecule-of-atom"] = "select a molecule to which a given atom belongs"; 229 251 DescriptionMap["select-molecules-atoms"] = "select all atoms of a molecule"; … … 237 259 DescriptionMap["unselect-all-atoms"] = "unselect all atoms"; 238 260 DescriptionMap["unselect-all-molecules"] = "unselect all molecules"; 261 DescriptionMap["unselect-atom-by-element"] = "unselect an atom by element"; 239 262 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"; 240 266 DescriptionMap["unselect-molecule-by-id"] = "unselect a molecule by index"; 241 267 DescriptionMap["unselect-molecule-of-atom"] = "unselect a molecule to which a given atom belongs"; … … 245 271 DescriptionMap["version"] = "show version"; 246 272 // 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"; 247 276 DescriptionMap["bin-output-file"] = "name of the bin output file"; 248 277 DescriptionMap["bin-end"] = "start of the last bin"; … … 293 322 ShortFormMap["parse-xyz"] = "p"; 294 323 ShortFormMap["remove-atom"] = "r"; 295 ShortFormMap["remove-sphere"] = "R";296 324 ShortFormMap["repeat-box"] = "d"; 297 325 ShortFormMap["rotate-to-pas"] = "m"; … … 310 338 311 339 // value types for the actions 312 TypeMap["add-atom"] = &typeid( element);340 TypeMap["add-atom"] = &typeid(const element); 313 341 TypeMap["bond-file"] = &typeid(std::string); 314 342 TypeMap["bond-table"] = &typeid(std::string); … … 316 344 TypeMap["center-in-box"] = &typeid(BoxValue); 317 345 TypeMap["change-box"] = &typeid(BoxValue); 318 TypeMap["change-element"] = &typeid( element);346 TypeMap["change-element"] = &typeid(const element); 319 347 TypeMap["change-molname"] = &typeid(std::string); 320 348 TypeMap["clear-atom-selection"] = &typeid(void); … … 338 366 TypeMap["redo"] = &typeid(void); 339 367 TypeMap["remove-atom"] = &typeid(void); 340 TypeMap["remove-sphere"] = &typeid(double);341 368 TypeMap["repeat-box"] = &typeid(VectorValue); 342 369 TypeMap["rotate-origin"] = &typeid(double); … … 349 376 TypeMap["select-all-atoms"] = &typeid(void); 350 377 TypeMap["select-all-molecules"] = &typeid(void); 378 TypeMap["select-atom-by-element"] = &typeid(const element); 351 379 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); 352 383 TypeMap["select-molecule-by-id"] = &typeid(molecule); 353 384 TypeMap["select-molecule-of-atom"] = &typeid(atom); … … 362 393 TypeMap["unselect-all-atoms"] = &typeid(void); 363 394 TypeMap["unselect-all-molecules"] = &typeid(void); 395 TypeMap["unselect-atom-by-element"] = &typeid(const element); 364 396 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); 365 400 TypeMap["unselect-molecule-by-id"] = &typeid(molecule); 366 401 TypeMap["unselect-molecule-of-atom"] = &typeid(atom); … … 370 405 371 406 // value types for the values 407 TypeMap["angle-x"] = &typeid(double); 408 TypeMap["angle-y"] = &typeid(double); 409 TypeMap["angle-z"] = &typeid(double); 372 410 TypeMap["bin-output-file"] = &typeid(std::string); 373 411 TypeMap["bin-end"] = &typeid(double); … … 378 416 TypeMap["distances"] = &typeid(VectorValue); 379 417 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 *>); 382 420 TypeMap["end-step"] = &typeid(int); 383 421 TypeMap["id-mapping"] = &typeid(bool); … … 408 446 TypeEnumMap[&typeid(atom)] = Atom; 409 447 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; 412 450 413 451 // default values for any action that needs one (always string!) … … 468 506 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-atoms") ); 469 507 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-all-molecules") ); 508 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atom-by-element") ); 470 509 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") ); 471 512 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") ); 472 514 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-of-atom") ); 473 515 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecules-atoms") ); 474 516 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-all-atoms") ); 475 517 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-all-molecules") ); 518 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-atom-by-element") ); 476 519 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") ); 477 523 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-molecule-by-id") ); 478 524 MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-molecule-of-atom") ); … … 489 535 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "input") ); 490 536 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "output") ); 491 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "remove-sphere") );492 537 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "repeat-box") ); 493 538 MenuContainsActionMap.insert( pair<std::string, std::string> ("world", "scale-box") ); … … 528 573 generic.insert("redo"); 529 574 generic.insert("remove-atom"); 530 generic.insert("remove-sphere");531 575 generic.insert("repeat-box"); 532 576 generic.insert("rotate-origin"); … … 539 583 generic.insert("select-all-atoms"); 540 584 generic.insert("select-all-molecules"); 585 generic.insert("select-atom-by-element"); 541 586 generic.insert("select-atom-by-id"); 587 generic.insert("select-atoms-inside-cuboid"); 588 generic.insert("select-atoms-inside-sphere"); 542 589 generic.insert("select-molecule-by-id"); 590 generic.insert("select-molecule-by-formula"); 543 591 generic.insert("select-molecule-of-atom"); 544 592 generic.insert("select-molecules-atoms"); … … 552 600 generic.insert("unselect-all-atoms"); 553 601 generic.insert("unselect-all-molecules"); 602 generic.insert("unselect-atom-by-element"); 554 603 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"); 555 607 generic.insert("unselect-molecule-by-id"); 556 608 generic.insert("unselect-molecule-of-atom"); … … 564 616 565 617 // hidden arguments 618 hidden.insert("angle-x"); 619 hidden.insert("angle-y"); 620 hidden.insert("angle-z"); 566 621 hidden.insert("bin-end"); 567 622 hidden.insert("bin-output-file"); … … 595 650 } 596 651 652 bool MapOfActions::isCurrentValuePresent(const char *name) const 653 { 654 return (CurrentValue.find(name) != CurrentValue.end()); 655 } 656 597 657 void MapOfActions::queryCurrentValue(const char * name, class atom * &_T) 598 658 { … … 608 668 } 609 669 610 void MapOfActions::queryCurrentValue(const char * name, c lasselement * &_T) {670 void MapOfActions::queryCurrentValue(const char * name, const element * &_T) { 611 671 int Z = -1; 612 if (typeid( element ) == *TypeMap[name]) {672 if (typeid(const element ) == *TypeMap[name]) { 613 673 if (CurrentValue.find(name) == CurrentValue.end()) 614 674 throw MissingValueException(__FILE__, __LINE__); … … 692 752 } 693 753 694 void MapOfActions::queryCurrentValue(const char * name, std::vector< element *>&_T)754 void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T) 695 755 { 696 756 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]) { 699 759 if (CurrentValue.find(name) == CurrentValue.end()) 700 760 throw MissingValueException(__FILE__, __LINE__); … … 744 804 } 745 805 746 void MapOfActions::setCurrentValue(const char * name, c lasselement * &_T)747 { 748 if (typeid( element ) == *TypeMap[name]) {806 void MapOfActions::setCurrentValue(const char * name, const element * &_T) 807 { 808 if (typeid(const element ) == *TypeMap[name]) { 749 809 std::ostringstream stream; 750 stream << _T-> Z;810 stream << _T->getAtomicNumber(); 751 811 CurrentValue[name] = stream.str(); 752 812 } else … … 804 864 } 805 865 806 void MapOfActions::setCurrentValue(const char * name, std::vector< element *>&_T)807 { 808 if (typeid( std::vector< element *> ) == *TypeMap[name]) {866 void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T) 867 { 868 if (typeid( std::vector<const element *> ) == *TypeMap[name]) { 809 869 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() << " "; 812 872 } 813 873 CurrentValue[name] = stream.str(); … … 873 933 new SelectionClearAllMoleculesAction(); 874 934 new SelectionAllAtomsAction(); 935 new SelectionAllAtomsInsideCuboidAction(); 936 new SelectionAllAtomsInsideSphereAction(); 875 937 new SelectionAllAtomsOfMoleculeAction(); 876 938 new SelectionAllMoleculesAction(); 939 new SelectionAtomByElementAction(); 877 940 new SelectionAtomByIdAction(); 878 941 new SelectionMoleculeByIdAction(); 942 new SelectionMoleculeByFormulaAction(); 879 943 new SelectionMoleculeOfAtomAction(); 880 944 new SelectionNotAllAtomsAction(); 945 new SelectionNotAllAtomsInsideCuboidAction(); 946 new SelectionNotAllAtomsInsideSphereAction(); 881 947 new SelectionNotAllAtomsOfMoleculeAction(); 882 948 new SelectionNotAllMoleculesAction(); 949 new SelectionNotAtomByElementAction(); 883 950 new SelectionNotAtomByIdAction(); 951 new SelectionNotMoleculeByFormulaAction(); 884 952 new SelectionNotMoleculeByIdAction(); 885 953 new SelectionNotMoleculeOfAtomAction(); … … 895 963 new WorldInputAction(); 896 964 new WorldOutputAction(); 897 new WorldRemoveSphereOfAtomsAction();898 965 new WorldRepeatBoxAction(); 899 966 new WorldScaleBoxAction(); -
src/Actions/MapOfActions.hpp
r8006ee r994713 163 163 void populateActions(); 164 164 165 bool isCurrentValuePresent(const char *name) const; 165 166 void queryCurrentValue(const char * name, class atom * &_T); 166 void queryCurrentValue(const char * name, c lasselement * &_T);167 void queryCurrentValue(const char * name, const element * &_T); 167 168 void queryCurrentValue(const char * name, class molecule * &_T); 168 169 void queryCurrentValue(const char * name, class Box &_T); 169 170 void queryCurrentValue(const char * name, class Vector &_T); 170 171 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); 172 173 void queryCurrentValue(const char * name, std::vector<molecule *>&_T); 173 174 template<typename T> void queryCurrentValue(const char * name, T &_T) … … 198 199 199 200 void setCurrentValue(const char * name, class atom * &_T); 200 void setCurrentValue(const char * name, c lasselement * &_T);201 void setCurrentValue(const char * name, const element * &_T); 201 202 void setCurrentValue(const char * name, class molecule * &_T); 202 203 void setCurrentValue(const char * name, class Box &_T); 203 204 void setCurrentValue(const char * name, class Vector &_T); 204 205 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); 206 207 void setCurrentValue(const char * name, std::vector<molecule *>&_T); 207 208 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 1 8 /* 2 9 * MethodAction.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * BondFileAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ChangeNameAction.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * FillWithMoleculeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * LinearInterpolationofTrajectoriesAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * RotateAroundSelfByAngleAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * RotateToPrincipalAxisSystemAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 85 97 Vector x = (*iter)->getPosition(); 86 98 x -= *CenterOfGravity; 87 const double mass = (*iter)->getType()-> mass;99 const double mass = (*iter)->getType()->getMass(); 88 100 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 89 101 InertiaTensor.at(0,1) += mass*(-x[0]*x[1]); … … 136 148 Vector x = (*iter)->getPosition(); 137 149 x -= *CenterOfGravity; 138 const double mass = (*iter)->getType()-> mass;150 const double mass = (*iter)->getType()->getMass(); 139 151 InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]); 140 152 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 1 8 /* 2 9 * SaveAdjacencyAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SaveBondsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SaveTemperatureAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SuspendInWaterAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * VerletIntegrationAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * LoadXyzAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 74 86 input.open(filename.c_str()); 75 87 if (!input.fail()) { 76 // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include77 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 }83 88 XyzParser parser; // briefly instantiate a parser which is removed at end of focus 84 89 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 parsed89 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 }104 90 } else { 105 91 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 1 8 /* 2 9 * SaveXyzAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Process.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AllAtomsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AllAtomsOfMoleculeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AllMoleculesAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AtomByIdAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ClearAllAtomsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ClearAllMoleculesAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeByIdAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeOfAtomAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotAllAtomsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotAllAtomsOfMoleculeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotAllMoleculesAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotAtomByIdAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotMoleculeByIdAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NotMoleculeOfAtomAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ConvexEnvelopeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * NonConvexEnvelopeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ValueStorage.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 8 21 9 22 #include "ValueStorage.hpp" 10 23 #include "Patterns/Singleton_impl.hpp" 11 24 12 ValueStorage::ValueStorage() {}; 25 ValueStorage::ValueStorage() : 26 MapOfActions_instance(MapOfActions::getInstance()) 27 {}; 13 28 14 29 ValueStorage::~ValueStorage() {}; -
src/Actions/ValueStorage.hpp
r8006ee r994713 8 8 #ifndef VALUESTORAGE_HPP_ 9 9 #define VALUESTORAGE_HPP_ 10 11 10 12 11 #include "Actions/MapOfActions.hpp" … … 22 21 23 22 public: 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; 29 36 } 30 37 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 */ 31 50 std::string getDescription(std::string actionname); 32 51 … … 34 53 ValueStorage(); 35 54 ~ValueStorage(); 55 56 MapOfActions &MapOfActions_instance; 36 57 }; 37 58 -
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 1 8 /* 2 9 * AddEmptyBoundaryAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * BoundInBoxAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CenterInBoxAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CenterOnEdgeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ChangeBoxAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * InputAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * OutputAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * RepeatBoxAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ScaleBoxAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SetDefaultNameAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 62 74 63 75 defaultname = World::getInstance().getDefaultName(); 76 WorldSetDefaultNameState *UndoState = new WorldSetDefaultNameState(defaultname); 64 77 ValueStorage::getInstance().queryCurrentValue(NAME, defaultname); 65 78 66 79 World::getInstance().setDefaultName(defaultname); 67 80 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl); 68 return Action::s uccess;81 return Action::state_ptr(UndoState); 69 82 } 70 83 … … 74 87 string newName = World::getInstance().getDefaultName(); 75 88 World::getInstance().setDefaultName(state->lastName); 89 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << World::getInstance().getDefaultName() << "." << endl); 76 90 77 91 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 1 8 /* 2 9 * SetGaussianBasisAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SetOutputFormatsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * BoundaryLineSet.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #include "BoundaryLineSet.hpp" -
src/BoundaryMaps.hpp
r8006ee r994713 22 22 typedef std::map <int, int> IndexToIndex; 23 23 24 // ============= TesselPoint maps ======================== // 25 typedef std::pair < double, class TesselPoint * > TesselPointDistancePair; 26 typedef std::multimap < double, class TesselPoint * > TesselPointDistanceMap; 27 typedef std::pair < TesselPointDistanceMap::iterator, bool > TesselPointDistanceTestPair; 28 29 typedef std::list <TesselPoint *> TesselPointList; 30 typedef std::set <TesselPoint *> TesselPointSet; 31 32 typedef std::list<std::list <TesselPoint *> *> ListOfTesselPointList; 33 34 // ============= BoundaryPointSet maps ======================== // 24 35 typedef std::map < int, class BoundaryPointSet * > PointMap; 25 36 typedef std::set < class BoundaryPointSet * > PointSet; … … 28 39 typedef std::pair < PointMap::iterator, bool > PointTestPair; 29 40 30 typedef std:: list <class CandidateForTesselation *> CandidateList;31 typedef std:: map <class BoundaryLineSet *, class CandidateForTesselation *> CandidateMap;41 typedef std::multimap <double, class BoundaryPointSet * > DistanceToPointMap; 42 typedef std::pair <double, class BoundaryPointSet * > DistanceToPointPair; 32 43 44 // ============= BoundaryLineSet maps ======================== // 33 45 typedef std::multimap < int, class BoundaryLineSet * > LineMap; 34 46 typedef std::set < class BoundaryLineSet * > LineSet; … … 37 49 typedef std::pair < LineMap::iterator, bool > LineTestPair; 38 50 51 // ============= BoundaryTriangleSet maps ======================== // 39 52 typedef std::map < int, class BoundaryTriangleSet * > TriangleMap; 40 53 typedef std::set < class BoundaryTriangleSet * > TriangleSet; … … 43 56 typedef std::pair < TriangleMap::iterator, bool > TriangleTestPair; 44 57 58 // ============= BoundaryPolygonSet maps ======================== // 45 59 typedef std::map < int, class BoundaryPolygonSet * > PolygonMap; 46 60 typedef std::set < class BoundaryPolygonSet * > PolygonSet; 47 61 typedef std::list < class BoundaryPolygonSet * > PolygonList; 48 62 49 typedef std::multimap <double, class BoundaryPointSet * > DistanceToPointMap; 50 typedef std::pair <double, class BoundaryPointSet * > DistanceToPointPair; 63 // ============= CandidateForTesselation maps ======================== // 64 typedef std::list <class CandidateForTesselation *> CandidateList; 65 typedef std::map <class BoundaryLineSet *, class CandidateForTesselation *> CandidateMap; 66 67 // ============= Various maps ======================== // 68 typedef std::map <double, TesselPointDistancePair > Boundaries; 69 typedef std::pair<double, TesselPointDistancePair > BoundariesPair; 70 typedef std::pair< Boundaries::iterator, bool> BoundariesTestPair; 51 71 52 72 typedef std::multimap <double, std::pair < PointMap::iterator, PointMap::iterator> > DistanceMultiMap; 53 73 typedef 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;59 74 60 75 enum 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 1 8 /* 2 9 * BoundaryPointSet.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * BoundaryPolygonSet.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * BoundaryTriangleSet.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * Box.cpp … … 6 13 */ 7 14 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" 9 21 10 22 #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 1 8 /* 2 9 * CandidateForTesselation.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * CommandLineParser.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ConfigFileBuffer.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * AtomDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AtomIdDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AtomSelectionDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * AtomTypeDescriptor_impl.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeFormulaDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * MoleculeIdDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeNameDescriptor.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * MoleculePtrDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MoleculeSelectionDescriptor.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * CustomException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * IllegalTypeException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * LinearDependenceException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MathException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MissingValueException.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * NotInvertibleException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * ParseError.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * SkewException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ZeroVectorException.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Formula.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 21 8 22 #include "Formula.hpp" 9 23 … … 47 61 for(const_iterator iter=end();iter!=begin();){ 48 62 --iter; 49 sstr << (*iter).first-> symbol;63 sstr << (*iter).first->getSymbol(); 50 64 if((*iter).second>1) 51 65 sstr << (*iter).second; … … 146 160 147 161 bool Formula::hasElement(const string &shorthand) const{ 148 element * element = World::getInstance().getPeriode()->FindElement(shorthand);162 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 149 163 return hasElement(element); 150 164 } … … 167 181 168 182 void Formula::operator+=(const string &shorthand){ 169 element * element = World::getInstance().getPeriode()->FindElement(shorthand);183 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 170 184 operator+=(element); 171 185 } … … 198 212 199 213 void Formula::operator-=(const string &shorthand){ 200 element * element = World::getInstance().getPeriode()->FindElement(shorthand);214 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 201 215 operator-=(element); 202 216 } … … 220 234 221 235 void 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); 223 237 addElements(element,count); 224 238 } … … 252 266 253 267 const unsigned int Formula::operator[](string shorthand) const{ 254 element * element = World::getInstance().getPeriode()->FindElement(shorthand);268 const element * element = World::getInstance().getPeriode()->FindElement(shorthand); 255 269 return operator[](element); 256 270 } … … 380 394 result_type 381 395 Formula::_iterator<result_type>::operator*(){ 382 element *element = World::getInstance().getPeriode()->FindElement(pos+1);396 const element *element = World::getInstance().getPeriode()->FindElement(pos+1); 383 397 ASSERT(element,"Element with position of iterator not found"); 384 398 return make_pair(element,(*set)[pos]); … … 390 404 // no one can keep this value around, so a static is ok to avoid temporaries 391 405 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); 393 407 ASSERT(element,"Element with position of iterator not found"); 394 408 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 1 8 /* 2 9 * Assert.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * Info.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * log.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 18 30 void setVerbosity(int verbosityLevel) { 19 31 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 */ 39 int getVerbosity() { 40 return logger::getInstance().getVerbosity(); 20 41 } 21 42 -
src/Helpers/Log.hpp
r8006ee r994713 15 15 class errorLogger & eLog(); 16 16 void setVerbosity(int verbosityLevel); 17 int getVerbosity(); 17 18 bool DoLog(int verbose); 18 19 bool DoeLog(int verbose); -
src/Helpers/Makefile.am
r8006ee r994713 72 72 echo "" > unity.cpp; \ 73 73 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; \ 75 77 done; 76 78 -
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 1 8 /* 2 9 * MemDebug.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 // 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 2 18 3 19 #include "Helpers/MemDebug.hpp" … … 6 22 #include "Helpers/Verbose.hpp" 7 23 #include <iostream> 24 25 using namespace std; 8 26 9 27 /** 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 1 8 /* 2 9 * errorLogger.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 41 53 void errorLogger::setVerbosity(int verbosityLevel) { 42 54 verbosity = verbosityLevel; 55 } 56 57 /** 58 * Gets the verbosity. 59 * 60 * \return verbosity level 61 */ 62 int errorLogger::getVerbosity() 63 { 64 return verbosity; 43 65 } 44 66 -
src/Helpers/errorlogger.hpp
r8006ee r994713 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity(); 27 28 28 29 protected: -
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 1 8 /** \file helpers.cpp 2 9 * 3 10 * Implementation of some auxiliary functions for memory dis-/allocation and so on 4 11 */ 12 13 // include config.h 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 5 17 6 18 #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 1 8 /* 2 9 * logger.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 44 56 45 57 /** 58 * Gets the verbosity. 59 * 60 * \return verbosity level 61 */ 62 int logger::getVerbosity() 63 { 64 return verbosity; 65 } 66 67 /** 46 68 * Operator for the Binary(arg) call. 47 69 * Constructs temporary a Verbose class object, wherein the Binary is stored. -
src/Helpers/logger.hpp
r8006ee r994713 25 25 static bool DoOutput(); 26 26 static void setVerbosity(int verbosityLevel); 27 static int getVerbosity(); 27 28 28 29 protected: -
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 1 8 /* 2 9 * Line.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Matrix.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #include "LinearAlgebra/Matrix.hpp" … … 108 122 } 109 123 124 void 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 110 137 Matrix &Matrix::operator=(const Matrix &src){ 111 138 if(&src!=this){ … … 213 240 214 241 215 voidMatrix::transpose()242 Matrix &Matrix::transpose() 216 243 { 217 244 double tmp; … … 219 246 for (int j=i+1;j<NDIM;j++) { 220 247 tmp = at(j,i); 248 at(j,i) = at(i,j); 221 249 at(i,j) = tmp; 222 at(j,i) = tmp;223 }250 } 251 return *this; 224 252 } 225 253 … … 253 281 gsl_eigen_symmv_free(T); 254 282 gsl_matrix_memcpy(content->content, evec); 283 gsl_matrix_free(evec); 255 284 Vector evalues(gsl_vector_get(eval,0), gsl_vector_get(eval,1), gsl_vector_get(eval,2)); 285 gsl_vector_free(eval); 256 286 return evalues; 257 287 } … … 315 345 316 346 Vector 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; 322 350 } 323 351 -
src/LinearAlgebra/Matrix.hpp
r8006ee r994713 54 54 */ 55 55 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); 56 63 57 64 /** … … 113 120 */ 114 121 Matrix transpose() const; 115 voidtranspose();122 Matrix &transpose(); 116 123 117 124 // 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 1 8 /* 2 9 * Plane.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Space.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file vector.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #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 1 8 /* 2 9 * VectorInterface.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * gslmatrix.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * gslvector.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * linearsystemofequations.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * vector_ops.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" -
src/Makefile.am
r8006ee r994713 6 6 ATOMSOURCE = \ 7 7 atom.cpp \ 8 AtomicInfo.cpp \ 8 9 atom_atominfo.cpp \ 9 10 atom_bondedparticle.cpp \ … … 16 17 ATOMHEADER = \ 17 18 atom.hpp \ 19 AtomicInfo.hpp \ 18 20 atom_atominfo.hpp \ 19 21 atom_bondedparticle.hpp \ … … 77 79 Descriptors/AtomIdDescriptor.cpp \ 78 80 Descriptors/AtomSelectionDescriptor.cpp \ 81 Descriptors/AtomShapeDescriptor.cpp \ 79 82 Descriptors/AtomTypeDescriptor.cpp \ 80 83 Descriptors/MoleculeDescriptor.cpp \ … … 89 92 Descriptors/AtomIdDescriptor.hpp \ 90 93 Descriptors/AtomSelectionDescriptor.hpp \ 94 Descriptors/AtomShapeDescriptor.hpp \ 91 95 Descriptors/AtomTypeDescriptor.hpp \ 92 96 Descriptors/MoleculeDescriptor.hpp \ … … 371 375 372 376 $(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`"\";" > $@ 374 378 375 379 376 380 unity.cpp: ${MOLECUILDERSOURCE} ${MOLECUILDERHEADER} 377 echo " " > unity.cpp; \381 echo "#include \"$(srcdir)/Helpers/MemDebug.cpp\"" > unity.cpp; \ 378 382 list='$(MOLECUILDERSOURCE)'; for file in $$list; do \ 379 383 echo "#include \"$(srcdir)/$$file\"" >> unity.cpp; \ 380 384 done; \ 381 385 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 1 8 /* 2 9 * ChangeTracker.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 21 9 22 #include "Parser/ChangeTracker.hpp" 10 23 #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 1 8 /* 2 9 * FormatParser.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file FormatParserStorage.cpp 2 9 * … … 5 12 * 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * MpqcParser.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * PcpParser.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 21 8 22 #include <iostream> 9 23 #include <iomanip> 10 24 25 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp" 11 26 #include "atom.hpp" 12 27 #include "config.hpp" … … 349 364 // 4. dissect the molecule into connected subgraphs 350 365 // don't do this here ... 351 // MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);366 //FragmentationSubgraphDissection(); 352 367 //delete(mol); 353 368 … … 490 505 PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0; 491 506 for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) { 492 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()-> NoValenceOrbitals;507 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals(); 493 508 } 494 509 cout << PlaneWaveSpecifics.MaxPsiDouble << endl; … … 525 540 // insert all found elements into the map 526 541 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)); 528 543 if (!Inserter.second) // increase if present 529 544 Inserter.first->second += 1; … … 540 555 const element * const elemental = World::getInstance().getPeriode()->FindElement(iter->first); 541 556 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; 543 558 } 544 559 } … … 556 571 int nr = 0; 557 572 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) ); 559 574 if (!Inserter.second) 560 575 Inserter.first->second += 1; 561 const int Z = (*AtomRunner)->getType()-> Z;576 const int Z = (*AtomRunner)->getType()->getAtomicNumber(); 562 577 *file << "Ion_Type" << ZtoIndexMap[Z] << "_" << ZtoCountMap[Z] << "\t" << fixed << setprecision(9) << showpoint; 563 578 *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 1 8 /* 2 9 * TremoloParser.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * XyzParser.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 51 63 newmol = World::getInstance().createMolecule(); 52 64 newmol->ActiveFlag = true; 65 // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include 53 66 World::getInstance().getMolecules()->insert(newmol); 54 67 for (int i = 0; i < numberOfAtoms; i++) { … … 86 99 vector<atom*> atoms = World::getInstance().getAllAtoms(); 87 100 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; 89 102 } 90 103 } -
src/Patterns/ObservedContainer_impl.hpp
r8006ee r994713 186 186 } 187 187 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 188 215 #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 1 8 /* 2 9 * Observer.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 10 22 #include "Observer.hpp" 11 12 23 13 24 #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 1 8 /* 2 9 * PointCloud.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * BaseShapes_impl.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 21 8 22 #include "Shapes/BaseShapes.hpp" 9 23 #include "Shapes/BaseShapes_impl.hpp" 10 24 25 #include <cmath> 26 27 #include "Helpers/Assert.hpp" 11 28 #include "LinearAlgebra/Vector.hpp" 12 29 … … 14 31 return point.NormSquared()<=1; 15 32 } 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 */ 39 std::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 16 62 17 63 Shape Sphere(){ … … 21 67 22 68 bool 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 */ 75 std::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; 24 79 } 25 80 26 81 Shape Cuboid(){ 27 Shape::impl_ptr impl = Shape::impl_ptr(new Sphere_impl());82 Shape::impl_ptr impl = Shape::impl_ptr(new Cuboid_impl()); 28 83 return Shape(impl); 29 84 } -
src/Shapes/BaseShapes_impl.hpp
r8006ee r994713 13 13 class Sphere_impl : public Shape_impl { 14 14 virtual bool isInside(const Vector &point); 15 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 15 16 }; 16 17 17 18 class Cuboid_impl : public Shape_impl { 18 19 virtual bool isInside(const Vector &point); 20 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 19 21 }; 20 22 -
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 1 8 /* 2 9 * Shape.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 21 8 22 #include "Shape.hpp" 9 23 #include "Shape_impl.hpp" 24 25 26 #include "Helpers/Assert.hpp" 27 #include "LinearAlgebra/Vector.hpp" 10 28 11 29 Shape::Shape(const Shape& src) : … … 17 35 bool Shape::isInside(const Vector &point) const{ 18 36 return impl->isInside(point); 37 } 38 39 std::vector<Vector> Shape::getHomogeneousPointsOnSurface(const int N) const { 40 return impl->getHomogeneousPointsOnSurface(N); 19 41 } 20 42 … … 65 87 } 66 88 89 std::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 67 107 Shape operator&&(const Shape &lhs,const Shape &rhs){ 68 108 Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(getShapeImpl(lhs),getShapeImpl(rhs))); … … 80 120 bool OrShape_impl::isInside(const Vector &point){ 81 121 return rhs->isInside(point) || lhs->isInside(point); 122 } 123 124 std::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; 82 139 } 83 140 … … 99 156 } 100 157 158 std::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 101 163 Shape operator!(const Shape &arg){ 102 164 Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(getShapeImpl(arg))); -
src/Shapes/Shape.hpp
r8006ee r994713 10 10 11 11 #include <boost/shared_ptr.hpp> 12 13 #include <vector> 12 14 13 15 class Vector; … … 25 27 26 28 bool isInside(const Vector &point) const; 29 std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 27 30 28 31 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 1 8 /* 2 9 * ShapeOps.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #include "Shapes/ShapeOps.hpp" … … 25 39 } 26 40 41 std::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 27 50 Shape resize(const Shape &arg,double size){ 28 51 Shape::impl_ptr impl = Shape::impl_ptr(new Resize_impl(getShapeImpl(arg),size)); … … 40 63 bool Translate_impl::isInside(const Vector& point){ 41 64 return arg->isInside(point-offset); 65 } 66 67 std::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; 42 73 } 43 74 … … 68 99 } 69 100 101 std::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 70 109 Shape stretch(const Shape &arg, const Vector &factors){ 71 110 Shape::impl_ptr impl = Shape::impl_ptr(new Stretch_impl(getShapeImpl(arg),factors)); … … 87 126 } 88 127 128 std::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 89 136 Shape transform(const Shape &arg, const Matrix &transformation){ 90 137 Shape::impl_ptr impl = Shape::impl_ptr(new Transform_impl(getShapeImpl(arg),transformation)); -
src/Shapes/ShapeOps_impl.hpp
r8006ee r994713 19 19 virtual ~Resize_impl(); 20 20 virtual bool isInside(const Vector& point); 21 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 21 22 private: 22 23 Shape::impl_ptr arg; … … 30 31 virtual ~Translate_impl(); 31 32 virtual bool isInside(const Vector& point); 33 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 32 34 private: 33 35 Shape::impl_ptr arg; … … 41 43 virtual ~Stretch_impl(); 42 44 virtual bool isInside(const Vector& point); 45 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 43 46 private: 44 47 Shape::impl_ptr arg; … … 53 56 virtual ~Transform_impl(); 54 57 virtual bool isInside(const Vector& point); 58 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 55 59 private: 56 60 Shape::impl_ptr arg; -
src/Shapes/Shape_impl.hpp
r8006ee r994713 9 9 #define SHAPE_IMPL_HPP_ 10 10 11 #include <vector> 12 11 13 #include "Shapes/Shape.hpp" 14 15 class Vector; 12 16 13 17 class Shape_impl { … … 16 20 virtual ~Shape_impl(){}; 17 21 virtual bool isInside(const Vector &point)=0; 22 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const=0; 18 23 }; 19 24 … … 23 28 return true; 24 29 } 30 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const { 31 std::vector<Vector> PointsOnSurface; 32 return PointsOnSurface; 33 } 25 34 }; 26 35 … … 28 37 virtual bool isInside(const Vector &point){ 29 38 return false; 39 } 40 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const { 41 std::vector<Vector> PointsOnSurface; 42 return PointsOnSurface; 30 43 } 31 44 }; … … 36 49 virtual ~AndShape_impl(); 37 50 virtual bool isInside(const Vector &point); 51 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 38 52 private: 39 53 Shape::impl_ptr lhs; … … 46 60 virtual ~OrShape_impl(); 47 61 virtual bool isInside(const Vector &point); 62 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 48 63 private: 49 64 Shape::impl_ptr lhs; … … 56 71 virtual ~NotShape_impl(); 57 72 virtual bool isInside(const Vector &point); 73 virtual std::vector<Vector> getHomogeneousPointsOnSurface(const int N) const; 58 74 private: 59 75 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 1 8 /* 2 9 * TesselPoint.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * ThermoStatContainer.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * CommandLineDialog.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CommandLineStatusIndicator.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CommandLineUIFactory.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CommandLineWindow.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Dialog.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" -
src/UIElements/Dialog.hpp
r8006ee r994713 255 255 virtual void setResult(); 256 256 protected: 257 element * tmp;257 const element * tmp; 258 258 }; 259 259 … … 265 265 virtual void setResult(); 266 266 protected: 267 element *temp;268 std::vector< element *> tmp;267 const element *temp; 268 std::vector<const element *> tmp; 269 269 }; 270 270 -
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 1 8 /* 2 9 * Window.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ActionMenuItem.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * DisplayMenuItem.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * Menu.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MenuItem.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * QTMenu.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Menu/QT4/QTMenu.hpp" 9 21 10 22 #include <Qt/qaction.h> 23 24 #include "Helpers/MemDebug.hpp" 25 11 26 #include "Menu/MenuItem.hpp" 12 27 -
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 1 8 /* 2 9 * SeperatorItem.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * SubMenuItem.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * TextMenu.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * QTDialog.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "UIElements/QT4/QTDialog.hpp" … … 554 566 { 555 567 stringstream sstr; 556 sstr << (*iter).first << "\t" << (*iter).second-> name;568 sstr << (*iter).first << "\t" << (*iter).second->getName(); 557 569 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first)); 558 570 } … … 589 601 { 590 602 stringstream sstr; 591 sstr << (*iter).first << "\t" << (*iter).second-> name;603 sstr << (*iter).first << "\t" << (*iter).second->getName(); 592 604 inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first)); 593 605 } … … 816 828 } 817 829 818 ElementQTQueryPipe::ElementQTQueryPipe( element **_content, QTDialog *_dialog, QComboBox *_theBox) :830 ElementQTQueryPipe::ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox) : 819 831 content(_content), 820 832 dialog(_dialog), … … 832 844 } 833 845 834 ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector< element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :846 ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox) : 835 847 content(_content), 836 848 dialog(_dialog), … … 844 856 QVariant data = theBox->itemData(newIndex); 845 857 int idx = data.toInt(); 846 element *elemental = World::getInstance().getPeriode()->FindElement(idx);858 const element *elemental = World::getInstance().getPeriode()->FindElement(idx); 847 859 if(elemental) 848 860 (*content).push_back(elemental); -
src/UIElements/QT4/QTDialog.hpp
r8006ee r994713 451 451 Q_OBJECT 452 452 public: 453 ElementQTQueryPipe( element **_content, QTDialog *_dialog, QComboBox *_theBox);453 ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox); 454 454 virtual ~ElementQTQueryPipe(); 455 455 … … 458 458 459 459 private: 460 element **content;460 const element **content; 461 461 QTDialog *dialog; 462 462 QComboBox *theBox; … … 466 466 Q_OBJECT 467 467 public: 468 ElementsQTQueryPipe(std::vector< element *>*_content, QTDialog *_dialog, QComboBox *_theBox);468 ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox); 469 469 virtual ~ElementsQTQueryPipe(); 470 470 … … 473 473 474 474 private: 475 std::vector< element *>*content;475 std::vector<const element *>*content; 476 476 QTDialog *dialog; 477 477 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 1 8 /* 2 9 * QTMainWindow.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "QTMainWindow.hpp" … … 19 31 #include<boost/bind.hpp> 20 32 33 #include "Helpers/MemDebug.hpp" 34 21 35 #include "atom.hpp" 22 36 #include "molecule.hpp" … … 32 46 #include "Views/QT4/QTMoleculeView.hpp" 33 47 #include "Views/QT4/QTStatusBar.hpp" 34 #include "Helpers/MemDebug.hpp"35 36 48 37 49 using 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 1 8 /* 2 9 * QTUIFactory.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include <iostream> 9 21 #include <cassert> 10 22 11 using namespace std; 23 #include <qapplication.h> 12 24 13 #include <qapplication.h>14 25 15 26 #include "UIElements/QT4/QTUIFactory.hpp" 16 27 #include "UIElements/QT4/QTMainWindow.hpp" 17 28 #include "UIElements/QT4/QTDialog.hpp" 29 30 #include "Helpers/MemDebug.hpp" 31 18 32 #include "version.h" 19 33 #include "defs.hpp" 20 #include "Helpers/MemDebug.hpp" 34 35 using namespace std; 21 36 22 37 QTUIFactory::QTUIFactory() : … … 26 41 argv = new char*[1]; 27 42 argv[0] = new char[256]; 28 strcpy(argv[0], ESPACKVersion);43 strcpy(argv[0],MOLECUILDERVERSION); 29 44 app = new QApplication(argc,argv); 30 45 } -
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 1 8 /* 2 9 * TextDialog.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 569 581 bool badInput=false; 570 582 bool aborted = false; 571 element * temp = NULL;583 const element * temp = NULL; 572 584 do{ 573 585 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 1 8 /* 2 9 * TextStatusIndicator.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * TextUIFactory.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /* 2 9 * TextWindow.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 56 68 new SeperatorItem(main_menu); 57 69 58 Action* undoAction = ActionRegistry::getInstance().getActionByName(" Undo");70 Action* undoAction = ActionRegistry::getInstance().getActionByName("undo"); 59 71 new ActionMenuItem('u',"Undo last operation",main_menu,undoAction); 60 72 61 Action* redoAction = ActionRegistry::getInstance().getActionByName(" Redo");73 Action* redoAction = ActionRegistry::getInstance().getActionByName("redo"); 62 74 new ActionMenuItem('r',"Redo last operation",main_menu,redoAction); 63 75 -
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 1 8 /* 2 9 * UIFactory.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * MethodStringView.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * GLMoleculeView.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "GLMoleculeView.hpp" 21 22 #include "Helpers/MemDebug.hpp" 9 23 10 24 GLMoleculeView::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 1 8 /* 2 9 * QTMoleculeView.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Views/QT4/QTMoleculeView.hpp" 9 21 10 22 #include <iostream> 23 24 #include "Helpers/MemDebug.hpp" 25 11 26 #include "molecule.hpp" 12 13 27 14 28 using 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 1 8 /* 2 9 * QTStatusBar.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include <sstream> … … 13 25 14 26 #include "QTStatusBar.hpp" 27 28 #include "Helpers/MemDebug.hpp" 29 15 30 #include "World.hpp" 16 31 #include "Helpers/helpers.hpp" … … 21 36 QStatusBar(_parent), 22 37 Observer("QTStatusBar"), 23 parent(_parent),24 38 atomCount(World::getInstance().numAtoms()), 25 moleculeCount(World::getInstance().numMolecules()) 39 moleculeCount(World::getInstance().numMolecules()), 40 parent(_parent) 26 41 { 27 42 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 1 8 /* 2 9 * QTWorldView.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Views/QT4/QTWorldView.hpp" 9 21 10 22 #include <iostream> 11 23 24 #include "Helpers/MemDebug.hpp" 25 12 26 #include "atom.hpp" 27 #include "Formula.hpp" 13 28 #include "molecule.hpp" 14 29 … … 20 35 // these attributes are skiped so far 21 36 const int QTWorldView::COLUMNCOUNT = COLUMNTYPES_MAX; 22 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms" /*,"Formula"*/,"Center"/*,"Size"*/};37 const char *QTWorldView::COLUMNNAMES[QTWorldView::COLUMNCOUNT]={"Name","Atoms","Formula"/*,"Size"*/}; 23 38 24 39 QTWorldView::QTWorldView(QWidget * _parent) : … … 61 76 const int index = (*iter)->IndexNr; 62 77 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)); 67 79 indexWidget->setData(Qt::UserRole,QVariant(index)); 68 80 setVerticalHeaderItem(i,indexWidget); … … 75 87 const int atomCount = (*iter)->getAtomCount(); 76 88 QTableWidgetItem *countWidget= new QTableWidgetItem(); 77 stringstream countsstr; 78 countsstr << atomCount; 79 countWidget->setText(QString(countsstr.str().c_str())); 89 countWidget->setText(QString::number(atomCount)); 80 90 countWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); 81 91 setItem(i,ATOMS,countWidget); 82 92 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); 90 98 91 99 molSelection[i]=nameWidget->isSelected(); -
src/UIElements/Views/QT4/QTWorldView.hpp
r8006ee r994713 28 28 29 29 static const int COLUMNCOUNT; 30 enum {NAME,ATOMS, CENTER,COLUMNTYPES_MAX} COLUMNTYPES;30 enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES; 31 31 static const char *COLUMNNAMES[]; 32 32 -
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 1 8 /* 2 9 * StreamStringView.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * StringView.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * View.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * World.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 141 153 void World::destroyMolecule(molecule* mol){ 142 154 OBSERVE; 155 ASSERT(mol,"Molecule that was meant to be destroyed did not exist"); 143 156 destroyMolecule(mol->getId()); 144 157 } … … 202 215 atoms.erase(oldId); 203 216 atoms.insert(pair<atomId_t,atom*>(newId,target)); 217 return true; 218 } 219 else{ 220 return false; 221 } 222 } 223 } 224 225 bool 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)); 204 238 return true; 205 239 } … … 704 738 selectedMolecules(this), 705 739 currMoleculeId(0), 740 lastMoleculePoolSize(0), 741 numMoleculeDefragSkips(0), 706 742 molecules_deprecated(new MoleculeListClass(this)) 707 743 { … … 740 776 CONSTRUCT_SINGLETON(World) 741 777 778 CONSTRUCT_OBSERVEDCONTAINER(World::AtomSTLSet) 779 780 CONSTRUCT_OBSERVEDCONTAINER(World::MoleculeSTLSet) 781 742 782 /******************************* deprecated Legacy Stuff ***********************/ 743 783 -
src/World.hpp
r8006ee r994713 72 72 template<typename> friend class AtomsCalculation; 73 73 public: 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; 74 77 75 78 // 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; 78 81 79 82 typedef ATOMSET(std::vector) AtomComposite; … … 217 220 */ 218 221 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); 219 230 220 231 /** -
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 1 8 /* 2 9 * analysis_bonds.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 138 150 molecule::iterator Runner = (*MolRunner)->begin(); 139 151 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)) { 141 153 // check distance 142 154 const double distance = (*Runner)->DistanceSquared(*(*Walker)); … … 152 164 atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Runner); 153 165 // if hydrogen, check angle to be greater(!) than 30 degrees 154 if (OtherAtom->getType()-> Z== 1) {166 if (OtherAtom->getType()->getAtomicNumber() == 1) { 155 167 const double angle = CalculateAngle(OtherAtom->getPosition(), (*Runner)->getPosition(), (*Walker)->getPosition()); 156 168 OtherHydrogenFlag = OtherHydrogenFlag && (angle > M_PI*(30./180.) + MYEPSILON); … … 177 189 for (BondList::const_iterator BondRunner = (*Walker)->ListOfBonds.begin(); BondRunner != (*Walker)->ListOfBonds.end(); BondRunner++) { 178 190 atom * const OtherAtom = (*BondRunner)->GetOtherAtom(*Walker); 179 if (OtherAtom->getType()-> Z== 1) {191 if (OtherAtom->getType()->getAtomicNumber() == 1) { 180 192 // check angle 181 193 if (CheckHydrogenBridgeBondAngle(*Walker, OtherAtom, *Runner)) { … … 215 227 if (((OtherAtom->getType() == first) || (OtherAtom->getType() == second)) && (theAtom->nr < OtherAtom->nr)) { 216 228 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); 218 230 } 219 231 } … … 262 274 if (result) { // check results 263 275 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); 265 277 } 266 278 } -
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 1 8 /* 2 9 * analysis.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 33 45 * \return Map of doubles with values the pair of the two atoms. 34 46 */ 35 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector< element *> &elements)47 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements) 36 48 { 37 49 Info FunctionInfo(__func__); … … 48 60 49 61 // create all possible pairs of elements 50 set <pair< element *,element *> > PairsOfElements;62 set <pair<const element *,const element *> > PairsOfElements; 51 63 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) 54 66 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); 57 69 } 58 70 } 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) ); 62 74 } else { // all elements valid 63 75 PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) ); … … 74 86 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl); 75 87 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) 77 89 if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) { 78 90 distance = domain.periodicDistance((*iter)->getPosition(),(*runner)->getPosition()); … … 95 107 * \return Map of doubles with values the pair of the two atoms. 96 108 */ 97 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector< element *> &elements, const int ranges[NDIM] )109 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] ) 98 110 { 99 111 Info FunctionInfo(__func__); … … 115 127 116 128 // create all possible pairs of elements 117 set <pair< element *,element *> > PairsOfElements;129 set <pair<const element *,const element *> > PairsOfElements; 118 130 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) 121 133 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); 124 136 } 125 137 } 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) ); 129 141 } else { // all elements valid 130 142 PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) ); … … 149 161 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl); 150 162 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) 152 164 if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) { 153 165 periodicOtherX = FullInverseMatrix * ((*runner)->getPosition()); // x now in [0,1)^3 … … 178 190 * \return Map of dobules with values as pairs of atom and the vector 179 191 */ 180 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector< element *> &elements, const Vector *point )192 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point ) 181 193 { 182 194 Info FunctionInfo(__func__); … … 196 208 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 197 209 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) 199 211 if ((*type == NULL) || ((*iter)->getType() == *type)) { 200 212 distance = domain.periodicDistance((*iter)->getPosition(),*point); … … 215 227 * \return Map of dobules with values as pairs of atom and the vector 216 228 */ 217 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector< element *> &elements, const Vector *point, const int ranges[NDIM] )229 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] ) 218 230 { 219 231 Info FunctionInfo(__func__); … … 237 249 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 238 250 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) 240 252 if ((*type == NULL) || ((*iter)->getType() == *type)) { 241 253 periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3 … … 263 275 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest 264 276 */ 265 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector< element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )277 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC ) 266 278 { 267 279 Info FunctionInfo(__func__); … … 284 296 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 285 297 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) 287 299 if ((*type == NULL) || ((*iter)->getType() == *type)) { 288 300 TriangleIntersectionList Intersections((*iter)->getPosition(),Surface,LC); … … 309 321 * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest 310 322 */ 311 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector< element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )323 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] ) 312 324 { 313 325 Info FunctionInfo(__func__); … … 335 347 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 336 348 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) 338 350 if ((*type == NULL) || ((*iter)->getType() == *type)) { 339 351 periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3 -
src/analysis_correlation.hpp
r8006ee r994713 18 18 #endif 19 19 20 #include <cmath> 20 21 #include <fstream> 21 22 … … 46 47 /********************************************** declarations *******************************/ 47 48 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] );49 PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements); 50 CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point ); 51 CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC ); 52 PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] ); 53 CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] ); 54 CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] ); 54 55 int GetBin ( const double value, const double BinWidth, const double BinStart ); 55 56 void 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 1 8 /** \file analyzer.cpp 2 9 * … … 8 15 //============================ INCLUDES =========================== 9 16 17 // include config.h 18 #ifdef HAVE_CONFIG_H 19 #include <config.h> 20 #endif 21 10 22 #include "Helpers/MemDebug.hpp" 11 23 … … 17 29 #include "periodentafel.hpp" 18 30 #include "Helpers/Verbose.hpp" 19 20 // include config.h21 #ifdef HAVE_CONFIG_H22 #include <config.h>23 #endif24 25 31 26 32 //============================== 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 1 8 /** \file atom.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #include "Helpers/MemDebug.hpp" … … 168 180 bool atom::OutputArrayIndexed(ostream * const out,const enumeration<const element*> &elementLookup, int *AtomNo, const char *comment) const 169 181 { 170 AtomNo[getType()-> Z]++; // increment number182 AtomNo[getType()->getAtomicNumber()]++; // increment number 171 183 if (out != NULL) { 172 184 const element *elemental = getType(); 173 185 cout << "Looking for atom with element " << *elemental << endl; 174 186 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; 176 188 *out << at(0) << "\t" << at(1) << "\t" << at(2); 177 189 *out << "\t" << FixedIon; … … 194 206 { 195 207 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; 197 209 return true; 198 210 } else … … 209 221 bool atom::OutputTrajectory(ofstream * const out, const int *ElementNo, int *AtomNo, const int step) const 210 222 { 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; 214 226 *out << Trajectory.R.at(step)[0] << "\t" << Trajectory.R.at(step)[1] << "\t" << Trajectory.R.at(step)[2]; 215 227 *out << "\t" << FixedIon; … … 232 244 { 233 245 if (out != NULL) { 234 *out << getType()-> symbol<< "\t";246 *out << getType()->getSymbol() << "\t"; 235 247 *out << Trajectory.R.at(step)[0] << "\t"; 236 248 *out << Trajectory.R.at(step)[1] << "\t"; … … 250 262 Vector recentered(getPosition()); 251 263 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; 253 265 if (AtomNo != NULL) 254 266 *AtomNo++; … … 344 356 } 345 357 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 */ 346 362 void atom::setMolecule(molecule *_mol){ 347 363 // take this atom from the old molecule … … 353 369 } 354 370 355 molecule* atom::getMolecule(){ 371 /** Returns pointer to the molecule which atom belongs to. 372 * \return containing molecule 373 */ 374 molecule* atom::getMolecule() const { 356 375 return mol; 357 376 } 358 377 378 /** Erases the atom in atom::mol's list of atoms and sets it to zero. 379 */ 359 380 void atom::removeFromMolecule(){ 360 381 if(mol){ -
src/atom.hpp
r8006ee r994713 92 92 93 93 void setMolecule(molecule*); 94 molecule* getMolecule() ;94 molecule* getMolecule() const; 95 95 void removeFromMolecule(); 96 96 -
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 1 8 /* 2 9 * atom_atominfo.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "Helpers/MemDebug.hpp" 9 21 -
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 1 8 /* 2 9 * atom_bondedparticle.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 152 164 NoBonds = CountBonds(); 153 165 //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 mismatch166 if ((int)(getType()->getNoValenceOrbitals()) > NoBonds) { // we have a mismatch, check all bonding partners for mismatch 155 167 for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); (++Runner)) { 156 168 OtherWalker = (*Runner)->GetOtherAtom(this); 157 169 OtherNoBonds = OtherWalker->CountBonds(); 158 170 //Log() << Verbose(3) << "OtherWalker " << *OtherWalker << ": " << (int)OtherWalker->type->NoValenceOrbitals << " > " << OtherNoBonds << "?" << endl; 159 if ((int)(OtherWalker->getType()-> NoValenceOrbitals) > OtherNoBonds) { // check if possible candidate171 if ((int)(OtherWalker->getType()->getNoValenceOrbitals()) > OtherNoBonds) { // check if possible candidate 160 172 if ((CandidateBond == NULL) || (ListOfBonds.size() > OtherWalker->ListOfBonds.size())) { // pick the one with fewer number of bonds first 161 173 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 1 8 /* 2 9 * atom_bondedparticleinfo.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * atom_graphnode.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * atom_graphnodeinfo.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * atom_particleinfo.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * atom_trajectoryparticle.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 38 50 { 39 51 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]; 41 53 }; 42 54 … … 65 77 for(int d=0;d<NDIM;d++) { 66 78 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]; 68 80 } 69 81 }; … … 113 125 Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d]; 114 126 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 = 116 128 } 117 129 // Update U 118 130 for (int d=0; d<NDIM; d++) { 119 131 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 * t132 Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->getMass()); // v = F/m * t 121 133 } 122 134 // Update R (and F) … … 137 149 void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const 138 150 { 139 *TotalMass += getType()-> mass; // sum up total mass151 *TotalMass += getType()->getMass(); // sum up total mass 140 152 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(); 142 154 } 143 155 }; … … 154 166 for (int d=0; d<NDIM; d++) { 155 167 U[d] *= ScaleTempFactor; 156 *ekin += 0.5*getType()-> mass* U[d]*U[d];168 *ekin += 0.5*getType()->getMass() * U[d]*U[d]; 157 169 } 158 170 }; … … 170 182 for (int d=0; d<NDIM; d++) { 171 183 *G += U[d] * F[d]; 172 *E += U[d]*U[d]*getType()-> mass;184 *E += U[d]*U[d]*getType()->getMass(); 173 185 } 174 186 }; … … 185 197 if (FixedIon == 0) // even FixedIon moves, only not by other's forces 186 198 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]; 189 201 } 190 202 }; … … 198 210 void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration) 199 211 { 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) 201 213 Vector &U = Trajectory.U.at(Step); 202 214 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces … … 211 223 } 212 224 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]; 214 226 } 215 227 }; … … 227 239 for (int d=0; d<NDIM; d++) { 228 240 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]; 230 242 } 231 243 } … … 241 253 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 242 254 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(); 244 256 } 245 257 } … … 256 268 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 257 269 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]; 260 272 } 261 273 } -
src/atom_trajectoryparticle.hpp
r8006ee r994713 20 20 #include <fstream> 21 21 22 #include <gsl/gsl_inline.h>23 22 #include <gsl/gsl_randist.h> 24 23 -
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 1 8 /* 2 9 * atom_trajectoryparticleinfo.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file bond.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #include "Helpers/MemDebug.hpp" … … 51 63 { 52 64 if ((left != NULL) && (right != NULL)) { 53 if ((left->getType() != NULL) && (left->getType()-> Z== 1))65 if ((left->getType() != NULL) && (left->getType()->getAtomicNumber() == 1)) 54 66 HydrogenBond++; 55 if ((right->getType() != NULL) && (right->getType()-> Z== 1))67 if ((right->getType() != NULL) && (right->getType()->getAtomicNumber() == 1)) 56 68 HydrogenBond++; 57 69 } -
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 1 8 /* 2 9 * bondgraph.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 132 144 133 145 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(); 136 148 } 137 149 max_distance *= 2.; … … 149 161 void BondGraph::CovalentMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem) 150 162 { 151 MinDistance = OtherWalker->getType()-> CovalentRadius + Walker->getType()->CovalentRadius;163 MinDistance = OtherWalker->getType()->getCovalentRadius() + Walker->getType()->getCovalentRadius(); 152 164 MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 153 165 MaxDistance = MinDistance + BondThreshold; … … 170 182 CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 171 183 } else { 172 MinDistance = GetBondLength(Walker->getType()-> Z-1, OtherWalker->getType()->Z-1);184 MinDistance = GetBondLength(Walker->getType()->getAtomicNumber()-1, OtherWalker->getType()->getAtomicNumber()-1); 173 185 MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 174 186 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 1 8 /** \file boundary.cpp 2 9 * 3 10 * Implementations and super-function for envelopes 4 11 */ 12 13 // include config.h 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 5 17 6 18 #include "Helpers/MemDebug.hpp" … … 193 205 } 194 206 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)))); 196 208 if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity 197 209 DoLog(2) && (Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl); … … 705 717 // sum up the atomic masses 706 718 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 707 totalmass += (*iter)->getType()-> mass;719 totalmass += (*iter)->getType()->getMass(); 708 720 } 709 721 DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl); … … 804 816 // Center filler at origin 805 817 filler->CenterEdge(&Inserter); 806 filler->Center.Zero();807 818 const int FillerCount = filler->getAtomCount(); 808 819 DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl); -
src/boundary.hpp
r8006ee r994713 1 1 #ifndef BOUNDARY_HPP_ 2 2 #define BOUNDARY_HPP_ 3 4 using namespace std;5 3 6 4 /*********************************************** includes ***********************************/ … … 18 16 19 17 #include "defs.hpp" 18 #include "BoundaryMaps.hpp" 20 19 21 20 /****************************************** forward declarations *****************************/ 22 21 23 class atom;24 22 class BoundaryPointSet; 25 23 class BoundaryLineSet; … … 30 28 class MoleculeListClass; 31 29 class Tesselation; 30 class TesselPoint; 32 31 class Vector; 33 32 … … 38 37 enum { SingleStepWidth=10 }; 39 38 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 48 39 /********************************************** declarations *******************************/ 49 40 … … 52 43 void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename); 53 44 Vector* 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);55 45 bool FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LC, const double RADIUS, const char *tempbasename); 56 46 Boundaries *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 2 9 * 3 10 * date: Jan 1, 2007 4 11 * 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. 5 19 * 6 20 */ … … 53 67 * 54 68 */ 69 70 // include config.h 71 #ifdef HAVE_CONFIG_H 72 #include <config.h> 73 #endif 55 74 56 75 #include "Helpers/MemDebug.hpp" … … 127 146 std::string BondGraphFileName("\n"); 128 147 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; 131 154 132 155 setVerbosity(0); … … 166 189 #else 167 190 DoLog(0) && (Log() << Verbose(0) << "Setting UI to Text." << endl); 168 cout << ESPACKVersion<< endl;191 cout << MOLECUILDERVERSION << endl; 169 192 UIFactory::registerFactory(new TextUIFactory::description()); 170 193 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 1 8 /** \file config.cpp 2 9 * … … 5 12 */ 6 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 18 7 19 #include "Helpers/MemDebug.hpp" 8 20 … … 10 22 #include <cstring> 11 23 24 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp" 12 25 #include "atom.hpp" 13 26 #include "bond.hpp" … … 471 484 ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical); 472 485 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); 474 487 NoAtoms += No[i]; 475 488 } … … 851 864 // 4. dissect the molecule into connected subgraphs 852 865 // don't do this here ... 853 // MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this);866 //FragmentationSubgraphDissection(); 854 867 //delete(mol); 855 868 … … 1339 1352 AtomNo = 0; 1340 1353 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 digits1354 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 1343 1356 fprintf(f, 1344 1357 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", … … 1351 1364 (*iter)->at(1), /* position Y in Angstroem */ 1352 1365 (*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 */ 1355 1368 "0", /* segment identifier */ 1356 (*iter)->getType()-> symbol, /* element symbol */1369 (*iter)->getType()->getSymbol().c_str(), /* element symbol */ 1357 1370 "0"); /* charge */ 1358 1371 AtomNo++; … … 1392 1405 AtomNo = 0; 1393 1406 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 digits1407 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 1396 1409 fprintf(f, 1397 1410 "ATOM %6u %-4s %4s%c%4u %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s\n", … … 1404 1417 (*iter)->at(1), /* position Y in Angstroem */ 1405 1418 (*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 */ 1408 1421 "0", /* segment identifier */ 1409 (*iter)->getType()-> symbol, /* element symbol */1422 (*iter)->getType()->getSymbol().c_str(), /* element symbol */ 1410 1423 "0"); /* charge */ 1411 1424 AtomNo++; … … 1451 1464 *output << 0 << "\t"; 1452 1465 *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"; 1455 1468 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1456 1469 *output << (*runner)->GetOtherAtom(*iter)->nr << "\t"; … … 1523 1536 *output << MolCounter+1 << "\t"; 1524 1537 *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"; 1527 1540 for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++) 1528 1541 *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ] << "\t"; … … 1586 1599 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1587 1600 src[N++] = (*ListRunner)->IndexNr; 1588 (*ListRunner)->Translate(&(*ListRunner)->Center);1589 1601 } 1590 1602 mol = World::getInstance().createMolecule(); 1591 1603 mol->SetNameFromFilename(ConfigFileName); 1592 molecules->SimpleMultiMerge(mol, src, N);1593 1604 //mol->CalculateOrbitals(*this); 1594 1605 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 1 8 /** \file datacreator.cpp 2 9 * … … 6 13 7 14 //============================ INCLUDES =========================== 15 16 // include config.h 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 8 20 9 21 #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 1 8 /* 2 9 * defs.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 20 #include "Helpers/MemDebug.hpp" 7 21 8 22 #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 1 8 /** \file element.cpp 2 9 * … … 5 12 */ 6 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 18 7 19 #include "Helpers/MemDebug.hpp" 8 20 … … 10 22 #include <fstream> 11 23 24 #include "Helpers/Assert.hpp" 12 25 #include "element.hpp" 13 26 … … 23 36 VanDerWaalsRadius(0), 24 37 Z(-1), 25 previous(NULL),26 next(NULL),27 sort(NULL),28 38 Valence(0), 29 39 NoValenceOrbitals(0) … … 31 41 }; 32 42 43 element::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 33 58 /** Destructor of class element. 34 59 */ 35 60 element::~element() {}; 61 62 element &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 } 36 78 37 79 /** Prints element data to \a *out. … … 66 108 } 67 109 68 string element::getSymbol() const{ 69 return string(symbol); 110 double element::getMass() const 111 { 112 return mass; 70 113 } 71 114 72 std::string element::getName() const{ 73 return string(name); 115 double element::getCovalentRadius() const 116 { 117 return CovalentRadius; 118 } 119 120 double element::getVanDerWaalsRadius() const 121 { 122 return VanDerWaalsRadius; 123 } 124 125 int element::getAtomicNumber() const 126 { 127 return Z; 128 } 129 130 double element::getValence() const 131 { 132 return Valence; 133 } 134 135 int element::getNoValenceOrbitals() const 136 { 137 return NoValenceOrbitals; 138 } 139 140 double 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 146 double 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 152 string &element::getSymbol(){ 153 return symbol; 154 } 155 156 const string &element::getSymbol() const{ 157 return symbol; 158 } 159 160 void element::setSymbol(const std::string &temp) 161 { 162 symbol = temp; 163 } 164 165 std::string &element::getName(){ 166 return name; 167 } 168 169 const std::string &element::getName() const{ 170 return name; 171 } 172 173 void element::setName(const std::string &temp) 174 { 175 name = temp; 74 176 } 75 177 -
src/element.hpp
r8006ee r994713 22 22 #include "types.hpp" 23 23 24 class periodentafel; 25 24 26 /********************************************** declarations *******************************/ 25 27 … … 28 30 */ 29 31 class element { 32 friend class periodentafel; 30 33 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: 31 64 double mass; //!< mass in g/mol 32 65 double CovalentRadius; //!< covalent radius 33 66 double VanDerWaalsRadius; //!< can-der-Waals radius 34 67 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 43 71 double Valence; //!< number of valence electrons for this element 44 72 int NoValenceOrbitals; //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix() … … 46 74 double HBondAngle[NDIM]; //!< typical angle for one, two, three bonded hydrogen (in degrees) 47 75 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" 61 78 }; 62 79 -
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 1 8 /* 2 9 * elements_db.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ellipsoid.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file graph.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #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 1 8 /** \file joiner.cpp 2 9 * … … 7 14 8 15 //============================ INCLUDES =========================== 16 17 // include config.h 18 #ifdef HAVE_CONFIG_H 19 #include <config.h> 20 #endif 9 21 10 22 #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 1 8 /* 2 9 * leastsquaremin.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file linkedcell.cpp 2 9 * … … 4 11 * 5 12 */ 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 6 18 7 19 #include "Helpers/MemDebug.hpp" … … 23 35 LinkedCell::LinkedCell() : 24 36 LC(NULL), 25 index(-1),26 RADIUS(0.)37 RADIUS(0.), 38 index(-1) 27 39 { 28 40 for(int i=0;i<NDIM;i++) … … 37 49 */ 38 50 LinkedCell::LinkedCell(const PointCloud * const set, const double radius) : 51 LC(NULL), 39 52 RADIUS(radius), 40 LC(NULL),41 53 index(-1) 42 54 { … … 113 125 */ 114 126 LinkedCell::LinkedCell(LinkedNodes *set, const double radius) : 127 LC(NULL), 115 128 RADIUS(radius), 116 LC(NULL),117 129 index(-1) 118 130 { -
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 1 8 /** \file molecules.cpp 2 9 * … … 5 12 */ 6 13 14 // include config.h 7 15 #ifdef HAVE_CONFIG_H 8 16 #include <config.h> … … 89 97 } 90 98 99 bool 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 91 112 moleculeId_t molecule::getId(){ 92 113 return id; … … 213 234 pointer->sort = &pointer->nr; 214 235 if (pointer->getType() != NULL) { 215 formula += pointer->getType(); 216 if (pointer->getType()->Z != 1) 236 if (pointer->getType()->getAtomicNumber() != 1) 217 237 NoNonHydrogen++; 218 238 if(pointer->getName() == "Unknown"){ 219 239 stringstream sstr; 220 sstr << pointer->getType()-> symbol<< pointer->nr+1;240 sstr << pointer->getType()->getSymbol() << pointer->nr+1; 221 241 pointer->setName(sstr.str()); 222 242 } … … 239 259 if (pointer != NULL) { 240 260 atom *walker = pointer->clone(); 241 formula += walker->getType();242 261 walker->setName(pointer->getName()); 243 262 walker->nr = last_atom++; // increase number within molecule 244 263 insert(walker); 245 if ((pointer->getType() != NULL) && (pointer->getType()-> Z!= 1))264 if ((pointer->getType() != NULL) && (pointer->getType()->getAtomicNumber() != 1)) 246 265 NoNonHydrogen++; 247 266 retval=walker; … … 329 348 // get typical bond length and store as scale factor for later 330 349 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); 332 351 if (BondRescale == -1) { 333 352 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl); … … 346 365 FirstOtherAtom->AtomicVelocity = TopReplacement->AtomicVelocity; // copy velocity 347 366 FirstOtherAtom->FixedIon = TopReplacement->FixedIon; 348 if (TopReplacement->getType()-> Z== 1) { // neither rescale nor replace if it's already hydrogen367 if (TopReplacement->getType()->getAtomicNumber() == 1) { // neither rescale nor replace if it's already hydrogen 349 368 FirstOtherAtom->father = TopReplacement; 350 369 BondRescale = bondlength; … … 415 434 FirstOtherAtom->father = NULL; // we are just an added hydrogen with no father 416 435 SecondOtherAtom->father = NULL; // we are just an added hydrogen with no father 417 bondangle = TopOrigin->getType()-> HBondAngle[1];436 bondangle = TopOrigin->getType()->getHBondAngle(1); 418 437 if (bondangle == -1) { 419 438 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl); … … 491 510 492 511 // create correct coordination for the three atoms 493 alpha = (TopOrigin->getType()-> HBondAngle[2])/180.*M_PI/2.; // retrieve triple bond angle from database512 alpha = (TopOrigin->getType()->getHBondAngle(2))/180.*M_PI/2.; // retrieve triple bond angle from database 494 513 l = BondRescale; // desired bond length 495 514 b = 2.*l*sin(alpha); // base length of isosceles triangle … … 699 718 atom1->RegisterBond(Binder); 700 719 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)) 702 721 NoNonBonds++; 703 722 … … 765 784 }; 766 785 767 /** Removes atom from molecule list and deletes it.786 /** Removes atom from molecule list and removes all of its bonds. 768 787 * \param *pointer atom to be removed 769 788 * \return true - succeeded, false - atom not found in list … … 773 792 ASSERT(pointer, "Null pointer passed to molecule::RemoveAtom()."); 774 793 OBSERVE; 775 formula-=pointer->getType();776 794 RemoveBonds(pointer); 777 795 erase(pointer); … … 787 805 if (pointer == NULL) 788 806 return false; 789 formula-=pointer->getType();790 807 erase(pointer); 791 808 return true; … … 798 815 { 799 816 for (molecule::iterator iter = begin(); !empty(); iter = begin()) 800 erase(iter);817 erase(*iter); 801 818 return empty(); 802 819 }; … … 895 912 ElementNo[i] = 0; 896 913 } 897 SetIndexedArrayForEachAtomTo ( ElementNo, &element::Z, &AbsoluteValue, 1); 914 for(molecule::iterator iter = begin(); iter != end(); ++iter) { 915 ElementNo[(*iter)->getType()->getAtomicNumber()] = 1; 916 } 898 917 int current=1; 899 918 for (int i=0;i<MAX_ELEMENTS;++i) { … … 969 988 for (molecule::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) { 970 989 (*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 it990 if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it 972 991 NoNonHydrogen++; 973 992 stringstream sstr; 974 sstr << (*iter)->getType()-> symbol<< (*iter)->nr+1;993 sstr << (*iter)->getType()->getSymbol() << (*iter)->nr+1; 975 994 (*iter)->setName(sstr.str()); 976 995 DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->getName() << "." << endl); … … 978 997 } 979 998 return res; 980 };981 982 /** Determines whether two molecules actually contain the same atoms and coordination.983 * \param *out output stream for debugging984 * \param *OtherMolecule the molecule to compare this one to985 * \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 comparison996 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 /// -# AtomCount1003 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 /// -# Formula1010 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 molecules1030 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 all1059 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 memory1068 delete[](PermMap);1069 delete[](OtherPermMap);1070 delete[](Distances);1071 delete[](OtherDistances);1072 if (flag) { // if not equal1073 delete[](PermutationMap);1074 result = false;1075 }1076 }1077 /// return pointer to map if all distances were below \a threshold1078 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 }1086 999 }; 1087 1000 -
src/molecule.hpp
r8006ee r994713 104 104 double BondDistance; //!< typical bond distance used in CreateAdjacencyList() and furtheron 105 105 bool ActiveFlag; //!< in a MoleculeListClass used to discern active from inactive molecules 106 Vector Center; //!< Center of molecule in a global box106 //Vector Center; //!< Center of molecule in a global box 107 107 int IndexNr; //!< index of molecule in a MoleculeListClass 108 108 char name[MAXSTRINGSIZE]; //!< arbitrary name … … 141 141 bool hasElement(const std::string&) const; 142 142 143 virtual bool changeId(atomId_t newId); 143 144 144 145 iterator begin(); … … 324 325 325 326 // Recognize doubly appearing molecules in a list of them 326 int * IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold);327 327 int * GetFatherSonAtomicMap(molecule *OtherMolecule); 328 328 … … 368 368 void Enumerate(ostream *out); 369 369 void Output(ofstream *out); 370 void DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration);371 370 int CountAllAtoms() const; 372 371 … … 379 378 void parseXYZIntoMolecule(); 380 379 void eraseMolecule(); 381 382 383 // merging of molecules384 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);390 380 391 381 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 1 8 /* 2 9 * molecule_dynamics.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * molecule_fragmentation.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 451 463 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) { 452 464 #ifdef ADDHYDROGEN 453 if ((*iter)->getType()-> Z!= 1) // skip hydrogen465 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 454 466 #endif 455 467 { … … 471 483 for(molecule::const_iterator iter = begin(); iter != end(); ++iter) { 472 484 #ifdef ADDHYDROGEN 473 if ((*iter)->getType()-> Z!= 1) // skip hydrogen485 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 474 486 #endif 475 487 { … … 880 892 for (KeySet::iterator runner = Leaf->begin(); runner != Leaf->end(); runner++) { 881 893 Runner = FindAtom((*runner)); 882 if (Runner->getType()-> Z!= 1) { // skip all those added hydrogens when re-filling snake stack894 if (Runner->getType()->getAtomicNumber() != 1) { // skip all those added hydrogens when re-filling snake stack 883 895 if (ShortestPathList[(*runner)] > SP) { // remove the oldest one with longest shortest path 884 896 SP = ShortestPathList[(*runner)]; … … 969 981 ++iter; 970 982 #ifdef ADDHYDROGEN 971 while ((iter != Leaf->end()) && ((*iter)->getType()-> Z== 1)){ // skip added hydrogen983 while ((iter != Leaf->end()) && ((*iter)->getType()->getAtomicNumber() == 1)){ // skip added hydrogen 972 984 iter++; 973 985 } … … 1347 1359 if ((RestrictedKeySet.find(OtherWalker->nr) != RestrictedKeySet.end()) 1348 1360 #ifdef ADDHYDROGEN 1349 && (OtherWalker->getType()-> Z!= 1)1361 && (OtherWalker->getType()->getAtomicNumber() != 1) 1350 1362 #endif 1351 1363 ) { // 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 1 8 /* 2 9 * molecule_geometry.cpp … … 6 13 */ 7 14 15 // include config.h 8 16 #ifdef HAVE_CONFIG_H 9 17 #include <config.h> 10 18 #endif 11 19 20 #include "Helpers/MemDebug.hpp" 21 12 22 #include "Helpers/helpers.hpp" 13 23 #include "Helpers/Log.hpp" 14 #include "Helpers/MemDebug.hpp"15 24 #include "Helpers/Verbose.hpp" 16 25 #include "LinearAlgebra/Line.hpp" … … 104 113 (*max) += (*min); 105 114 Translate(min); 106 Center.Zero();107 115 } 108 116 delete(min); … … 118 126 int Num = 0; 119 127 molecule::const_iterator iter = begin(); // start at first in list 128 Vector Center; 120 129 121 130 Center.Zero(); 122 123 131 if (iter != end()) { //list not empty? 124 132 for (; iter != end(); ++iter) { // continue with second if present … … 128 136 Center.Scale(-1./(double)Num); // divide through total number (and sign for direction) 129 137 Translate(&Center); 130 Center.Zero();131 138 } 132 139 }; … … 179 186 if (iter != end()) { //list not empty? 180 187 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(); 183 190 (*a) += tmp; 184 191 } … … 197 204 void molecule::CenterPeriodic() 198 205 { 199 DeterminePeriodicCenter(Center); 206 Vector NewCenter; 207 DeterminePeriodicCenter(NewCenter); 208 // go through all atoms 209 BOOST_FOREACH(atom* iter, atoms){ 210 *iter -= NewCenter; 211 } 200 212 }; 201 213 … … 207 219 void molecule::CenterAtVector(Vector *newcenter) 208 220 { 209 Center = *newcenter; 221 // go through all atoms 222 BOOST_FOREACH(atom* iter, atoms){ 223 *iter -= *newcenter; 224 } 210 225 }; 211 226 … … 277 292 bool flag; 278 293 Vector Testvector, Translationvector; 294 Vector Center; 279 295 280 296 do { … … 283 299 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) { 284 300 #ifdef ADDHYDROGEN 285 if ((*iter)->getType()-> Z!= 1) {301 if ((*iter)->getType()->getAtomicNumber() != 1) { 286 302 #endif 287 303 Testvector = inversematrix * (*iter)->getPosition(); … … 308 324 // now also change all hydrogens 309 325 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) { 311 327 Testvector = inversematrix * (*Runner)->GetOtherAtom((*iter))->getPosition(); 312 328 Testvector += Translationvector; … … 322 338 323 339 Center.Scale(1./static_cast<double>(getAtomCount())); 340 CenterAtVector(&Center); 324 341 }; 325 342 -
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 1 8 /* 2 9 * molecule_graph.cpp … … 6 13 */ 7 14 15 // include config.h 8 16 #ifdef HAVE_CONFIG_H 9 17 #include <config.h> … … 737 745 OtherAtom = (*Runner)->GetOtherAtom(Walker); 738 746 #ifdef ADDHYDROGEN 739 if (OtherAtom->getType()-> Z!= 1) {747 if (OtherAtom->getType()->getAtomicNumber() != 1) { 740 748 #endif 741 749 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 1 8 /* 2 9 * molecule_pointcloud.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /** \file MoleculeListClass.cpp 2 9 * … … 5 12 */ 6 13 14 // include config.h 7 15 #ifdef HAVE_CONFIG_H 8 16 #include <config.h> … … 44 52 MoleculeListClass::MoleculeListClass(World *_world) : 45 53 Observable("MoleculeListClass"), 46 world(_world),47 MaxIndex(1)54 MaxIndex(1), 55 world(_world) 48 56 {}; 49 57 … … 193 201 } 194 202 // 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); 196 206 } 197 207 } … … 210 220 }; 211 221 212 /** Simple merge of two molecules into one.213 * \param *mol destination molecule214 * \param *srcmol source molecule215 * \return true - merge successful, false - merge failed (probably due to non-existant indices216 */217 bool MoleculeListClass::SimpleMerge(molecule *mol, molecule *srcmol)218 {219 if (srcmol == NULL)220 return false;221 222 // put all molecules of src into mol223 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 src230 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 molecule237 * \param *srcmol source molecule238 * \return true - merge successful, false - merge failed (probably due to non-existant indices239 */240 bool MoleculeListClass::SimpleAdd(molecule *mol, molecule *srcmol)241 {242 if (srcmol == NULL)243 return false;244 245 // put all molecules of src into mol246 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 molecule257 * \param *src index of set of source molecule258 * \param N number of source molecules259 * \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 molecules265 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 molecule275 * \param *src index of set of source molecule276 * \param N number of source molecules277 * \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 molecules283 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 molecule293 * \param *src index of set of source molecule294 * \param N number of source molecules295 * \return true - merge successful, false - merge failed (probably due to non-existant indices296 * \TODO find scatter center for each src molecule297 */298 bool MoleculeListClass::ScatterMerge(molecule *mol, int *src, int N)299 {300 // check presence of all source molecules301 for (int i=0;i<N;i++) {302 // get pointer to src molecule303 molecule *srcmol = ReturnIndex(src[i]);304 if (srcmol == NULL)305 return false;306 }307 // adapt each Center308 for (int i=0;i<N;i++) {309 // get pointer to src molecule310 molecule *srcmol = ReturnIndex(src[i]);311 //srcmol->Center.Zero();312 srcmol->Translate(&srcmol->Center);313 }314 // perform a simple multi merge315 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 *mol336 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 bonds346 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 atom351 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 nothing360 }361 }362 DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->getAtomCount() << " atoms have been merged.");363 364 // go through all bonds and add as well365 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 };374 222 375 223 /** Simple output of the pointers in ListOfMolecules. … … 499 347 for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) { 500 348 //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 hydrogen349 if (((*iter)->getType()->getAtomicNumber() == 1) && (((*iter)->father == NULL) 350 || ((*iter)->father->getType()->getAtomicNumber() != 1))) { // if it's a hydrogen 503 351 for (molecule::const_iterator runner = (*ListRunner)->begin(); runner != (*ListRunner)->end(); ++runner) { 504 352 //Log() << Verbose(2) << "Runner: " << *(*runner) << " with first bond " << *((*iter)->ListOfBonds.begin()) << "." << endl; 505 353 // 3. take every other hydrogen that is the not the first and not bound to same bonding partner 506 354 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!) 508 356 // 4. evaluate the morse potential for each matrix component and add up 509 357 distance = (*runner)->distance(*(*iter)); … … 744 592 }; 745 593 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 debugging748 * \param *periode periodentafel749 * \param *configuration config with BondGraph750 */751 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration)752 {753 // 0a. remove all present molecules754 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 atoms760 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 subgraphs769 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 subgraphs781 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis782 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 in792 // 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 fill796 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 1827 }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 list833 // TODO: check whether this is really not needed anymore834 // 4e. free Leafs835 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 845 594 /** Count all atoms in each molecule. 846 595 * \return number of atoms in the MoleculeListClass. … … 1087 836 if (AtomMask[Father->nr]) // apply mask 1088 837 #ifdef ADDHYDROGEN 1089 if ((*iter)->getType()-> Z!= 1) // skip hydrogen838 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 1090 839 #endif 1091 840 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 1 8 /** \file parsing.cpp 2 9 * … … 7 14 // ======================================= INCLUDES ========================================== 8 15 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 17 16 // include config.h 18 17 #ifdef HAVE_CONFIG_H 19 18 #include <config.h> 20 19 #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" 21 28 22 29 // ======================================= 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 1 8 /** \file periodentafel.cpp 2 9 * … … 5 12 */ 6 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 18 7 19 #include "Helpers/MemDebug.hpp" 8 9 using namespace std;10 20 11 21 #include <iomanip> … … 34 44 { 35 45 stringstream input(elementsDB,ios_base::in); 36 bool status = LoadElementsDatabase( &input);46 bool status = LoadElementsDatabase(input); 37 47 ASSERT(status, "General element initialization failed"); 38 48 } … … 72 82 * \return iterator to added element 73 83 */ 74 periodentafel::iterator periodentafel::AddElement(element * constpointer)84 periodentafel::iterator periodentafel::AddElement(element * pointer) 75 85 { 76 86 atomicNumber_t Z = pointer->getNumber(); 77 87 ASSERT(!elements.count(Z), "Element is already present."); 78 pointer->sort = &pointer->Z;79 88 if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS) 80 89 DoeLog(0) && (eLog() << Verbose(0) << "Invalid Z number!\n"); … … 86 95 * \param *pointer element to be removed 87 96 */ 88 size_t periodentafel::RemoveElement( element * constpointer)97 size_t periodentafel::RemoveElement(const element * pointer) 89 98 { 90 99 return RemoveElement(pointer->getNumber()); … … 114 123 * \return pointer to element or NULL if not found 115 124 */ 116 element * constperiodentafel::FindElement(atomicNumber_t Z) const125 const element * periodentafel::FindElement(atomicNumber_t Z) const 117 126 { 118 127 const_iterator res = elements.find(Z); … … 125 134 * \return pointer to element 126 135 */ 127 element * constperiodentafel::FindElement(const string &shorthand) const136 const element * periodentafel::FindElement(const string &shorthand) const 128 137 { 129 138 element *res = 0; … … 140 149 * \return desired element or NULL 141 150 */ 142 element * constperiodentafel::AskElement() const143 { 144 element * walker = NULL;151 const element * periodentafel::AskElement() const 152 { 153 const element * walker = NULL; 145 154 int Z; 146 155 do { … … 155 164 * \return pointer to either present or newly created element 156 165 */ 157 element * constperiodentafel::EnterElement()166 const element * periodentafel::EnterElement() 158 167 { 159 168 atomicNumber_t Z = 0; 160 169 DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl); 161 170 cin >> Z; 162 element * constres = FindElement(Z);171 const element *res = FindElement(Z); 163 172 if (!res) { 164 173 // TODO: make this using the constructor … … 169 178 cin >> tmp->mass; 170 179 DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl); 171 cin >> tmp-> name;180 cin >> tmp->getName(); 172 181 DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl); 173 cin >> tmp-> symbol;182 cin >> tmp->getSymbol(); 174 183 AddElement(tmp); 175 184 return tmp; … … 180 189 181 190 /******************** Access to iterators ****************************/ 182 periodentafel::const_iterator periodentafel::begin() {191 periodentafel::const_iterator periodentafel::begin() const{ 183 192 return elements.begin(); 184 193 } 185 194 186 periodentafel::const_iterator periodentafel::end() {195 periodentafel::const_iterator periodentafel::end() const{ 187 196 return elements.end(); 188 197 } 189 198 190 periodentafel::reverse_iterator periodentafel::rbegin() {199 periodentafel::reverse_iterator periodentafel::rbegin() const{ 191 200 return reverse_iterator(elements.end()); 192 201 } 193 202 194 periodentafel::reverse_iterator periodentafel::rend() {203 periodentafel::reverse_iterator periodentafel::rend() const{ 195 204 return reverse_iterator(elements.begin()); 196 205 } … … 228 237 if (!input.fail()) 229 238 DoLog(0) && (Log() << Verbose(0) << "Using " << filename << " as elements database." << endl); 230 status = status && LoadElementsDatabase( &input);239 status = status && LoadElementsDatabase(input); 231 240 input.close(); 232 241 input.clear(); … … 287 296 * \return true - parsing successful, false - something went wrong 288 297 */ 289 bool periodentafel::LoadElementsDatabase(istream *input)298 bool periodentafel::LoadElementsDatabase(istream &input) 290 299 { 291 300 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; 297 309 DoLog(0) && (Log() << Verbose(0) << "Parsed elements:"); 298 while (! (*input).eof()) {310 while (!input.eof()) { 299 311 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; 319 331 //neues->Output((ofstream *)&cout); 320 332 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); 334 335 } else { 335 336 DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl); … … 337 338 delete(neues); 338 339 } 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 } 339 346 } 340 347 DoLog(0) && (Log() << Verbose(0) << endl); … … 344 351 } 345 352 346 if ( counter == 0)353 if (!parsedElements.size()) 347 354 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 } 348 377 349 378 return status; -
src/periodentafel.hpp
r8006ee r994713 43 43 ~periodentafel(); 44 44 45 iterator AddElement(element * constpointer);46 size_t RemoveElement( element * constpointer);45 iterator AddElement(element * pointer); 46 size_t RemoveElement(const element * pointer); 47 47 size_t RemoveElement(atomicNumber_t); 48 48 void CleanupPeriodtable(); 49 element * constFindElement(atomicNumber_t) const;50 element * constFindElement(const std::string &shorthand) const;51 element * constAskElement() const;52 element * constEnterElement();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(); 53 53 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; 58 58 bool Output(std::ostream * const output) const; 59 59 bool LoadPeriodentafel(const char * const path); … … 62 62 private: 63 63 64 bool LoadElementsDatabase(std::istream *input);64 bool LoadElementsDatabase(std::istream &input); 65 65 bool LoadValenceDatabase(std::istream *input); 66 66 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 1 8 /* 2 9 * tesselation.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * TesselationHelpers.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 165 177 Center += helper[1] * b; 166 178 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])); 168 181 Log() << Verbose(1) << "INFO: Center (2nd algo) is at " << Center << "." << endl; 169 182 }; -
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 1 8 /* 2 9 * triangleintersectionlist.cpp … … 8 15 * Author: heber 9 16 */ 17 18 // include config.h 19 #ifdef HAVE_CONFIG_H 20 #include <config.h> 21 #endif 10 22 11 23 #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 1 8 /* 2 9 * ActOnAllUnitTest.cpp … … 5 12 * Author: FrederikHeber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * ActionSequenzTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * AnalysisCorrelationToPointUnitTest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using namespace std; … … 46 58 47 59 // construct element list 48 std::vector< element *> elements;60 std::vector<const element *> elements; 49 61 hydrogen = World::getInstance().getPeriode()->FindElement(1); 50 62 CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found"); -
src/unittests/AnalysisCorrelationToPointUnitTest.hpp
r8006ee r994713 37 37 std::vector<molecule *> allMolecules; 38 38 molecule *TestMolecule; 39 element *hydrogen;39 const element *hydrogen; 40 40 41 41 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 1 8 /* 2 9 * AnalysisCorrelationToSurfaceUnitTest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using namespace std; -
src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
r8006ee r994713 45 45 std::vector<molecule *> allMolecules; 46 46 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; 50 50 51 51 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 1 8 /* 2 9 * AnalysisPairCorrelationUnitTest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using namespace std; … … 49 61 50 62 // construct element list 51 std::vector< element *> elements;63 std::vector<const element *> elements; 52 64 hydrogen = World::getInstance().getPeriode()->FindElement(1); 53 65 CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found"); -
src/unittests/AnalysisPairCorrelationUnitTest.hpp
r8006ee r994713 37 37 std::vector<molecule *> allMolecules; 38 38 molecule *TestMolecule; 39 element *hydrogen;39 const element *hydrogen; 40 40 41 41 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 1 8 /* 2 9 * DescriptorUnittest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * BoxUnittest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CacheableTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * CountBondsUnitTest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 8 19 9 20 using 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 1 8 /* 2 9 * FormulaUnittest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * LineUnittest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * LinkedCellUnitTest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using namespace std; -
src/unittests/Makefile.am
r8006ee r994713 16 16 atomsCalculationTest \ 17 17 AtomDescriptorTest \ 18 BaseShapesUnitTest \ 18 19 BondGraphUnitTest \ 19 20 BoxUnittest \ … … 73 74 AtomDescriptorTest.cpp \ 74 75 atomsCalculationTest.cpp \ 76 BaseShapesUnittest.cpp \ 75 77 bondgraphunittest.cpp \ 76 78 BoxUnittest.cpp \ … … 111 113 AtomDescriptorTest.hpp \ 112 114 atomsCalculationTest.hpp \ 115 BaseShapesUnittest.hpp \ 113 116 bondgraphunittest.hpp \ 114 117 BoxUnittest.hpp \ … … 164 167 AtomDescriptorTest_LDADD = ${ALLLIBS} 165 168 169 BaseShapesUnitTest_SOURCES = UnitTestMain.cpp BaseShapesUnittest.cpp BaseShapesUnittest.hpp 170 BaseShapesUnitTest_LDADD = ${ALLLIBS} 171 166 172 BondGraphUnitTest_SOURCES = UnitTestMain.cpp bondgraphunittest.cpp bondgraphunittest.hpp 167 173 BondGraphUnitTest_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 1 8 /* 2 9 * analysisbondsunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * MatrixUnittest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include <cppunit/CompilerOutputter.h> 9 21 #include <cppunit/extensions/TestFactoryRegistry.h> 10 22 #include <cppunit/ui/text/TestRunner.h> 23 24 #include <cmath> 11 25 12 26 #include "MatrixUnittest.hpp" … … 151 165 } 152 166 } 167 } 168 169 void 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); 153 181 } 154 182 … … 225 253 } 226 254 255 void 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 } 227 276 228 277 void MatrixUnittest::InvertTest(){ -
src/unittests/MatrixUnittest.hpp
r8006ee r994713 19 19 CPPUNIT_TEST ( VectorTest ); 20 20 CPPUNIT_TEST ( OperationTest ); 21 CPPUNIT_TEST ( TransposeTest ); 22 CPPUNIT_TEST ( RotationTest ); 21 23 CPPUNIT_TEST ( InvertTest ); 22 24 CPPUNIT_TEST ( DeterminantTest ); … … 31 33 void VectorTest(); 32 34 void OperationTest(); 35 void TransposeTest(); 36 void RotationTest(); 33 37 void InvertTest(); 34 38 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 1 8 /* 2 9 * MoleculeDescriptorTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ObserverTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ParserUnitTest.cpp … … 5 12 * Author: metzler 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * PlaneUnittest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * ShapeUnittest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 #include "ShapeUnittest.hpp" 9 21 … … 12 24 #include <cppunit/ui/text/TestRunner.h> 13 25 26 #include <cmath> 27 14 28 #ifdef HAVE_TESTRUNNER 15 29 #include "UnitTestMain.hpp" … … 18 32 #include "LinearAlgebra/Vector.hpp" 19 33 #include "Shapes/Shape.hpp" 34 35 #include "Shapes/BaseShapes.hpp" 20 36 21 37 // Registers the fixture into the 'registry' … … 179 195 180 196 } 197 181 198 void ShapeUnittest::operatorTest(){ 182 199 { -
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 1 8 /* 2 9 * SingletonTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * 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 1 8 /* 2 9 * 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 1 8 /* 2 9 * analysisbondsunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * atomsCalculationTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * bondgraphunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * gslmatrixunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * gslmatrixunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * gslvectorunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * InfoUnitTest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * linearsystemofequationsunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * listofbondsunittest.cpp … … 5 12 * Author: user 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * logunittest.cpp 3 10 */ 4 11 12 13 // include config.h 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 5 17 6 18 using 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 1 8 /* 2 9 * manipulateAtomsTest.cpp … … 5 12 * Author: crueger 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #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 1 8 /* 2 9 * memoryallocatorunittest.cpp 10 * 3 11 */ 4 12 13 14 // include config.h 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 5 18 6 19 using 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 1 8 /* 2 9 * memoryusageobserverunittest.cpp 3 10 */ 4 11 12 13 // include config.h 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 5 17 6 18 using 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 1 8 /* 2 9 * periodentafelTest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 8 20 using namespace std; 9 21 … … 11 23 #include <cppunit/extensions/TestFactoryRegistry.h> 12 24 #include <cppunit/ui/text/TestRunner.h> 25 26 #include <sstream> 27 #include <iostream> 13 28 14 29 #include "Helpers/Assert.hpp" … … 67 82 { 68 83 // 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"); 70 86 CPPUNIT_ASSERT(tafel->LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)) && "Valence entry of element initialization failed"); 71 87 CPPUNIT_ASSERT(tafel->LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)) && "Orbitals entry of element initialization failed"); -
src/unittests/periodentafelTest.hpp
r8006ee r994713 31 31 private: 32 32 33 element *hydrogen;34 element *carbon;33 const element *hydrogen; 34 const element *carbon; 35 35 periodentafel *tafel; 36 36 -
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 1 8 /* 2 9 * stackclassunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * tesselation_boundarytriangleunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * tesselation_insideoutsideunittest.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 using 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 1 8 /* 2 9 * tesselationunittest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 8 19 9 20 using 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 1 8 /* 2 9 * unittest.cpp … … 6 13 */ 7 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 8 19 9 20 using namespace std; -
src/version.h
r8006ee r994713 2 2 #define VERSION_H_ 3 3 4 extern const char * ESPACKVersion;4 extern const char *MOLECUILDERVERSION; 5 5 6 6 #endif /* VERSION_H_ */ -
test_all.sh
r8006ee r994713 1 1 #!/bin/bash 2 2 3 optimizations=("-O0"\ 3 optimizations=("-g3"\ 4 "-O0"\ 4 5 "-O1"\ 5 6 "-O2"\ … … 49 50 } 50 51 52 function logdate() 53 { 54 echo -e "Launched on `date`.\n\n" >> $logfile 2>&1; 55 } 56 57 51 58 while getopts âho:f:j:scO:t:p:â OPTION 52 59 do … … 105 112 function configure(){ 106 113 echo "Configuring"; 107 CXXFLAGS="$2" $1/configure --prefix=$PWD>> $logfile 2>&1;114 $1/configure $3 --prefix=$PWD CXXFLAGS="-Wall $2" >> $logfile 2>&1; 108 115 } 109 116 … … 134 141 then 135 142 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; 137 144 if [ $? ] 138 145 then … … 149 156 function test(){ 150 157 151 echo "Testing with \"$2 \"";158 echo "Testing with \"$2 $3\""; 152 159 echo "" >> $logfile; 153 160 echo "" >> $logfile; 154 161 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" 159 172 then 160 173 echo "OK" >> $outfile; … … 201 214 202 215 function run(){ 203 echo "Testing with \"$1 \":" >> $outfile;216 echo "Testing with \"$1 $2\":" >> $outfile; 204 217 testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`; 205 218 basedir=$PWD; 206 219 cd $testdir; 207 test "$basedir" "$1" ;220 test "$basedir" "$1" "$2"; 208 221 cd $basedir; 209 222 rm -rf $testdir; … … 220 233 for option in "${options[@]}" 221 234 do 222 run "$optimization 235 run "$optimization" "$option"; 223 236 done 224 237 done -
tests/regression/Makefile.am
r8006ee r994713 1 1 AUTOM4TE = autom4te 2 EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in regression 2 EXTRA_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 3 15 TESTSUITE = $(srcdir)/testsuite 4 16 -
tests/regression/Simple_configuration/5/pre/test.conf
r8006ee r994713 28 28 OutSrcStep 5 # Output "restart" data every ..th step 29 29 TargetTemp 0.000950045 # Target temperature 30 MaxPsiStep 0# number of Minimisation steps per state (0 - default)30 MaxPsiStep 3 # number of Minimisation steps per state (0 - default) 31 31 EpsWannier 1e-07 # tolerance value for spread minimisation of orbitals 32 32 … … 35 35 RelEpsTotalE 1e-07 # relative change in total energy 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 MaxMinStopStep 0# check every ..th steps38 MaxMinGapStopStep 0# check every ..th steps37 MaxMinStopStep 1 # check every ..th steps 38 MaxMinGapStopStep 1 # check every ..th steps 39 39 40 40 # Values specifying when to stop for INIT, otherwise same as above … … 42 42 InitRelEpsTotalE 1e-05 # relative change in total energy 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 InitMaxMinStopStep 0# check every ..th steps45 InitMaxMinGapStopStep 0# check every ..th steps44 InitMaxMinStopStep 1 # check every ..th steps 45 InitMaxMinGapStopStep 1 # check every ..th steps 46 46 47 47 BoxLength # (Length of a unit cell) … … 54 54 Level0Factor 2 # factor by which node number increases from S to 0 level 55 55 RiemannTensor 0 # (Use metric) 56 PsiType 0# 0 - doubly occupied, 1 - SpinUp,SpinDown56 PsiType 1 # 0 - doubly occupied, 1 - SpinUp,SpinDown 57 57 MaxPsiDouble 0 # here: specifying both maximum number of SpinUp- and -Down-states 58 58 PsiMaxNoUp 0 # here: specifying maximum number of SpinUp-states 59 PsiMaxNoDown 0# here: specifying maximum number of SpinDown-states59 PsiMaxNoDown 1 # here: specifying maximum number of SpinDown-states 60 60 AddPsis 0 # Additional unoccupied Psis for bandgap determination 61 61 -
tests/regression/Simple_configuration/8/post/test.xyz-sorted
r8006ee r994713 2 2 C 8.53279 4.15859 3.53589 3 3 C 9.78209 3.27519 3.53589 4 H 0.758602 0 0 5 H 0.758602 0 1.00857 6 H 0.758602 0 11.4286 7 H 0.758602 0 12.4371 8 H 0.758602 0 14.2857 9 H 0.758602 0 15.2943 10 H 0.758602 0 17.1429 11 H 0.758602 0 18.1514 12 H 0.758602 0 2.85714 13 H 0.758602 0 3.86571 14 H 0.758602 0 5.71429 15 H 0.758602 0 6.72285 16 H 0.758602 0 8.57143 17 H 0.758602 0 9.58 18 H 0.758602 11.4286 0 19 H 0.758602 11.4286 1.00857 20 H 0.758602 11.4286 11.4286 21 H 0.758602 11.4286 12.4371 22 H 0.758602 11.4286 14.2857 23 H 0.758602 11.4286 15.2943 24 H 0.758602 11.4286 17.1429 25 H 0.758602 11.4286 18.1514 26 H 0.758602 11.4286 2.85714 27 H 0.758602 11.4286 3.86571 28 H 0.758602 11.4286 5.71429 29 H 0.758602 11.4286 6.72285 30 H 0.758602 11.4286 8.57143 31 H 0.758602 11.4286 9.58 32 H 0.758602 14.2857 0 33 H 0.758602 14.2857 1.00857 34 H 0.758602 14.2857 11.4286 35 H 0.758602 14.2857 12.4371 36 H 0.758602 14.2857 14.2857 37 H 0.758602 14.2857 15.2943 38 H 0.758602 14.2857 17.1429 39 H 0.758602 14.2857 18.1514 40 H 0.758602 14.2857 2.85714 41 H 0.758602 14.2857 3.86571 42 H 0.758602 14.2857 5.71429 43 H 0.758602 14.2857 6.72285 44 H 0.758602 14.2857 8.57143 45 H 0.758602 14.2857 9.58 46 H 0.758602 17.1429 0 47 H 0.758602 17.1429 1.00857 48 H 0.758602 17.1429 11.4286 49 H 0.758602 17.1429 12.4371 50 H 0.758602 17.1429 14.2857 51 H 0.758602 17.1429 15.2943 52 H 0.758602 17.1429 17.1429 53 H 0.758602 17.1429 18.1514 54 H 0.758602 17.1429 2.85714 55 H 0.758602 17.1429 3.86571 56 H 0.758602 17.1429 5.71429 57 H 0.758602 17.1429 6.72285 58 H 0.758602 17.1429 8.57143 59 H 0.758602 17.1429 9.58 60 H 0.758602 2.85714 0 61 H 0.758602 2.85714 1.00857 62 H 0.758602 2.85714 11.4286 63 H 0.758602 2.85714 12.4371 64 H 0.758602 2.85714 14.2857 65 H 0.758602 2.85714 15.2943 66 H 0.758602 2.85714 17.1429 67 H 0.758602 2.85714 18.1514 4 68 H 0.758602 2.85714 2.85714 5 69 H 0.758602 2.85714 3.86571 6 70 H 0.758602 2.85714 5.71429 71 H 0.758602 2.85714 6.72285 72 H 0.758602 2.85714 8.57143 73 H 0.758602 2.85714 9.58 74 H 0.758602 5.71429 0 75 H 0.758602 5.71429 1.00857 76 H 0.758602 5.71429 11.4286 77 H 0.758602 5.71429 12.4371 78 H 0.758602 5.71429 14.2857 79 H 0.758602 5.71429 15.2943 80 H 0.758602 5.71429 17.1429 81 H 0.758602 5.71429 18.1514 7 82 H 0.758602 5.71429 2.85714 8 83 H 0.758602 5.71429 3.86571 84 H 0.758602 5.71429 5.71429 85 H 0.758602 5.71429 6.72285 86 H 0.758602 5.71429 8.57143 87 H 0.758602 5.71429 9.58 88 H 0.758602 8.57143 0 89 H 0.758602 8.57143 1.00857 90 H 0.758602 8.57143 11.4286 91 H 0.758602 8.57143 12.4371 92 H 0.758602 8.57143 14.2857 93 H 0.758602 8.57143 15.2943 94 H 0.758602 8.57143 17.1429 95 H 0.758602 8.57143 18.1514 96 H 0.758602 8.57143 2.85714 97 H 0.758602 8.57143 3.86571 98 H 0.758602 8.57143 5.71429 99 H 0.758602 8.57143 6.72285 100 H 0.758602 8.57143 8.57143 101 H 0.758602 8.57143 9.58 9 102 H 10.672 3.90454 3.53589 10 103 H 12.1872 0 0 11 104 H 12.1872 0 1.00857 105 H 12.1872 0 11.4286 106 H 12.1872 0 12.4371 107 H 12.1872 0 14.2857 108 H 12.1872 0 15.2943 109 H 12.1872 0 17.1429 110 H 12.1872 0 18.1514 12 111 H 12.1872 0 2.85714 13 112 H 12.1872 0 3.86571 14 113 H 12.1872 0 5.71429 15 114 H 12.1872 0 6.72285 115 H 12.1872 0 8.57143 116 H 12.1872 0 9.58 117 H 12.1872 11.4286 0 118 H 12.1872 11.4286 1.00857 119 H 12.1872 11.4286 11.4286 120 H 12.1872 11.4286 12.4371 121 H 12.1872 11.4286 14.2857 122 H 12.1872 11.4286 15.2943 123 H 12.1872 11.4286 17.1429 124 H 12.1872 11.4286 18.1514 125 H 12.1872 11.4286 2.85714 126 H 12.1872 11.4286 3.86571 127 H 12.1872 11.4286 5.71429 128 H 12.1872 11.4286 6.72285 129 H 12.1872 11.4286 8.57143 130 H 12.1872 11.4286 9.58 131 H 12.1872 14.2857 0 132 H 12.1872 14.2857 1.00857 133 H 12.1872 14.2857 11.4286 134 H 12.1872 14.2857 12.4371 135 H 12.1872 14.2857 14.2857 136 H 12.1872 14.2857 15.2943 137 H 12.1872 14.2857 17.1429 138 H 12.1872 14.2857 18.1514 139 H 12.1872 14.2857 2.85714 140 H 12.1872 14.2857 3.86571 141 H 12.1872 14.2857 5.71429 142 H 12.1872 14.2857 6.72285 143 H 12.1872 14.2857 8.57143 144 H 12.1872 14.2857 9.58 145 H 12.1872 17.1429 0 146 H 12.1872 17.1429 1.00857 147 H 12.1872 17.1429 11.4286 148 H 12.1872 17.1429 12.4371 149 H 12.1872 17.1429 14.2857 150 H 12.1872 17.1429 15.2943 151 H 12.1872 17.1429 17.1429 152 H 12.1872 17.1429 18.1514 153 H 12.1872 17.1429 2.85714 154 H 12.1872 17.1429 3.86571 155 H 12.1872 17.1429 5.71429 156 H 12.1872 17.1429 6.72285 157 H 12.1872 17.1429 8.57143 158 H 12.1872 17.1429 9.58 16 159 H 12.1872 2.85714 0 17 160 H 12.1872 2.85714 1.00857 161 H 12.1872 2.85714 11.4286 162 H 12.1872 2.85714 12.4371 163 H 12.1872 2.85714 14.2857 164 H 12.1872 2.85714 15.2943 165 H 12.1872 2.85714 17.1429 166 H 12.1872 2.85714 18.1514 18 167 H 12.1872 2.85714 5.71429 19 168 H 12.1872 2.85714 6.72285 169 H 12.1872 2.85714 8.57143 170 H 12.1872 2.85714 9.58 20 171 H 12.1872 5.71429 0 21 172 H 12.1872 5.71429 1.00857 173 H 12.1872 5.71429 11.4286 174 H 12.1872 5.71429 12.4371 175 H 12.1872 5.71429 14.2857 176 H 12.1872 5.71429 15.2943 177 H 12.1872 5.71429 17.1429 178 H 12.1872 5.71429 18.1514 22 179 H 12.1872 5.71429 2.85714 23 180 H 12.1872 5.71429 3.86571 24 181 H 12.1872 5.71429 5.71429 25 182 H 12.1872 5.71429 6.72285 183 H 12.1872 5.71429 8.57143 184 H 12.1872 5.71429 9.58 185 H 12.1872 8.57143 0 186 H 12.1872 8.57143 1.00857 187 H 12.1872 8.57143 11.4286 188 H 12.1872 8.57143 12.4371 189 H 12.1872 8.57143 14.2857 190 H 12.1872 8.57143 15.2943 191 H 12.1872 8.57143 17.1429 192 H 12.1872 8.57143 18.1514 193 H 12.1872 8.57143 2.85714 194 H 12.1872 8.57143 3.86571 195 H 12.1872 8.57143 5.71429 196 H 12.1872 8.57143 6.72285 197 H 12.1872 8.57143 8.57143 198 H 12.1872 8.57143 9.58 199 H 15.0443 0 0 200 H 15.0443 0 1.00857 201 H 15.0443 0 11.4286 202 H 15.0443 0 12.4371 203 H 15.0443 0 14.2857 204 H 15.0443 0 15.2943 205 H 15.0443 0 17.1429 206 H 15.0443 0 18.1514 207 H 15.0443 0 2.85714 208 H 15.0443 0 3.86571 209 H 15.0443 0 5.71429 210 H 15.0443 0 6.72285 211 H 15.0443 0 8.57143 212 H 15.0443 0 9.58 213 H 15.0443 11.4286 0 214 H 15.0443 11.4286 1.00857 215 H 15.0443 11.4286 11.4286 216 H 15.0443 11.4286 12.4371 217 H 15.0443 11.4286 14.2857 218 H 15.0443 11.4286 15.2943 219 H 15.0443 11.4286 17.1429 220 H 15.0443 11.4286 18.1514 221 H 15.0443 11.4286 2.85714 222 H 15.0443 11.4286 3.86571 223 H 15.0443 11.4286 5.71429 224 H 15.0443 11.4286 6.72285 225 H 15.0443 11.4286 8.57143 226 H 15.0443 11.4286 9.58 227 H 15.0443 14.2857 0 228 H 15.0443 14.2857 1.00857 229 H 15.0443 14.2857 11.4286 230 H 15.0443 14.2857 12.4371 231 H 15.0443 14.2857 14.2857 232 H 15.0443 14.2857 15.2943 233 H 15.0443 14.2857 17.1429 234 H 15.0443 14.2857 18.1514 235 H 15.0443 14.2857 2.85714 236 H 15.0443 14.2857 3.86571 237 H 15.0443 14.2857 5.71429 238 H 15.0443 14.2857 6.72285 239 H 15.0443 14.2857 8.57143 240 H 15.0443 14.2857 9.58 241 H 15.0443 17.1429 0 242 H 15.0443 17.1429 1.00857 243 H 15.0443 17.1429 11.4286 244 H 15.0443 17.1429 12.4371 245 H 15.0443 17.1429 14.2857 246 H 15.0443 17.1429 15.2943 247 H 15.0443 17.1429 17.1429 248 H 15.0443 17.1429 18.1514 249 H 15.0443 17.1429 2.85714 250 H 15.0443 17.1429 3.86571 251 H 15.0443 17.1429 5.71429 252 H 15.0443 17.1429 6.72285 253 H 15.0443 17.1429 8.57143 254 H 15.0443 17.1429 9.58 255 H 15.0443 2.85714 0 256 H 15.0443 2.85714 1.00857 257 H 15.0443 2.85714 11.4286 258 H 15.0443 2.85714 12.4371 259 H 15.0443 2.85714 14.2857 260 H 15.0443 2.85714 15.2943 261 H 15.0443 2.85714 17.1429 262 H 15.0443 2.85714 18.1514 263 H 15.0443 2.85714 2.85714 264 H 15.0443 2.85714 3.86571 265 H 15.0443 2.85714 5.71429 266 H 15.0443 2.85714 6.72285 267 H 15.0443 2.85714 8.57143 268 H 15.0443 2.85714 9.58 269 H 15.0443 5.71429 0 270 H 15.0443 5.71429 1.00857 271 H 15.0443 5.71429 11.4286 272 H 15.0443 5.71429 12.4371 273 H 15.0443 5.71429 14.2857 274 H 15.0443 5.71429 15.2943 275 H 15.0443 5.71429 17.1429 276 H 15.0443 5.71429 18.1514 277 H 15.0443 5.71429 2.85714 278 H 15.0443 5.71429 3.86571 279 H 15.0443 5.71429 5.71429 280 H 15.0443 5.71429 6.72285 281 H 15.0443 5.71429 8.57143 282 H 15.0443 5.71429 9.58 283 H 15.0443 8.57143 0 284 H 15.0443 8.57143 1.00857 285 H 15.0443 8.57143 11.4286 286 H 15.0443 8.57143 12.4371 287 H 15.0443 8.57143 14.2857 288 H 15.0443 8.57143 15.2943 289 H 15.0443 8.57143 17.1429 290 H 15.0443 8.57143 18.1514 291 H 15.0443 8.57143 2.85714 292 H 15.0443 8.57143 3.86571 293 H 15.0443 8.57143 5.71429 294 H 15.0443 8.57143 6.72285 295 H 15.0443 8.57143 8.57143 296 H 15.0443 8.57143 9.58 297 H 17.9015 0 0 298 H 17.9015 0 1.00857 299 H 17.9015 0 11.4286 300 H 17.9015 0 12.4371 301 H 17.9015 0 14.2857 302 H 17.9015 0 15.2943 303 H 17.9015 0 17.1429 304 H 17.9015 0 18.1514 305 H 17.9015 0 2.85714 306 H 17.9015 0 3.86571 307 H 17.9015 0 5.71429 308 H 17.9015 0 6.72285 309 H 17.9015 0 8.57143 310 H 17.9015 0 9.58 311 H 17.9015 11.4286 0 312 H 17.9015 11.4286 1.00857 313 H 17.9015 11.4286 11.4286 314 H 17.9015 11.4286 12.4371 315 H 17.9015 11.4286 14.2857 316 H 17.9015 11.4286 15.2943 317 H 17.9015 11.4286 17.1429 318 H 17.9015 11.4286 18.1514 319 H 17.9015 11.4286 2.85714 320 H 17.9015 11.4286 3.86571 321 H 17.9015 11.4286 5.71429 322 H 17.9015 11.4286 6.72285 323 H 17.9015 11.4286 8.57143 324 H 17.9015 11.4286 9.58 325 H 17.9015 14.2857 0 326 H 17.9015 14.2857 1.00857 327 H 17.9015 14.2857 11.4286 328 H 17.9015 14.2857 12.4371 329 H 17.9015 14.2857 14.2857 330 H 17.9015 14.2857 15.2943 331 H 17.9015 14.2857 17.1429 332 H 17.9015 14.2857 18.1514 333 H 17.9015 14.2857 2.85714 334 H 17.9015 14.2857 3.86571 335 H 17.9015 14.2857 5.71429 336 H 17.9015 14.2857 6.72285 337 H 17.9015 14.2857 8.57143 338 H 17.9015 14.2857 9.58 339 H 17.9015 17.1429 0 340 H 17.9015 17.1429 1.00857 341 H 17.9015 17.1429 11.4286 342 H 17.9015 17.1429 12.4371 343 H 17.9015 17.1429 14.2857 344 H 17.9015 17.1429 15.2943 345 H 17.9015 17.1429 17.1429 346 H 17.9015 17.1429 18.1514 347 H 17.9015 17.1429 2.85714 348 H 17.9015 17.1429 3.86571 349 H 17.9015 17.1429 5.71429 350 H 17.9015 17.1429 6.72285 351 H 17.9015 17.1429 8.57143 352 H 17.9015 17.1429 9.58 353 H 17.9015 2.85714 0 354 H 17.9015 2.85714 1.00857 355 H 17.9015 2.85714 11.4286 356 H 17.9015 2.85714 12.4371 357 H 17.9015 2.85714 14.2857 358 H 17.9015 2.85714 15.2943 359 H 17.9015 2.85714 17.1429 360 H 17.9015 2.85714 18.1514 361 H 17.9015 2.85714 2.85714 362 H 17.9015 2.85714 3.86571 363 H 17.9015 2.85714 5.71429 364 H 17.9015 2.85714 6.72285 365 H 17.9015 2.85714 8.57143 366 H 17.9015 2.85714 9.58 367 H 17.9015 5.71429 0 368 H 17.9015 5.71429 1.00857 369 H 17.9015 5.71429 11.4286 370 H 17.9015 5.71429 12.4371 371 H 17.9015 5.71429 14.2857 372 H 17.9015 5.71429 15.2943 373 H 17.9015 5.71429 17.1429 374 H 17.9015 5.71429 18.1514 375 H 17.9015 5.71429 2.85714 376 H 17.9015 5.71429 3.86571 377 H 17.9015 5.71429 5.71429 378 H 17.9015 5.71429 6.72285 379 H 17.9015 5.71429 8.57143 380 H 17.9015 5.71429 9.58 381 H 17.9015 8.57143 0 382 H 17.9015 8.57143 1.00857 383 H 17.9015 8.57143 11.4286 384 H 17.9015 8.57143 12.4371 385 H 17.9015 8.57143 14.2857 386 H 17.9015 8.57143 15.2943 387 H 17.9015 8.57143 17.1429 388 H 17.9015 8.57143 18.1514 389 H 17.9015 8.57143 2.85714 390 H 17.9015 8.57143 3.86571 391 H 17.9015 8.57143 5.71429 392 H 17.9015 8.57143 6.72285 393 H 17.9015 8.57143 8.57143 394 H 17.9015 8.57143 9.58 26 395 H 3.61574 0 0 27 396 H 3.61574 0 1.00857 397 H 3.61574 0 11.4286 398 H 3.61574 0 12.4371 399 H 3.61574 0 14.2857 400 H 3.61574 0 15.2943 401 H 3.61574 0 17.1429 402 H 3.61574 0 18.1514 28 403 H 3.61574 0 2.85714 29 404 H 3.61574 0 3.86571 30 405 H 3.61574 0 5.71429 31 406 H 3.61574 0 6.72285 407 H 3.61574 0 8.57143 408 H 3.61574 0 9.58 409 H 3.61574 11.4286 0 410 H 3.61574 11.4286 1.00857 411 H 3.61574 11.4286 11.4286 412 H 3.61574 11.4286 12.4371 413 H 3.61574 11.4286 14.2857 414 H 3.61574 11.4286 15.2943 415 H 3.61574 11.4286 17.1429 416 H 3.61574 11.4286 18.1514 417 H 3.61574 11.4286 2.85714 418 H 3.61574 11.4286 3.86571 419 H 3.61574 11.4286 5.71429 420 H 3.61574 11.4286 6.72285 421 H 3.61574 11.4286 8.57143 422 H 3.61574 11.4286 9.58 423 H 3.61574 14.2857 0 424 H 3.61574 14.2857 1.00857 425 H 3.61574 14.2857 11.4286 426 H 3.61574 14.2857 12.4371 427 H 3.61574 14.2857 14.2857 428 H 3.61574 14.2857 15.2943 429 H 3.61574 14.2857 17.1429 430 H 3.61574 14.2857 18.1514 431 H 3.61574 14.2857 2.85714 432 H 3.61574 14.2857 3.86571 433 H 3.61574 14.2857 5.71429 434 H 3.61574 14.2857 6.72285 435 H 3.61574 14.2857 8.57143 436 H 3.61574 14.2857 9.58 437 H 3.61574 17.1429 0 438 H 3.61574 17.1429 1.00857 439 H 3.61574 17.1429 11.4286 440 H 3.61574 17.1429 12.4371 441 H 3.61574 17.1429 14.2857 442 H 3.61574 17.1429 15.2943 443 H 3.61574 17.1429 17.1429 444 H 3.61574 17.1429 18.1514 445 H 3.61574 17.1429 2.85714 446 H 3.61574 17.1429 3.86571 447 H 3.61574 17.1429 5.71429 448 H 3.61574 17.1429 6.72285 449 H 3.61574 17.1429 8.57143 450 H 3.61574 17.1429 9.58 32 451 H 3.61574 2.85714 0 33 452 H 3.61574 2.85714 1.00857 453 H 3.61574 2.85714 11.4286 454 H 3.61574 2.85714 12.4371 455 H 3.61574 2.85714 14.2857 456 H 3.61574 2.85714 15.2943 457 H 3.61574 2.85714 17.1429 458 H 3.61574 2.85714 18.1514 34 459 H 3.61574 2.85714 2.85714 35 460 H 3.61574 2.85714 3.86571 … … 37 462 H 3.61574 2.85714 6.72285 38 463 H 3.61574 2.85714 8.57143 464 H 3.61574 2.85714 9.58 39 465 H 3.61574 5.71429 0 40 466 H 3.61574 5.71429 1.00857 467 H 3.61574 5.71429 11.4286 468 H 3.61574 5.71429 12.4371 469 H 3.61574 5.71429 14.2857 470 H 3.61574 5.71429 15.2943 471 H 3.61574 5.71429 17.1429 472 H 3.61574 5.71429 18.1514 41 473 H 3.61574 5.71429 2.85714 42 474 H 3.61574 5.71429 3.86571 … … 44 476 H 3.61574 5.71429 6.72285 45 477 H 3.61574 5.71429 8.57143 478 H 3.61574 5.71429 9.58 479 H 3.61574 8.57143 0 46 480 H 3.61574 8.57143 1.00857 481 H 3.61574 8.57143 11.4286 482 H 3.61574 8.57143 12.4371 483 H 3.61574 8.57143 14.2857 484 H 3.61574 8.57143 15.2943 485 H 3.61574 8.57143 17.1429 486 H 3.61574 8.57143 18.1514 47 487 H 3.61574 8.57143 2.85714 48 488 H 3.61574 8.57143 3.86571 49 489 H 3.61574 8.57143 5.71429 490 H 3.61574 8.57143 6.72285 491 H 3.61574 8.57143 8.57143 492 H 3.61574 8.57143 9.58 50 493 H 6.39363 3.90454 3.53589 51 494 H 6.47289 0 0 52 495 H 6.47289 0 1.00857 496 H 6.47289 0 11.4286 497 H 6.47289 0 12.4371 498 H 6.47289 0 14.2857 499 H 6.47289 0 15.2943 500 H 6.47289 0 17.1429 501 H 6.47289 0 18.1514 53 502 H 6.47289 0 2.85714 54 503 H 6.47289 0 3.86571 … … 57 506 H 6.47289 0 8.57143 58 507 H 6.47289 0 9.58 508 H 6.47289 11.4286 0 509 H 6.47289 11.4286 1.00857 510 H 6.47289 11.4286 11.4286 511 H 6.47289 11.4286 12.4371 512 H 6.47289 11.4286 14.2857 513 H 6.47289 11.4286 15.2943 514 H 6.47289 11.4286 17.1429 515 H 6.47289 11.4286 18.1514 516 H 6.47289 11.4286 2.85714 517 H 6.47289 11.4286 3.86571 518 H 6.47289 11.4286 5.71429 519 H 6.47289 11.4286 6.72285 520 H 6.47289 11.4286 8.57143 521 H 6.47289 11.4286 9.58 522 H 6.47289 14.2857 0 523 H 6.47289 14.2857 1.00857 524 H 6.47289 14.2857 11.4286 525 H 6.47289 14.2857 12.4371 526 H 6.47289 14.2857 14.2857 527 H 6.47289 14.2857 15.2943 528 H 6.47289 14.2857 17.1429 529 H 6.47289 14.2857 18.1514 530 H 6.47289 14.2857 2.85714 531 H 6.47289 14.2857 3.86571 532 H 6.47289 14.2857 5.71429 533 H 6.47289 14.2857 6.72285 534 H 6.47289 14.2857 8.57143 535 H 6.47289 14.2857 9.58 536 H 6.47289 17.1429 0 537 H 6.47289 17.1429 1.00857 538 H 6.47289 17.1429 11.4286 539 H 6.47289 17.1429 12.4371 540 H 6.47289 17.1429 14.2857 541 H 6.47289 17.1429 15.2943 542 H 6.47289 17.1429 17.1429 543 H 6.47289 17.1429 18.1514 544 H 6.47289 17.1429 2.85714 545 H 6.47289 17.1429 3.86571 546 H 6.47289 17.1429 5.71429 547 H 6.47289 17.1429 6.72285 548 H 6.47289 17.1429 8.57143 549 H 6.47289 17.1429 9.58 59 550 H 6.47289 2.85714 0 551 H 6.47289 2.85714 11.4286 552 H 6.47289 2.85714 12.4371 553 H 6.47289 2.85714 14.2857 554 H 6.47289 2.85714 15.2943 555 H 6.47289 2.85714 17.1429 556 H 6.47289 2.85714 18.1514 60 557 H 6.47289 2.85714 6.72285 61 558 H 6.47289 2.85714 8.57143 … … 63 560 H 6.47289 5.71429 0 64 561 H 6.47289 5.71429 1.00857 562 H 6.47289 5.71429 11.4286 563 H 6.47289 5.71429 12.4371 564 H 6.47289 5.71429 14.2857 565 H 6.47289 5.71429 15.2943 566 H 6.47289 5.71429 17.1429 567 H 6.47289 5.71429 18.1514 65 568 H 6.47289 5.71429 5.71429 66 569 H 6.47289 5.71429 6.72285 … … 69 572 H 6.47289 8.57143 0 70 573 H 6.47289 8.57143 1.00857 574 H 6.47289 8.57143 11.4286 575 H 6.47289 8.57143 12.4371 576 H 6.47289 8.57143 14.2857 577 H 6.47289 8.57143 15.2943 578 H 6.47289 8.57143 17.1429 579 H 6.47289 8.57143 18.1514 71 580 H 6.47289 8.57143 2.85714 72 581 H 6.47289 8.57143 3.86571 73 582 H 6.47289 8.57143 5.71429 74 583 H 6.47289 8.57143 6.72285 584 H 6.47289 8.57143 8.57143 585 H 6.47289 8.57143 9.58 75 586 H 7.28359 2.64589 2.64589 76 587 H 7.28359 2.64589 4.42589 … … 79 590 H 9.33003 0 0 80 591 H 9.33003 0 1.00857 592 H 9.33003 0 11.4286 593 H 9.33003 0 12.4371 594 H 9.33003 0 14.2857 595 H 9.33003 0 15.2943 596 H 9.33003 0 17.1429 597 H 9.33003 0 18.1514 81 598 H 9.33003 0 2.85714 82 599 H 9.33003 0 3.86571 … … 84 601 H 9.33003 0 6.72285 85 602 H 9.33003 0 8.57143 603 H 9.33003 0 9.58 604 H 9.33003 11.4286 0 605 H 9.33003 11.4286 1.00857 606 H 9.33003 11.4286 11.4286 607 H 9.33003 11.4286 12.4371 608 H 9.33003 11.4286 14.2857 609 H 9.33003 11.4286 15.2943 610 H 9.33003 11.4286 17.1429 611 H 9.33003 11.4286 18.1514 612 H 9.33003 11.4286 2.85714 613 H 9.33003 11.4286 3.86571 614 H 9.33003 11.4286 5.71429 615 H 9.33003 11.4286 6.72285 616 H 9.33003 11.4286 8.57143 617 H 9.33003 11.4286 9.58 618 H 9.33003 14.2857 0 619 H 9.33003 14.2857 1.00857 620 H 9.33003 14.2857 11.4286 621 H 9.33003 14.2857 12.4371 622 H 9.33003 14.2857 14.2857 623 H 9.33003 14.2857 15.2943 624 H 9.33003 14.2857 17.1429 625 H 9.33003 14.2857 18.1514 626 H 9.33003 14.2857 2.85714 627 H 9.33003 14.2857 3.86571 628 H 9.33003 14.2857 5.71429 629 H 9.33003 14.2857 6.72285 630 H 9.33003 14.2857 8.57143 631 H 9.33003 14.2857 9.58 632 H 9.33003 17.1429 0 633 H 9.33003 17.1429 1.00857 634 H 9.33003 17.1429 11.4286 635 H 9.33003 17.1429 12.4371 636 H 9.33003 17.1429 14.2857 637 H 9.33003 17.1429 15.2943 638 H 9.33003 17.1429 17.1429 639 H 9.33003 17.1429 18.1514 640 H 9.33003 17.1429 2.85714 641 H 9.33003 17.1429 3.86571 642 H 9.33003 17.1429 5.71429 643 H 9.33003 17.1429 6.72285 644 H 9.33003 17.1429 8.57143 645 H 9.33003 17.1429 9.58 86 646 H 9.33003 2.85714 0 647 H 9.33003 2.85714 11.4286 648 H 9.33003 2.85714 12.4371 649 H 9.33003 2.85714 14.2857 650 H 9.33003 2.85714 15.2943 651 H 9.33003 2.85714 17.1429 652 H 9.33003 2.85714 18.1514 87 653 H 9.33003 2.85714 6.72285 88 654 H 9.33003 2.85714 8.57143 89 655 H 9.33003 2.85714 9.58 90 656 H 9.33003 5.71429 0 657 H 9.33003 5.71429 11.4286 658 H 9.33003 5.71429 12.4371 659 H 9.33003 5.71429 14.2857 660 H 9.33003 5.71429 15.2943 661 H 9.33003 5.71429 17.1429 662 H 9.33003 5.71429 18.1514 91 663 H 9.33003 5.71429 6.72285 92 664 H 9.33003 5.71429 8.57143 … … 94 666 H 9.33003 8.57143 0 95 667 H 9.33003 8.57143 1.00857 668 H 9.33003 8.57143 11.4286 669 H 9.33003 8.57143 12.4371 670 H 9.33003 8.57143 14.2857 671 H 9.33003 8.57143 15.2943 672 H 9.33003 8.57143 17.1429 673 H 9.33003 8.57143 18.1514 96 674 H 9.33003 8.57143 2.85714 97 675 H 9.33003 8.57143 3.86571 98 676 H 9.33003 8.57143 5.71429 99 677 H 9.33003 8.57143 6.72285 678 H 9.33003 8.57143 8.57143 679 H 9.33003 8.57143 9.58 100 680 H 9.78209 2.64589 2.64589 101 681 H 9.78209 2.64589 4.42589 682 O 0 0 0.504284 683 O 0 0 11.9329 684 O 0 0 14.79 685 O 0 0 17.6471 686 O 0 0 3.36143 687 O 0 0 6.21857 688 O 0 0 9.07571 689 O 0 11.4286 0.504284 690 O 0 11.4286 11.9329 691 O 0 11.4286 14.79 692 O 0 11.4286 17.6471 693 O 0 11.4286 3.36143 694 O 0 11.4286 6.21857 695 O 0 11.4286 9.07571 696 O 0 14.2857 0.504284 697 O 0 14.2857 11.9329 698 O 0 14.2857 14.79 699 O 0 14.2857 17.6471 700 O 0 14.2857 3.36143 701 O 0 14.2857 6.21857 702 O 0 14.2857 9.07571 703 O 0 17.1429 0.504284 704 O 0 17.1429 11.9329 705 O 0 17.1429 14.79 706 O 0 17.1429 17.6471 707 O 0 17.1429 3.36143 708 O 0 17.1429 6.21857 709 O 0 17.1429 9.07571 710 O 0 2.85714 0.504284 711 O 0 2.85714 11.9329 712 O 0 2.85714 14.79 713 O 0 2.85714 17.6471 714 O 0 2.85714 3.36143 715 O 0 2.85714 6.21857 716 O 0 2.85714 9.07571 717 O 0 5.71429 0.504284 718 O 0 5.71429 11.9329 719 O 0 5.71429 14.79 720 O 0 5.71429 17.6471 721 O 0 5.71429 3.36143 722 O 0 5.71429 6.21857 723 O 0 5.71429 9.07571 724 O 0 8.57143 0.504284 725 O 0 8.57143 11.9329 726 O 0 8.57143 14.79 727 O 0 8.57143 17.6471 728 O 0 8.57143 3.36143 729 O 0 8.57143 6.21857 730 O 0 8.57143 9.07571 102 731 O 11.4286 0 0.504284 732 O 11.4286 0 11.9329 733 O 11.4286 0 14.79 734 O 11.4286 0 17.6471 103 735 O 11.4286 0 3.36143 104 736 O 11.4286 0 6.21857 737 O 11.4286 0 9.07571 738 O 11.4286 11.4286 0.504284 739 O 11.4286 11.4286 11.9329 740 O 11.4286 11.4286 14.79 741 O 11.4286 11.4286 17.6471 742 O 11.4286 11.4286 3.36143 743 O 11.4286 11.4286 6.21857 744 O 11.4286 11.4286 9.07571 745 O 11.4286 14.2857 0.504284 746 O 11.4286 14.2857 11.9329 747 O 11.4286 14.2857 14.79 748 O 11.4286 14.2857 17.6471 749 O 11.4286 14.2857 3.36143 750 O 11.4286 14.2857 6.21857 751 O 11.4286 14.2857 9.07571 752 O 11.4286 17.1429 0.504284 753 O 11.4286 17.1429 11.9329 754 O 11.4286 17.1429 14.79 755 O 11.4286 17.1429 17.6471 756 O 11.4286 17.1429 3.36143 757 O 11.4286 17.1429 6.21857 758 O 11.4286 17.1429 9.07571 105 759 O 11.4286 2.85714 0.504284 760 O 11.4286 2.85714 11.9329 761 O 11.4286 2.85714 14.79 762 O 11.4286 2.85714 17.6471 106 763 O 11.4286 2.85714 6.21857 107 764 O 11.4286 2.85714 9.07571 108 765 O 11.4286 5.71429 0.504284 766 O 11.4286 5.71429 11.9329 767 O 11.4286 5.71429 14.79 768 O 11.4286 5.71429 17.6471 109 769 O 11.4286 5.71429 6.21857 770 O 11.4286 5.71429 9.07571 771 O 11.4286 8.57143 0.504284 772 O 11.4286 8.57143 11.9329 773 O 11.4286 8.57143 14.79 774 O 11.4286 8.57143 17.6471 110 775 O 11.4286 8.57143 3.36143 776 O 11.4286 8.57143 6.21857 777 O 11.4286 8.57143 9.07571 778 O 14.2857 0 0.504284 779 O 14.2857 0 11.9329 780 O 14.2857 0 14.79 781 O 14.2857 0 17.6471 782 O 14.2857 0 3.36143 783 O 14.2857 0 6.21857 784 O 14.2857 0 9.07571 785 O 14.2857 11.4286 0.504284 786 O 14.2857 11.4286 11.9329 787 O 14.2857 11.4286 14.79 788 O 14.2857 11.4286 17.6471 789 O 14.2857 11.4286 3.36143 790 O 14.2857 11.4286 6.21857 791 O 14.2857 11.4286 9.07571 792 O 14.2857 14.2857 0.504284 793 O 14.2857 14.2857 11.9329 794 O 14.2857 14.2857 14.79 795 O 14.2857 14.2857 17.6471 796 O 14.2857 14.2857 3.36143 797 O 14.2857 14.2857 6.21857 798 O 14.2857 14.2857 9.07571 799 O 14.2857 17.1429 0.504284 800 O 14.2857 17.1429 11.9329 801 O 14.2857 17.1429 14.79 802 O 14.2857 17.1429 17.6471 803 O 14.2857 17.1429 3.36143 804 O 14.2857 17.1429 6.21857 805 O 14.2857 17.1429 9.07571 806 O 14.2857 2.85714 0.504284 807 O 14.2857 2.85714 11.9329 808 O 14.2857 2.85714 14.79 809 O 14.2857 2.85714 17.6471 810 O 14.2857 2.85714 3.36143 811 O 14.2857 2.85714 6.21857 812 O 14.2857 2.85714 9.07571 813 O 14.2857 5.71429 0.504284 814 O 14.2857 5.71429 11.9329 815 O 14.2857 5.71429 14.79 816 O 14.2857 5.71429 17.6471 817 O 14.2857 5.71429 3.36143 818 O 14.2857 5.71429 6.21857 819 O 14.2857 5.71429 9.07571 820 O 14.2857 8.57143 0.504284 821 O 14.2857 8.57143 11.9329 822 O 14.2857 8.57143 14.79 823 O 14.2857 8.57143 17.6471 824 O 14.2857 8.57143 3.36143 825 O 14.2857 8.57143 6.21857 826 O 14.2857 8.57143 9.07571 827 O 17.1429 0 0.504284 828 O 17.1429 0 11.9329 829 O 17.1429 0 14.79 830 O 17.1429 0 17.6471 831 O 17.1429 0 3.36143 832 O 17.1429 0 6.21857 833 O 17.1429 0 9.07571 834 O 17.1429 11.4286 0.504284 835 O 17.1429 11.4286 11.9329 836 O 17.1429 11.4286 14.79 837 O 17.1429 11.4286 17.6471 838 O 17.1429 11.4286 3.36143 839 O 17.1429 11.4286 6.21857 840 O 17.1429 11.4286 9.07571 841 O 17.1429 14.2857 0.504284 842 O 17.1429 14.2857 11.9329 843 O 17.1429 14.2857 14.79 844 O 17.1429 14.2857 17.6471 845 O 17.1429 14.2857 3.36143 846 O 17.1429 14.2857 6.21857 847 O 17.1429 14.2857 9.07571 848 O 17.1429 17.1429 0.504284 849 O 17.1429 17.1429 11.9329 850 O 17.1429 17.1429 14.79 851 O 17.1429 17.1429 17.6471 852 O 17.1429 17.1429 3.36143 853 O 17.1429 17.1429 6.21857 854 O 17.1429 17.1429 9.07571 855 O 17.1429 2.85714 0.504284 856 O 17.1429 2.85714 11.9329 857 O 17.1429 2.85714 14.79 858 O 17.1429 2.85714 17.6471 859 O 17.1429 2.85714 3.36143 860 O 17.1429 2.85714 6.21857 861 O 17.1429 2.85714 9.07571 862 O 17.1429 5.71429 0.504284 863 O 17.1429 5.71429 11.9329 864 O 17.1429 5.71429 14.79 865 O 17.1429 5.71429 17.6471 866 O 17.1429 5.71429 3.36143 867 O 17.1429 5.71429 6.21857 868 O 17.1429 5.71429 9.07571 869 O 17.1429 8.57143 0.504284 870 O 17.1429 8.57143 11.9329 871 O 17.1429 8.57143 14.79 872 O 17.1429 8.57143 17.6471 873 O 17.1429 8.57143 3.36143 874 O 17.1429 8.57143 6.21857 875 O 17.1429 8.57143 9.07571 111 876 O 2.85714 0 0.504284 877 O 2.85714 0 11.9329 878 O 2.85714 0 14.79 879 O 2.85714 0 17.6471 112 880 O 2.85714 0 3.36143 113 881 O 2.85714 0 6.21857 882 O 2.85714 0 9.07571 883 O 2.85714 11.4286 0.504284 884 O 2.85714 11.4286 11.9329 885 O 2.85714 11.4286 14.79 886 O 2.85714 11.4286 17.6471 887 O 2.85714 11.4286 3.36143 888 O 2.85714 11.4286 6.21857 889 O 2.85714 11.4286 9.07571 890 O 2.85714 14.2857 0.504284 891 O 2.85714 14.2857 11.9329 892 O 2.85714 14.2857 14.79 893 O 2.85714 14.2857 17.6471 894 O 2.85714 14.2857 3.36143 895 O 2.85714 14.2857 6.21857 896 O 2.85714 14.2857 9.07571 897 O 2.85714 17.1429 0.504284 898 O 2.85714 17.1429 11.9329 899 O 2.85714 17.1429 14.79 900 O 2.85714 17.1429 17.6471 901 O 2.85714 17.1429 3.36143 902 O 2.85714 17.1429 6.21857 903 O 2.85714 17.1429 9.07571 114 904 O 2.85714 2.85714 0.504284 905 O 2.85714 2.85714 11.9329 906 O 2.85714 2.85714 14.79 907 O 2.85714 2.85714 17.6471 115 908 O 2.85714 2.85714 3.36143 116 909 O 2.85714 2.85714 6.21857 910 O 2.85714 2.85714 9.07571 117 911 O 2.85714 5.71429 0.504284 912 O 2.85714 5.71429 11.9329 913 O 2.85714 5.71429 14.79 914 O 2.85714 5.71429 17.6471 118 915 O 2.85714 5.71429 3.36143 119 916 O 2.85714 5.71429 6.21857 917 O 2.85714 5.71429 9.07571 918 O 2.85714 8.57143 0.504284 919 O 2.85714 8.57143 11.9329 920 O 2.85714 8.57143 14.79 921 O 2.85714 8.57143 17.6471 120 922 O 2.85714 8.57143 3.36143 923 O 2.85714 8.57143 6.21857 924 O 2.85714 8.57143 9.07571 121 925 O 5.71429 0 0.504284 926 O 5.71429 0 11.9329 927 O 5.71429 0 14.79 928 O 5.71429 0 17.6471 122 929 O 5.71429 0 3.36143 123 930 O 5.71429 0 6.21857 124 931 O 5.71429 0 9.07571 932 O 5.71429 11.4286 0.504284 933 O 5.71429 11.4286 11.9329 934 O 5.71429 11.4286 14.79 935 O 5.71429 11.4286 17.6471 936 O 5.71429 11.4286 3.36143 937 O 5.71429 11.4286 6.21857 938 O 5.71429 11.4286 9.07571 939 O 5.71429 14.2857 0.504284 940 O 5.71429 14.2857 11.9329 941 O 5.71429 14.2857 14.79 942 O 5.71429 14.2857 17.6471 943 O 5.71429 14.2857 3.36143 944 O 5.71429 14.2857 6.21857 945 O 5.71429 14.2857 9.07571 946 O 5.71429 17.1429 0.504284 947 O 5.71429 17.1429 11.9329 948 O 5.71429 17.1429 14.79 949 O 5.71429 17.1429 17.6471 950 O 5.71429 17.1429 3.36143 951 O 5.71429 17.1429 6.21857 952 O 5.71429 17.1429 9.07571 125 953 O 5.71429 2.85714 0.504284 954 O 5.71429 2.85714 11.9329 955 O 5.71429 2.85714 14.79 956 O 5.71429 2.85714 17.6471 126 957 O 5.71429 2.85714 6.21857 127 958 O 5.71429 2.85714 9.07571 128 959 O 5.71429 5.71429 0.504284 960 O 5.71429 5.71429 11.9329 961 O 5.71429 5.71429 14.79 962 O 5.71429 5.71429 17.6471 129 963 O 5.71429 5.71429 6.21857 130 964 O 5.71429 5.71429 9.07571 131 965 O 5.71429 8.57143 0.504284 966 O 5.71429 8.57143 11.9329 967 O 5.71429 8.57143 14.79 968 O 5.71429 8.57143 17.6471 132 969 O 5.71429 8.57143 3.36143 133 970 O 5.71429 8.57143 6.21857 971 O 5.71429 8.57143 9.07571 134 972 O 8.57143 0 0.504284 973 O 8.57143 0 11.9329 974 O 8.57143 0 14.79 975 O 8.57143 0 17.6471 135 976 O 8.57143 0 3.36143 136 977 O 8.57143 0 6.21857 137 978 O 8.57143 0 9.07571 979 O 8.57143 11.4286 0.504284 980 O 8.57143 11.4286 11.9329 981 O 8.57143 11.4286 14.79 982 O 8.57143 11.4286 17.6471 983 O 8.57143 11.4286 3.36143 984 O 8.57143 11.4286 6.21857 985 O 8.57143 11.4286 9.07571 986 O 8.57143 14.2857 0.504284 987 O 8.57143 14.2857 11.9329 988 O 8.57143 14.2857 14.79 989 O 8.57143 14.2857 17.6471 990 O 8.57143 14.2857 3.36143 991 O 8.57143 14.2857 6.21857 992 O 8.57143 14.2857 9.07571 993 O 8.57143 17.1429 0.504284 994 O 8.57143 17.1429 11.9329 995 O 8.57143 17.1429 14.79 996 O 8.57143 17.1429 17.6471 997 O 8.57143 17.1429 3.36143 998 O 8.57143 17.1429 6.21857 999 O 8.57143 17.1429 9.07571 138 1000 O 8.57143 2.85714 0.504284 1001 O 8.57143 2.85714 11.9329 1002 O 8.57143 2.85714 14.79 1003 O 8.57143 2.85714 17.6471 139 1004 O 8.57143 2.85714 9.07571 140 1005 O 8.57143 5.71429 0.504284 1006 O 8.57143 5.71429 11.9329 1007 O 8.57143 5.71429 14.79 1008 O 8.57143 5.71429 17.6471 141 1009 O 8.57143 5.71429 9.07571 142 1010 O 8.57143 8.57143 0.504284 1011 O 8.57143 8.57143 11.9329 1012 O 8.57143 8.57143 14.79 1013 O 8.57143 8.57143 17.6471 143 1014 O 8.57143 8.57143 3.36143 144 1015 O 8.57143 8.57143 6.21857 145 144 1016 O 8.57143 8.57143 9.07571 -
tests/regression/atlocal.in
r8006ee r994713 1 1 prefix='@prefix@' 2 2 exec_prefix='@prefix@' 3 topdir='@ topdir@'3 topdir='@abs_top_builddir@' 4 4 bindir='@bindir@' 5 valgrind='@VALGRIND@' -
tests/regression/molecuilder.in
r8006ee r994713 3 3 # wrapper for testing molecuilder 4 4 5 . ../../at config5 . ../../atlocal 6 6 7 "${abs_top_builddir}/src/molecuilder" \ 8 ${1+"$@"} 7 if test ! -z ${valgrind} 8 then 9 G_SLICE=always-malloc G_DEBUG=gc-friendly \ 10 libtool --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+"$@"} 24 else 25 "${topdir}/src/molecuilder" \ 26 ${1+"$@"} 27 fi 28 9 29 status=$? 10 30 -
tests/regression/testsuite-analysis.at
r8006ee r994713 39 39 AT_KEYWORDS([analysis]) 40 40 AT_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])41 AT_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]) 42 42 AT_CHECK([fgrep "Begin of CorrelationToSurface" stdout], 0, [ignore], [ignore]) 43 43 #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 16 16 AT_CLEANUP 17 17 18 AT_SETUP([Graph - subgraph dissection with Undo/Redo]) 19 AT_KEYWORDS([graph]) 20 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0) 21 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I], 0, [stdout], [stderr]) 22 AT_CHECK([fgrep "I scanned 31 molecules." stdout], 0, [ignore], [ignore]) 23 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0) 24 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --undo], 0, [stdout], [stderr]) 25 AT_CHECK([fgrep "I scanned 31 molecules." stdout], 0, [ignore], [ignore]) 26 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Graph/2/pre/test.conf .], 0) 27 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -v 3 -I --undo --redo], 0, [stdout], [stderr]) 28 AT_CHECK([grep -c "I scanned 31 molecules." stdout], 0, [2 29 ], [ignore]) 30 AT_CLEANUP 31 -
tests/regression/testsuite-simple_configuration.at
r8006ee r994713 31 31 AT_CHECK([../../molecuilder -i test2.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -a 1 --position "0., 0., -1."], 134, [ignore], [ignore]) 32 32 AT_CLEANUP 33 AT_SETUP([Simple configuration - adding atom with Undo/Redo]) 34 AT_KEYWORDS([configuration]) 35 AT_CHECK([../../molecuilder -i empty.conf -o pcp -a 1 --position "10., 10., 10." --undo], 0, [ignore], [ignore]) 36 AT_CHECK([file=empty.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 37 AT_CHECK([../../molecuilder -i test.conf -o mpqc pcp xyz -a 1 --position "10., 10., 10." --undo --redo], 0, [ignore], [ignore]) 38 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 39 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 40 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 41 AT_CLEANUP 33 42 34 43 # 4. change the element … … 37 46 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 38 47 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore]) 48 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 49 AT_CLEANUP 50 AT_SETUP([Simple configuration - Changing element with Undo/Redo]) 51 AT_KEYWORDS([configuration]) 52 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 53 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore]) 54 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore]) 55 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 56 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore]) 39 57 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 40 58 AT_CLEANUP … … 48 66 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 49 67 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 68 AT_CLEANUP 69 AT_SETUP([Simple configuration - Atom removal with Undo/Redo]) 70 AT_KEYWORDS([configuration]) 71 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0) 72 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo], 0, [ignore], [ignore]) 73 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/$file], 0, [ignore], [ignore]) 74 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/pre/test.conf .], 0) 75 AT_CHECK([../../molecuilder -i test.conf --select-atom-by-id 0 -r --undo --redo], 0, [ignore], [ignore]) 76 AT_CHECK([file=test.conf; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 50 77 AT_CLEANUP 51 78 … … 72 99 AT_CLEANUP 73 100 74 # 8. Removing sphereof atoms101 # 8. Removing _shape_ of atoms 75 102 AT_SETUP([Simple configuration - Removing sphere of atoms]) 76 103 AT_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]) 104 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0) 105 AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r], 0, [stdout], [stderr]) 106 AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore]) 107 AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 108 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0) 109 AT_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]) 110 AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore]) 111 AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 112 AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore]) 113 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 114 AT_CLEANUP 115 AT_SETUP([Simple configuration - Removing sphere of atoms with Undo/Redo]) 116 AT_KEYWORDS([configuration]) 117 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0) 118 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo], 0, [stdout], [stderr]) 119 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore]) 120 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutsphere.xyz], 0) 121 AT_CHECK([../../molecuilder -i test-withoutsphere.xyz --select-atoms-inside-sphere 7. --position "7.283585982, 3.275186040, 3.535886037" -r --undo --redo], 0, [stdout], [stderr]) 122 AT_CHECK([sort -n test-withoutsphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore]) 123 AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 124 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0) 125 AT_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]) 126 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore]) 127 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-sphere.xyz], 0) 128 AT_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]) 129 AT_CHECK([sort -n test-sphere.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore]) 130 AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 131 AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore]) 132 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 133 AT_CLEANUP 134 135 AT_SETUP([Simple configuration - Removing cuboid of atoms]) 136 AT_KEYWORDS([configuration]) 137 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0) 138 AT_CHECK([../../molecuilder -i test-withoutcuboid.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r], 0, [stdout], [stderr]) 139 AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore]) 140 AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 141 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0) 142 AT_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]) 143 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore]) 144 AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 145 AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore]) 146 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 147 AT_CLEANUP 148 AT_SETUP([Simple configuration - Removing cuboid of atoms with Undo/Redo]) 149 AT_KEYWORDS([configuration]) 150 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0) 151 AT_CHECK([../../molecuilder -i test.xyz --select-atoms-inside-cuboid "2,2,2" --position "9.78,2.64,2.64" -r --undo], 0, [stdout], [stderr]) 152 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore]) 153 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-withoutcuboid.xyz], 0) 154 AT_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]) 155 AT_CHECK([sort -n test-withoutcuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutcuboid.xyz-sorted], 0, [ignore], [ignore]) 156 AT_CHECK([file=test-withoutcuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 157 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz .], 0) 158 AT_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]) 159 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/$file], 0, [ignore], [ignore]) 160 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/pre/test.xyz test-cuboid.xyz], 0) 161 AT_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]) 162 AT_CHECK([sort -n test-cuboid.xyz | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-cuboid.xyz-sorted], 0, [ignore], [ignore]) 163 AT_CHECK([file=test-cuboid.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 164 AT_CHECK([cat test-cuboid.xyz-sorted test-withoutcuboid.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore]) 81 165 AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/8/post/$file], 0, [ignore], [ignore]) 82 166 AT_CLEANUP -
tests/regression/testsuite-standard_options.at
r8006ee r994713 5 5 AT_CHECK([pwd],[ignore],[ignore]) 6 6 AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore]) 7 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore]) 7 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore]) 8 AT_CLEANUP 9 AT_SETUP([Standard Options - verbosity with Undo/Redo]) 10 AT_KEYWORDS([options]) 11 AT_CHECK([../../molecuilder -v 1 --undo], 0, [stdout], [ignore]) 12 AT_CHECK([grep "Setting verbosity from 1 to .*" stdout], 0, [ignore], [ignore]) 13 AT_CHECK([../../molecuilder -v 1 --undo --redo], 0, [stdout], [ignore]) 14 AT_CHECK([grep "Setting verbosity from .* to 1" stdout], 0, [ignore], [ignore]) 8 15 AT_CLEANUP 9 16 … … 53 60 AT_CHECK([fgrep "I won't parse trajectories" stdout], 0, [ignore], [ignore]) 54 61 AT_CLEANUP 62 AT_SETUP([Standard Options - fast trajectories with Undo/Redo]) 63 AT_KEYWORDS([options]) 64 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo], 0, [stdout], [stderr]) 65 AT_CHECK([fgrep "I will parse trajectories." stdout], 0, [ignore], [ignore]) 66 AT_CHECK([../../molecuilder -i test.conf -n 1 --undo --redo], 0, [stdout], [stderr]) 67 AT_CHECK([grep -c "I won't parse trajectories" stdout], 0, 2 68 , [ignore]) 69 AT_CLEANUP 55 70 56 71 # 7. molecule default name … … 60 75 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore]) 61 76 AT_CLEANUP 77 AT_SETUP([Standard Options - molecule default name with Undo/Redo]) 78 AT_KEYWORDS([options]) 79 AT_CHECK([../../molecuilder -i test.conf -X test --undo], 0, [stdout], [stderr]) 80 AT_CHECK([fgrep "Default name of new molecules set to none." stdout], 0, [ignore], [ignore]) 81 AT_CHECK([../../molecuilder -i test.conf -X test --undo --redo], 0, [stdout], [stderr]) 82 AT_CHECK([fgrep "Default name of new molecules set to test." stdout], 0, [ignore], [ignore]) 83 AT_CLEANUP -
tests/regression/testsuite.at
r8006ee r994713 7 7 AT_TESTED(diff fgrep grep) 8 8 9 # Use colored output with new-enough Autotest. 10 m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS]) 9 11 10 12 m4_include(testsuite-standard_options.at)
Note:
See TracChangeset
for help on using the changeset viewer.