commit 843ec686de5c4f91c46ea05a3e8ce8ebf781f3ac Author: Craig Warren Date: Wed Sep 30 14:26:59 2015 +0100 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..cbd7deb9 --- /dev/null +++ b/README.rst @@ -0,0 +1,132 @@ + +*************** +Getting Started +*************** + +What is gprMax? +=============== + +gprMax (http://www.gprmax.com) is free software that simulates electromagnetic wave propagation. It solves Maxwell's equations in 3D using the Finite-Difference Time-Domain (FDTD) method. gprMax was designed for modelling Ground Penetrating Radar (GPR) but can also be used to model electromagnetic wave propagation for many other applications. + +gprMax is released under the GNU General Public License v3 or higher (http://www.gnu.org/copyleft/gpl.html). + +gprMax is written in Python 3 (https://www.python.org) and includes performance-critical parts written in Cython/OpenMP (http://cython.org). + +.. code-block:: none + + gprMax/ + gprMax/ + tests/ + tools/ + user_libs/ + user_models/ + README.rst + setup.py + +* ``gprMax`` is the main package. Within this package the main module is ``gprMax.py`` +* ``tests`` is a sub-package which contains test modules and input files. +* ``tools`` is a sub-package which contains scripts to assist with viewing and post-processing output from models. +* ``user_libs`` is a sub-package where useful modules contributed by users are stored. +* ``user_models`` is a sub-package where useful input files contributed by users are stored. +* ``README.rst`` contains getting started information on installation, usage, and new features/changes. +* ``setup.py`` is used to compile the Cython extension modules. + +Installation +============ + +Get the code +------------ + +* Use **Git** (https://git-scm.com) and clone the master branch of the repository: :code:`git clone https://github.com/gprMax/gprMax.git` + +* or **download a zip archive** of the code from https://github.com/gprMax/gprMax. Choose the ``Download ZIP`` button (right-hand side of the page). + + +Install Python and a C compiler +------------------------------- + +To build and use the code you will need: + +* **Python 3**. +* Python packages: **cython, h5py, matplotlib, numpy, psutil, pyfiglet**. Optionally **mpi4py** if you want to use the Message Passing Interface (MPI) task farm functionality (requires an installation of OpenMPI). +* **C compiler which supports OpenMP** + +Use the following guidance dependent on your platform. + +Mac OS X and Linux +^^^^^^^^^^^^^^^^^^ + +* Install Python 3 (https://www.python.org/downloads/) +* Install the aforementioned Python packages, which on Mac OS X can be done using the :code:`pip` package manager which comes with Python, e.g. :code:`pip install cython`. The same goes for Linux, or alternatively you can use the :code:`apt-get` package manager, e.g. :code:`sudo apt-get install python3-cython`. To check what packages are installed use :code:`pip list`. +* Install a C compiler which supports OpenMP. Linux should have gcc (https://gcc.gnu.org) already installed. With most recent versions of Mac OS X the LLVM (clang) is installed by default which does not support OpenMP. However, gcc is easily installed using the Homebrew package manager (http://brew.sh). + +Microsoft Windows +^^^^^^^^^^^^^^^^^ + +Using the code on Windows is not as simple as for other platforms. Please make sure you install the correct versions of binary packages depending on whether you have 32- or 64-bit Windows. The most straightforward method is to: + +* Install Python 3 (https://www.python.org/downloads/) +* Download and install Microsoft Visual Studio 2015 Community (https://www.visualstudio.com/downloads/download-visual-studio-vs), which is free. Do a custom install and make sure under programming languages Visual C++ is selected, no other options are required. +* Create a new environment variable :code:`VS100COMNTOOLS` which matches the value of the existing :code:`VS140COMNTOOLS` environment variable. To set an environment variable from the Start Menu, right-click the Computer icon and select Properties. Click the Advanced System Settings link in the left column. In the System Properties window, click on the Advanced tab, then click the Environment Variables button near the bottom of that tab. +* Use the :code:`pip` package manager, which comes with Python, to install the cython, psutil, pyfiglet, pyparsing, python-dateutil, and pytz packages e.g. :code:`pip install cython`. To check what packages are installed use :code:`pip list`. +* Download binaries of packages numpy, h5py, matplotlib (http://www.lfd.uci.edu/~gohlke/pythonlibs/) and install (in the aforementioned order) using ``pip``, e.g. :code:`pip install numpy-1.9.2+mkl-cp35-none-win_amd64.whl` + + +Compile Cython extensions +------------------------- + +Once you have installed the aforementioned tools follow these steps to build the Cython extension modules for gprMax: + +#. Open a Terminal (Linux/Mac OS X) or Command Prompt (Windows) and navigate into the gprMax directory. +#. Compile the Cython extension modules using: :code:`python setup.py build_ext --inplace`. You should see a set of :code:`.c` source files and a set of :code:`.so` (Linux/Mac OS X) or :code:`.pyd` (Windows) compiled module files inside the gprMax directory. If you want to remove/clean Cython generated files, use :code:`python setup.py cleanall`. + +You are now ready to run gprMax. + + +Run the code +============ + +* Open a Terminal (Linux/Mac OS X) or Command Prompt (Windows) and navigate into the top-level gprMax directory. gprMax in designed as a Python package, i.e. a namespace which can contain multiple packages and modules, much like a directory. Basic usage of gprMax is: + +.. code-block:: none + + python -m gprMax path_to/name_of_input_file + +For example to run one of the test models, navigate into the top-level gprMax directory and use: + +.. code-block:: none + + python -m gprMax user_models/hertzian_dipole_2D.in + +When the simulation is complete you can plot the A-scan using: + +.. code-block:: none + + python -m tools.plot_hdf5Ascan user_models/hertzian_dipole_2D.out + +Optional command line arguments +------------------------------- + +There are optional command line arguments for gprMax: + +* ``--geometry-only`` will build a model and produce any geometry views but will not run the simulation. This option is useful for checking the geometry of the model is correct. +* ``-n`` is used along with a integer number to specify the number of times to run the input file. This option can be used to run a series of models, e.g. to create a B-scan that uses an antenna model. +* ``-mpi`` is a flag to turn on Message Passing Interface (MPI) task farm functionality. This option is most usefully combined with ``-n`` to allow individual models to be farmed out using MPI to compute nodes, e.g. when creating a B-scan each separate trace (model) would run as a separate MPI task. +* ``--commands-python`` will write an input file after any Python code blocks in the original input file have been processed. +* ``-h`` or ``--help`` can be used to get help on command line options. + +For example, to check the geometry of a model: + +.. code-block:: none + + python -m gprMax heterogeneous_soil.in --geometry-only + +For example, to run a B-scan with 50 traces using MPI: + +.. code-block:: none + + python -m gprMax GSSI_1500_cylinder_Bscan.in -n 50 -mpi + + + + diff --git a/gprMax/__init__.py b/gprMax/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/gprMax/__main__.py b/gprMax/__main__.py new file mode 100644 index 00000000..889b8fb2 --- /dev/null +++ b/gprMax/__main__.py @@ -0,0 +1,15 @@ +"""gprMax.__main__: executed when gprMax directory is called as script.""" + +from .gprMax import main +main() + +# Code profiling +# Time profiling +#import cProfile, pstats +#cProfile.run('main()','stats') +#p = pstats.Stats('stats') +#p.sort_stats('time').print_stats(50) + +# Memory profiling - use in gprMax.py +# from memory profiler import profile +# add @profile before function to profile diff --git a/gprMax/constants.pxd b/gprMax/constants.pxd new file mode 100644 index 00000000..8916a187 --- /dev/null +++ b/gprMax/constants.pxd @@ -0,0 +1,29 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np + +# Data types: +# Solid and ID arrays use 32-bit integers (0 to 4294967295) +# Rigid arrays use 8-bit integers (the smallest available type to store true/false) +# Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats +# Main field arrays use floats (floattype) and complex numbers (complextype) + +ctypedef np.float32_t floattype_t +ctypedef np.complex64_t complextype_t \ No newline at end of file diff --git a/gprMax/constants.py b/gprMax/constants.py new file mode 100644 index 00000000..f165ce0f --- /dev/null +++ b/gprMax/constants.py @@ -0,0 +1,43 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys +import decimal as d +import numpy as np +from pyfiglet import Figlet + +# Data types: +# Solid and ID arrays use 32-bit integers (0 to 4294967295) +# Rigid arrays use 8-bit integers (the smallest available type to store true/false) +# Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats +# Main field arrays use floats (floattype) and complex numbers (complextype) + +floattype = np.float32 +complextype = np.complex64 + +# Speed of light in vacuum (m/s) +c = 2.9979245e8 + +# Permittivity of free space (F/m) +e0 = 8.854187e-12 + +# Permeability of free space (H/m) +m0 = 1.256637e-6 + +# Impedance of free space (Ohms) +z0 = 376.7303134 \ No newline at end of file diff --git a/gprMax/exceptions.py b/gprMax/exceptions.py new file mode 100644 index 00000000..86397e12 --- /dev/null +++ b/gprMax/exceptions.py @@ -0,0 +1,20 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +class CmdInputError(ValueError): + """Handles errors in user specified commands. Subclasses the ValueError class.""" \ No newline at end of file diff --git a/gprMax/fields_output.py b/gprMax/fields_output.py new file mode 100644 index 00000000..3dc2d739 --- /dev/null +++ b/gprMax/fields_output.py @@ -0,0 +1,112 @@ +import numpy as np +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import h5py + +from .constants import floattype + + +def prepare_output_file(outputfile, G): + """Prepares an output file in HDF5 format for writing. + + Args: + outputfile (str): Name of the output file. + G (class): Grid class instance - holds essential parameters describing the model. + + Returns: + f (file object): File object for the file to be written to. + """ + + f = h5py.File(outputfile, 'w') + f.attrs['Title'] = G.title + f.attrs['Iterations'] = G.iterations + f.attrs['dx, dy, dz'] = (G.dx, G.dy, G.dz) + f.attrs['dt'] = G.dt + f.attrs['txsteps'] = (G.txstepx, G.txstepy, G.txstepz) + f.attrs['rxsteps'] = (G.rxstepx, G.rxstepy, G.rxstepz) + f.attrs['ntx'] = len(G.voltagesources) + len(G.hertziandipoles) + len(G.magneticdipoles) + f.attrs['nrx'] = len(G.rxs) + + # Create groups for txs, rxs + txs = f.create_group('/txs') + rxs = f.create_group('/rxs') + + # Add positional data for txs + if G.txs: # G.txs will be populated only if this is being used for converting old style output file to HDF5 format + txlist = G.txs + else: + txlist = G.voltagesources + G.hertziandipoles + G.magneticdipoles + for txindex, tx in enumerate(txlist): + tmp = f.create_group('/txs/tx' + str(txindex + 1)) + tmp['Position'] = (tx.positionx * G.dx, tx.positiony * G.dy, tx.positionz * G.dz) + + # Add positional data for rxs + for rxindex, rx in enumerate(G.rxs): + tmp = f.create_group('/rxs/rx' + str(rxindex + 1)) + tmp['Position'] = (rx.positionx * G.dx, rx.positiony * G.dy, rx.positionz * G.dz) + tmp['Ex'] = np.zeros(G.iterations, dtype=floattype) + tmp['Ey'] = np.zeros(G.iterations, dtype=floattype) + tmp['Ez'] = np.zeros(G.iterations, dtype=floattype) + tmp['Hx'] = np.zeros(G.iterations, dtype=floattype) + tmp['Hy'] = np.zeros(G.iterations, dtype=floattype) + tmp['Hz'] = np.zeros(G.iterations, dtype=floattype) + + return f + + +def write_output(f, timestep, Ex, Ey, Ez, Hx, Hy, Hz, G): + """Writes field component values to an output file in HDF5 format. + + Args: + f (file object): File object for the file to be written to. + timestep (int): Current iteration number. + Ex, Ey, Ez, Hx, Hy, Hz (memory view): Current electric and magnetic field values. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # Normal field writing from main + if type(timestep) is not slice: + # For each rx, write field component values at current timestep + for rxindex, rx in enumerate(G.rxs): + f['/rxs/rx' + str(rxindex + 1) + '/Ex'][timestep] = Ex[rx.positionx, rx.positiony, rx.positionz] + f['/rxs/rx' + str(rxindex + 1) + '/Ey'][timestep] = Ey[rx.positionx, rx.positiony, rx.positionz] + f['/rxs/rx' + str(rxindex + 1) + '/Ez'][timestep] = Ez[rx.positionx, rx.positiony, rx.positionz] + f['/rxs/rx' + str(rxindex + 1) + '/Hx'][timestep] = Hx[rx.positionx, rx.positiony, rx.positionz] + f['/rxs/rx' + str(rxindex + 1) + '/Hy'][timestep] = Hy[rx.positionx, rx.positiony, rx.positionz] + f['/rxs/rx' + str(rxindex + 1) + '/Hz'][timestep] = Hz[rx.positionx, rx.positiony, rx.positionz] + + # Field writing when converting old style output file to HDF5 format + else: + if len(G.rxs) == 1: + f['/rxs/rx1/Ex'][timestep] = Ex + f['/rxs/rx1/Ey'][timestep] = Ey + f['/rxs/rx1/Ez'][timestep] = Ez + f['/rxs/rx1/Hx'][timestep] = Hx + f['/rxs/rx1/Hy'][timestep] = Hy + f['/rxs/rx1/Hz'][timestep] = Hz + else: + for rxindex, rx in enumerate(G.rxs): + f['/rxs/rx' + str(rxindex + 1) + '/Ex'][timestep] = Ex[:, rxindex] + f['/rxs/rx' + str(rxindex + 1) + '/Ey'][timestep] = Ey[:, rxindex] + f['/rxs/rx' + str(rxindex + 1) + '/Ez'][timestep] = Ez[:, rxindex] + f['/rxs/rx' + str(rxindex + 1) + '/Hx'][timestep] = Hx[:, rxindex] + f['/rxs/rx' + str(rxindex + 1) + '/Hy'][timestep] = Hy[:, rxindex] + f['/rxs/rx' + str(rxindex + 1) + '/Hz'][timestep] = Hz[:, rxindex] + + diff --git a/gprMax/fields_update.pyx b/gprMax/fields_update.pyx new file mode 100644 index 00000000..22ea2f57 --- /dev/null +++ b/gprMax/fields_update.pyx @@ -0,0 +1,397 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np +from cython.parallel import prange +from .constants cimport floattype_t, complextype_t + + +######################################### +# Electric field updates - Ex component # +######################################### +cpdef update_ex(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Hz): + """This function updates the Ex field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(1, nz): + listIndex = ID[0, i, j, k] + Ex[i, j, k] = updatecoeffsE[listIndex, 0] * Ex[i, j, k] + updatecoeffsE[listIndex, 2] * (Hz[i, j, k] - Hz[i, j - 1, k]) - updatecoeffsE[listIndex, 3] * (Hy[i, j, k] - Hy[i, j, k - 1]) + + +cpdef update_ex_dispersive_multipole_A(int nx, int ny, int nz, int nthreads, int maxpoles, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tx, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Hz): + """This function updates the Ex field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + cdef float phi = 0.0 + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(1, nz): + listIndex = ID[0, i, j, k] + phi = 0.0 + for p in range(0, maxpoles): + phi = phi + updatecoeffsdispersive[listIndex, p * 3].real * Tx[p, i, j, k].real + Tx[p, i, j, k] = updatecoeffsdispersive[listIndex, 1 + (p * 3)] * Tx[p, i, j, k] + updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ex[i, j, k] + Ex[i, j, k] = updatecoeffsE[listIndex, 0] * Ex[i, j, k] + updatecoeffsE[listIndex, 2] * (Hz[i, j, k] - Hz[i, j - 1, k]) - updatecoeffsE[listIndex, 3] * (Hy[i, j, k] - Hy[i, j, k - 1]) - updatecoeffsE[listIndex, 4] * phi + +cpdef update_ex_dispersive_multipole_B(int nx, int ny, int nz, int nthreads, int maxpoles, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tx, floattype_t[:, :, :] Ex): + """This function updates the Ex field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(1, nz): + listIndex = ID[0, i, j, k] + for p in range(0, maxpoles): + Tx[p, i, j, k] = Tx[p, i, j, k] - updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ex[i, j, k] + + +cpdef update_ex_dispersive_1pole_A(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tx, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Hz): + """This function updates the Ex field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + cdef float phi = 0.0 + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(1, nz): + listIndex = ID[0, i, j, k] + phi = updatecoeffsdispersive[listIndex, 0].real * Tx[0, i, j, k].real + Tx[0, i, j, k] = updatecoeffsdispersive[listIndex, 1] * Tx[0, i, j, k] + updatecoeffsdispersive[listIndex, 2] * Ex[i, j, k] + Ex[i, j, k] = updatecoeffsE[listIndex, 0] * Ex[i, j, k] + updatecoeffsE[listIndex, 2] * (Hz[i, j, k] - Hz[i, j - 1, k]) - updatecoeffsE[listIndex, 3] * (Hy[i, j, k] - Hy[i, j, k - 1]) - updatecoeffsE[listIndex, 4] * phi + + +cpdef update_ex_dispersive_1pole_B(int nx, int ny, int nz, int nthreads, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tx, floattype_t[:, :, :] Ex): + """This function updates the Ex field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(1, nz): + listIndex = ID[0, i, j, k] + Tx[0, i, j, k] = Tx[0, i, j, k] - updatecoeffsdispersive[listIndex, 2] * Ex[i, j, k] + + +######################################### +# Electric field updates - Ey component # +######################################### +cpdef update_ey(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hz): + """This function updates the Ey field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[1, i, j, k] + Ey[i, j, k] = updatecoeffsE[listIndex, 0] * Ey[i, j, k] + updatecoeffsE[listIndex, 3] * (Hx[i, j, k] - Hx[i, j, k - 1]) - updatecoeffsE[listIndex, 1] * (Hz[i, j, k] - Hz[i - 1, j, k]) + + +cpdef update_ey_dispersive_multipole_A(int nx, int ny, int nz, int nthreads, int maxpoles, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Ty, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hz): + """This function updates the Ey field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + cdef float phi = 0.0 + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[1, i, j, k] + phi = 0.0 + for p in range(0, maxpoles): + phi = phi + updatecoeffsdispersive[listIndex, p * 3].real * Ty[p, i, j, k].real + Ty[p, i, j, k] = updatecoeffsdispersive[listIndex, 1 + (p * 3)] * Ty[p, i, j, k] + updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ey[i, j, k] + Ey[i, j, k] = updatecoeffsE[listIndex, 0] * Ey[i, j, k] + updatecoeffsE[listIndex, 3] * (Hx[i, j, k] - Hx[i, j, k - 1]) - updatecoeffsE[listIndex, 1] * (Hz[i, j, k] - Hz[i - 1, j, k]) - updatecoeffsE[listIndex, 4] * phi + + +cpdef update_ey_dispersive_multipole_B(int nx, int ny, int nz, int nthreads, int maxpoles, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Ty, floattype_t[:, :, :] Ey): + """This function updates the Ey field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[1, i, j, k] + for p in range(0, maxpoles): + Ty[p, i, j, k] = Ty[p, i, j, k] - updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ey[i, j, k] + + +cpdef update_ey_dispersive_1pole_A(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Ty, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hz): + """This function updates the Ey field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + cdef float phi = 0.0 + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[1, i, j, k] + phi = updatecoeffsdispersive[listIndex, 0].real * Ty[0, i, j, k].real + Ty[0, i, j, k] = updatecoeffsdispersive[listIndex, 1] * Ty[0, i, j, k] + updatecoeffsdispersive[listIndex, 2] * Ey[i, j, k] + Ey[i, j, k] = updatecoeffsE[listIndex, 0] * Ey[i, j, k] + updatecoeffsE[listIndex, 3] * (Hx[i, j, k] - Hx[i, j, k - 1]) - updatecoeffsE[listIndex, 1] * (Hz[i, j, k] - Hz[i - 1, j, k]) - updatecoeffsE[listIndex, 4] * phi + + +cpdef update_ey_dispersive_1pole_B(int nx, int ny, int nz, int nthreads, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Ty, floattype_t[:, :, :] Ey): + """This function updates the Ey field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[1, i, j, k] + Ty[0, i, j, k] = Ty[0, i, j, k] - updatecoeffsdispersive[listIndex, 2] * Ey[i, j, k] + + +######################################### +# Electric field updates - Ez component # +######################################### +cpdef update_ez(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hy): + """This function updates the Ez field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[2, i, j, k] + Ez[i, j, k] = updatecoeffsE[listIndex, 0] * Ez[i, j, k] + updatecoeffsE[listIndex, 1] * (Hy[i, j, k] - Hy[i - 1, j, k]) - updatecoeffsE[listIndex, 2] * (Hx[i, j, k] - Hx[i, j - 1, k]) + + +cpdef update_ez_dispersive_multipole_A(int nx, int ny, int nz, int nthreads, int maxpoles, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tz, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hy): + """This function updates the Ez field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + cdef float phi = 0.0 + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[2, i, j, k] + phi = 0.0 + for p in range(0, maxpoles): + phi = phi + updatecoeffsdispersive[listIndex, p * 3].real * Tz[p, i, j, k].real + Tz[p, i, j, k] = updatecoeffsdispersive[listIndex, 1 + (p * 3)] * Tz[p, i, j, k] + updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ez[i, j, k] + Ez[i, j, k] = updatecoeffsE[listIndex, 0] * Ez[i, j, k] + updatecoeffsE[listIndex, 1] * (Hy[i, j, k] - Hy[i - 1, j, k]) - updatecoeffsE[listIndex, 2] * (Hx[i, j, k] - Hx[i, j - 1, k]) - updatecoeffsE[listIndex, 4] * phi + + +cpdef update_ez_dispersive_multipole_B(int nx, int ny, int nz, int nthreads, int maxpoles, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tz, floattype_t[:, :, :] Ez): + """This function updates the Ez field components when dispersive materials (with multiple poles) are present. + + Args: + nx, ny, nz (int): Grid size in cells + maxpoles (int): Maximum number of poles + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex, p + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[2, i, j, k] + for p in range(0, maxpoles): + Tz[p, i, j, k] = Tz[p, i, j, k] - updatecoeffsdispersive[listIndex, 2 + (p * 3)] * Ez[i, j, k] + + +cpdef update_ez_dispersive_1pole_A(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsE, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tz, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Hy): + """This function updates the Ez field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E, H (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + cdef float phi = 0.0 + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[2, i, j, k] + phi = updatecoeffsdispersive[listIndex, 0].real * Tz[0, i, j, k].real + Tz[0, i, j, k] = updatecoeffsdispersive[listIndex, 1] * Tz[0, i, j, k] + updatecoeffsdispersive[listIndex, 2] * Ez[i, j, k] + Ez[i, j, k] = updatecoeffsE[listIndex, 0] * Ez[i, j, k] + updatecoeffsE[listIndex, 1] * (Hy[i, j, k] - Hy[i - 1, j, k]) - updatecoeffsE[listIndex, 2] * (Hx[i, j, k] - Hx[i, j - 1, k]) - updatecoeffsE[listIndex, 4] * phi + + +cpdef update_ez_dispersive_1pole_B(int nx, int ny, int nz, int nthreads, complextype_t[:, :] updatecoeffsdispersive, np.uint32_t[:, :, :, :] ID, complextype_t[:, :, :, :] Tz, floattype_t[:, :, :] Ez): + """This function updates the Ez field components when dispersive materials (with 1 pole) are present. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, T, ID, E (memoryviews): Access to update coeffients, temporary, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[2, i, j, k] + Tz[0, i, j, k] = Tz[0, i, j, k] - updatecoeffsdispersive[listIndex, 2] * Ez[i, j, k] + + +######################################### +# Magnetic field updates - Hx component # +######################################### +cpdef update_hx(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Ez): + """This function updates the Hx field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(1, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i, j, k] + Hx[i, j, k] = updatecoeffsH[listIndex, 0] * Hx[i, j, k] - updatecoeffsH[listIndex, 2] * (Ez[i, j + 1, k] - Ez[i, j, k]) + updatecoeffsH[listIndex, 3] * (Ey[i, j, k + 1] - Ey[i, j, k]) + + +######################################### +# Magnetic field updates - Hy component # +######################################### +cpdef update_hy(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Ez): + """This function updates the Hy field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(1, ny): + for k in range(0, nz): + listIndex = ID[4, i, j, k] + Hy[i, j, k] = updatecoeffsH[listIndex, 0] * Hy[i, j, k] - updatecoeffsH[listIndex, 3] * (Ex[i, j, k + 1] - Ex[i, j, k]) + updatecoeffsH[listIndex, 1] * (Ez[i + 1, j, k] - Ez[i, j, k]) + + +######################################### +# Magnetic field updates - Hz component # +######################################### +cpdef update_hz(int nx, int ny, int nz, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Ey): + """This function updates the Hz field components. + + Args: + nx, ny, nz (int): Grid size in cells + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + """ + + cdef int i, j, k, listIndex + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(1, nz): + listIndex = ID[5, i, j, k] + Hz[i, j, k] = updatecoeffsH[listIndex, 0] * Hz[i, j, k] - updatecoeffsH[listIndex, 1] * (Ey[i + 1, j, k] - Ey[i, j, k]) + updatecoeffsH[listIndex, 2] * (Ex[i, j + 1, k] - Ex[i, j, k]) + diff --git a/gprMax/fractals.py b/gprMax/fractals.py new file mode 100644 index 00000000..22d64fff --- /dev/null +++ b/gprMax/fractals.py @@ -0,0 +1,265 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +np.seterr(divide='raise') + +from .constants import floattype, complextype +from .utilities import rvalue + + +class FractalSurface(): + """Fractal surfaces.""" + + surfaceIDs = ['xminus', 'xplus', 'yminus', 'yplus', 'zminus', 'zplus'] + + def __init__(self, xs, xf, ys, yf, zs, zf, dimension): + """ + Args: + xs, xf, ys, yf, zs, zf (float): Extent of the fractal surface (one pair of coordinates must be equal to correctly define a surface). + dimension (float): Fractal dimension that controls the fractal distribution. + """ + + self.ID = None + self.surfaceID = None + self.xs = xs + self.xf = xf + self.ys = ys + self.yf = yf + self.zs = zs + self.zf = zf + self.nx = xf - xs + self.ny = yf - ys + self.nz = zf - zs + self.seed = None + self.dimension = dimension + # Constant related to fractal dimension from: http://dx.doi.org/10.1017/CBO9781139174695 + self.b = -(2 * self.dimension - 7) / 2 + self.weighting = (1, 1) + self.fractalrange = (0, 0) + self.filldepth = 0 + self.grass = [] + + def generate_fractal_surface(self, G): + """Generate a 2D array with a fractal distribution. + + Args: + G (class): Grid class instance - holds essential parameters describing the model. + """ + + if self.xs == self.xf: + surfacedims = (self.ny + 1, self.nz + 1) + d = G.dx + elif self.ys == self.yf: + surfacedims = (self.nx + 1, self.nz + 1) + d = G.dy + elif self.zs == self.zf: + surfacedims = (self.nx + 1, self.ny + 1) + d = G.dz + + self.fractalsurface = np.zeros(surfacedims, dtype=complextype) + + # Positional vector at centre of array, scaled by weighting + v1 = np.array([self.weighting[0]*(surfacedims[0])/2, self.weighting[1]*(surfacedims[1])/2]) + + # 2D array of random numbers to be convolved with the fractal function + R = np.random.RandomState(self.seed) + A = R.randn(surfacedims[0], surfacedims[1]) + + # 2D FFT + A = np.fft.fftn(A) + + for i in range(surfacedims[0]): + for j in range(surfacedims[1]): + # Positional vector for current position + v2 = np.array([self.weighting[0]*i, self.weighting[1]*j]) + rr = np.linalg.norm(v2 - v1) + try: + self.fractalsurface[i, j] = A[i, j] * 1/(rr**self.b) + except FloatingPointError: + rr = 0.9 + self.fractalsurface[i, j] = A[i, j] * 1/(rr**self.b) + + # Shift the zero frequency component to the centre of the spectrum + self.fractalsurface = np.fft.ifftshift(self.fractalsurface) + # Take the real part (numerical errors can give rise to an imaginary part) of the IFFT + self.fractalsurface = np.real(np.fft.ifftn(self.fractalsurface)) + # Scale the fractal volume according to requested range + fractalmin = np.amin(self.fractalsurface) + fractalmax = np.amax(self.fractalsurface) + fractalrange = fractalmax - fractalmin + self.fractalsurface = self.fractalsurface * ((self.fractalrange[1] - self.fractalrange[0])/fractalrange) + self.fractalrange[0] - ((self.fractalrange[1] - self.fractalrange[0])/fractalrange) * fractalmin + + +class FractalVolume(): + """Fractal volumes.""" + + def __init__(self, xs, xf, ys, yf, zs, zf, dimension): + """ + Args: + xs, xf, ys, yf, zs, zf (float): Extent of the fractal volume. + dimension (float): Fractal dimension that controls the fractal distribution. + """ + + self.ID = None + self.operatingonID= None + self.xs = xs + self.xf = xf + self.ys = ys + self.yf = yf + self.zs = zs + self.zf = zf + self.nx = xf - xs + self.ny = yf - ys + self.nz = zf - zs + self.seed = None + self.dimension = dimension + # Constant related to fractal dimension from: http://dx.doi.org/10.1017/CBO9781139174695 + self.b = -(2 * self.dimension - 7) / 2 + self.weighting = (1, 1, 1) + self.nbins = 0 + self.fractalsurfaces = [] + + def generate_fractal_volume(self, G): + """Generate a 3D volume with a fractal distribution. + + Args: + G (class): Grid class instance - holds essential parameters describing the model. + """ + + self.fractalvolume = np.zeros((self.nx + 1, self.ny + 1, self.nz + 1), dtype=complextype) + + # Positional vector at centre of array, scaled by weighting + v1 = np.array([self.weighting[0]*(self.nx + 1)/2, self.weighting[1]*(self.ny + 1)/2, self.weighting[2]*(self.nz + 1)/2]) + + # 3D array of random numbers to be convolved with the fractal function + R = np.random.RandomState(self.seed) + A = R.randn(self.nx + 1, self.ny + 1, self.nz + 1) + + # 3D FFT + A = np.fft.fftn(A) + + for i in range(self.nx + 1): + for j in range(self.ny + 1): + for k in range(self.nz + 1): + # Positional vector for current position + v2 = np.array([self.weighting[0]*i, self.weighting[1]*j, self.weighting[2]*k]) + rr = np.linalg.norm(v2 - v1) + try: + self.fractalvolume[i, j, k] = A[i, j, k] * 1/(rr**self.b) + except FloatingPointError: + rr = 0.9 + self.fractalvolume[i, j, k] = A[i, j, k] * 1/(rr**self.b) + + # Shift the zero frequency component to the centre of the spectrum + self.fractalvolume = np.fft.ifftshift(self.fractalvolume) + # Take the real part (numerical errors can give rise to an imaginary part) of the IFFT + self.fractalvolume = np.real(np.fft.ifftn(self.fractalvolume)) + # Bin fractal values + bins = np.linspace(np.amin(self.fractalvolume), np.amax(self.fractalvolume), self.nbins + 1) + for j in range(self.ny + 1): + for k in range(self.nz + 1): + self.fractalvolume[:, j, k] = np.digitize(self.fractalvolume[:, j, k], bins, right=True) + + def generate_volume_mask(self): + """Generate a 3D volume to use as a mask for adding rough surfaces, water and grass/roots. Zero signifies the mask is not set, one signifies the mask is set.""" + + self.mask = np.zeros((self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.int8) + maskxs = self.originalxs - self.xs + maskxf = (self.originalxf - self.originalxs) + maskxs + 1 + maskys = self.originalys - self.ys + maskyf = (self.originalyf - self.originalys) + maskys + 1 + maskzs = self.originalzs - self.zs + maskzf = (self.originalzf - self.originalzs) + maskzs + 1 + self.mask[maskxs:maskxf, maskys:maskyf, maskzs:maskzf] = 1 + + +class Grass(): + """Geometry information for blades of grass.""" + + def __init__(self, numblades): + """ + Args: + numblades (int): Number of blades of grass. + """ + + self.numblades = numblades + self.geometryparams = np.zeros((self.numblades, 6), dtype=floattype) + self.seed = None + + # Randomly defined parameters that will be used to calculate geometry + self.R1 = np.random.RandomState(self.seed) + self.R2 = np.random.RandomState(self.seed) + self.R3 = np.random.RandomState(self.seed) + self.R4 = np.random.RandomState(self.seed) + self.R5 = np.random.RandomState(self.seed) + self.R6 = np.random.RandomState(self.seed) + + for i in range(self.numblades): + self.geometryparams[i, 0] = 10 + 20 * self.R1.random_sample() + self.geometryparams[i, 1] = 10 + 20 * self.R2.random_sample() + self.geometryparams[i, 2] = self.R3.choice([-1, 1]) + self.geometryparams[i, 3] = self.R4.choice([-1, 1]) + + def calculate_blade_geometry(self, blade, height): + """Calculates the x and y coordinates for a given height of grass blade. + + Args: + blade (int): Numeric ID of grass blade. + height (float): Height of grass blade. + + Returns: + x, y (float): x and y coordinates of grass blade. + """ + + x = self.geometryparams[blade, 2] * (height / self.geometryparams[blade, 0]) * (height / self.geometryparams[blade, 0]) + y = self.geometryparams[blade, 3] * (height / self.geometryparams[blade, 1]) * (height / self.geometryparams[blade, 1]) + x = rvalue(x) + y = rvalue(y) + + return x, y + + def calculate_root_geometry(self, root, depth): + """Calculates the x and y coordinates for a given depth of grass root. + + Args: + root (int): Numeric ID of grass root. + depth (float): Depth of grass root. + + Returns: + x, y (float): x and y coordinates of grass root. + """ + + self.geometryparams[root, 4] += -1 + 2 * self.R5.random_sample() + self.geometryparams[root, 5] += -1 + 2 * self.R6.random_sample() + x = round(self.geometryparams[root, 4]) + y = round(self.geometryparams[root, 5]) + + return x, y + + + + + + + + + + + + diff --git a/gprMax/geometry_primitives.pyx b/gprMax/geometry_primitives.pyx new file mode 100644 index 00000000..ebf33d5b --- /dev/null +++ b/gprMax/geometry_primitives.pyx @@ -0,0 +1,600 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np +np.seterr(divide='raise') +from .utilities import rvalue +from .yee_cell_setget_rigid cimport set_rigid_Ex, set_rigid_Ey, set_rigid_Ez, set_rigid_Hx, set_rigid_Hy, set_rigid_Hz, set_rigid_E, unset_rigid_E, set_rigid_H, unset_rigid_H + + +cpdef bint are_clockwise(float v1x, float v1y, float v2x, float v2y): + """Find if vector 2 is clockwise relative to vector 1. + + Args: + v1x, v1y, v2x, v2y (float): Coordinates of vectors. + + Returns: + (boolean) + """ + + return -v1x*v2y + v1y*v2x > 0 + + +cpdef bint is_within_radius(float vx, float vy, float radius): + """Check if the point is within a given radius of the centre of the circle. + + Args: + vx, vy (float): Coordinates of vector. + radius (float): Radius. + + Returns: + (boolean) + """ + + return vx*vx + vy*vy <= radius*radius + + +cpdef bint is_inside_sector(float px, float py, float ctrx, float ctry, float sectorstartangle, float sectorangle, float radius): + """For a point to be inside a circular sector, it has to meet the following tests: + It has to be positioned anti-clockwise from the start "arm" of the sector + It has to be positioned clockwise from the end arm of the sector + It has to be closer to the center of the circle than the sectors radius. + Assumes sector start is always clockwise from sector end, + i.e. sector defined in an anti-clockwise direction + + Args: + px, py (float): Coordinates of point. + ctrx, ctry (float): Coordinates of centre of circle. + sectorstartangle (float): Angle (in radians) of start of sector. + sectorangle (float): Angle (in radians) that sector makes. + radius (float): Radius. + + Returns: + (boolean) + """ + + cdef float sectorstart1, sectorstart2, sectorend1, sectorend2, relpoint1, relpoint2 + + sectorstart1 = radius * np.cos(sectorstartangle) + sectorstart2 = radius * np.sin(sectorstartangle) + sectorend1 = radius * np.cos(sectorstartangle + sectorangle) + sectorend2 = radius * np.sin(sectorstartangle + sectorangle) + relpoint1 = px - ctrx + relpoint2 = py - ctry + + return not are_clockwise(sectorstart1, sectorstart2, relpoint1, relpoint2) and are_clockwise(sectorend1, sectorend2, relpoint1, relpoint2) and is_within_radius(relpoint1, relpoint2, radius) + + +cpdef build_edge_x(int i, int j, int k, int numIDx, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set x-orientated edges in the rigid and ID arrays for a Yee voxel. + + Args: + i, j, k (int): Cell coordinates of edge. + numIDz (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ex(i, j, k, rigidE) + ID[0, i, j, k] = numIDx + + +cpdef build_edge_y(int i, int j, int k, int numIDy, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set y-orientated edges in the rigid and ID arrays for a Yee voxel. + + Args: + i, j, k (int): Cell coordinates of edge. + numIDz (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ey(i, j, k, rigidE) + ID[1, i, j, k] = numIDy + + +cpdef build_edge_z(int i, int j, int k, int numIDz, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set z-orientated edges in the rigid and ID arrays for a Yee voxel. + + Args: + i, j, k (int): Cell coordinates of edge. + numIDz (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ez(i, j, k, rigidE) + ID[2, i, j, k] = numIDz + + +cpdef build_face_yz(int i, int j, int k, int numIDy, int numIDz, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set the edges of the yz-plane face of a Yell cell in the rigid and ID arrays. + + Args: + i, j, k (int): Cell coordinates of the face. + numIDx, numIDy (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ey(i, j, k, rigidE) + set_rigid_Ez(i, j, k, rigidE) + set_rigid_Ey(i, j, k + 1, rigidE) + set_rigid_Ez(i, j + 1, k, rigidE) + set_rigid_Hy(i, j, k, rigidH) + set_rigid_Hz(i, j, k, rigidH) + set_rigid_Hy(i, j, k + 1, rigidH) + set_rigid_Hz(i, j + 1, k, rigidH) + ID[1, i, j, k] = numIDy + ID[2, i, j, k] = numIDz + ID[1, i, j, k + 1] = numIDy + ID[2, i, j + 1, k] = numIDz + ID[4, i, j, k] = numIDy + ID[5, i, j, k] = numIDz + ID[4, i, j, k + 1] = numIDy + ID[5, i, j + 1, k] = numIDz + + +cpdef build_face_xz(int i, int j, int k, int numIDx, int numIDz, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set the edges of the xz-plane face of a Yell cell in the rigid and ID arrays. + + Args: + i, j, k (int): Cell coordinates of the face. + numIDx, numIDy (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ex(i, j, k, rigidE) + set_rigid_Ez(i, j, k, rigidE) + set_rigid_Ex(i, j, k + 1, rigidE) + set_rigid_Ez(i + 1, j, k, rigidE) + set_rigid_Hx(i, j, k, rigidH) + set_rigid_Hz(i, j, k, rigidH) + set_rigid_Hx(i, j, k + 1, rigidH) + set_rigid_Hz(i + 1, j, k, rigidH) + ID[0, i, j, k] = numIDx + ID[2, i, j, k] = numIDz + ID[0, i, j, k + 1] = numIDx + ID[2, i + 1, j, k] = numIDz + ID[3, i, j, k] = numIDx + ID[5, i, j, k] = numIDz + ID[3, i, j, k + 1] = numIDx + ID[5, i + 1, j, k] = numIDz + + +cpdef build_face_xy(int i, int j, int k, int numIDx, int numIDy, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set the edges of the xy-plane face of a Yell cell in the rigid and ID arrays. + + Args: + i, j, k (int): Cell coordinates of the face. + numIDx, numIDy (int): Numeric ID of material. + rigidE, rigidH, ID (memoryviews): Access to rigid and ID arrays. + """ + + set_rigid_Ex(i, j, k, rigidE) + set_rigid_Ey(i, j, k, rigidE) + set_rigid_Ex(i, j + 1, k, rigidE) + set_rigid_Ey(i + 1, j, k, rigidE) + set_rigid_Hx(i, j, k, rigidH) + set_rigid_Hy(i, j, k, rigidH) + set_rigid_Hx(i, j + 1, k, rigidH) + set_rigid_Hy(i + 1, j, k, rigidH) + ID[0, i, j, k] = numIDx + ID[1, i, j, k] = numIDy + ID[0, i, j + 1, k] = numIDx + ID[1, i + 1, j, k] = numIDy + ID[3, i, j, k] = numIDx + ID[4, i, j, k] = numIDy + ID[3, i, j + 1, k] = numIDx + ID[4, i + 1, j, k] = numIDy + + +cpdef build_voxel(int i, int j, int k, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Set values in the solid, rigid and ID arrays for a Yee voxel. + + Args: + i, j, k (int): Cell coordinates of voxel. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + if averaging: + solid[i, j, k] = numID + unset_rigid_E(i, j, k, rigidE) + unset_rigid_H(i, j, k, rigidH) + + else: + solid[i, j, k] = numID + set_rigid_E(i, j, k, rigidE) + set_rigid_H(i, j, k, rigidH) + + ID[0, i, j, k] = numIDx + ID[0, i, j + 1, k + 1] = numIDx + ID[0, i, j + 1, k] = numIDx + ID[0, i, j, k + 1] = numIDx + + ID[1, i, j, k] = numIDy + ID[1, i + 1, j, k + 1] = numIDy + ID[1, i + 1, j, k] = numIDy + ID[1, i, j, k + 1] = numIDy + + ID[2, i, j, k] = numIDz + ID[2, i + 1, j + 1, k] = numIDz + ID[2, i + 1, j, k] = numIDz + ID[2, i, j + 1, k] = numIDz + + ID[3, i, j, k] = numIDx + ID[3, i, j + 1, k + 1] = numIDx + ID[3, i, j + 1, k] = numIDx + ID[3, i, j, k + 1] = numIDx + + ID[4, i, j, k] = numIDy + ID[4, i + 1, j, k + 1] = numIDy + ID[4, i + 1, j, k] = numIDy + ID[4, i, j, k + 1] = numIDy + + ID[5, i, j, k] = numIDz + ID[5, i + 1, j + 1, k] = numIDz + ID[5, i + 1, j, k] = numIDz + ID[5, i, j + 1, k] = numIDz + + +cpdef build_triangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, str normal, int thickness, float dx, float dy, float dz, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Builds #triangle and #triangular_prism commands which sets values in the solid, rigid and ID arrays for a Yee voxel. + + Args: + x1, y1, z1, x2, y2, z2, x3, y3, z3 (float): Coordinates of the vertices of the triangular prism. + normal (char): Normal direction to the plane of the triangular prism. + thickness (int): Thickness of the triangular prism. + dx, dy, dz (float): Spatial discretisation. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + cdef int i, j, k, i1, i2, j1, j2, sign, level + cdef float area, s, t + + # Calculate a bounding box for the triangle + if normal == 'x': + area = 0.5 * (-z2 * y3 + z1 * (-y2 + y3) + y1 * (z2 - z3) + y2 * z3) + i1 = rvalue(np.amin([y1, y2, y3]) / dy) - 1 + i2 = rvalue(np.amax([y1, y2, y3]) / dy) + 1 + j1 = rvalue(np.amin([z1, z2, z3]) / dz) - 1 + j2 = rvalue(np.amax([z1, z2, z3]) / dz) + 1 + level = rvalue(x1 / dx) + elif normal == 'y': + area = 0.5 * (-z2 * x3 + z1 * (-x2 + x3) + x1 * (z2 - z3) + x2 * z3) + i1 = rvalue(np.amin([x1, x2, x3]) / dx) - 1 + i2 = rvalue(np.amax([x1, x2, x3]) / dx) + 1 + j1 = rvalue(np.amin([z1, z2, z3]) / dz) - 1 + j2 = rvalue(np.amax([z1, z2, z3]) / dz) + 1 + level = rvalue(y1 /dy) + elif normal == 'z': + area = 0.5 * (-y2 * x3 + y1 * (-x2 + x3) + x1 * (y2 - y3) + x2 * y3) + i1 = rvalue(np.amin([x1, x2, x3]) / dx) - 1 + i2 = rvalue(np.amax([x1, x2, x3]) / dx) + 1 + j1 = rvalue(np.amin([y1, y2, y3]) / dy) - 1 + j2 = rvalue(np.amax([y1, y2, y3]) / dy) + 1 + level = rvalue(z1 / dz) + + sign = np.sign(area) + + for i in range(i1, i2): + for j in range(j1, j2): + + # Calculate the areas of the 3 triangles defined by the 3 vertices of the main triangle and the point under test + if normal == 'x': + ir = (i + 0.5) * dy + jr = (j + 0.5) * dz + s = sign * (z1 * y3 - y1 * z3 + (z3 - z1) * ir + (y1 - y3) * jr); + t = sign * (y1 * z2 - z1 * y2 + (z1 - z2) * ir + (y2 - y1) * jr); + elif normal == 'y': + ir = (i + 0.5) * dx + jr = (j + 0.5) * dz + s = sign * (z1 * x3 - x1 * z3 + (z3 - z1) * ir + (x1 - x3) * jr); + t = sign * (x1 * z2 - z1 * x2 + (z1 - z2) * ir + (x2 - x1) * jr); + elif normal == 'z': + ir = (i + 0.5) * dx + jr = (j + 0.5) * dy + s = sign * (y1 * x3 - x1 * y3 + (y3 - y1) * ir + (x1 - x3) * jr); + t = sign * (x1 * y2 - y1 * x2 + (y1 - y2) * ir + (x2 - x1) * jr); + + # If these conditions are true then point is inside triangle + if s > 0 and t > 0 and (s + t) < 2 * area * sign: + if thickness == 0: + if normal == 'x': + build_face_yz(level, i, j, numIDy, numIDz, rigidE, rigidH, ID) + elif normal == 'y': + build_face_xz(i, level, j, numIDx, numIDz, rigidE, rigidH, ID) + elif normal == 'z': + build_face_xy(i, j, level, numIDx, numIDy, rigidE, rigidH, ID) + else: + for k in range(level, level + thickness): + if normal == 'x': + build_voxel(k, i, j, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + elif normal == 'y': + build_voxel(i, k, j, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + elif normal == 'z': + build_voxel(i, j, k, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + + +cpdef build_cylindrical_sector(float ctr1, float ctr2, int level, float sectorstartangle, float sectorangle, float radius, str normal, int thickness, float dx, float dy, float dz, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Builds #cylindrical_sector commands which sets values in the solid, rigid and ID arrays for a Yee voxel. It defines a sector of cylinder given by the direction of the axis of the coordinates of the cylinder face centre, depth coordinates, sector start point, sector angle, and sector radius. N.B Assumes sector start is always clockwise from sector end, i.e. sector defined in an anti-clockwise direction. + + Args: + ctr1, ctr2 (float): Coordinates of centre of circle. + level (int): Third dimensional coordinate. + sectorstartangle (float): Angle (in radians) of start of sector. + sectorangle (float): Angle (in radians) that sector makes. + radius (float): Radius of the cylindrical sector. + normal (char): Normal direction to the plane of the cylindrical sector. + thickness (int): Thickness of the cylindrical sector. + dx, dy, dz (float): Spatial discretisation. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + cdef int x1, x2, y1, y2, z1, z2, x, y, z + + if normal == 'x': + # Angles are defined from zero degrees on the positive y-axis going towards positive z-axis + y1 = rvalue((ctr1 - radius)/dy) + y2 = rvalue((ctr1 + radius)/dy) + z1 = rvalue((ctr2 - radius)/dz) + z2 = rvalue((ctr2 + radius)/dz) + + for y in range(y1, y2): + for z in range(z1, z2): + if is_inside_sector(y * dy + 0.5 * dy, z * dz + 0.5 * dz, ctr1, ctr2, sectorstartangle, sectorangle, radius): + if thickness == 0: + build_face_yz(level, y, z, numIDy, numIDz, rigidE, rigidH, ID) + else: + for x in range(level, level + thickness): + build_voxel(x, y, z, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + + elif normal == 'y': + # Angles are defined from zero degrees on the positive x-axis going towards positive z-axis + x1 = rvalue((ctr1 - radius)/dx) + x2 = rvalue((ctr1 + radius)/dx) + z1 = rvalue((ctr2 - radius)/dz) + z2 = rvalue((ctr2 + radius)/dz) + + for x in range(x1, x2): + for z in range(z2, z2): + if is_inside_sector(x * dx + 0.5 * dx, z * dz + 0.5 * dz, ctr1, ctr2, sectorstartangle, sectorangle, radius): + if thickness == 0: + build_face_xz(x, level, z, numIDx, numIDz, rigidE, rigidH, ID) + else: + for y in range(level, level + thickness): + build_voxel(x, y, z, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + + elif normal == 'z': + # Angles are defined from zero degrees on the positive x-axis going towards positive y-axis + x1 = rvalue((ctr1 - radius)/dx) + x2 = rvalue((ctr1 + radius)/dx) + y1 = rvalue((ctr2 - radius)/dy) + y2 = rvalue((ctr2 + radius)/dy) + + for x in range(x1, x2): + for y in range(y1, y2): + if is_inside_sector(x * dx + 0.5 * dx, y * dy + 0.5 * dy, ctr1, ctr2, sectorstartangle, sectorangle, radius): + if thickness == 0: + build_face_xy(x, y, level, numIDx, numIDy, rigidE, rigidH, ID) + else: + for z in range(level, level + thickness): + build_voxel(x, y, z, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + + +cpdef build_box(int xs, int xf, int ys, int yf, int zs, int zf, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Builds #box commands which sets values in the solid, rigid and ID arrays. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + cdef int i, j, k + + if averaging: + for i in range(xs, xf): + for j in range(ys, yf): + for k in range(zs, zf): + solid[i, j, k] = numID + unset_rigid_E(i, j, k, rigidE) + unset_rigid_H(i, j, k, rigidH) + else: + for i in range(xs, xf): + for j in range(ys, yf): + for k in range(zs, zf): + solid[i, j, k] = numID + set_rigid_E(i, j, k, rigidE) + set_rigid_H(i, j, k, rigidH) + + for i in range(xs, xf): + for j in range(ys, yf + 1): + for k in range(zs, zf + 1): + ID[0, i, j, k] = numIDx + + for i in range(xs, xf + 1): + for j in range(ys, yf): + for k in range(zs, zf + 1): + ID[1, i, j, k] = numIDy + + for i in range(xs, xf + 1): + for j in range(ys, yf + 1): + for k in range(zs, zf): + ID[2, i, j, k] = numIDz + + for i in range(xs, xf + 1): + for j in range(ys, yf): + for k in range(zs, zf): + ID[3, i, j, k] = numIDx + + for i in range(xs, xf): + for j in range(ys, yf + 1): + for k in range(zs, zf): + ID[4, i, j, k] = numIDy + + for i in range(xs, xf): + for j in range(ys, yf): + for k in range(zs, zf + 1): + ID[5, i, j, k] = numIDz + + +cpdef build_cylinder(float x1, float y1, float z1, float x2, float y2, float z2, float r, float dx, float dy, float dz, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Builds #cylinder commands which sets values in the solid, rigid and ID arrays for a Yee voxel. + + Args: + x1, y1, z1, x2, y2, z2 (float): Coordinates of the centres of cylinder faces. + r (float): Radius of the cylinder. + dx, dy, dz (float): Spatial discretisation. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + cdef int i, j, k, xs, xf, ys, yf, zs, zf + cdef float f1f2mag, f2f1mag, f1ptmag, f2ptmag, dot1, dot2, factor1, factor2, theta1, theta2, distance1, distance2 + cdef bint build + cdef np.ndarray f1f2, f2f1, f1pt, f2pt + + # Calculate a bounding box for the cylinder + if x1 < x2: + xs = rvalue((x1 - r) / dx) - 1 + xf = rvalue((x2 + r) / dx) + 1 + else: + xs = rvalue((x2 - r) / dx) - 1 + xf = rvalue((x1 + r) / dx) + 1 + if y1 < y2: + ys = rvalue((y1 - r) / dy) - 1 + yf = rvalue((y2 + r) / dy) + 1 + else: + ys = rvalue((y2 - r) / dy) - 1 + yf = rvalue((y1 + r) / dy) + 1 + if z1 < z2: + zs = rvalue((z1 - r) / dz) - 1 + zf = rvalue((z2 + r) / dz) + 1 + else: + zs = rvalue((z2 - r) / dz) - 1 + zf = rvalue((z1 + r) / dz) + 1 + + # Set bounds to domain if they outside + if xs < 0: + xs = 0 + if xf >= solid.shape[0]: + xf = solid.shape[0] - 1 + if ys < 0: + ys = 0 + if yf >= solid.shape[1]: + yf = solid.shape[1] - 1 + if zs < 0: + zs = 0 + if zf >= solid.shape[2]: + zf = solid.shape[2] - 1 + + # Vectors between centres of cylinder faces + f1f2 = np.array([x2 - x1, y2 - y1, z2 - z1], dtype=np.float32) + f2f1 = np.array([x1 - x2, y1 - y2, z1 - z2], dtype=np.float32) + + # Magnitudes + f1f2mag = np.sqrt((f1f2*f1f2).sum(axis=0)) + f2f1mag = np.sqrt((f2f1*f2f1).sum(axis=0)) + + for i in range(xs, xf): + for j in range(ys, yf): + for k in range(zs, zf): + # Build flag - default false, set to True if point is in cylinder + build = 0 + # Vector from centre of first cylinder face to test point + f1pt = np.array([i * dx + 0.5 * dx - x1, j * dy + 0.5 * dy - y1, k * dz + 0.5 * dz - z1], dtype=np.float32) + # Vector from centre of second cylinder face to test point + f2pt = np.array([i * dx + 0.5 * dx - x2, j * dy + 0.5 * dy - y2, k * dz + 0.5 * dz - z2], dtype=np.float32) + # Magnitudes + f1ptmag = np.sqrt((f1pt*f1pt).sum(axis=0)) + f2ptmag = np.sqrt((f2pt*f2pt).sum(axis=0)) + # Dot products + dot1 = np.dot(f1f2, f1pt) + dot2 = np.dot(f2f1, f2pt) + + if f1ptmag == 0 or f2ptmag == 0: + build = 1 + else: + factor1 = dot1 / (f1f2mag * f1ptmag) + factor2 = dot2 / (f2f1mag * f2ptmag) + # Catch cases where either factor1 or factor2 are 1 + try: + theta1 = np.arccos(factor1) + except FloatingPointError: + theta1 = 0 + try: + theta2 = np.arccos(factor2) + except FloatingPointError: + theta2 = 0 + distance1 = f1ptmag * np.sin(theta1) + distance2 = f2ptmag * np.sin(theta2) + if (distance1 <= r or distance2 <= r) and theta1 <= np.pi/2 and theta2 <= np.pi/2: + build = 1 + + if build: + build_voxel(i, j, k, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + + +cpdef build_sphere(int xc, int yc, int zc, float r, float dx, float dy, float dz, int numID, int numIDx, int numIDy, int numIDz, bint averaging, np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID): + """Builds #sphere commands which sets values in the solid, rigid and ID arrays for a Yee voxel. + + Args: + xc, yc, zc (int): Cell coordinates of the centre of the sphere. + r (float): Radius of the sphere. + dx, dy, dz (float): Spatial discretisation. + numID, numIDx, numIDy, numIDz (int): Numeric ID of material. + averaging (bint): Whether material property averging will occur for the object. + solid, rigidE, rigidH, ID (memoryviews): Access to solid, rigid and ID arrays. + """ + + cdef int i, j, k, xs, xf, ys, yf, zs, zf + + # Calculate a bounding box for sphere + xs = rvalue(((xc * dx) - r) / dx) - 1 + xf = rvalue(((xc * dx) + r) / dx) + 1 + ys = rvalue(((yc * dy) - r) / dy) - 1 + yf = rvalue(((yc * dy) + r) / dy) + 1 + zs = rvalue(((zc * dz) - r) / dz) - 1 + zf = rvalue(((zc * dz) + r) / dz) + 1 + + # Set bounds to domain if they outside + if xs < 0: + xs = 0 + if xf >= solid.shape[0]: + xf = solid.shape[0] - 1 + if ys < 0: + ys = 0 + if yf >= solid.shape[1]: + yf = solid.shape[1] - 1 + if zs < 0: + zs = 0 + if zf >= solid.shape[2]: + zf = solid.shape[2] - 1 + + for i in range(xs, xf): + for j in range(ys, yf): + for k in range(zs, zf): + if np.sqrt((i - xc)**2 * dx**2 + (j - yc)**2 * dy**2 + (k - zc)**2 * dz**2) <= r: + build_voxel(i, j, k, numID, numIDx, numIDy, numIDz, averaging, solid, rigidE, rigidH, ID) + diff --git a/gprMax/geometry_views.py b/gprMax/geometry_views.py new file mode 100644 index 00000000..649f7c2f --- /dev/null +++ b/gprMax/geometry_views.py @@ -0,0 +1,205 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys +import numpy as np +from struct import pack + +from .utilities import rvalue + + +class GeometryView: + """Views of the geometry of the model.""" + + if sys.byteorder == 'little': + byteorder = 'LittleEndian' + else: + byteorder = 'BigEndian' + + def __init__(self, xs=None, ys=None, zs=None, xf=None, yf=None, zf=None, dx=None, dy=None, dz=None, filename=None, type=None): + """ + Args: + xs, xf, ys, yf, zs, zf (float): Extent of the volume. + dx, dy, dz (float): Spatial discretisation. + filename (str): Filename to save to. + type (str): Either 'n' for a per cell geometry view, or 'f' for a per cell edge geometry view. + """ + self.xs = xs + self.ys = ys + self.zs = zs + self.xf = xf + self.yf = yf + self.zf = zf + self.dx = dx + self.dy = dy + self.dz = dz + self.filename = filename + self.type = type + + def write_file(self, modelrun, numbermodelruns, G): + """Writes the geometry information to a VTK file. Either ImageData (.vti) for a per cell geometry view, or PolygonalData (.vtp) for a per cell edge geometry view. + + Args: + modelrun (int): Current model run number. + numbermodelruns (int): Total number of model runs. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # Construct filename from user-supplied name and model run number + if numbermodelruns == 1: + self.filename = G.inputdirectory + self.filename + else: + self.filename = G.inputdirectory + self.filename + '_' + str(modelrun) + + # No Python 3 support for VTK at time of writing (03/2015) + self.vtk_nx = self.xf - self.xs + self.vtk_ny = self.yf - self.ys + self.vtk_nz = self.zf - self.zs + + if self.type == 'n': + self.filename += '.vti' + + # Calculate number of cells according to requested sampling + self.vtk_xscells = rvalue(self.xs / self.dx) + self.vtk_xfcells = rvalue(self.xf / self.dx) + self.vtk_yscells = rvalue(self.ys / self.dy) + self.vtk_yfcells = rvalue(self.yf / self.dy) + self.vtk_zscells = rvalue(self.zs / self.dz) + self.vtk_zfcells = rvalue(self.zf / self.dz) + with open(self.filename, 'wb') as f: + f.write('\n'.encode('utf-8')) + f.write('\n'.format(GeometryView.byteorder).encode('utf-8')) + f.write('\n'.format(self.vtk_xscells, self.vtk_xfcells, self.vtk_yscells, self.vtk_yfcells, self.vtk_zscells, self.vtk_zfcells, self.dx * G.dx, self.dy * G.dy, self.dz * G.dz).encode('utf-8')) + f.write('\n'.format(self.vtk_xscells, self.vtk_xfcells, self.vtk_yscells, self.vtk_yfcells, self.vtk_zscells, self.vtk_zfcells).encode('utf-8')) + f.write('\n'.encode('utf-8')) + f.write('\n'.encode('utf-8')) + f.write('\n\n\n\n_'.encode('utf-8')) + + # Calculate number of bytes of appended data section + datasize = rvalue(np.dtype(np.uint32).itemsize * (self.vtk_nx / self.dx) * (self.vtk_ny / self.dy) * (self.vtk_nz / self.dz)) + # Write number of bytes of appended data as UInt32 + f.write(pack('I', datasize)) + for k in range(self.zs, self.zf, self.dz): + for j in range(self.ys, self.yf, self.dy): + for i in range(self.xs, self.xf, self.dx): + f.write(pack('I', G.solid[i, j, k])) + f.write('\n\n'.encode('utf-8')) + + # Write gprMax specific information which relates material name to material numeric identifier + f.write('\n\n\n'.encode('utf-8')) + for material in G.materials: + f.write('{}\n'.format(material.ID, material.numID).encode('utf-8')) + f.write('\n'.encode('utf-8')) + + elif self.type == 'f': + self.filename += '.vtp' + + vtk_numpoints = (self.vtk_nx + 1) * (self.vtk_ny + 1) * (self.vtk_nz + 1) + vtk_numpoint_components = 3 + vtk_numlines = 2 * self.vtk_nx * self.vtk_ny + 2 * self.vtk_ny * self.vtk_nz + 2 * self.vtk_nx * self.vtk_nz + 3 * self.vtk_nx * self.vtk_ny * self.vtk_nz + self.vtk_nx + self.vtk_ny + self.vtk_nz + vtk_numline_components = 2; + vtk_connectivity_offset = (vtk_numpoints * vtk_numpoint_components * np.dtype(np.float32).itemsize) + np.dtype(np.uint32).itemsize + vtk_offsets_offset = vtk_connectivity_offset + (vtk_numlines * vtk_numline_components * np.dtype(np.uint32).itemsize) + np.dtype(np.uint32).itemsize + vtk_id_offset = vtk_offsets_offset + (vtk_numlines * np.dtype(np.uint32).itemsize) + np.dtype(np.uint32).itemsize + vtk_offsets_size = vtk_numlines + + with open(self.filename, 'wb') as f: + f.write('\n'.encode('utf-8')) + f.write('\n'.format(GeometryView.byteorder).encode('utf-8')) + f.write('\n\n'.format(vtk_numpoints, vtk_numlines).encode('utf-8')) + f.write('\n\n\n'.encode('utf-8')) + f.write('\n\n'.format(vtk_connectivity_offset).encode('utf-8')) + f.write('\n\n'.format(vtk_offsets_offset).encode('utf-8')) + f.write('\n\n\n'.format(vtk_id_offset).encode('utf-8')) + f.write('\n\n\n_'.encode('utf-8')) + + # Write points + datasize = np.dtype(np.float32).itemsize * vtk_numpoints * vtk_numpoint_components + f.write(pack('I', datasize)) + for i in range(self.xs, self.xf + 1): + for j in range(self.ys, self.yf + 1): + for k in range(self.zs, self.zf + 1): + f.write(pack('fff', i * G.dx, j * G.dy, k * G.dz)) + + # Write cell type (line) connectivity for x components + datasize = np.dtype(np.uint32).itemsize * vtk_numlines * vtk_numline_components + f.write(pack('I', datasize)) + vtk_x2 = (self.vtk_ny + 1) * (self.vtk_nz + 1) + for vtk_x1 in range(self.vtk_nx * (self.vtk_ny + 1) * (self.vtk_nz + 1)): + f.write(pack('II', vtk_x1, vtk_x2)) + # print('x {} {}'.format(vtk_x1, vtk_x2)) + vtk_x2 += 1 + + # Write cell type (line) connectivity for y components + vtk_ycnt1 = 1 + vtk_ycnt2 = 0 + for vtk_y1 in range((self.vtk_nx + 1) * (self.vtk_ny + 1) * (self.vtk_nz + 1)): + if vtk_y1 >= (vtk_ycnt1 * (self.vtk_ny + 1) * (self.vtk_nz + 1)) - (self.vtk_nz + 1) and vtk_y1 < vtk_ycnt1 * (self.vtk_ny + 1) * (self.vtk_nz + 1): + vtk_ycnt2 += 1 + else: + vtk_y2 = vtk_y1 + self.vtk_nz + 1 + f.write(pack('II', vtk_y1, vtk_y2)) + # print('y {} {}'.format(vtk_y1, vtk_y2)) + if vtk_ycnt2 == self.vtk_nz + 1: + vtk_ycnt1 += 1 + vtk_ycnt2 = 0 + + # Write cell type (line) connectivity for z components + vtk_zcnt = self.vtk_nz + for vtk_z1 in range((self.vtk_nx + 1) * (self.vtk_ny + 1) * self.vtk_nz + (self.vtk_nx + 1) * (self.vtk_ny + 1)): + if vtk_z1 != vtk_zcnt: + vtk_z2 = vtk_z1 + 1 + f.write(pack('II', vtk_z1, vtk_z2)) + # print('z {} {}'.format(vtk_z1, vtk_z2)) + else: + vtk_zcnt += self.vtk_nz + 1 + + # Write cell type (line) offsets + vtk_cell_pts = 2 + datasize = np.dtype(np.uint32).itemsize * vtk_offsets_size + f.write(pack('I', datasize)) + for vtk_offsets in range(vtk_cell_pts, (vtk_numline_components * vtk_numlines) + vtk_cell_pts, vtk_cell_pts): + f.write(pack('I', vtk_offsets)) + + # Write Ex, Ey, Ez values from ID array + datasize = np.dtype(np.uint32).itemsize * vtk_numlines + f.write(pack('I', datasize)) + for i in range(self.xs, self.xf): + for j in range(self.ys, self.yf + 1): + for k in range(self.zs, self.zf + 1): + f.write(pack('I', G.ID[0, i, j, k])) + + for i in range(self.xs, self.xf + 1): + for j in range(self.ys, self.yf): + for k in range(self.zs, self.zf + 1): + f.write(pack('I', G.ID[1, i, j, k])) + + for i in range(self.xs, self.xf + 1): + for j in range(self.ys, self.yf + 1): + for k in range(self.zs, self.zf): + f.write(pack('I', G.ID[2, i, j, k])) + + f.write('\n\n'.encode('utf-8')) + + # Write gprMax specific information which relates material name to material numeric identifier + f.write('\n\n\n'.encode('utf-8')) + for material in G.materials: + f.write('{}\n'.format(material.ID, material.numID).encode('utf-8')) + f.write('\n'.encode('utf-8')) + + diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py new file mode 100644 index 00000000..86482ca3 --- /dev/null +++ b/gprMax/gprMax.py @@ -0,0 +1,396 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +"""gprMax.gprMax: provides entry point main().""" + +# Set the version number here +__version__ = '3.0.0b1' +versionname = ' (Bowmore)' + +import sys, os, datetime, itertools, argparse +if sys.platform != 'win32': + import resource +from time import perf_counter +from copy import deepcopy +from enum import Enum + +import numpy as np + +from .constants import e0 +from .exceptions import CmdInputError +from .fields_output import prepare_output_file, write_output +from .fields_update import * +from .grid import FDTDGrid +from .input_cmds_geometry import process_geometrycmds +from .input_cmds_file import python_code_blocks, write_python_processed, check_cmd_names +from .input_cmds_multiuse import process_multicmds +from .input_cmds_singleuse import process_singlecmds +from .materials import Material +from .pml_call_updates import update_pml_electric, update_pml_magnetic +from .pml import build_pml, calculate_initial_pml_params +from .utilities import update_progress, logo, human_size +from .yee_cell_build import build_ex_component, build_ey_component, build_ez_component, build_hx_component, build_hy_component, build_hz_component + + +def main(): + """This is the main function for gprMax.""" + + # Print gprMax logo, version, and licencing/copyright information + logo(__version__ + versionname) + + # Parse command line arguments + parser = argparse.ArgumentParser(prog='gprMax', description='Electromagnetic modelling software based on the Finite-Difference Time-Domain (FDTD) method') + parser.add_argument('inputfile', help='path to and name of inputfile') + parser.add_argument('--geometry-only', action='store_true', default=False, help='only build model and produce geometry files') + parser.add_argument('-n', default=1, type=int, help='number of times to run the input file') + parser.add_argument('-mpi', action='store_true', default=False, help='switch on MPI') + parser.add_argument('--commands-python', action='store_true', default=False, help='write an input file after any Python code blocks in the original input file have been processed') + args = parser.parse_args() + numbermodelruns = args.n + inputdirectory = os.path.dirname(os.path.abspath(args.inputfile)) + os.sep + inputfile = inputdirectory + os.path.basename(args.inputfile) + + print('Model input file: {}\n'.format(inputfile)) + + # Mixed mode MPI/OpenMP - task farm for model runs with MPI; each model parallelised with OpenMP + if args.mpi: + from mpi4py import MPI + + # Define MPI message tags + tags = Enum('tags', {'READY': 0, 'DONE': 1, 'EXIT': 2, 'START': 3}) + + # Initializations and preliminaries + comm = MPI.COMM_WORLD # get MPI communicator object + size = comm.size # total number of processes + rank = comm.rank # rank of this process + status = MPI.Status() # get MPI status object + name = MPI.Get_processor_name() # get name of processor/host + + if rank == 0: + # Master process + modelrun = 1 + numworkers = size - 1 + closedworkers = 0 + print('Master: PID {} on {} using {} workers.'.format(os.getpid(), name, numworkers)) + while closedworkers < numworkers: + data = comm.recv(source=MPI.ANY_SOURCE, tag=MPI.ANY_TAG, status=status) + source = status.Get_source() + tag = status.Get_tag() + if tag == tags.READY.value: + # Worker is ready, so send it a task + if modelrun < numbermodelruns + 1: + comm.send(modelrun, dest=source, tag=tags.START.value) + print('Master: sending model {} to worker {}.'.format(modelrun, source)) + modelrun += 1 + else: + comm.send(None, dest=source, tag=tags.EXIT.value) + elif tag == tags.DONE.value: + print('Worker {}: completed.'.format(source)) + elif tag == tags.EXIT.value: + print('Worker {}: exited.'.format(source)) + closedworkers += 1 + else: + # Worker process + + print('Worker {}: PID {} on {} requesting {} OpenMP threads.'.format(rank, os.getpid(), name, os.environ.get('OMP_NUM_THREADS'))) + while True: + comm.send(None, dest=0, tag=tags.READY.value) + # Receive a model number to run from the master + modelrun = comm.recv(source=0, tag=MPI.ANY_TAG, status=status) + tag = status.Get_tag() + + if tag == tags.START.value: + # Run a model + run_model(args, modelrun, numbermodelruns, inputfile, inputdirectory) + comm.send(None, dest=0, tag=tags.DONE.value) + elif tag == tags.EXIT.value: + break + + comm.send(None, dest=0, tag=tags.EXIT.value) + + # Standard behaviour - models run serially; each model parallelised with OpenMP + else: + tsimstart = perf_counter() + for modelrun in range(1, numbermodelruns + 1): + run_model(args, modelrun, numbermodelruns, inputfile, inputdirectory) + tsimend = perf_counter() + print('\nTotal simulation time [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart)))) + + print('\nSimulation completed.\n{}\n'.format(65*'*')) + + +def run_model(args, modelrun, numbermodelruns, inputfile, inputdirectory): + """Runs a model - processes the input file; builds the Yee cells; calculates update coefficients; runs main FDTD loop. + + Args: + args (dict): Namespace with command line arguments + modelrun (int): Current model run number. + numbermodelruns (int): Total number of model runs. + inputfile (str): Name of the input file to open. + inputdirectory (str): Path to the directory containing the inputfile. + """ + + # Process any user input Python commands + processedlines = python_code_blocks(inputfile, modelrun, numbermodelruns, inputdirectory) + + # Write a file containing the input commands after Python blocks have been processed + if args.commands_python: + write_python_processed(inputfile, modelrun, numbermodelruns, processedlines) + + # Check validity of command names & that essential commands are present + singlecmds, multicmds, geometry = check_cmd_names(processedlines) + + # Initialise an instance of the FDTDGrid class + G = FDTDGrid() + G.inputdirectory = inputdirectory + + # Process parameters for commands that can only occur once in the model + process_singlecmds(singlecmds, multicmds, G) + + # Process parameters for commands that can occur multiple times in the model + process_multicmds(multicmds, G) + + # Initialise an array for volumetric material IDs (solid), boolean arrays for specifying materials not to be averaged (rigid), + # an array for cell edge IDs (ID), and arrays for the field components. + G.initialise_std_arrays() + + # Process the geometry commands in the order they were given + tinputprocstart = perf_counter() + process_geometrycmds(geometry, G) + tinputprocend = perf_counter() + print('\nInput file processed in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tinputprocend - tinputprocstart)))) + + # Build the PML and calculate initial coefficients + build_pml(G) + calculate_initial_pml_params(G) + + # Build the model, i.e. set the material properties (ID) for every edge of every Yee cell + tbuildstart = perf_counter() + build_ex_component(G.solid, G.rigidE, G.ID, G) + build_ey_component(G.solid, G.rigidE, G.ID, G) + build_ez_component(G.solid, G.rigidE, G.ID, G) + build_hx_component(G.solid, G.rigidH, G.ID, G) + build_hy_component(G.solid, G.rigidH, G.ID, G) + build_hz_component(G.solid, G.rigidH, G.ID, G) + tbuildend = perf_counter() + print('\nModel built in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tbuildend - tbuildstart)))) + + # Process any voltage sources that have resistance to create a new material at the source location + # that adds the voltage source conductivity to the underlying parameters + if G.voltagesources: + for source in G.voltagesources: + if source.resistance != 0: + if source.polarisation == 'x': + requirednumID = G.ID[0, source.positionx, source.positiony, source.positionz] + material = next(x for x in G.materials if x.numID == requirednumID) + newmaterial = deepcopy(material) + newmaterial.ID = material.ID + '|VoltageSource_' + str(source.resistance) + newmaterial.numID = len(G.materials) + newmaterial.se += G.dx / (source.resistance * G.dy * G.dz) + newmaterial.average = False + G.ID[0, source.positionx, source.positiony, source.positionz] = newmaterial.numID + elif source.polarisation == 'y': + requirednumID = G.ID[1, source.positionx, source.positiony, source.positionz] + material = next(x for x in G.materials if x.numID == requirednumID) + newmaterial = deepcopy(material) + newmaterial.ID = material.ID + '|VoltageSource_' + str(source.resistance) + newmaterial.numID = len(G.materials) + newmaterial.se += G.dy / (source.resistance * G.dx * G.dz) + newmaterial.average = False + G.ID[1, source.positionx, source.positiony, source.positionz] = newmaterial.numID + elif source.polarisation == 'z': + requirednumID = G.ID[2, source.positionx, source.positiony, source.positionz] + material = next(x for x in G.materials if x.numID == requirednumID) + newmaterial = deepcopy(material) + newmaterial.ID = material.ID + '|VoltageSource_' + str(source.resistance) + newmaterial.numID = len(G.materials) + newmaterial.se += G.dz / (source.resistance * G.dx * G.dy) + newmaterial.average = False + G.ID[2, source.positionx, source.positiony, source.positionz] = newmaterial.numID + G.materials.append(newmaterial) + + # Initialise arrays for storing temporary values if there are any dispersive materials + if Material.maxpoles != 0: + G.initialise_dispersive_arrays(len(G.materials)) + + # Initialise arrays of update coefficients to pass to update functions + G.initialise_std_updatecoeff_arrays(len(G.materials)) + + # Calculate update coefficients, store in arrays, and list materials in model + if G.messages: + print('\nMaterials:\n') + print('ID\tName\t\tProperties') + print('{}'.format('-'*50)) + for x, material in enumerate(G.materials): + material.calculate_update_coeffsE(G) + material.calculate_update_coeffsH(G) + + G.updatecoeffsE[x, :] = material.CA, material.CBx, material.CBy, material.CBz, material.srce + G.updatecoeffsH[x, :] = material.DA, material.DBx, material.DBy, material.DBz, material.srcm + + if Material.maxpoles != 0: + z = 0 + for y in range(Material.maxpoles): + G.updatecoeffsdispersive[x, z:z+3] = e0 * material.eqt2[y], material.eqt[y], material.zt[y] + z += 3 + + if G.messages: + if material.deltaer and material.tau: + tmp = 'delta_epsr={}, tau={} secs; '.format(','.join('%4.2f' % deltaer for deltaer in material.deltaer), ','.join('%4.3e' % tau for tau in material.tau)) + else: + tmp = '' + if material.average: + dielectricsmoothing = 'dielectric smoothing permitted.' + else: + dielectricsmoothing = 'dielectric smoothing not permitted.' + print('{:3}\t{:12}\tepsr={:4.2f}, sig={:.3e} S/m; mur={:4.2f}, sig*={:.3e} S/m; '.format(material.numID, material.ID, material.er, material.se, material.mr, material.sm) + tmp + dielectricsmoothing) + + # Write files for any geometry views + if G.geometryviews: + tgeostart = perf_counter() + for geometryview in G.geometryviews: + geometryview.write_file(modelrun, numbermodelruns, G) + tgeoend = perf_counter() + print('\nGeometry file(s) written in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tgeoend - tgeostart)))) + + # Run simulation if not doing only geometry + if not args.geometry_only: + + # Prepare any snapshot files + if G.snapshots: + for snapshot in G.snapshots: + snapshot.prepare_file(modelrun, numbermodelruns, G) + + # Prepare output file + inputfileparts = inputfile.split('.') + if numbermodelruns == 1: + outputfile = inputfileparts[0] + '.out' + else: + outputfile = inputfileparts[0] + str(modelrun) + '.out' + sys.stdout.write('\nOutput to file: {}\n'.format(outputfile)) + sys.stdout.flush() + f = prepare_output_file(outputfile, G) + + # Adjust position of sources and receivers if required + if G.txstepx > 0 or G.txstepy > 0 or G.txstepz > 0: + for source in itertools.chain(G.hertziandipoles, G.magneticdipoles, G.voltagesources): + source.positionx += (modelrun - 1) * G.txstepx + source.positiony += (modelrun - 1) * G.txstepy + source.positionz += (modelrun - 1) * G.txstepz + if G.rxstepx > 0 or G.rxstepy > 0 or G.rxstepz > 0: + for receiver in G.rxs: + receiver.positionx += (modelrun - 1) * G.rxstepx + receiver.positiony += (modelrun - 1) * G.rxstepy + receiver.positionz += (modelrun - 1) * G.rxstepz + + ################################## + # Main FDTD calculation loop # + ################################## + tsolvestart = perf_counter() + # Absolute time + abstime = 0 + + for timestep in range(G.iterations): + if timestep == 0: + tstepstart = perf_counter() + + # Write field outputs to file + write_output(f, timestep, G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz, G) + + # Write any snapshots to file + if G.snapshots: + for snapshot in G.snapshots: + if snapshot.time == timestep + 1: + snapshot.write_snapshot(G.Ex, G.Ey, G.Ez, G.Hx, G.Hy, G.Hz, G) + + # Update electric field components + # If there are any dispersive materials do 1st part of dispersive update. It is split into two parts as it requires present and updated electric field values. + if Material.maxpoles == 1: + update_ex_dispersive_1pole_A(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Tx, G.Ex, G.Hy, G.Hz) + update_ey_dispersive_1pole_A(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Ty, G.Ey, G.Hx, G.Hz) + update_ez_dispersive_1pole_A(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Tz, G.Ez, G.Hx, G.Hy) + elif Material.maxpoles > 1: + update_ex_dispersive_multipole_A(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Tx, G.Ex, G.Hy, G.Hz) + update_ey_dispersive_multipole_A(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Ty, G.Ey, G.Hx, G.Hz) + update_ez_dispersive_multipole_A(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsE, G.updatecoeffsdispersive, G.ID, G.Tz, G.Ez, G.Hx, G.Hy) + # Otherwise all materials are non-dispersive so do standard update + else: + update_ex(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hy, G.Hz) + update_ey(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hx, G.Hz) + update_ez(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hx, G.Hy) + + # Update electric field components with the PML correction + update_pml_electric(G) + + # Update electric field components with electric sources + if G.voltagesources: + for v in G.voltagesources: + v.update_fields(abstime, timestep, G.updatecoeffsE, G.ID, G.Ex, G.Ey, G.Ez, G) + if G.hertziandipoles: # Update any Hertzian dipole sources last + for h in G.hertziandipoles: + h.update_fields(abstime, timestep, G.updatecoeffsE, G.ID, G.Ex, G.Ey, G.Ez, G) + + # If there are any dispersive materials do 2nd part of dispersive update. It is split into two parts as it requires present and updated electric field values. Therefore it can only be completely updated after the electric field has been updated by the PML and source updates. + if Material.maxpoles == 1: + update_ex_dispersive_1pole_B(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsdispersive, G.ID, G.Tx, G.Ex) + update_ey_dispersive_1pole_B(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsdispersive, G.ID, G.Ty, G.Ey) + update_ez_dispersive_1pole_B(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsdispersive, G.ID, G.Tz, G.Ez) + elif Material.maxpoles > 1: + update_ex_dispersive_multipole_B(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsdispersive, G.ID, G.Tx, G.Ex) + update_ey_dispersive_multipole_B(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsdispersive, G.ID, G.Ty, G.Ey) + update_ez_dispersive_multipole_B(G.nx, G.ny, G.nz, G.nthreads, Material.maxpoles, G.updatecoeffsdispersive, G.ID, G.Tz, G.Ez) + + # Increment absolute time value + abstime += 0.5 * G.dt + + # Update magnetic field components + update_hx(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ey, G.Ez) + update_hy(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ex, G.Ez) + update_hz(G.nx, G.ny, G.nz, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ex, G.Ey) + + # Update magnetic field components with the PML correction + update_pml_magnetic(G) + + # Update magnetic field components with magnetic sources + if G.magneticdipoles: + for m in G.magneticdipoles: + m.update_fields(abstime, timestep, G.updatecoeffsH, G.ID, G.Hx, G.Hy, G.Hz, G) + + # Increment absolute time value + abstime += 0.5 * G.dt + + # Calculate time for two iterations, used to estimate overall runtime + if timestep == 1: + tstepend = perf_counter() + runtime = datetime.timedelta(seconds=int((tstepend - tstepstart) / 2 * G.iterations)) + sys.stdout.write('Estimated runtime [HH:MM:SS]: {}\n'.format(runtime)) + sys.stdout.write('Solving for model run {} of {}...\n'.format(modelrun, numbermodelruns)) + sys.stdout.flush() + elif timestep > 1: + update_progress((timestep + 1) / G.iterations) + + # Close output file + f.close() + tsolveend = perf_counter() + print('\n\nSolving took [HH:MM:SS]:'.format(datetime.timedelta(seconds=int(tsolveend - tsolvestart)))) + if sys.platform != 'win32': + print('Peak memory (approx) required: {}'.format(human_size(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss, False))) + + + + diff --git a/gprMax/grid.py b/gprMax/grid.py new file mode 100644 index 00000000..536e61d9 --- /dev/null +++ b/gprMax/grid.py @@ -0,0 +1,102 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np + +from .constants import floattype, complextype +from .materials import Material + + +class FDTDGrid(): + """Holds attributes associated with the entire grid. A convenient way for accessing regularly used parameters.""" + + def __init__(self): + self.inputdirectory = '' + self.title = '' + self.messages = True + self.nx = 0 + self.ny = 0 + self.nz = 0 + self.dx = 0 + self.dy = 0 + self.dz = 0 + self.dt = 0 + self.iterations = 0 + self.timewindow = 0 + self.nthreads = 0 + self.cfs = [] + self.pmlthickness = (10, 10, 10, 10, 10, 10) + self.pmls = [] + self.materials = [] + self.mixingmodels = [] + self.averagevolumeobjects = True + self.fractalvolumes = [] + self.geometryviews = [] + self.waveforms = [] + self.voltagesources = [] + self.hertziandipoles = [] + self.magneticdipoles = [] + self.txs = [] # Only used for converting old output files to HDF5 format + self.txstepx = 0 + self.txstepy = 0 + self.txstepz = 0 + self.rxstepx = 0 + self.rxstepy = 0 + self.rxstepz = 0 + self.rxs = [] + self.snapshots = [] + + def initialise_std_arrays(self): + """Initialise an array for volumetric material IDs (solid); boolean arrays for specifying whether materials can have dielectric smoothing (rigid); + an array for cell edge IDs (ID); and arrays for the electric and magnetic field components. Solid and ID arrays are initialised to free_space (one); rigid arrays + to allow dielectric smoothing (zero). + """ + self.solid = np.ones((self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.uint32) + self.rigidE = np.zeros((12, self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.int8) + self.rigidH = np.zeros((6, self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.int8) + self.ID = np.ones((6, self.nx + 1, self.ny + 1, self.nz + 1), dtype=np.uint32) + self.Ex = np.zeros((self.nx, self.ny + 1, self.nz + 1), dtype=floattype) + self.Ey = np.zeros((self.nx + 1, self.ny, self.nz + 1), dtype=floattype) + self.Ez = np.zeros((self.nx + 1, self.ny + 1, self.nz), dtype=floattype) + self.Hx = np.zeros((self.nx + 1, self.ny, self.nz), dtype=floattype) + self.Hy = np.zeros((self.nx, self.ny + 1, self.nz), dtype=floattype) + self.Hz = np.zeros((self.nx, self.ny, self.nz + 1), dtype=floattype) + + def initialise_std_updatecoeff_arrays(self, nummaterials): + """Initialise arrays for storing update coefficients. + + Args: + nummaterials (int): Number of materials present in the model. + """ + self.updatecoeffsE = np.zeros((nummaterials, 5), dtype=floattype) + self.updatecoeffsH = np.zeros((nummaterials, 5), dtype=floattype) + + def initialise_dispersive_arrays(self, nummaterials): + """Initialise arrays for storing coefficients when there are dispersive materials present. + + Args: + nummaterials (int): Number of materials present in the model. + """ + self.Tx = np.zeros((Material.maxpoles, self.nx, self.ny + 1, self.nz + 1), dtype=complextype) + self.Ty = np.zeros((Material.maxpoles, self.nx + 1, self.ny, self.nz + 1), dtype=complextype) + self.Tz = np.zeros((Material.maxpoles, self.nx + 1, self.ny + 1, self.nz), dtype=complextype) + self.updatecoeffsdispersive = np.zeros((nummaterials, 3 * Material.maxpoles), dtype=complextype) + + + + diff --git a/gprMax/input_cmds_file.py b/gprMax/input_cmds_file.py new file mode 100644 index 00000000..0cabef72 --- /dev/null +++ b/gprMax/input_cmds_file.py @@ -0,0 +1,174 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys, os + +from .constants import c, e0, m0, z0 +from .exceptions import CmdInputError +from .utilities import ListStream + + +def python_code_blocks(inputfile, modelrun, numbermodelruns, inputdirectory): + """Looks for and processes any Python code found in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines. It will also ignore any lines that do not begin with a hash (#) after it has processed Python commands. + + Args: + inputfile (str): Name of the input file to open. + modelrun (int): Current model run number. + numbermodelruns (int): Total number of model runs. + inputdirectory (str): Directory containing input file. + + Returns: + processedlines (list): Input commands after Python processing. + """ + + with open(inputfile, 'r') as f: + # Strip out any newline characters and comments that must begin with double hashes + inputlines = [line.rstrip() for line in f if(not line.startswith('##') and line.rstrip('\n'))] + + # List to hold final processed commands + processedlines = [] + + # Separate namespace for users Python code blocks to use; pre-populated some standard constants and the + # current model run number and total number of model runs + usernamespace = {'c': c, 'e0': e0, 'm0': m0, 'z0': z0, 'current_model_run': modelrun, 'number_model_runs': numbermodelruns, 'inputdirectory': inputdirectory} + print('Constants/variables available for Python scripting: {}\n'.format(usernamespace)) + + x = 0 + while(x < len(inputlines)): + if(inputlines[x].startswith('#python:')): + # String to hold Python code to be executed + pythoncode = '' + x += 1 + while not inputlines[x].startswith('#end_python:'): + # Add all code in current code block to string + pythoncode += inputlines[x] + '\n' + x += 1 + if x == len(inputlines): + raise CmdInputError('Cannot find the end of the Python code block, i.e. missing #end_python: command.') + # Compile code for faster execution + pythoncompiledcode = compile(pythoncode, '', 'exec') + # Redirect stdio to a ListStream + sys.stdout = codeout = ListStream() + # Execute code block & make available only usernamespace + exec(pythoncompiledcode, usernamespace) + + # Now strip out any lines that don't begin with a hash command + codeproc = [line + ('\n') for line in codeout.data if(line.startswith('#'))] + + # Add processed Python code to list + processedlines.extend(codeproc) + x += 1 + + elif(inputlines[x].startswith('#')): + # Add gprMax command to list + inputlines[x] += ('\n') + processedlines.append(inputlines[x]) + x += 1 + + else: + x += 1 + + sys.stdout = sys.__stdout__ # Reset stdio + + return processedlines + + +def write_python_processed(inputfile, modelrun, numbermodelruns, processedlines): + """Writes input commands to file after Python processing. + + Args: + inputfile (str): Name of the input file to open. + modelrun (int): Current model run number. + numbermodelruns (int): Total number of model runs. + processedlines (list): Input commands after Python processing. + """ + + if numbermodelruns == 1: + processedfile = os.path.splitext(inputfile)[0] + '_proc.in' + else: + processedfile = os.path.splitext(inputfile)[0] + str(modelrun) + '_proc.in' + + with open(processedfile, 'w') as f: + for item in processedlines: + f.write('{}'.format(item)) + + print('Written input commands after Python processing to file: {}\n'.format(processedfile)) + + +def check_cmd_names(processedlines): + """Checks the validity of commands, i.e. are they gprMax commands, and that all essential commands are present. + + Args: + processedlines (list): Input commands after Python processing. + + Returns: + singlecmds (dict): Commands that can only occur once in the model. + multiplecmds (dict): Commands that can have multiple instances in the model. + geometry (list): Geometry commands in the model. + """ + + # Dictionaries of available commands + # Essential commands neccessary to run a gprMax model + essentialcmds = ['#domain', '#dx_dy_dz', '#time_window'] + + # Commands that there should only be one instance of in a model + singlecmds = dict.fromkeys(['#domain', '#dx_dy_dz', '#time_window', '#title', '#messages', '#num_threads', '#time_step_stability_factor', '#time_step_limit_type', '#pml_cells', '#excitation_file', '#src_steps', '#rx_steps'], 'None') + + # Commands that there can be multiple instances of in a model - these will be lists within the dictionary + multiplecmds = {key: [] for key in ['#geometry_view', '#material', '#soil_peplinski', '#add_dispersion_debye', '#add_dispersion_lorenz', '#add_dispersion_drude', '#waveform', '#voltage_source', '#hertzian_dipole', '#magnetic_dipole', '#rx', '#rx_box', '#snapshot', '#pml_cfs']} + + # Geometry object building commands that there can be multiple instances of in a model - these will be lists within the dictionary + geometrycmds = ['#edge', '#plate', '#triangle', '#box', '#sphere', '#cylinder', '#cylindrical_sector', '#fractal_box', '#add_surface_roughness', '#add_surface_water', '#add_grass'] + # List to store all geometry object commands in order from input file + geometry = [] + + # Check if command names are valid, if essential commands are present, and add command parameters to appropriate dictionary values or lists + countessentialcmds = 0 + lindex = 0 + while(lindex < len(processedlines)): + cmd = processedlines[lindex].split(':') + cmdname = cmd[0].lower() + + # Check if command name is valid + if cmdname not in essentialcmds and cmdname not in singlecmds and cmdname not in multiplecmds and cmdname not in geometrycmds: + raise CmdInputError('Your input file contains the invalid command: ' + cmdname) + + # Count essential commands + if cmdname in essentialcmds: + countessentialcmds += 1 + + # Assign command parameters as values to dictionary keys + if cmdname in singlecmds: + if singlecmds[cmdname] == 'None': + singlecmds[cmdname] = cmd[1].strip(' \t\n') + else: + raise CmdInputError('You can only have one ' + cmdname + ' commmand in your model') + + elif cmdname in multiplecmds: + multiplecmds[cmdname].append(cmd[1].strip(' \t\n')) + + elif cmdname in geometrycmds: + geometry.append(processedlines[lindex].strip(' \t\n')) + + lindex += 1 + + if (countessentialcmds < len(essentialcmds)): + raise CmdInputError('Your input file is missing essential gprMax commands required to run a model. Essential commands are: ' + ', '.join(essentialcmds)) + + return singlecmds, multiplecmds, geometry + diff --git a/gprMax/input_cmds_geometry.py b/gprMax/input_cmds_geometry.py new file mode 100644 index 00000000..6599925d --- /dev/null +++ b/gprMax/input_cmds_geometry.py @@ -0,0 +1,1438 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys +import numpy as np + +from .constants import floattype +from .exceptions import CmdInputError +from .fractals import FractalSurface, FractalVolume, Grass +from .geometry_primitives import build_edge_x, build_edge_y, build_edge_z, build_face_yz, build_face_xz, build_face_xy, build_triangle, build_voxel, build_box, build_cylinder, build_cylindrical_sector, build_sphere +from .materials import Material +from .utilities import rvalue + + +def process_geometrycmds(geometry, G): + """This function checks the validity of command parameters, creates instances of classes of parameters, and calls functions to directly set arrays solid, rigid and ID. + + Args: + geometry (list): Geometry commands in the model + + """ + + for x, object in enumerate(geometry): + tmp = object.split() + + if tmp[0] == '#edge:': + if len(tmp) != 8: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires exactly seven parameters') + + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs > xf or ys > yf or zs > zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + + material = next((x for x in G.materials if x.ID == tmp[7]), None) + + if not material: + raise CmdInputError('Material with ID {} does not exist'.format(tmp[7])) + + # Check for valid orientations + # x-orientated wire + if xs != xf: + if ys != yf or zs != zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the edge is not specified correctly') + else: + for i in range(xs, xf): + build_edge_x(i, ys, zs, material.numID, G.rigidE, G.rigidH, G.ID) + + # y-orientated wire + elif ys != yf: + if xs != xf or zs != zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the edge is not specified correctly') + else: + for j in range(ys, yf): + build_edge_y(xs, j, zs, material.numID, G.rigidE, G.rigidH, G.ID) + + # z-orientated wire + elif zs != zf: + if xs != xf or ys != yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the edge is not specified correctly') + else: + for k in range(zs, zf): + build_edge_z(xs, ys, k, material.numID, G.rigidE, G.rigidH, G.ID) + + if G.messages: + print('Edge from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m of material {} created.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, tmp[7])) + + + elif tmp[0] == '#plate:': + if len(tmp) < 8: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least seven parameters') + + # Isotropic case + elif len(tmp) == 8: + materialsrequested = [tmp[7]] + + # Anisotropic case + elif len(tmp) == 9: + materialsrequested = [tmp[7:]] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs > xf or ys > yf or zs > zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + + # Check for valid orientations + if xs == xf: + if ys == yf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the plate is not specified correctly') + + elif ys == yf: + if xs == xf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the plate is not specified correctly') + + elif zs == zf: + if xs == xf or ys == yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the plate is not specified correctly') + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the plate is not specified correctly') + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + # yz-plane plate + if xs == xf: + # Isotropic case + if len(materials) == 1: + numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 2: + numIDy = materials[0].numID + numIDz = materials[1].numID + + for j in range(ys, yf): + for k in range(zs, zf): + build_face_yz(xs, j, k, numIDy, numIDz, G.rigidE, G.rigidH, G.ID) + + # xz-plane plate + elif ys == yf: + # Isotropic case + if len(materials) == 1: + numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 2: + numIDx = materials[0].numID + numIDz = materials[1].numID + + for i in range(xs, xf): + for k in range(zs, zf): + build_face_xz(i, ys, k, numIDx, numIDz, G.rigidE, G.rigidH, G.ID) + + # xy-plane plate + elif zs == zf: + # Isotropic case + if len(materials) == 1: + numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 2: + numIDx = materials[0].numID + numIDy = materials[1].numID + + for i in range(xs, xf): + for j in range(ys, yf): + build_face_xy(i, j, zs, numIDx, numIDy, G.rigidE, G.rigidH, G.ID) + + if G.messages: + print('Plate from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m of material(s) {} created.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, ', '.join(materialsrequested))) + + + elif tmp[0] == '#triangle:': + if len(tmp) < 12: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least eleven parameters') + + # Isotropic case with no user specified averaging + elif len(tmp) == 12: + materialsrequested = [tmp[11]] + averagetriangularprism = G.averagevolumeobjects + + # Isotropic case with user specified averaging + elif len(tmp) == 13: + materialsrequested = [tmp[11]] + if tmp[12].lower() == 'y': + averagetriangularprism = True + elif tmp[12].lower() == 'n': + averagetriangularprism = False + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires averaging to be either y or n') + + # Uniaxial anisotropic case + elif len(tmp) == 14: + materialsrequested = tmp[11:] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + x1 = rvalue(float(tmp[1])/G.dx) * G.dx + y1 = rvalue(float(tmp[2])/G.dy) * G.dy + z1 = rvalue(float(tmp[3])/G.dz) * G.dz + x2 = rvalue(float(tmp[4])/G.dx) * G.dx + y2 = rvalue(float(tmp[5])/G.dy) * G.dy + z2 = rvalue(float(tmp[6])/G.dz) * G.dz + x3 = rvalue(float(tmp[7])/G.dx) * G.dx + y3 = rvalue(float(tmp[8])/G.dy) * G.dy + z3 = rvalue(float(tmp[9])/G.dz) * G.dz + thickness = float(tmp[10]) + + if x1 < 0 or x2 < 0 or x3 < 0 or x1 > G.nx or x2 > G.nx or x3 > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the one of the x-coordinates is not within the model domain') + if y1 < 0 or y2 < 0 or y3 < 0 or y1 > G.ny or y2 > G.ny or y3 > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the one of the y-coordinates is not within the model domain') + if z1 < 0 or z2 < 0 or z3 < 0 or z1 > G.nz or z2 > G.nz or z3 > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the one of the z-coordinates is not within the model domain') + if thickness < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for thickness') + + # Check for valid orientations + # yz-plane triangle + if x1 == x2 and x2 == x3: + normal = 'x' + if thickness > 0: + thickness = rvalue(thickness/G.dx) + + # xz-plane triangle + elif y1 == y2 and y2 == y3: + normal = 'y' + if thickness > 0: + thickness = rvalue(thickness/G.dy) + + # xy-plane triangle + elif z1 == z2 and z2 == z3: + normal = 'z' + if thickness > 0: + thickness = rvalue(thickness/G.dz) + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the triangle is not specified correctly') + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + if thickness > 0: + # Isotropic case + if len(materials) == 1: + averaging = materials[0].average and averagetriangularprism + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + averaging = False + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + requiredID = materials[0].ID + '|' + materials[1].ID + '|' + materials[2].ID + averagedmaterial = [x for x in G.materials if x.ID == requiredID] + if averagedmaterial: + numID = averagedmaterial.numID + else: + numID = len(G.materials) + m = Material(numID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((materials[0].er, materials[1].er, materials[2].er), axis=0) + m.se = np.mean((materials[0].se, materials[1].se, materials[2].se), axis=0) + m.mr = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + m.sm = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + else: + averaging = False + # Isotropic case + if len(materials) == 1: + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + # numID requires a value but it will not be used + numID = None + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + + build_triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3, normal, thickness, G.dx, G.dy, G.dz, numID, numIDx, numIDy, numIDz, averaging, G.solid, G.rigidE, G.rigidH, G.ID) + + if G.messages: + if thickness > 0: + if averaging: + dielectricsmoothing = 'on' + else: + dielectricsmoothing = 'off' + print('Triangle with coordinates {:.3f}m {:.3f}m {:.3f}m, {:.3f}m {:.3f}m {:.3f}m, {:.3f}m {:.3f}m {:.3f}m and thickness {:.3f}m of material(s) {} created, dielectric smoothing is {}.'.format(x1, y1, z1, x2, y2, z2, x3, y3, z3, thickness, ', '.join(materialsrequested), dielectricsmoothing)) + else: + print('Triangle with coordinates {:.3f}m {:.3f}m {:.3f}m, {:.3f}m {:.3f}m {:.3f}m, {:.3f}m {:.3f}m {:.3f}m of material(s) {} created.'.format(x1, y1, z1, x2, y2, z2, x3, y3, z3, ', '.join(materialsrequested))) + + + elif tmp[0] == '#box:': + if len(tmp) < 8: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least seven parameters') + + # Isotropic case with no user specified averaging + elif len(tmp) == 8: + materialsrequested = [tmp[7]] + averagebox = G.averagevolumeobjects + + # Isotropic case with user specified averaging + elif len(tmp) == 9: + materialsrequested = [tmp[7]] + if tmp[8].lower() == 'y': + averagebox = True + elif tmp[8].lower() == 'n': + averagebox = False + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires averaging to be either y or n') + + # Uniaxial anisotropic case + elif len(tmp) == 10: + materialsrequested = tmp[7:] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs >= xf or ys >= yf or zs >= zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates {} {} {} {} {} {}'.format(xs, xf, ys, yf, zs, zf)) + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + # Isotropic case + if len(materials) == 1: + averaging = materials[0].average and averagebox + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + averaging = False + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + requiredID = materials[0].ID + '|' + materials[1].ID + '|' + materials[2].ID + averagedmaterial = [x for x in G.materials if x.ID == requiredID] + if averagedmaterial: + numID = averagedmaterial.numID + else: + numID = len(G.materials) + m = Material(numID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((materials[0].er, materials[1].er, materials[2].er), axis=0) + m.se = np.mean((materials[0].se, materials[1].se, materials[2].se), axis=0) + m.mr = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + m.sm = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + + build_box(xs, xf, ys, yf, zs, zf, numID, numIDx, numIDy, numIDz, averaging, G.solid, G.rigidE, G.rigidH, G.ID) + + if G.messages: + if averaging: + dielectricsmoothing = 'on' + else: + dielectricsmoothing = 'off' + print('Box from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m of material(s) {} created, dielectric smoothing is {}.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, ', '.join(materialsrequested), dielectricsmoothing)) + + + elif tmp[0] == '#cylinder:': + if len(tmp) < 9: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least eight parameters') + + # Isotropic case with no user specified averaging + elif len(tmp) == 9: + materialsrequested = [tmp[8]] + averagecylinder = G.averagevolumeobjects + + # Isotropic case with user specified averaging + elif len(tmp) == 10: + materialsrequested = [tmp[8]] + if tmp[9].lower() == 'y': + averagecylinder = True + elif tmp[9].lower() == 'n': + averagecylinder = False + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires averaging to be either y or n') + + # Uniaxial anisotropic case + elif len(tmp) == 11: + materialsrequested = tmp[8:] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + x1 = rvalue(float(tmp[1])/G.dx) * G.dx + y1 = rvalue(float(tmp[2])/G.dy) * G.dy + z1 = rvalue(float(tmp[3])/G.dz) * G.dz + x2 = rvalue(float(tmp[4])/G.dx) * G.dx + y2 = rvalue(float(tmp[5])/G.dy) * G.dy + z2 = rvalue(float(tmp[6])/G.dz) * G.dz + r = float(tmp[7]) + + if r <= 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the radius {:.3f} should be a positive value.'.format(r)) + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + # Isotropic case + if len(materials) == 1: + averaging = materials[0].average and averagecylinder + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + averaging = False + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + requiredID = materials[0].ID + '|' + materials[1].ID + '|' + materials[2].ID + averagedmaterial = [x for x in G.materials if x.ID == requiredID] + if averagedmaterial: + numID = averagedmaterial.numID + else: + numID = len(G.materials) + m = Material(numID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((materials[0].er, materials[1].er, materials[2].er), axis=0) + m.se = np.mean((materials[0].se, materials[1].se, materials[2].se), axis=0) + m.mr = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + m.sm = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + + build_cylinder(x1, y1, z1, x2, y2, z2, r, G.dx, G.dy, G.dz, numID, numIDx, numIDy, numIDz, averaging, G.solid, G.rigidE, G.rigidH, G.ID) + + if G.messages: + if averaging: + dielectricsmoothing = 'on' + else: + dielectricsmoothing = 'off' + print('Cylinder with face centres {:.3f}m, {:.3f}m, {:.3f}m and {:.3f}m, {:.3f}m, {:.3f}m, with radius {:.3f}m, of material(s) {} created, dielectric smoothing is {}.'.format(x1, y1, z1, x2, y2, z2, r, ', '.join(materialsrequested), dielectricsmoothing)) + + + elif tmp[0] == '#cylindrical_sector:': + if len(tmp) < 10: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least nine parameters') + + # Isotropic case with no user specified averaging + elif len(tmp) == 10: + materialsrequested = [tmp[9]] + averagecylindricalsector = G.averagevolumeobjects + + # Isotropic case with user specified averaging + elif len(tmp) == 11: + materialsrequested = [tmp[9]] + if tmp[10].lower() == 'y': + averagecylindricalsector = True + elif tmp[10].lower() == 'n': + averagecylindricalsector = False + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires averaging to be either y or n') + + # Uniaxial anisotropic case + elif len(tmp) == 12: + materialsrequested = tmp[9:] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + normal = tmp[1].lower() + ctr1 = float(tmp[2]) + ctr2 = float(tmp[3]) + extent1 = float(tmp[4]) + extent2 = float(tmp[5]) + thickness = extent2 - extent1 + r = float(tmp[6]) + sectorstartangle = 2*np.pi*(float(tmp[7])/360) + sectorangle = 2*np.pi*(float(tmp[8])/360) + + if normal != 'x' and normal != 'y' and normal != 'z': + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the normal direction must be either x, y or z.') + if ctr1 < 0 or ctr1 > G.nx or ctr1 > G.ny or ctr1 > G.nz or ctr2 < 0 or ctr2 > G.nx or ctr2 > G.ny or ctr2 > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the coordinates of the centre of the circle are not within the model domain.') + if r <= 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the radius {:.3f} should be a positive value.'.format(r)) + if sectorstartangle >= 2 * np.pi or sectorangle >= 2 * np.pi: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the starting angle and sector angle must be less than 360 degrees.') + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + if thickness > 0: + # Isotropic case + if len(materials) == 1: + averaging = materials[0].average and averagecylindricalsector + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + averaging = False + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + requiredID = materials[0].ID + '|' + materials[1].ID + '|' + materials[2].ID + averagedmaterial = [x for x in G.materials if x.ID == requiredID] + if averagedmaterial: + numID = averagedmaterial.numID + else: + numID = len(G.materials) + m = Material(numID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((materials[0].er, materials[1].er, materials[2].er), axis=0) + m.se = np.mean((materials[0].se, materials[1].se, materials[2].se), axis=0) + m.mr = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + m.sm = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + else: + averaging = False + # Isotropic case + if len(materials) == 1: + numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + # numID requires a value but it will not be used + numID = None + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + + # yz-plane cylindrical sector + if normal == 'x': + ctr1 = rvalue(ctr1/G.dy) * G.dy + ctr2 = rvalue(ctr2/G.dz) * G.dz + level = rvalue(extent1/G.dx) + if thickness > 0: + thickness = rvalue(thickness/G.dx) + + # xz-plane cylindrical sector + elif normal == 'y': + ctr1 = rvalue(ctr1/G.dx) * G.dx + ctr2 = rvalue(ctr2/G.dz) * G.dz + level = rvalue(extent1/G.dy) + if thickness > 0: + thickness = rvalue(thickness/G.dy) + + # xy-plane cylindrical sector + elif normal == 'z': + ctr1 = rvalue(ctr1/G.dx) * G.dx + ctr2 = rvalue(ctr2/G.dy) * G.dy + level = rvalue(extent1/G.dz) + if thickness > 0: + thickness = rvalue(thickness/G.dz) + + build_cylindrical_sector(ctr1, ctr2, level, sectorstartangle, sectorangle, r, normal, thickness, G.dx, G.dy, G.dz, numID, numIDx, numIDy, numIDz, averaging, G.solid, G.rigidE, G.rigidH, G.ID) + + if G.messages: + if thickness > 0: + if averaging: + dielectricsmoothing = 'on' + else: + dielectricsmoothing = 'off' + print('Cylindrical sector with centre {:.3f}m, {:.3f}m, radius {:.3f}m, starting angle {:.1f} degrees, sector angle {:.1f} degrees, thickness {:.3f}m, of material(s) {} created, dielectric smoothing is {}.'.format(ctr1, ctr2, r, (sectorstartangle/(2*np.pi))*360, (sectorangle/(2*np.pi))*360, extent2 - extent1, ', '.join(materialsrequested), dielectricsmoothing)) + else: + print('Cylindrical sector with centre {:.3f}m, {:.3f}m, radius {:.3f}m, starting angle {:.1f} degrees, sector angle {:.1f} degrees, of material(s) {} created.'.format(ctr1, ctr2, r, (sectorstartangle/(2*np.pi))*360, (sectorangle/(2*np.pi))*360, ', '.join(materialsrequested))) + + + elif tmp[0] == '#sphere:': + if len(tmp) < 6: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least five parameters') + + # Isotropic case with no user specified averaging + elif len(tmp) == 6: + materialsrequested = [tmp[5]] + averagesphere = G.averagevolumeobjects + + # Isotropic case with user specified averaging + elif len(tmp) == 7: + materialsrequested = [tmp[5]] + if tmp[6].lower() == 'y': + averagesphere = True + elif tmp[6].lower() == 'n': + averagesphere = False + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires averaging to be either y or n') + + # Uniaxial anisotropic case + elif len(tmp) == 8: + materialsrequested = tmp[5:] + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + # Centre of sphere + xc = rvalue(float(tmp[1])/G.dx) + yc = rvalue(float(tmp[2])/G.dy) + zc = rvalue(float(tmp[3])/G.dz) + r = float(tmp[4]) + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + # Isotropic case + if len(materials) == 1: + averaging = materials[0].average and averagesphere + numID = numIDx = numIDy = numIDz = materials[0].numID + + # Uniaxial anisotropic case + elif len(materials) == 3: + averaging = False + numIDx = materials[0].numID + numIDy = materials[1].numID + numIDz = materials[2].numID + requiredID = materials[0].ID + '|' + materials[1].ID + '|' + materials[2].ID + averagedmaterial = [x for x in G.materials if x.ID == requiredID] + if averagedmaterial: + numID = averagedmaterial.numID + else: + numID = len(G.materials) + m = Material(numID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((materials[0].er, materials[1].er, materials[2].er), axis=0) + m.se = np.mean((materials[0].se, materials[1].se, materials[2].se), axis=0) + m.mr = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + m.sm = np.mean((materials[0].mr, materials[1].mr, materials[2].mr), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + + build_sphere(xc, yc, zc, r, G.dx, G.dy, G.dz, numID, numIDx, numIDy, numIDz, averaging, G.solid, G.rigidE, G.rigidH, G.ID) + + if G.messages: + if averaging: + dielectricsmoothing = 'on' + else: + dielectricsmoothing = 'off' + print('Sphere with centre {:.3f}m, {:.3f}m, {:.3f}m, radius {:.3f}m, of material(s) {} created, dielectric smoothing is {}.'.format(xc * G.dx, yc * G.dy, zc * G.dz, r, ', '.join(materialsrequested), dielectricsmoothing)) + + + elif tmp[0] == '#fractal_box:': + if len(tmp) < 14: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least thirteen parameters') + elif len(tmp) == 14: + seed = None + elif len(tmp) == 15: + seed = int(tmp[14]) + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs >= xf or ys >= yf or zs >= zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if float(tmp[7]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal dimension') + if float(tmp[8]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal weighting in the x direction') + if float(tmp[9]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal weighting in the y direction') + if float(tmp[10]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal weighting in the z direction') + if rvalue(tmp[11]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the number of bins') + + # Find materials to use to build fractal volume, either from mixing models or normal materials + mixingmodel = next((x for x in G.mixingmodels if x.ID == tmp[12]), None) + material = next((x for x in G.materials if x.ID == tmp[12]), None) + nbins = rvalue(tmp[11]) + + if mixingmodel: + if nbins == 1: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must be used with more than one material from the mixing model.') + # Create materials from mixing model as number of bins now known from fractal_box command + mixingmodel.calculate_debye_properties(nbins, G) + elif not material: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' mixing model or material with ID {} does not exist'.format(tmp[12])) + + volume = FractalVolume(xs, xf, ys, yf, zs, zf, float(tmp[7])) + volume.ID = tmp[13] + volume.operatingonID = tmp[12] + volume.nbins = nbins + volume.seed = seed + volume.weighting = (float(tmp[8]), float(tmp[9]), float(tmp[10])) + + if G.messages: + print('Fractal box {} from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m with {}, fractal dimension {}, fractal weightings {}, {}, {}, fractal seeding {} and with {} values created.'.format(volume.ID, xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, volume.operatingonID, volume.dimension, volume.weighting[0], volume.weighting[1], volume.weighting[2], volume.seed, volume.nbins)) + + G.fractalvolumes.append(volume) + + # Search and process any modifiers for the fractal box + for object in geometry: + tmp = object.split() + + if tmp[0] == '#add_surface_roughness:': + if len(tmp) < 13: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least twelve parameters') + elif len(tmp) == 13: + seed = None + elif len(tmp) == 14: + seed = int(tmp[13]) + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + # Only process rough surfaces for this fractal volume + if tmp[12] == volume.ID: + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs > xf or ys > yf or zs > zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if float(tmp[7]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal dimension') + if float(tmp[8]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal weighting in the first direction of the surface') + if float(tmp[9]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal weighting in the second direction of the surface') + + # Check for valid orientations + if xs == xf: + if ys == yf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if xs != volume.xs and xs != volume.xf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + fractalrange = (rvalue(float(tmp[10]) / G.dx), rvalue(float(tmp[11]) / G.dx)) + # xminus surface + if xs == volume.xs: + if fractalrange[0] < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the x direction') + requestedsurface = 'xminus' + # xplus surface + elif xf == volume.xf: + if fractalrange[1] > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the x direction') + requestedsurface = 'xplus' + + elif ys == yf: + if xs == xf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if ys != volume.ys and ys != volume.yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + fractalrange = (rvalue(float(tmp[10]) / G.dy), rvalue(float(tmp[11]) / G.dy)) + # yminus surface + if ys == volume.ys: + if fractalrange[0] < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the y direction') + requestedsurface = 'yminus' + # yplus surface + elif yf == volume.yf: + if fractalrange[1] > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the y direction') + requestedsurface = 'yplus' + + elif zs == zf: + if xs == xf or ys == yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if zs != volume.zs and zs != volume.zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + fractalrange = (rvalue(float(tmp[10]) / G.dz), rvalue(float(tmp[11]) / G.dz)) + # zminus surface + if zs == volume.zs: + if fractalrange[0] < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the z direction') + requestedsurface = 'zminus' + # zplus surface + elif zf == volume.zf: + if fractalrange[1] > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply fractal surface to fractal box as it would exceed the domain size in the z direction') + requestedsurface = 'zplus' + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + + surface = FractalSurface(xs, xf, ys, yf, zs, zf, float(tmp[7])) + surface.surfaceID = requestedsurface + surface.fractalrange = fractalrange + surface.operatingonID = volume.ID + surface.seed = seed + surface.weighting = (float(tmp[8]), float(tmp[9])) + + # List of existing surfaces IDs + existingsurfaceIDs = [x.surfaceID for x in volume.fractalsurfaces] + if surface.surfaceID in existingsurfaceIDs: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' has already been used on the {} surface'.format(surface.surfaceID)) + + surface.generate_fractal_surface(G) + volume.fractalsurfaces.append(surface) + + if G.messages: + print('Fractal surface from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m with fractal dimension {}, fractal weightings {}, {}, fractal seeding {}, and range {:.3f}m to {:.3f}m, added to {}.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, surface.dimension, surface.weighting[0], surface.weighting[1], surface.seed, float(tmp[10]), float(tmp[11]), surface.operatingonID)) + + if tmp[0] == '#add_surface_water:': + if len(tmp) != 9: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires exactly eight parameters') + + # Only process surfaces for this fractal volume + if tmp[8] == volume.ID: + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + depth = float(tmp[7]) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs > xf or ys > yf or zs > zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if depth <= 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the depth of water') + + # Check for valid orientations + if xs == xf: + if ys == yf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if xs != volume.xs and xs != volume.xf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + # xminus surface + if xs == volume.xs: + requestedsurface = 'xminus' + # xplus surface + elif xf == volume.xf: + requestedsurface = 'xplus' + filldepthcells = rvalue(depth / G.dx) + filldepth = filldepthcells * G.dx + + elif ys == yf: + if xs == xf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if ys != volume.ys and ys != volume.yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + # yminus surface + if ys == volume.ys: + requestedsurface = 'yminus' + # yplus surface + elif yf == volume.yf: + requestedsurface = 'yplus' + filldepthcells = rvalue(depth / G.dy) + filldepth = filldepthcells * G.dy + + elif zs == zf: + if xs == xf or ys == yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if zs != volume.zs and zs != volume.zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' can only be used on the external surfaces of a fractal box') + # zminus surface + if zs == volume.zs: + requestedsurface = 'zminus' + # zplus surface + elif zf == volume.zf: + requestedsurface = 'zplus' + filldepthcells = rvalue(depth / G.dz) + filldepth = filldepthcells * G.dz + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + + surface = next((x for x in volume.fractalsurfaces if x.surfaceID == requestedsurface), None) + if not surface: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' specified surface {} does not have a rough surface applied'.format(requestedsurface)) + + surface.filldepth = filldepthcells + + # Check that requested fill depth falls within range of surface roughness + if surface.filldepth < surface.fractalrange[0] or surface.filldepth > surface.fractalrange[1]: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a value for the depth of water that lies with the range of the requested surface roughness') + + # Check to see if water has been already defined as a material + if not any(x.ID == 'water' for x in G.materials): + m = Material(len(G.materials), 'water', G) + m.average = False + m.er = Material.watereri + m.deltaer.append(Material.waterdeltaer) + m.tau.append(Material.watertau) + G.materials.append(m) + if Material.maxpoles == 0: + Material.maxpoles = 1 + + # Check if time step for model is suitable for using water + water = next((x for x in G.materials if x.ID == 'water')) + testwater = next((x for x in water.tau if x < G.dt), None) + if testwater: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires the time step for the model to be less than the relaxation time required to model water.') + + if G.messages: + print('Water on surface from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m with depth {:.3f}m, added to {}.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, filldepth, surface.operatingonID)) + + + if tmp[0] == '#add_grass:': + if len(tmp) < 12: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires at least eleven parameters') + elif len(tmp) == 12: + seed = None + elif len(tmp) == 13: + seed = int(tmp[12]) + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' too many parameters have been given') + + # Only process grass for this fractal volume + if tmp[11] == volume.ID: + xs = rvalue(float(tmp[1])/G.dx) + xf = rvalue(float(tmp[4])/G.dx) + ys = rvalue(float(tmp[2])/G.dy) + yf = rvalue(float(tmp[5])/G.dy) + zs = rvalue(float(tmp[3])/G.dz) + zf = rvalue(float(tmp[6])/G.dz) + numblades = int(tmp[10]) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs > xf or ys > yf or zs > zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if float(tmp[7]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the fractal dimension') + if float(tmp[8]) < 0 or float(tmp[9]) < 0: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires a positive value for the minimum and maximum heights for grass blades') + + # Check for valid orientations + if xs == xf: + if ys == yf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if xs != volume.xs and xs != volume.xf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must specify external surfaces on a fractal box') + fractalrange = (rvalue(float(tmp[8]) / G.dx), rvalue(float(tmp[9]) / G.dx)) + # xminus surface + if xs == volume.xs: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' grass can only be specified on surfaces in the positive axis direction') + # xplus surface + elif xf == volume.xf: + if fractalrange[1] > G.nx: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply grass to fractal box as it would exceed the domain size in the x direction') + requestedsurface = 'xplus' + + elif ys == yf: + if xs == xf or zs == zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if ys != volume.ys and ys != volume.yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must specify external surfaces on a fractal box') + fractalrange = (rvalue(float(tmp[8]) / G.dy), rvalue(float(tmp[9]) / G.dy)) + # yminus surface + if ys == volume.ys: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' grass can only be specified on surfaces in the positive axis direction') + # yplus surface + elif yf == volume.yf: + if fractalrange[1] > G.ny: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply grass to fractal box as it would exceed the domain size in the y direction') + requestedsurface = 'yplus' + + elif zs == zf: + if xs == xf or ys == yf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + if zs != volume.zs and zs != volume.zf: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' must specify external surfaces on a fractal box') + fractalrange = (rvalue(float(tmp[8]) / G.dz), rvalue(float(tmp[9]) / G.dz)) + # zminus surface + if zs == volume.zs: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' grass can only be specified on surfaces in the positive axis direction') + # zplus surface + elif zf == volume.zf: + if fractalrange[1] > G.nz: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' cannot apply grass to fractal box as it would exceed the domain size in the z direction') + requestedsurface = 'zplus' + + else: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' dimensions are not specified correctly') + + surface = FractalSurface(xs, xf, ys, yf, zs, zf, float(tmp[7])) + surface.ID = 'grass' + surface.surfaceID = requestedsurface + surface.seed = seed + + # Set the fractal range to scale the fractal distribution between zero and one + surface.fractalrange = (0, 1) + surface.operatingonID = volume.ID + surface.generate_fractal_surface(G) + if numblades > surface.fractalsurface.shape[0] * surface.fractalsurface.shape[1]: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' the specified surface is not large enough for the number of grass blades/roots specified') + + # Scale the distribution so that the summation is equal to one, i.e. a probability distribution + surface.fractalsurface = surface.fractalsurface / np.sum(surface.fractalsurface) + + # Set location of grass blades using probability distribution + # Create 1D vector of probability values from the 2D surface + probability1D = np.cumsum(np.ravel(surface.fractalsurface)) + + # Create random numbers between zero and one for the number of blades of grass + R = np.random.RandomState(surface.seed) + A = R.random_sample(numblades) + + # Locate the random numbers in the bins created by the 1D vector of probability values, and convert the 1D index back into a x, y index for the original surface. + bladesindex = np.unravel_index(np.digitize(A, probability1D), (surface.fractalsurface.shape[0], surface.fractalsurface.shape[1])) + + # Set the fractal range to minimum and maximum heights of the grass blades + surface.fractalrange = fractalrange + + # Set the fractal surface using the pre-calculated spatial distribution and a random height + surface.fractalsurface = np.zeros((surface.fractalsurface.shape[0], surface.fractalsurface.shape[1])) + for i in range(len(bladesindex[0])): + surface.fractalsurface[bladesindex[0][i], bladesindex[1][i]] = R.randint(surface.fractalrange[0], surface.fractalrange[1], size=1) + + # Create grass geometry parameters + g = Grass(numblades) + g.seed = surface.seed + surface.grass.append(g) + + # Check to see if grass has been already defined as a material + if not any(x.ID == 'grass' for x in G.materials): + m = Material(len(G.materials), 'grass', G) + m.average = False + m.er = Material.grasseri + m.deltaer.append(Material.grassdeltaer) + m.tau.append(Material.grasstau) + G.materials.append(m) + if Material.maxpoles == 0: + Material.maxpoles = 1 + + # Check if time step for model is suitable for using grass + grass = next((x for x in G.materials if x.ID == 'grass')) + testgrass = next((x for x in grass.tau if x < G.dt), None) + if testgrass: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' requires the time step for the model to be less than the relaxation time required to model grass.') + + volume.fractalsurfaces.append(surface) + + if G.messages: + print('{} blades of grass on surface from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m with fractal dimension {}, fractal seeding {} and range {:.3f}m to {:.3f}m, added to {}.'.format(numblades, xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, surface.dimension, surface.seed, float(tmp[8]), float(tmp[9]), surface.operatingonID)) + + + # Process any modifications to the original fractal box then generate it + if volume.fractalsurfaces: + volume.originalxs = volume.xs + volume.originalxf = volume.xf + volume.originalys = volume.ys + volume.originalyf = volume.yf + volume.originalzs = volume.zs + volume.originalzf = volume.zf + + # Extend the volume to accomodate any rough surfaces, grass, or roots + for surface in volume.fractalsurfaces: + if surface.surfaceID == 'xminus': + if surface.fractalrange[0] < volume.xs: + volume.nx += volume.xs - surface.fractalrange[0] + volume.xs = surface.fractalrange[0] + elif surface.surfaceID == 'xplus': + if surface.fractalrange[1] > volume.xf: + volume.nx += surface.fractalrange[1] - volume.xf + volume.xf = surface.fractalrange[1] + elif surface.surfaceID == 'yminus': + if surface.fractalrange[0] < volume.ys: + volume.ny += volume.ys - surface.fractalrange[0] + volume.ys = surface.fractalrange[0] + elif surface.surfaceID == 'yplus': + if surface.fractalrange[1] > volume.yf: + volume.ny += surface.fractalrange[1] - volume.yf + volume.yf = surface.fractalrange[1] + elif surface.surfaceID == 'zminus': + if surface.fractalrange[0] < volume.zs: + volume.nz += volume.zs - surface.fractalrange[0] + volume.zs = surface.fractalrange[0] + elif surface.surfaceID == 'zplus': + if surface.fractalrange[1] > volume.zf: + volume.nz += surface.fractalrange[1] - volume.zf + volume.zf = surface.fractalrange[1] + + # If there is only 1 bin then a normal material is being used, otherwise a mixing model + if volume.nbins == 1: + volume.fractalvolume = np.ones((volume.nx + 1, volume.ny + 1, volume.nz + 1), dtype=floattype) + materialnumID = next(x.numID for x in G.materials if x.ID == volume.operatingonID) + volume.fractalvolume = volume.fractalvolume * materialnumID + else: + volume.generate_fractal_volume(G) + volume.fractalvolume += mixingmodel.startmaterialnum + + volume.generate_volume_mask() + + # Apply any rough surfaces and add any surface water to the 3D mask array + for surface in volume.fractalsurfaces: + if surface.surfaceID == 'xminus': + for i in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.zs, surface.zf + 1): + if i > surface.fractalsurface[j - surface.ys, k - surface.zs]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and i > surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + + elif surface.surfaceID == 'xplus': + if not surface.ID: + for i in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.zs, surface.zf + 1): + if i < surface.fractalsurface[j - surface.ys, k - surface.zs]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and i < surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + elif surface.ID == 'grass': + g = surface.grass[0] + # Build the blades of the grass + blade = 0 + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.zs, surface.zf + 1): + if surface.fractalsurface[j - surface.ys, k - surface.zs] > 0: + height = 0 + blade += 1 + for i in range(volume.xs, surface.fractalrange[1] + 1): + if i < surface.fractalsurface[j - surface.ys, k - surface.zs] and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] != 1: + y, z = g.calculate_blade_geometry(blade - 1, height) + # Add y, z coordinates to existing location + yy = j - volume.ys + y + zz = k - volume.zs + z + # If these coordinates are outwith fractal volume stop building the blade, otherwise set the mask for grass + if yy < 0 or yy >= volume.mask.shape[1] or zz < 0 or zz >= volume.mask.shape[2]: + break + else: + volume.mask[i - volume.xs, yy, zz] = 3 + height += 1 + # Build the roots of the grass + blade = 0 + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.zs, surface.zf + 1): + if surface.fractalsurface[j - surface.ys, k - surface.zs] > 0: + depth = 0 + blade += 1 + i = volume.xf + while i > volume.xs: + if i > volume.originalxf - (surface.fractalsurface[j - surface.ys, k - surface.zs] - volume.originalxf) and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 1: + y, z = g.calculate_root_geometry(blade - 1, depth) + # Add y, z coordinates to existing location + yy = j - volume.ys + y + zz = k - volume.zs + z + # If these coordinates are outwith the fractal volume stop building the root, otherwise set the mask for grass + if yy < 0 or yy >= volume.mask.shape[1] or zz < 0 or zz >= volume.mask.shape[2]: + break + else: + volume.mask[i - volume.xs, yy, zz] = 3 + depth += 1 + i -= 1 + + elif surface.surfaceID == 'yminus': + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + for k in range(surface.zs, surface.zf + 1): + if j > surface.fractalsurface[i - surface.xs, k - surface.zs]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and j > surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + + elif surface.surfaceID == 'yplus': + if not surface.ID: + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + for k in range(surface.zs, surface.zf + 1): + if j < surface.fractalsurface[i - surface.xs, k - surface.zs]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and j < surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + elif surface.ID == 'grass': + g = surface.grass[0] + # Build the blades of the grass + blade = 0 + for i in range(surface.xs, surface.xf + 1): + for k in range(surface.zs, surface.zf + 1): + if surface.fractalsurface[i - surface.xs, k - surface.zs] > 0: + height = 0 + blade += 1 + for j in range(volume.ys, surface.fractalrange[1] + 1): + if j < surface.fractalsurface[i - surface.xs, k - surface.zs] and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] != 1: + x, z = g.calculate_blade_geometry(blade - 1, height) + # Add x, z coordinates to existing location + xx = i - volume.xs + x + zz = k - volume.zs + z + # If these coordinates are outwith fractal volume stop building the blade, otherwise set the mask for grass + if xx < 0 or xx >= volume.mask.shape[0] or zz < 0 or zz >= volume.mask.shape[2]: + break + else: + volume.mask[xx, j - volume.ys, zz] = 3 + height += 1 + # Build the roots of the grass + blade = 0 + for i in range(surface.xs, surface.xf + 1): + for k in range(surface.zs, surface.zf + 1): + if surface.fractalsurface[i - surface.xs, k - surface.zs] > 0: + depth = 0 + blade += 1 + j = volume.yf + while j > volume.ys: + if j > volume.originalyf - (surface.fractalsurface[i - surface.xs, k - surface.zs] - volume.originalyf) and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 1: + x, z = g.calculate_root_geometry(blade - 1, depth) + # Add x, z coordinates to existing location + xx = i - volume.xs + x + zz = k - volume.zs + z + # If these coordinates are outwith the fractal volume stop building the root, otherwise set the mask for grass + if xx < 0 or xx >= volume.mask.shape[0] or zz < 0 or zz >= volume.mask.shape[2]: + break + else: + volume.mask[xx, j - volume.ys, zz] = 3 + depth += 1 + j -= 1 + + elif surface.surfaceID == 'zminus': + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + if k > surface.fractalsurface[i - surface.xs, j - surface.ys]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and k > surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + + elif surface.surfaceID == 'zplus': + if not surface.ID: + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.ys, surface.yf + 1): + for k in range(surface.fractalrange[0], surface.fractalrange[1] + 1): + if k < surface.fractalsurface[i - surface.xs, j - surface.ys]: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 1 + elif surface.filldepth > 0 and k < surface.filldepth: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 2 + else: + volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] = 0 + elif surface.ID == 'grass': + g = surface.grass[0] + # Build the blades of the grass + blade = 0 + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.ys, surface.yf + 1): + if surface.fractalsurface[i - surface.xs, j - surface.ys] > 0: + height = 0 + blade += 1 + for k in range(volume.zs, surface.fractalrange[1] + 1): + if k < surface.fractalsurface[i - surface.xs, j - surface.ys] and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] != 1: + x, y = g.calculate_blade_geometry(blade - 1, height) + # Add x, y coordinates to existing location + xx = i - volume.xs + x + yy = j - volume.ys + y + # If these coordinates are outwith the fractal volume stop building the blade, otherwise set the mask for grass + if xx < 0 or xx >= volume.mask.shape[0] or yy < 0 or yy >= volume.mask.shape[1]: + break + else: + volume.mask[xx, yy, k - volume.zs] = 3 + height += 1 + # Build the roots of the grass + blade = 0 + for i in range(surface.xs, surface.xf + 1): + for j in range(surface.ys, surface.yf + 1): + if surface.fractalsurface[i - surface.xs, j - surface.ys] > 0: + depth = 0 + blade += 1 + k = volume.zf + while k > volume.zs: + if k > volume.originalzf - (surface.fractalsurface[i - surface.xs, j - surface.ys] - volume.originalzf) and volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 1: + x, y = g.calculate_root_geometry(blade - 1, depth) + # Add x, y coordinates to existing location + xx = i - volume.xs + x + yy = j - volume.ys + y + # If these coordinates are outwith the fractal volume stop building the root, otherwise set the mask for grass + if xx < 0 or xx >= volume.mask.shape[0] or yy < 0 or yy >= volume.mask.shape[1]: + break + else: + volume.mask[xx, yy, k - volume.zs] = 3 + depth += 1 + k -= 1 + + + # Build voxels from any true values of the 3D mask array + for i in range(volume.xs, volume.xf + 1): + for j in range(volume.ys, volume.yf + 1): + for k in range(volume.zs, volume.zf + 1): + if volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 1: + numID = numIDx = numIDy = numIDz = volume.fractalvolume[i - volume.xs, j - volume.ys, k - volume.zs] + elif volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 2: + waternumID = next(x.numID for x in G.materials if x.ID == 'water') + numID = numIDx = numIDy = numIDz = waternumID + elif volume.mask[i - volume.xs, j - volume.ys, k - volume.zs] == 3: + grassnumID = next(x.numID for x in G.materials if x.ID == 'grass') + numID = numIDx = numIDy = numIDz = grassnumID + build_voxel(i, j, k, numID, numIDx, numIDy, numIDz, False, G.solid, G.rigidE, G.rigidH, G.ID) + + else: + if volume.nbins == 1: + raise CmdInputError("'" + ' '.join(tmp) + "'" + ' is being used with a single material and no modifications, therefore please use a #box command instead.') + else: + volume.generate_fractal_volume(G) + volume.fractalvolume += mixingmodel.startmaterialnum + + for i in range(volume.xs, volume.xf + 1): + for j in range(volume.ys, volume.yf + 1): + for k in range(volume.zs, volume.zf + 1): + numID = numIDx = numIDy = numIDz = volume.fractalvolume[i - volume.xs, j - volume.ys, k - volume.zs] + build_voxel(i, j, k, numID, numIDx, numIDy, numIDz, False, G.solid, G.rigidE, G.rigidH, G.ID) + + + + + + + + diff --git a/gprMax/input_cmds_multiuse.py b/gprMax/input_cmds_multiuse.py new file mode 100644 index 00000000..487c75b1 --- /dev/null +++ b/gprMax/input_cmds_multiuse.py @@ -0,0 +1,620 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +from .exceptions import CmdInputError +from .geometry_views import GeometryView +from .materials import Material, PeplinskiSoil +from .pml import CFS +from .receivers import Rx +from .snapshots import Snapshot +from .sources import VoltageSource, HertzianDipole, MagneticDipole +from .utilities import rvalue +from .waveforms import Waveform + + +def process_multicmds(multicmds, G): + """Checks the validity of command parameters and creates instances of classes of parameters. + + Args: + multicmds (dict): Commands that can have multiple instances in the model. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # Waveform definitions + cmdname = '#waveform' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 4: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly four parameters') + if tmp[0].lower() not in Waveform.waveformtypes: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' must have one of the following types {}'.format(','.join(Waveform.waveformtypes))) + if float(tmp[2]) <= 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires an excitation frequency value of greater than zero') + if any(x.ID == tmp[3] for x in G.waveforms): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' with ID {} already exists'.format(tmp[2])) + + w = Waveform() + w.ID = tmp[3] + w.type = tmp[0].lower() + w.amp = float(tmp[1]) + w.freq = float(tmp[2]) + + if G.messages: + print('Waveform {} of type {} with amplitude {}, frequency {:.3e} Hz created.'.format(w.ID, w.type, w.amp, w.freq)) + + G.waveforms.append(w) + + + # Voltage source + cmdname = '#voltage_source' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) < 6: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least six parameters') + + # Check polarity & position parameters + if tmp[0].lower() not in ('x', 'y', 'z'): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' polarisation must be x, y, or z') + positionx = rvalue(float(tmp[1])/G.dx) + positiony = rvalue(float(tmp[2])/G.dy) + positionz = rvalue(float(tmp[3])/G.dz) + resistance = float(tmp[4]) + if positionx < 0 or positionx > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' x-coordinate is not within the model domain') + if positiony < 0 or positiony > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' y-coordinate is not within the model domain') + if positionz < 0 or positionz > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' z-coordinate is not within the model domain') + if resistance < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a source resistance of zero or greater') + + # Check if there is a waveformID in the waveforms list + if not any(x.ID == tmp[5] for x in G.waveforms): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' there is no waveform with the identifier {}'.format(tmp[5])) + + v = VoltageSource() + v.polarisation= tmp[0] + v.positionx = positionx + v.positiony = positiony + v.positionz = positionz + v.resistance = resistance + + if len(tmp) > 6: + # Check source start & source remove time parameters + start = float(tmp[6]) + stop = float(tmp[7]) + if start < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' delay of the initiation of the source should not be less than zero') + if stop < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' time to remove the source should not be less than zero') + if stop - start <= 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' duration of the source should not be zero or less') + v.start = start + if stop > G.timewindow: + v.stop = G.timewindow + v.waveformID = tmp[8] + tmp = ' start time {:.3e} secs, finish time {:.3e} secs '.format(v.start, v.stop) + else: + v.start = 0 + v.stop = G.timewindow + v.waveformID = tmp[5] + tmp = ' ' + + if G.messages: + print('Voltage source with polarity {} at {:.3f}m, {:.3f}m, {:.3f}m, resistance {:.1f} Ohms,'.format(v.polarisation, v.positionx * G.dx, v.positiony * G.dy, v.positionz * G.dz, v.resistance) + tmp + 'using waveform {} created.'.format(v.waveformID)) + + G.voltagesources.append(v) + + + # Hertzian dipole + cmdname = '#hertzian_dipole' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 5: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least five parameters') + + # Check polarity & position parameters + if tmp[0].lower() not in ('x', 'y', 'z'): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' polarisation must be x, y, or z') + positionx = rvalue(float(tmp[1])/G.dx) + positiony = rvalue(float(tmp[2])/G.dy) + positionz = rvalue(float(tmp[3])/G.dz) + if positionx < 0 or positionx > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' x-coordinate is not within the model domain') + if positiony < 0 or positiony > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' y-coordinate is not within the model domain') + if positionz < 0 or positionz > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' z-coordinate is not within the model domain') + + # Check if there is a waveformID in the waveforms list + if not any(x.ID == tmp[4] for x in G.waveforms): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' there is no waveform with the identifier {}'.format(tmp[4])) + + h = HertzianDipole() + h.polarisation = tmp[0] + h.positionx = positionx + h.positiony = positiony + h.positionz = positionz + + if len(tmp) > 6: + # Check source start & source remove time parameters + start = float(tmp[6]) + stop = float(tmp[7]) + if start < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' delay of the initiation of the source should not be less than zero') + if stop < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' time to remove the source should not be less than zero') + if stop - start <= 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' duration of the source should not be zero or less') + h.start = start + if stop > G.timewindow: + h.stop = G.timewindow + h.waveformID = tmp[7] + tmp = ' start time {:.3e} secs, finish time {:.3e} secs '.format(h.start, h.stop) + else: + h.start = 0 + h.stop = G.timewindow + h.waveformID = tmp[4] + tmp = ' ' + + if G.messages: + print('Hertzian dipole with polarity {} at {:.3f}m, {:.3f}m, {:.3f}m,'.format(h.polarisation, h.positionx * G.dx, h.positiony * G.dy, h.positionz * G.dz) + tmp + 'using waveform {} created.'.format(h.waveformID)) + + G.hertziandipoles.append(h) + + + # Magnetic dipole + cmdname = '#magnetic_dipole' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 5: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least five parameters') + + # Check polarity & position parameters + if tmp[0].lower() not in ('x', 'y', 'z'): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' polarisation must be x, y, or z') + positionx = rvalue(float(tmp[1])/G.dx) + positiony = rvalue(float(tmp[2])/G.dy) + positionz = rvalue(float(tmp[3])/G.dz) + if positionx < 0 or positionx > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' x-coordinate is not within the model domain') + if positiony < 0 or positiony > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' y-coordinate is not within the model domain') + if positionz < 0 or positionz > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' z-coordinate is not within the model domain') + + # Check if there is a waveformID in the waveforms list + if not any(x.ID == tmp[4] for x in G.waveforms): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' there is no waveform with the identifier {}'.format(tmp[4])) + + m = MagneticDipole() + m.polarisation = tmp[0] + m.positionx = positionx + m.positiony = positiony + m.positionz = positionz + + if len(tmp) > 6: + # Check source start & source remove time parameters + start = float(tmp[6]) + stop = float(tmp[7]) + if start < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' delay of the initiation of the source should not be less than zero') + if stop < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' time to remove the source should not be less than zero') + if stop - start <= 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' duration of the source should not be zero or less') + m.start = start + if stop > G.timewindow: + m.stop = G.timewindow + m.waveformID = tmp[7] + tmp = ' start time {:.3e} secs, finish time {:.3e} secs '.format(m.start, m.stop) + else: + m.start = 0 + m.stop = G.timewindow + m.waveformID = tmp[4] + tmp = ' ' + + if G.messages: + print('Magnetic dipole with polarity {} at {:.3f}m, {:.3f}m, {:.3f}m,'.format(m.polarisation, m.positionx * G.dx, m.positiony * G.dy, m.positionz * G.dz) + tmp + 'using waveform {} created.'.format(m.waveformID)) + + G.magneticdipoles.append(m) + + + # Receiver + cmdname = '#rx' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 3: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly three parameters') + + # Check position parameters + positionx = rvalue(float(tmp[0])/G.dx) + positiony = rvalue(float(tmp[1])/G.dy) + positionz = rvalue(float(tmp[2])/G.dz) + if positionx < 0 or positionx > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' x-coordinate is not within the model domain') + if positiony < 0 or positiony > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' y-coordinate is not within the model domain') + if positionz < 0 or positionz > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' z-coordinate is not within the model domain') + + r = Rx(positionx=positionx, positiony=positiony, positionz=positionz) + + if G.messages: + print('Receiver at {:.3f}m, {:.3f}m, {:.3f}m created.'.format(r.positionx * G.dx, r.positiony * G.dy, r.positionz * G.dz)) + + G.rxs.append(r) + + + # Receiver box + cmdname = '#rx_box' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 9: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly nine parameters') + + xs = rvalue(float(tmp[0])/G.dx) + xf = rvalue(float(tmp[3])/G.dx) + ys = rvalue(float(tmp[1])/G.dy) + yf = rvalue(float(tmp[4])/G.dy) + zs = rvalue(float(tmp[2])/G.dz) + zf = rvalue(float(tmp[5])/G.dz) + dx = rvalue(float(tmp[6])/G.dx) + dy = rvalue(float(tmp[7])/G.dy) + dz = rvalue(float(tmp[8])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf)) + if xs >= xf or ys >= yf or zs >= zf: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if dx < 0 or dy < 0 or dz < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than zero') + if dx < G.dx or dy < G.dy or dz < G.dz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than the spatial discretisation') + + for x in range(xs, xf, dx): + for y in range(ys, yf, dy): + for z in range(zs, zf, dz): + r = Rx(positionx=x, positiony=y, positionz=z) + G.rxs.append(r) + + if G.messages: + print('Receiver box {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m with steps {:.3f}m, {:.3f}m, {:.3f} created.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, dx * G.dx, dy * G.dy, dz * G.dz)) + + + # Snapshot + cmdname = '#snapshot' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 11: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly eleven parameters') + + xs = rvalue(float(tmp[0])/G.dx) + xf = rvalue(float(tmp[3])/G.dx) + ys = rvalue(float(tmp[1])/G.dy) + yf = rvalue(float(tmp[4])/G.dy) + zs = rvalue(float(tmp[2])/G.dz) + zf = rvalue(float(tmp[5])/G.dz) + dx = rvalue(float(tmp[6])/G.dx) + dy = rvalue(float(tmp[7])/G.dy) + dz = rvalue(float(tmp[8])/G.dz) + + # If real floating point value given + if '.' in tmp[9] or 'e' in tmp[9]: + if float(tmp[9]) > 0: + time = rvalue((float(tmp[9]) / G.dt)) + 1 + else: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' time value must be greater than zero') + # If number of iterations given + else: + time = int(tmp[9]) + + if dx < 0 or dy < 0 or dz < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than zero') + if dx < G.dx or dy < G.dy or dz < G.dz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than the spatial discretisation') + if time <= 0 or time > G.iterations: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' time value is not valid') + + s = Snapshot(xs, ys, zs, xf, yf, zf, dx, dy, dz, time, tmp[10]) + + if G.messages: + print('Snapshot from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m, discretisation {:.3f}m, {:.3f}m, {:.3f}m, at {:.3e} secs with filename {} created.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, dx * G.dx, dx * G.dy, dx * G.dz, s.time * G.dt, s.filename)) + + G.snapshots.append(s) + + + # Materials + # Create built-in materials + m = Material(0, 'pec', G) + m.average = False + G.materials.append(m) + + m = Material(1, 'free_space', G) + m.average = True + G.materials.append(m) + + cmdname = '#material' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 5: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly five parameters') + if float(tmp[0]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for static (DC) permittivity') + if float(tmp[1]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for conductivity') + if float(tmp[2]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for permeability') + if float(tmp[3]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for magnetic conductivity') + if any(x.ID == tmp[4] for x in G.materials): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' with ID {} already exists'.format(tmp[4])) + + # Create a new instance of the Material class material (start index after pec & free_space) + m = Material(len(G.materials), tmp[4], G) + m.er = float(tmp[0]) + m.se = float(tmp[1]) + m.mr = float(tmp[2]) + m.sm = float(tmp[3]) + + if G.messages: + print('Material {} with epsr={:4.2f}, sig={:.3e} S/m; mur={:4.2f}, sig*={:.3e} S/m created.'.format(m.ID, m.er, m.se, m.mr, m.sm)) + + # Append the new material object to the materials list + G.materials.append(m) + + + cmdname = '#add_dispersion_debye' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + + if len(tmp) < 4: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least four parameters') + if int(tmp[0]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for number of poles') + poles = int(tmp[0]) + materialsrequested = tmp[(2 * poles) + 1:len(tmp)] + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + for material in materials: + material.type = 'debye' + material.poles = poles + material.average = False + for pole in range(1, 2 * poles, 2): + if float(tmp[pole]) > 0 and float(tmp[pole + 1]) > G.dt: + material.deltaer.append(float(tmp[pole])) + material.tau.append(float(tmp[pole + 1])) + else: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires positive values for the permittivity difference and relaxation times, and relaxation times that are greater than the time step for the model.') + if material.poles > Material.maxpoles: + Material.maxpoles = material.poles + + if G.messages: + print('Debye-type disperion added to {} with delta_epsr={}, and tau={} secs created.'.format(material.ID, ','.join('%4.2f' % deltaer for deltaer in material.deltaer), ','.join('%4.3e' % tau for tau in material.tau))) + + cmdname = '#add_dispersion_lorenz' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + + if len(tmp) < 5: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least five parameters') + if int(tmp[0]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for number of poles') + poles = int(tmp[0]) + materialsrequested = tmp[(3 * poles) + 1:len(tmp)] + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + for material in materials: + material.type = 'lorenz' + material.poles = poles + material.average = False + for pole in range(1, 3 * poles, 3): + if float(tmp[pole]) > 0 and float(tmp[pole + 1]) > G.dt and float(tmp[pole + 2]) > G.dt: + material.deltaer.append(float(tmp[pole])) + material.tau.append(float(tmp[pole + 1])) + material.alpha.append(float(tmp[pole + 2])) + else: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires positive values for the permittivity difference and relaxation times, and relaxation times that are greater than the time step for the model.') + if material.poles > Material.maxpoles: + Material.maxpoles = material.poles + + if G.messages: + print('Lorenz-type disperion added to {} with delta_epsr={}, tau={} secs, and alpha={} created.'.format(material.ID, ','.join('%4.2f' % deltaer for deltaer in material.deltaer), ','.join('%4.3e' % tau for tau in material.tau), ','.join('%4.3e' % alpha for alpha in material.alpha))) + + + cmdname = '#add_dispersion_drude' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + + if len(tmp) < 5: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at least five parameters') + if int(tmp[0]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for number of poles') + poles = int(tmp[0]) + materialsrequested = tmp[(3 * poles) + 1:len(tmp)] + + # Look up requested materials in existing list of material instances + materials = [y for x in materialsrequested for y in G.materials if y.ID == x] + + if len(materials) != len(materialsrequested): + notfound = [x for x in materialsrequested if x not in materials] + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' material(s) {} do not exist'.format(notfound)) + + for material in materials: + material.type = 'drude' + material.poles = poles + material.average = False + for pole in range(1, 3 * poles, 3): + if float(tmp[pole]) > 0 and float(tmp[pole + 1]) > G.dt and float(tmp[pole + 2]) > G.dt: + material.deltaer.append(float(tmp[pole])) + material.tau.append(float(tmp[pole + 1])) + material.alpha.append(float(tmp[pole + 2])) + else: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires positive values for the permittivity difference and relaxation times, and relaxation times that are greater than the time step for the model.') + if material.poles > Material.maxpoles: + Material.maxpoles = material.poles + + if G.messages: + print('Drude-type disperion added to {} with delta_epsr={}, tau1={} secs, and tau2={} secs created.'.format(material.ID, ','.join('%4.2f' % deltaer for deltaer in material.deltaer), ','.join('%4.3e' % tau for tau in material.tau), ','.join('%4.3e' % alpha for alpha in material.alpha))) + + + cmdname = '#soil_peplinski' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 7: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires at exactly seven parameters') + if float(tmp[0]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the sand fraction') + if float(tmp[1]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the clay fraction') + if float(tmp[2]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the bulk density') + if float(tmp[3]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the sand particle density') + if float(tmp[4]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the lower limit of the water volumetric fraction') + if float(tmp[5]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires a positive value for the upper limit of the water volumetric fraction') + if any(x.ID == tmp[6] for x in G.mixingmodels): + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' with ID {} already exists'.format(tmp[6])) + + # Create a new instance of the Material class material (start index after pec & free_space) + s = PeplinskiSoil(tmp[6], float(tmp[0]), float(tmp[1]), float(tmp[2]), float(tmp[3]), (float(tmp[4]), float(tmp[5]))) + + if G.messages: + print('Mixing model (Peplinski) used to create {} with sand fraction {:.3f}, clay fraction {:.3f}, bulk density {:.3f} g/cm3, sand particle density {:.3f} g/cm3, and water volumetric fraction {} to {} created.'.format(s.ID, s.S, s.C, s.rb, s.rs, s.mu[0], s.mu[1])) + + # Append the new material object to the materials list + G.mixingmodels.append(s) + + + # Geometry views (creates VTK-based geometry files) + cmdname = '#geometry_view' + if multicmds[cmdname] != 'None': + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 11: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly eleven parameters') + + xs = rvalue(float(tmp[0])/G.dx) + xf = rvalue(float(tmp[3])/G.dx) + ys = rvalue(float(tmp[1])/G.dy) + yf = rvalue(float(tmp[4])/G.dy) + zs = rvalue(float(tmp[2])/G.dz) + zf = rvalue(float(tmp[5])/G.dz) + dx = rvalue(float(tmp[6])/G.dx) + dy = rvalue(float(tmp[7])/G.dy) + dz = rvalue(float(tmp[8])/G.dz) + + if xs < 0 or xs > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower x-coordinate {} is not within the model domain'.format(xs * G.dx)) + if xf < 0 or xf > G.nx: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper x-coordinate {} is not within the model domain'.format(xf * G.dx)) + if ys < 0 or ys > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower y-coordinate {} is not within the model domain'.format(ys * G.dy)) + if yf < 0 or yf > G.ny: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper y-coordinate {} is not within the model domain'.format(yf * G.dy)) + if zs < 0 or zs > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower z-coordinate {} is not within the model domain'.format(zs * G.dz)) + if zf < 0 or zf > G.nz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the upper z-coordinate {} is not within the model domain'.format(zf * G.dz)) + if xs >= xf or ys >= yf or zs >= zf: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the lower coordinates should be less than the upper coordinates') + if dx < 0 or dy < 0 or dz < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than zero') + if dx < G.dx or dy < G.dy or dz < G.dz: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' the step size should not be less than the spatial discretisation') + if tmp[10].lower() != 'n' and tmp[10].lower() != 'f': + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires type to be either n (normal) or f (fine)') + + g = GeometryView(xs, ys, zs, xf, yf, zf, dx, dy, dz, tmp[9], tmp[10].lower()) + + if G.messages: + print('Geometry view from {:.3f}m, {:.3f}m, {:.3f}m, to {:.3f}m, {:.3f}m, {:.3f}m, discretisation {:.3f}m, {:.3f}m, {:.3f}m, filename {} created.'.format(xs * G.dx, ys * G.dy, zs * G.dz, xf * G.dx, yf * G.dy, zf * G.dz, dx * G.dx, dy * G.dy, dz * G.dz, g.filename)) + + # Append the new GeometryView object to the geometry views list + G.geometryviews.append(g) + + + # Complex frequency shifted (CFS) PML parameter + cmdname = '#pml_cfs' + if multicmds[cmdname] != 'None': + if len(multicmds[cmdname]) > 2: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' can only be used up to two times, for up to a 2nd order PML') + for cmdinstance in multicmds[cmdname]: + tmp = cmdinstance.split() + if len(tmp) != 9: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' requires exactly nine parameters') + if tmp[0] not in CFS.scalingtypes or tmp[3] not in CFS.scalingtypes or tmp[6] not in CFS.scalingtypes: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' must have scaling type {}'.format(','.join(CFS.scalingtypes))) + if float(tmp[1]) < 0 or float(tmp[2]) < 0 or float(tmp[4]) < 0 or float(tmp[5]) < 0 or float(tmp[7]) < 0: + raise CmdInputError("'" + cmdname + ': ' + ' '.join(tmp) + "'" + ' minimum and maximum scaling values must be greater than zero') + + cfs = CFS() + cfs.alphascaling = tmp[0] + cfs.alphamin = float(tmp[1]) + cfs.alphamax = float(tmp[2]) + cfs.kappascaling = tmp[3] + cfs.kappamin = float(tmp[4]) + cfs.kappamax = float(tmp[5]) + cfs.sigmascaling = tmp[6] + cfs.sigmamin = float(tmp[7]) + if tmp[8] == 'None': + cfs.sigmamax = None + else: + cfs.sigmamax = float(tmp[8]) + + if G.messages: + print('CFS parameters: alpha scaling {}, alpha_min {:.2f}, alpha_max {:.2f}, kappa scaling {}, kappa_min {:.2f}, kappa_max {:.2f}, sigma scaling {}, sigma_min {:.2f}, sigma_max {} created.'.format(cfs.alphascaling, cfs.alphamin, cfs.alphamax, cfs.kappascaling, cfs.kappamin, cfs.kappamax, cfs.sigmascaling, cfs.sigmamin, cfs.sigmamax)) + + G.cfs.append(cfs) + diff --git a/gprMax/input_cmds_singleuse.py b/gprMax/input_cmds_singleuse.py new file mode 100644 index 00000000..f26b1d7c --- /dev/null +++ b/gprMax/input_cmds_singleuse.py @@ -0,0 +1,258 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, sys +import numpy as np +from psutil import virtual_memory + +from .constants import c, floattype +from .exceptions import CmdInputError +from .pml import PML, CFS +from .utilities import rvalue, human_size +from .waveforms import Waveform + + +def process_singlecmds(singlecmds, multicmds, G): + """Checks the validity of command parameters and creates instances of classes of parameters. + + Args: + singlecmds (dict): Commands that can only occur once in the model. + multicmds (dict): Commands that can have multiple instances in the model (required to pass to process_materials_file function). + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # Check validity of command parameters in order needed + # messages + cmd = '#messages' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter') + if singlecmds[cmd].lower() == 'y': + G.messages = True + elif singlecmds[cmd].lower() == 'n': + G.messages = False + else: + raise CmdInputError(cmd + ' requires input values of either y or n') + + + # Title + cmd = '#title' + if singlecmds[cmd] != 'None': + G.title = singlecmds[cmd] + if G.messages: + print('Model title: {}'.format(G.title)) + + + # Number of processors to run on (OpenMP) + cmd = '#num_threads' + ompthreads = os.environ.get('OMP_NUM_THREADS') + if singlecmds[cmd] != 'None': + tmp = tuple(int(x) for x in singlecmds[cmd].split()) + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter to specify the number of OpenMP threads to use') + if tmp[0] < 1: + raise CmdInputError(cmd + ' requires the value to be an integer not less than one') + G.nthreads = tmp[0] + elif ompthreads: + G.nthreads = int(ompthreads) + else: + # Set number of threads to number of physical CPU cores, i.e. avoid hyperthreading with OpenMP for now + if sys.platform == 'darwin': + G.nthreads = int(os.popen('sysctl hw.physicalcpu').readlines()[0].split(':')[1].strip()) + elif sys.platform == 'win32': + # Consider using wmi tools to check hyperthreading on Windows + G.nthreads = os.cpu_count() + elif 'linux' in sys.platform: + lscpu = os.popen('lscpu').readlines() + cpusockets = [item for item in lscpu if item.startswith('Socket(s)')] + cpusockets = int(cpusockets[0].split(':')[1].strip()) + corespersocket = [item for item in lscpu if item.startswith('Core(s) per socket')] + corespersocket = int(corespersocket[0].split(':')[1].strip()) + G.nthreads = cpusockets * corespersocket + else: + G.nthreads = os.cpu_count() + if G.messages: + print('Number of threads: {}'.format(G.nthreads)) + + + # Spatial discretisation + cmd = '#dx_dy_dz' + tmp = [float(x) for x in singlecmds[cmd].split()] + if len(tmp) != 3: + raise CmdInputError(cmd + ' requires exactly three parameters') + if tmp[0] <= 0: + raise CmdInputError(cmd + ' requires the x-direction spatial step to be greater than zero') + if tmp[1] <= 0: + raise CmdInputError(cmd + ' requires the y-direction spatial step to be greater than zero') + if tmp[2] <= 0: + raise CmdInputError(cmd + ' requires the z-direction spatial step to be greater than zero') + G.dx = tmp[0] + G.dy = tmp[1] + G.dz = tmp[2] + if G.messages: + print('Spatial discretisation: {:.3f} x {:.3f} x {:.3f} m'.format(G.dx, G.dy, G.dz)) + + + # Domain + cmd = '#domain' + tmp = [float(x) for x in singlecmds[cmd].split()] + nx = rvalue(tmp[0]/G.dx) + ny = rvalue(tmp[1]/G.dy) + nz = rvalue(tmp[2]/G.dz) + if len(tmp) != 3: + raise CmdInputError(cmd + ' requires exactly three parameters') + G.nx = nx + G.ny = ny + G.nz = nz + if G.messages: + print('Model domain: {:.3f} x {:.3f} x {:.3f} m ({:d} x {:d} x {:d} = {:d} Mcells)'.format(tmp[0], tmp[1], tmp[2], G.nx, G.ny, G.nz, int((G.nx * G.ny * G.nz)/1e6))) + mem = (((G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 13 * np.dtype(floattype).itemsize + (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 18) * 1.1) + 30e6 + print('Memory (approx) required/available: {} / {}'.format(human_size(mem), human_size(virtual_memory().total))) + + + # Time step CFL limit - use either 2D or 3D (default) + cmd = '#time_step_limit_type' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter') + if singlecmds[cmd].lower() == '2d': + if G.nx == 1: + G.dt = 1 / (c * np.sqrt((1 / G.dy) * (1 / G.dy) + (1 / G.dz) * (1 / G.dz))) + elif G.ny == 1: + G.dt = 1 / (c * np.sqrt((1 / G.dx) * (1 / G.dx) + (1 / G.dz) * (1 / G.dz))) + elif G.nz == 1: + G.dt = 1 / (c * np.sqrt((1 / G.dx) * (1 / G.dx) + (1 / G.dy) * (1 / G.dy))) + else: + raise CmdInputError(cmd + ' 2D CFL limit can only be used when one dimension of the domain is one cell') + elif singlecmds[cmd].lower() == '3d': + G.dt = 1 / (c * np.sqrt((1 / G.dx) * (1 / G.dx) + (1 / G.dy) * (1 / G.dy) + (1 / G.dz) * (1 / G.dz))) + else: + raise CmdInputError(cmd + ' requires input values of either 2D or 3D') + else: + G.dt = 1 / (c * np.sqrt((1 / G.dx) * (1 / G.dx) + (1 / G.dy) * (1 / G.dy) + (1 / G.dz) * (1 / G.dz))) + if G.messages: + print('Time step: {:.3e} secs'.format(G.dt)) + + + # Time step stability factor + cmd = '#time_step_stability_factor' + if singlecmds[cmd] != 'None': + tmp = tuple(float(x) for x in singlecmds[cmd].split()) + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter') + if tmp[0] <= 0 or tmp[0] > 1: + raise CmdInputError(cmd + ' requires the value of the time step stability factor to be between zero and one') + G.dt = G.dt * tmp[0] + if G.messages: + print('Time step (modified): {:.3e} secs'.format(G.dt)) + + + # Time window + cmd = '#time_window' + tmp = singlecmds[cmd].split() + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter to specify the time window. Either in seconds or number of iterations.') + tmp = tmp[0].lower() + # If real floating point value given + if '.' in tmp or 'e' in tmp: + if float(tmp) > 0: + G.timewindow = float(tmp) + G.iterations = rvalue((float(tmp) / G.dt)) + 1 + else: + raise CmdInputError(cmd + ' must have a value greater than zero') + # If number of iterations given + else: + G.timewindow = (int(tmp) - 1) * G.dt + G.iterations = int(tmp) + if G.messages: + print('Time window: {:.3e} secs ({} iterations)'.format(G.timewindow, G.iterations)) + + + # PML + cmd = '#pml_cells' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 1 and len(tmp) != 6: + raise CmdInputError(cmd + ' requires either one or six parameters') + if len(tmp) == 1: + G.pmlthickness = (int(tmp[0]), int(tmp[0]), int(tmp[0]), int(tmp[0]), int(tmp[0]), int(tmp[0])) + else: + G.pmlthickness = (int(tmp[0]), int(tmp[1]), int(tmp[2]), int(tmp[3]), int(tmp[4]), int(tmp[5])) + if 2*G.pmlthickness[0] >= G.nx or 2*G.pmlthickness[1] >= G.ny or 2*G.pmlthickness[2] >= G.nz or 2*G.pmlthickness[3] >= G.nx or 2*G.pmlthickness[4] >= G.ny or 2*G.pmlthickness[5] >= G.nz: + raise CmdInputError(cmd + ' has too many cells for the domain size') + + + # src_steps + cmd = '#src_steps' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 3: + raise CmdInputError(cmd + ' requires exactly three parameters') + G.txstepx = rvalue(float(tmp[0])/G.dx) + G.txstepy = rvalue(float(tmp[1])/G.dy) + G.txstepz = rvalue(float(tmp[2])/G.dz) + if G.messages: + print('All sources will step {:.3f}m, {:.3f}m, {:.3f}m for each model run.'.format(G.txstepx * G.dx, G.txstepy * G.dy, G.txstepz * G.dz)) + + + # rx_steps + cmd = '#rx_steps' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 3: + raise CmdInputError(cmd + ' requires exactly three parameters') + G.rxstepx = rvalue(float(tmp[0])/G.dx) + G.rxstepy = rvalue(float(tmp[1])/G.dy) + G.rxstepz = rvalue(float(tmp[2])/G.dz) + if G.messages: + print('All receivers will step {:.3f}m, {:.3f}m, {:.3f}m for each model run.'.format(G.rxstepx * G.dx, G.rxstepy * G.dy, G.rxstepz * G.dz)) + + + # Excitation file for user-defined source waveforms + cmd = '#excitation_file' + if singlecmds[cmd] != 'None': + tmp = singlecmds[cmd].split() + if len(tmp) != 1: + raise CmdInputError(cmd + ' requires exactly one parameter') + excitationfile = tmp[0] + + # Open file and get waveform names + with open(excitationfile, 'r') as f: + waveformIDs = f.readline().split() + + # Read all waveform values into an array + waveformvalues = np.loadtxt(excitationfile, skiprows=1, dtype=floattype) + + for waveform in range(len(waveformIDs)): + if any(x.ID == waveformIDs[waveform] for x in G.waveforms): + raise CmdInputError('Waveform with ID {} already exists'.format(waveformIDs[waveform])) + w = Waveform() + w.ID = waveformIDs[waveform] + w.type = 'user' + w.uservalues = waveformvalues[:,waveform] + + if G.messages: + print('User waveform {} created.'.format(w.ID)) + + G.waveforms.append(w) + + + + diff --git a/gprMax/materials.py b/gprMax/materials.py new file mode 100644 index 00000000..6f332098 --- /dev/null +++ b/gprMax/materials.py @@ -0,0 +1,233 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np + +from .constants import e0, m0, floattype, complextype + + +class Material(): + """Materials, their properties and update coefficients.""" + + # Maximum number of dispersive material poles in a model + maxpoles = 0 + + # Types of material + types = ['standard', 'debye', 'lorenz', 'drude'] + + # Properties of water from: http://dx.doi.org/10.1109/TGRS.2006.873208 + waterer = 80.1 + watereri = 4.9 + waterdeltaer = waterer - watereri + watertau = 9.231e-12 + + # Properties of grass from: http://dx.doi.org/10.1007/BF00902994 + grasser = 18.5087 + grasseri = 12.7174 + grassdeltaer = grasser - grasseri + grasstau = 1.0793e-11 + + def __init__(self, numID, ID, G): + """ + Args: + numID (int): Numeric identifier of the material. + ID (str): Name of the material. + G (class): Grid class instance - holds essential parameters describing the model. + """ + self.numID = numID + self.ID = ID + self.type = 'standard' + # Default material averaging + self.average = True + + # Default material constitutive parameters (free_space) + self.er = 1.0 + self.se = 0.0 + self.mr = 1.0 + self.sm = 0.0 + + # Parameters for dispersive materials + self.poles = 0 + self.deltaer = [] + self.tau = [] + self.alpha = [] + + def calculate_update_coeffsH(self, G): + """Calculates the magnetic update coefficients of the material. + + Args: + G (class): Grid class instance - holds essential parameters describing the model. + """ + HA = (m0*self.mr / G.dt) + 0.5*self.sm + HB = (m0*self.mr / G.dt) - 0.5*self.sm + self.DA = HB / HA + self.DBx = (1 / G.dx) * 1 / HA + self.DBy = (1 / G.dy) * 1 / HA + self.DBz = (1 / G.dz) * 1 / HA + self.srcm = 1 / HA + + # Calculate electric update coefficients + def calculate_update_coeffsE(self, G): + """Calculates the electric update coefficients of the material. + + Args: + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # The implementation of the dispersive material modelling comes from the derivation in: http://dx.doi.org/10.1109/TAP.2014.2308549 + if self.maxpoles > 0: + self.w = np.zeros(self.maxpoles, dtype=complextype) + self.q = np.zeros(self.maxpoles, dtype=complextype) + self.zt = np.zeros(self.maxpoles, dtype=complextype) + self.zt2 = np.zeros(self.maxpoles, dtype=complextype) + self.eqt = np.zeros(self.maxpoles, dtype=complextype) + self.eqt2 = np.zeros(self.maxpoles, dtype=complextype) + + for x in range(self.poles): + if self.type == 'debye': + self.w[x] = self.deltaer[x] / self.tau[x] + self.q[x] = -1 / self.tau[x] + elif self.type == 'lorenz': + wp2 = (2 * np.pi * (1 / self.tau[x])) * (2 * np.pi * (1 / self.tau[x])) + self.w[x] = -(wp2 * self.deltaer[x]) * j / np.sqrt(wp2 - (self.alpha[x] * self.alpha[x])) + self.q[x] = -self.alpha[x] + np.sqrt(wp2 - (self.alpha[x] * self.alpha[x])) * j + elif self.type == 'drude': + wp2 = (2 * np.pi * (1 / self.tau[x])) * (2 * np.pi * (1 / self.tau[x])) + self.se += wp2 / self.alpha[x] + self.w[x] = - (wp2 / self.alpha[x]) + self.q[x] = - self.alpha[x] + + self.eqt[x] = np.exp(self.q[x] * G.dt) + self.eqt2[x] = np.exp(self.q[x] * (G.dt / 2)) + self.zt[x] = (self.w[x] / self.q[x]) * (1 - self.eqt[x]) / G.dt + self.zt2[x] = (self.w[x] / self.q[x]) * (1 - self.eqt2[x]) + + EA = (e0*self.er / G.dt) + 0.5*self.se - (e0 / G.dt) * np.sum(self.zt2.real) + EB = (e0*self.er / G.dt) - 0.5*self.se - (e0 / G.dt) * np.sum(self.zt2.real) + + else: + EA = (e0*self.er / G.dt) + 0.5*self.se + EB = (e0*self.er / G.dt) - 0.5*self.se + + if self.ID == 'pec': + self.CA = 0 + self.CBx = 0 + self.CBy = 0 + self.CBz = 0 + self.srce = 0 + else: + self.CA = EB / EA + self.CBx = (1 / G.dx) * 1 / EA + self.CBy = (1 / G.dy) * 1 / EA + self.CBz = (1 / G.dz) * 1 / EA + self.srce = 1 / EA + + +class PeplinskiSoil(): + """Soil objects that are characterised according to a mixing model by Peplinski (http://dx.doi.org/10.1109/36.387598).""" + + def __init__(self, ID, sandfraction, clayfraction, bulkdensity, sandpartdensity, watervolfraction): + """ + Args: + ID (str): Name of the soil. + sandfraction (float): Sand fraction of the soil. + clayfraction (float): Clay fraction of the soil. + bulkdensity (float): Bulk density of the soil (g/cm3). + sandpartdensity (float): Density of the sand particles in the soil (g/cm3). + watervolfraction (float): Two numbers that specify a range for the volumetric water fraction of the soil. + """ + self.ID = ID + self.S = sandfraction + self.C = clayfraction + self.rb = bulkdensity + self.rs = sandpartdensity + self.mu = watervolfraction + self.startmaterialnum = 0 + + def calculate_debye_properties(self, nbins, G): + """Calculates the real and imaginery part of a Debye model for the soil as well as a conductivity. It uses a semi-empirical model (http://dx.doi.org/10.1109/36.387598). + + Args: + nbins (int): Number of bins to use to create the different materials. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # Debye model properties of water + f = 1.3e9 + w = 2 * np.pi * f + erealw = Material.watereri + ((Material.waterdeltaer) / (1 + (w * Material.watertau)**2)) + eimagw = w * Material.watertau * ((Material.waterdeltaer) / (1 + (w * Material.watertau)**2)) + + a = 0.65 # Experimentally derived constant + es = (1.01 + 0.44 * self.rs)**2 - 0.062 + b1 = 1.2748 - 0.519 * self.S - 0.152 * self.C + b2 = 1.33797 - 0.603 * self.S - 0.166 * self.C + + # For frequencies in the range 0.3GHz to 1.3GHz + sigf1 = 0.0467 + 0.2204 * self.rb - 0.411 * self.S + 0.6614 * self.C + # For frequencies in the range 1.4GHz to 18GHz + sigf2 = -1.645 + 1.939 * self.rb - 2.25622 * self.S + 1.594 * self.C + + # Generate a set of bins based on the given volumetric water fraction values + mubins = np.linspace(self.mu[0], self.mu[1], nbins + 1) + # Generate a range of volumetric water fraction values the mid-point of each bin to make materials from + mumaterials = mubins + (mubins[1] - mubins[0]) / 2 + + # Create an iterator + muiter = np.nditer(mumaterials, flags=['c_index']) + while not muiter.finished: + # Real part for frequencies in the range 1.4GHz to 18GHz + er1 = (1 + (self.rb/self.rs) * ((es**a) - 1) + (muiter[0]**b1 * erealw**a) - muiter[0]) ** (1/a) + # Real part for frequencies in the range 0.3GHz to 1.3GHz + er2 = 1.15 * er1 - 0.68 + + # Imaginary part for frequencies in the range 0.3GHz to 1.3GHz + eri = er2 - (muiter[0]**(b2/a) * Material.waterdeltaer) + + # Effective conductivity + sig = muiter[0]**(b2/a) * ((sigf1 * (self.rs - self.rb)) / (self.rs * muiter[0])) + + # Check to see if the material already exists before creating a new one + requiredID = '|{:.4f}|'.format(float(muiter[0])) + material = next((x for x in G.materials if x.ID == requiredID), None) + if muiter.index == 0: + if material: + self.startmaterialnum = material.numID + else: + self.startmaterialnum = len(G.materials) + if not material: + m = Material(len(G.materials), requiredID, G) + m.average = False + m.er = eri + m.se = sig + m.deltaer.append(er2 - m.er) + m.tau.append(Material.watertau) + G.materials.append(m) + + muiter.iternext() + + + + + + + + + + + diff --git a/gprMax/pml.py b/gprMax/pml.py new file mode 100644 index 00000000..d48139d6 --- /dev/null +++ b/gprMax/pml.py @@ -0,0 +1,343 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np + +from .constants import e0, z0, floattype + + +class CFS(): + """PML CFS parameters.""" + + # Allowable scaling types + scalingtypes = {'constant': 0, 'linear': 1, 'inverselinear': -1, 'quadratic': 2, 'cubic': 3, 'quartic': 4} + + def __init__(self, alphascaling='constant', alphamin=0, alphamax=0, kappascaling='constant', kappamin=1, kappamax=1, sigmascaling='quartic', sigmamin=0, sigmamax=None): + """ + Args: + alphascaling (str): Type of scaling used for alpha parameter. Can be: 'constant', 'linear', 'inverselinear', 'quadratic', 'cubic', 'quartic'. + alphamin (float): Minimum value for alpha parameter. + alphamax (float): Maximum value for alpha parameter. + kappascaling (str): Type of scaling used for kappa parameter. Can be: 'constant', 'linear', 'inverselinear', 'quadratic', 'cubic', 'quartic'. + kappamin (float): Minimum value for kappa parameter. + kappamax (float): Maximum value for kappa parameter. + sigmascaling (str): Type of scaling used for sigma parameter. Can be: 'constant', 'linear', 'inverselinear', 'quadratic', 'cubic', 'quartic'. + sigmamin (float): Minimum value for sigma parameter. + sigmamax (float): Maximum value for sigma parameter. + """ + self.alphascaling = alphascaling + self.alphamin = alphamin + self.alphamax = alphamax + self.kappascaling = kappascaling + self.kappamin = kappamin + self.kappamax = kappamax + self.sigmascaling = sigmascaling + self.sigmamin = sigmamin + self.sigmamax = sigmamax + + def calculate_sigmamax(self, direction, er, mr, G): + """Calculates an optimum value for sigma max based on underlying material properties. + + Args: + direction (str): Direction of PML slab + er (float): Average permittivity of underlying material. + mr (float): Average permeability of underlying material. + G (class): Grid class instance - holds essential parameters describing the model. + """ + # Get general direction from first letter of PML direction + if direction[0] == 'x': + d = G.dx + elif direction[0] == 'y': + d = G.dy + elif direction[0] == 'z': + d = G.dz + # Calculation of the maximum value of sigma from http://dx.doi.org/10.1109/8.546249 + m = CFS.scalingtypes[self.sigmascaling] + self.sigmamax = (0.8 * (m + 1)) / (z0 * d * np.sqrt(er * mr)) + + def scaling_polynomial(self, min, max, order, Evalues, Hvalues): + """Applies the polynomial to be used for scaling for electric and magnetic PML updates based on scaling type and minimum and maximum values. + + Args: + min (float): Minimum value for scaling. + max (float): Maximum value for scaling. + order (int): Order of polynomial for scaling. + Evalues (float): numpy array holding scaling value for electric PML update. + Hvalues (float): numpy array holding scaling value for magnetic PML update. + + Returns: + Evalues (float): numpy array holding scaling value for electric PML update. + Hvalues (float): numpy array holding scaling value for magnetic PML update. + """ + tmp = max * ((np.linspace(0, (len(Evalues) - 1) + 0.5, num=2*len(Evalues))) / (len(Evalues) - 1)) ** order + Evalues = tmp[0:-1:2] + Hvalues = tmp[1::2] + return Evalues, Hvalues + + def calculate_values(self, min, max, scaling, Evalues, Hvalues): + """Calculates values for electric and magnetic PML updates based on scaling type and minimum and maximum values. + + Args: + min (float): Minimum value for scaling. + max (float): Maximum value for scaling. + scaling (int): Type of scaling, can be: 'constant', 'linear', 'inverselinear', 'quadratic', 'cubic', 'quartic'. + Evalues (float): numpy array holding scaling value for electric PML update. + Hvalues (float): numpy array holding scaling value for magnetic PML update. + + Returns: + Evalues (float): numpy array holding scaling value for electric PML update. + Hvalues (float): numpy array holding scaling value for magnetic PML update. + """ + if scaling == 'constant': + Evalues += max + Hvalues += max + else: + Evalues, Hvalues = self.scaling_polynomial(min, max, CFS.scalingtypes[scaling], Evalues, Hvalues) + + if scaling == 'inverselinear': + Evalues = Evalues[::-1] + Hvalues = Hvalues[::-1] +# print('Evalues: scaling {}, {}'.format(scaling, Evalues)) +# print('Hvalues: scaling {}, {}'.format(scaling, Hvalues)) + return Evalues, Hvalues + + +class PML(): + """PML - the implementation comes from the derivation in: http://dx.doi.org/10.1109/TAP.2011.2180344""" + + def __init__(self, direction=None, xs=0, ys=0, zs=0, xf=0, yf=0, zf=0, cfs=[]): + """ + Args: + xs, xf, ys, yf, zs, zf (float): Extent of the PML volume. + cfs (list): CFS class instances associated with the PML. + """ + self.direction = direction + self.xs = xs + self.xf = xf + self.ys = ys + self.yf = yf + self.zs = zs + self.zf = zf + self.nx = xf - xs + self.ny = yf - ys + self.nz = zf - zs + self.CFS = cfs + if not self.CFS: + self.CFS = [CFS()] + + # Subscript notation, e.g. 'EPhiyxz' means the electric field Phi vector, of which the + # component being corrected is y, the stretching direction is x, and field derivative + # is z direction. + if self.direction == 'xminus' or self.direction == 'xplus': + self.thickness = self.nx + self.EPhiyxz = np.zeros((len(self.CFS), self.nx + 1, self.ny, self.nz + 1), dtype=floattype) + self.EPhizxy = np.zeros((len(self.CFS), self.nx + 1, self.ny + 1, self.nz), dtype=floattype) + self.HPhiyxz = np.zeros((len(self.CFS), self.nx, self.ny + 1, self.nz), dtype=floattype) + self.HPhizxy = np.zeros((len(self.CFS), self.nx, self.ny, self.nz + 1), dtype=floattype) + elif self.direction == 'yminus' or self.direction == 'yplus': + self.thickness = self.ny + self.EPhixyz = np.zeros((len(self.CFS), self.nx, self.ny + 1, self.nz + 1), dtype=floattype) + self.EPhizyx = np.zeros((len(self.CFS), self.nx + 1, self.ny + 1, self.nz), dtype=floattype) + self.HPhixyz = np.zeros((len(self.CFS), self.nx + 1, self.ny, self.nz), dtype=floattype) + self.HPhizyx = np.zeros((len(self.CFS), self.nx, self.ny, self.nz + 1), dtype=floattype) + elif self.direction == 'zminus' or self.direction == 'zplus': + self.thickness = self.nz + self.EPhixzy = np.zeros((len(self.CFS), self.nx, self.ny + 1, self.nz + 1), dtype=floattype) + self.EPhiyzx = np.zeros((len(self.CFS), self.nx + 1, self.ny, self.nz + 1), dtype=floattype) + self.HPhixzy = np.zeros((len(self.CFS), self.nx + 1, self.ny, self.nz), dtype=floattype) + self.HPhiyzx = np.zeros((len(self.CFS), self.nx, self.ny + 1, self.nz), dtype=floattype) + + self.ERA = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.ERB = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.ERE = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.ERF = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.HRA = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.HRB = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.HRE = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + self.HRF = np.zeros((len(self.CFS), self.thickness + 1), dtype=floattype) + + def calculate_update_coeffs(self, er, mr, G): + """Calculates electric and magnetic update coefficients for the PML. + + Args: + er (float): Average permittivity of underlying material + mr (float): Average permeability of underlying material + G (class): Grid class instance - holds essential parameters describing the model. + """ + + for x, cfs in enumerate(self.CFS): + Ealpha = np.zeros(self.thickness + 1, dtype=floattype) + Halpha = np.zeros(self.thickness + 1, dtype=floattype) + Ekappa = np.zeros(self.thickness + 1, dtype=floattype) + Hkappa = np.zeros(self.thickness + 1, dtype=floattype) + Esigma = np.zeros(self.thickness + 1, dtype=floattype) + Hsigma = np.zeros(self.thickness + 1, dtype=floattype) + if not cfs.sigmamax: + cfs.calculate_sigmamax(self.direction, er, mr, G) + Ealpha, Halpha = cfs.calculate_values(cfs.alphamin, cfs.alphamax, cfs.alphascaling, Ealpha, Halpha) + Ekappa, Hkappa = cfs.calculate_values(cfs.kappamin, cfs.kappamax, cfs.kappascaling, Ekappa, Hkappa) + Esigma, Hsigma = cfs.calculate_values(cfs.sigmamin, cfs.sigmamax, cfs.sigmascaling, Esigma, Hsigma) + +# print('Ealpha {}'.format(Ealpha)) +# print('Halpha {}'.format(Halpha)) +# print('Ekappa {}'.format(Ekappa)) +# print('Hkappa {}'.format(Hkappa)) +# print('Esigma {}'.format(Esigma)) +# print('Hsigma {}'.format(Hsigma)) + + # Electric PML update coefficients + tmp = (2*e0*Ekappa) + G.dt * (Ealpha * Ekappa + Esigma) + self.ERA[x, :] = (2*e0 + G.dt*Ealpha) / tmp + self.ERB[x, :] = (2*e0*Ekappa) / tmp + self.ERE[x, :] = ((2*e0*Ekappa) - G.dt * (Ealpha * Ekappa + Esigma)) / tmp + self.ERF[x, :] = (2*Esigma*G.dt) / (Ekappa * tmp) + + # Magnetic PML update coefficients + tmp = (2*e0*Hkappa) + G.dt * (Halpha * Hkappa + Hsigma) + self.HRA[x, :] = (2*e0 + G.dt*Halpha) / tmp + self.HRB[x, :] = (2*e0*Hkappa) / tmp + self.HRE[x, :] = ((2*e0*Hkappa) - G.dt * (Halpha * Hkappa + Hsigma)) / tmp + self.HRF[x, :] = (2*Hsigma*G.dt) / (Hkappa * tmp) + +# print('ERA {}'.format(self.ERA)) +# print('ERB {}'.format(self.ERB)) +# print('ERE {}'.format(self.ERE)) +# print('ERF {}'.format(self.ERF)) +# print('HRA {}'.format(self.HRA)) +# print('HRB {}'.format(self.HRB)) +# print('HRE {}'.format(self.HRE)) +# print('HRF {}'.format(self.HRF)) + + +def build_pml(G): + """This function builds instances of the PML.""" + + if G.messages: + print('') + # Create the PML slabs + if G.pmlthickness[0] > 0: + pml = PML(direction='xminus', xf=G.pmlthickness[0], yf=G.ny, zf=G.nz, cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.pmlthickness[1] > 0: + pml = PML(direction='yminus', xf=G.nx, yf=G.pmlthickness[1], zf=G.nz, cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.pmlthickness[2] > 0: + pml = PML(direction='zminus', xf=G.nx, yf=G.ny, zf=G.pmlthickness[2], cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.pmlthickness[3] > 0: + pml = PML(direction='xplus', xs=G.nx-G.pmlthickness[3], xf=G.nx, yf=G.ny, zf=G.nz, cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.pmlthickness[4] > 0: + pml = PML(direction='yplus', xf=G.nx, ys=G.ny-G.pmlthickness[4], yf=G.ny, zf=G.nz, cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.pmlthickness[5] > 0: + pml = PML(direction='zplus', xf=G.nx, yf=G.ny, zs=G.nz-G.pmlthickness[5], zf=G.nz, cfs=G.cfs) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) != len(G.pmlthickness): + print('PML {} slab with {} cells created.'.format(pml.direction, pml.thickness)) + G.pmls.append(pml) + if G.messages and G.pmlthickness.count(G.pmlthickness[0]) == len(G.pmlthickness): + if G.pmlthickness[0] == 0: + print('PML is switched off') + else: + print('PML: {} cells'.format(pml.thickness)) + + +def calculate_initial_pml_params(G): + """ This function calculates the initial parameters and coefficients for PML including setting scaling + (based on underlying material er and mr from solid array). + """ + + for pml in G.pmls: + sumer = 0 + summr = 0 + if pml.direction == 'xminus': + for j in range(G.ny): + for k in range(G.nz): + numID = G.solid[0, j, k] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.ny * G.nz) + averagemr = summr / (G.ny * G.nz) + elif pml.direction == 'xplus': + for j in range(G.ny): + for k in range(G.nz): + numID = G.solid[G.nx - pml.thickness, j, k] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.ny * G.nz) + averagemr = summr / (G.ny * G.nz) + elif pml.direction == 'yminus': + for i in range(G.nx): + for k in range(G.nz): + numID = G.solid[i, 0, k] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.nx * G.nz) + averagemr = summr / (G.nx * G.nz) + elif pml.direction == 'yplus': + for i in range(G.nx): + for k in range(G.nz): + numID = G.solid[i, G.ny - pml.thickness, k] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.nx * G.nz) + averagemr = summr / (G.nx * G.nz) + elif pml.direction == 'zminus': + for i in range(G.nx): + for j in range(G.ny): + numID = G.solid[i, j, 0] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.nx * G.ny) + averagemr = summr / (G.nx * G.ny) + elif pml.direction == 'zplus': + for i in range(G.nx): + for j in range(G.ny): + numID = G.solid[i, j, G.nz - pml.thickness] + material = next(x for x in G.materials if x.numID == numID) + sumer += material.er + summr += material.mr + averageer = sumer / (G.nx * G.ny) + averagemr = summr / (G.nx * G.ny) + pml.calculate_update_coeffs(averageer, averagemr, G) + + + + + + + + + + + diff --git a/gprMax/pml_1order_update.pyx b/gprMax/pml_1order_update.pyx new file mode 100644 index 00000000..aa964007 --- /dev/null +++ b/gprMax/pml_1order_update.pyx @@ -0,0 +1,665 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np +from cython.parallel import prange +from .constants cimport floattype_t, complextype_t + + +############################################# +# Electric field PML updates - Ex component # +############################################# +cpdef update_pml_1order_ex_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ex field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, k + zs] + dHz = (Hz[i + xs, j + ys, k + zs] - Hz[i + xs, j - 1 + ys, k + zs]) / dy + Ex[i + xs, j + ys, k + zs] = Ex[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, j] - 1) * dHz + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHz + + +cpdef update_pml_1order_ex_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ex field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, yf - j, k + zs] + dHz = (Hz[i + xs, yf - j, k + zs] - Hz[i + xs, yf - j - 1, k + zs]) / dy + Ex[i + xs, yf - j, k + zs] = Ex[i + xs, yf - j, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, j] - 1) * dHz + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHz + + +cpdef update_pml_1order_ex_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ex field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, k + zs] + dHy = (Hy[i + xs, j + ys, k + zs] - Hy[i + xs, j + ys, k - 1 + zs]) / dz + Ex[i + xs, j + ys, k + zs] = Ex[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, k] - 1) * dHy + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHy + + +cpdef update_pml_1order_ex_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ex field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, zf - k] + dHy = (Hy[i + xs, j + ys, zf - k] - Hy[i + xs, j + ys, zf - k - 1]) / dz + Ex[i + xs, j + ys, zf - k] = Ex[i + xs, j + ys, zf - k] - updatecoeffsE[listIndex, 4] * ((RA[0, k] - 1) * dHy + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHy + + +############################################# +# Electric field PML updates - Ey component # +############################################# +cpdef update_pml_1order_ey_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, k + zs] + dHz = (Hz[i + xs, j + ys, k + zs] - Hz[i - 1 + xs, j + ys, k + zs]) / dx + Ey[i + xs, j + ys, k + zs] = Ey[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, i] - 1) * dHz + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHz + + +cpdef update_pml_1order_ey_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, xf - i, j + ys, k + zs] + dHz = (Hz[xf - i, j + ys, k + zs] - Hz[xf - i - 1, j + ys, k + zs]) / dx + Ey[xf - i, j + ys, k + zs] = Ey[xf - i, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, i] - 1) * dHz + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHz + + +cpdef update_pml_1order_ey_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, k + zs] + dHx = (Hx[i + xs, j + ys, k + zs] - Hx[i + xs, j + ys, k - 1 + zs]) / dz + Ey[i + xs, j + ys, k + zs] = Ey[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, k] - 1) * dHx + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHx + + +cpdef update_pml_1order_ey_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, zf - k] + dHx = (Hx[i + xs, j + ys, zf - k] - Hx[i + xs, j + ys, zf - k - 1]) / dz + Ey[i + xs, j + ys, zf - k] = Ey[i + xs, j + ys, zf - k] + updatecoeffsE[listIndex, 4] * ((RA[0, k] - 1) * dHx + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHx + + +############################################# +# Electric field PML updates - Ez component # +############################################# +cpdef update_pml_1order_ez_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, j + ys, k + zs] + dHy = (Hy[i + xs, j + ys, k + zs] - Hy[i - 1 + xs, j + ys, k + zs]) / dx + Ez[i + xs, j + ys, k + zs] = Ez[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, i] - 1) * dHy + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHy + + +cpdef update_pml_1order_ez_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ez field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, xf - i, j + ys, k + zs] + dHy = (Hy[xf - i, j + ys, k + zs] - Hy[xf - i - 1, j + ys, k + zs]) / dx + Ez[xf - i, j + ys, k + zs] = Ez[xf - i, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, i] - 1) * dHy + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHy + + +cpdef update_pml_1order_ez_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ez field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, j + ys, k + zs] + dHx = (Hx[i + xs, j + ys, k + zs] - Hx[i + xs, j - 1 + ys, k + zs]) / dy + Ez[i + xs, j + ys, k + zs] = Ez[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, j] - 1) * dHx + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHx + + +cpdef update_pml_1order_ez_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ez field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, yf - j, k + zs] + dHx = (Hx[i + xs, yf - j, k + zs] - Hx[i + xs, yf - j - 1, k + zs]) / dy + Ez[i + xs, yf - j, k + zs] = Ez[i + xs, yf - j, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, j] - 1) * dHx + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHx + + +############################################# +# Magnetic field PML updates - Hx component # +############################################# +cpdef update_pml_1order_hx_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hx field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, k + zs] + dEz = (Ez[i + xs, j + 1 + ys, k + zs] - Ez[i + xs, j + ys, k + zs]) / dy + Hx[i + xs, j + ys, k + zs] = Hx[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, j] - 1) * dEz + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEz + + +cpdef update_pml_1order_hx_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hx field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, yf - (j + 1), k + zs] + dEz = (Ez[i + xs, yf - j, k + zs] - Ez[i + xs, yf - (j + 1), k + zs]) / dy + Hx[i + xs, yf - (j + 1), k + zs] = Hx[i + xs, yf - (j + 1), k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, j] - 1) * dEz + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEz + + +cpdef update_pml_1order_hx_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hx field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, k + zs] + dEy = (Ey[i + xs, j + ys, k + 1 + zs] - Ey[i + xs, j + ys, k + zs]) / dz + Hx[i + xs, j + ys, k + zs] = Hx[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, k] - 1) * dEy + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEy + + +cpdef update_pml_1order_hx_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hx field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, zf - (k + 1)] + dEy = (Ey[i + xs, j + ys, zf - k] - Ey[i + xs, j + ys, zf - (k + 1)]) / dz + Hx[i + xs, j + ys, zf - (k + 1)] = Hx[i + xs, j + ys, zf - (k + 1)] + updatecoeffsH[listIndex, 4] * ((RA[0, k] - 1) * dEy + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEy + + +############################################# +# Magnetic field PML updates - Hy component # +############################################# +cpdef update_pml_1order_hy_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hy field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, k + zs] + dEz = (Ez[i + 1 + xs, j + ys, k + zs] - Ez[i + xs, j + ys, k + zs]) / dx + Hy[i + xs, j + ys, k + zs] = Hy[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, i] - 1) * dEz + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEz + + +cpdef update_pml_1order_hy_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hy field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, xf - (i + 1), j + ys, k + zs] + dEz = (Ez[xf - i, j + ys, k + zs] - Ez[xf - (i + 1), j + ys, k + zs]) / dx + Hy[xf - (i + 1), j + ys, k + zs] = Hy[xf - (i + 1), j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, i] - 1) * dEz + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEz + + +cpdef update_pml_1order_hy_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hy field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, k + zs] + dEx = (Ex[i + xs, j + ys, k + 1 + zs] - Ex[i + xs, j + ys, k + zs]) / dz + Hy[i + xs, j + ys, k + zs] = Hy[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, k] - 1) * dEx + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEx + + +cpdef update_pml_1order_hy_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hy field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, zf - (k + 1)] + dEx = (Ex[i + xs, j + ys, zf - k] - Ex[i + xs, j + ys, zf - (k + 1)]) / dz + Hy[i + xs, j + ys, zf - (k + 1)] = Hy[i + xs, j + ys, zf - (k + 1)] - updatecoeffsH[listIndex, 4] * ((RA[0, k] - 1) * dEx + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEx + + +############################################# +# Magnetic field PML updates - Hz component # +############################################# +cpdef update_pml_1order_hz_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hz field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, j + ys, k + zs] + dEy = (Ey[i + 1 + xs, j + ys, k + zs] - Ey[i + xs, j + ys, k + zs]) / dx + Hz[i + xs, j + ys, k + zs] = Hz[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, i] - 1) * dEy + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEy + + +cpdef update_pml_1order_hz_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hz field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, xf - (i + 1), j + ys, k + zs] + dEy = (Ey[xf - i, j + ys, k + zs] - Ey[xf - (i + 1), j + ys, k + zs]) / dx + Hz[xf - (i + 1), j + ys, k + zs] = Hz[xf - (i + 1), j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, i] - 1) * dEy + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEy + + +cpdef update_pml_1order_hz_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hz field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, j + ys, k + zs] + dEx = (Ex[i + xs, j + 1 + ys, k + zs] - Ex[i + xs, j + ys, k + zs]) / dy + Hz[i + xs, j + ys, k + zs] = Hz[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, j] - 1) * dEx + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEx + + +cpdef update_pml_1order_hz_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hz field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, yf - (j + 1), k + zs] + dEx = (Ex[i + xs, yf - j, k + zs] - Ex[i + xs, yf - (j + 1), k + zs]) / dy + Hz[i + xs, yf - (j + 1), k + zs] = Hz[i + xs, yf - (j + 1), k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, j] - 1) * dEx + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEx + diff --git a/gprMax/pml_2order_update.pyx b/gprMax/pml_2order_update.pyx new file mode 100644 index 00000000..c3af155a --- /dev/null +++ b/gprMax/pml_2order_update.pyx @@ -0,0 +1,689 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np +from cython.parallel import prange +from .constants cimport floattype_t, complextype_t + + +############################################# +# Electric field PML updates - Ex component # +############################################# +cpdef update_pml_2order_ex_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ex field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, k + zs] + dHz = (Hz[i + xs, j + ys, k + zs] - Hz[i + xs, j - 1 + ys, k + zs]) / dy + Ex[i + xs, j + ys, k + zs] = Ex[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dHz + RA[1, j] * RB[0, j] * EPhi[0, i, j, k] + RB[1, j] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, j] * EPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dHz + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHz + + +cpdef update_pml_2order_ex_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ex field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, yf - j, k + zs] + dHz = (Hz[i + xs, yf - j, k + zs] - Hz[i + xs, yf - j - 1, k + zs]) / dy + Ex[i + xs, yf - j, k + zs] = Ex[i + xs, yf - j, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dHz + RA[1, j] * RB[0, j] * EPhi[0, i, j, k] + RB[1, j] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, j] * EPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dHz + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHz + + +cpdef update_pml_2order_ex_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ex field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, k + zs] + dHy = (Hy[i + xs, j + ys, k + zs] - Hy[i + xs, j + ys, k - 1 + zs]) / dz + Ex[i + xs, j + ys, k + zs] = Ex[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dHy + RA[1, k] * RB[0, k] * EPhi[0, i, j, k] + RB[1, k] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, k] * EPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dHy + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHy + + +cpdef update_pml_2order_ex_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ex, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ex field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[0, i + xs, j + ys, zf - k] + dHy = (Hy[i + xs, j + ys, zf - k] - Hy[i + xs, j + ys, zf - k - 1]) / dz + Ex[i + xs, j + ys, zf - k] = Ex[i + xs, j + ys, zf - k] - updatecoeffsE[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dHy + RA[1, k] * RB[0, k] * EPhi[0, i, j, k] + RB[1, k] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, k] * EPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dHy + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHy + + +############################################# +# Electric field PML updates - Ey component # +############################################# +cpdef update_pml_2order_ey_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, k + zs] + dHz = (Hz[i + xs, j + ys, k + zs] - Hz[i - 1 + xs, j + ys, k + zs]) / dx + Ey[i + xs, j + ys, k + zs] = Ey[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dHz + RA[1, i] * RB[0, i] * EPhi[0, i, j, k] + RB[1, i] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, i] * EPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dHz + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHz + + +cpdef update_pml_2order_ey_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hz, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, xf - i, j + ys, k + zs] + dHz = (Hz[xf - i, j + ys, k + zs] - Hz[xf - i - 1, j + ys, k + zs]) / dx + Ey[xf - i, j + ys, k + zs] = Ey[xf - i, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dHz + RA[1, i] * RB[0, i] * EPhi[0, i, j, k] + RB[1, i] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, i] * EPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dHz + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHz + + +cpdef update_pml_2order_ey_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, k + zs] + dHx = (Hx[i + xs, j + ys, k + zs] - Hx[i + xs, j + ys, k - 1 + zs]) / dz + Ey[i + xs, j + ys, k + zs] = Ey[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dHx + RA[1, k] * RB[0, k] * EPhi[0, i, j, k] + RB[1, k] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, k] * EPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dHx + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHx + + +cpdef update_pml_2order_ey_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ey, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[1, i + xs, j + ys, zf - k] + dHx = (Hx[i + xs, j + ys, zf - k] - Hx[i + xs, j + ys, zf - k - 1]) / dz + Ey[i + xs, j + ys, zf - k] = Ey[i + xs, j + ys, zf - k] + updatecoeffsE[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dHx + RA[1, k] * RB[0, k] * EPhi[0, i, j, k] + RB[1, k] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, k] * EPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dHx + RB[0, k] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, k] * EPhi[0, i, j, k] - RF[0, k] * dHx + + +############################################# +# Electric field PML updates - Ez component # +############################################# +cpdef update_pml_2order_ez_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ey field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, j + ys, k + zs] + dHy = (Hy[i + xs, j + ys, k + zs] - Hy[i - 1 + xs, j + ys, k + zs]) / dx + Ez[i + xs, j + ys, k + zs] = Ez[i + xs, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dHy + RA[1, i] * RB[0, i] * EPhi[0, i, j, k] + RB[1, i] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, i] * EPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dHy + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHy + + +cpdef update_pml_2order_ez_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hy, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Ez field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, xf - i, j + ys, k + zs] + dHy = (Hy[xf - i, j + ys, k + zs] - Hy[xf - i - 1, j + ys, k + zs]) / dx + Ez[xf - i, j + ys, k + zs] = Ez[xf - i, j + ys, k + zs] + updatecoeffsE[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dHy + RA[1, i] * RB[0, i] * EPhi[0, i, j, k] + RB[1, i] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, i] * EPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dHy + RB[0, i] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, i] * EPhi[0, i, j, k] - RF[0, i] * dHy + + +cpdef update_pml_2order_ez_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ez field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, j + ys, k + zs] + dHx = (Hx[i + xs, j + ys, k + zs] - Hx[i + xs, j - 1 + ys, k + zs]) / dy + Ez[i + xs, j + ys, k + zs] = Ez[i + xs, j + ys, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dHx + RA[1, j] * RB[0, j] * EPhi[0, i, j, k] + RB[1, j] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, j] * EPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dHx + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHx + + +cpdef update_pml_2order_ez_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsE, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Ez, floattype_t[:, :, :] Hx, floattype_t[:, :, :, :] EPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Ez field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dHx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[2, i + xs, yf - j, k + zs] + dHx = (Hx[i + xs, yf - j, k + zs] - Hx[i + xs, yf - j - 1, k + zs]) / dy + Ez[i + xs, yf - j, k + zs] = Ez[i + xs, yf - j, k + zs] - updatecoeffsE[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dHx + RA[1, j] * RB[0, j] * EPhi[0, i, j, k] + RB[1, j] * EPhi[1, i, j, k]) + EPhi[1, i, j, k] = RE[1, j] * EPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dHx + RB[0, j] * EPhi[0, i, j, k]) + EPhi[0, i, j, k] = RE[0, j] * EPhi[0, i, j, k] - RF[0, j] * dHx + + +############################################# +# Magnetic field PML updates - Hx component # +############################################# +cpdef update_pml_2order_hx_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hx field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, k + zs] + dEz = (Ez[i + xs, j + 1 + ys, k + zs] - Ez[i + xs, j + ys, k + zs]) / dy + Hx[i + xs, j + ys, k + zs] = Hx[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dEz + RA[1, j] * RB[0, j] * HPhi[0, i, j, k] + RB[1, j] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, j] * HPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dEz + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEz + + +cpdef update_pml_2order_hx_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hx field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, yf - (j + 1), k + zs] + dEz = (Ez[i + xs, yf - j, k + zs] - Ez[i + xs, yf - (j + 1), k + zs]) / dy + Hx[i + xs, yf - (j + 1), k + zs] = Hx[i + xs, yf - (j + 1), k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dEz + RA[1, j] * RB[0, j] * HPhi[0, i, j, k] + RB[1, j] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, j] * HPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dEz + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEz + + +cpdef update_pml_2order_hx_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hx field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, k + zs] + dEy = (Ey[i + xs, j + ys, k + 1 + zs] - Ey[i + xs, j + ys, k + zs]) / dz + Hx[i + xs, j + ys, k + zs] = Hx[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dEy + RA[1, k] * RB[0, k] * HPhi[0, i, j, k] + RB[1, k] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, k] * HPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dEy + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEy + + +cpdef update_pml_2order_hx_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hx, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hx field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[3, i + xs, j + ys, zf - (k + 1)] + dEy = (Ey[i + xs, j + ys, zf - k] - Ey[i + xs, j + ys, zf - (k + 1)]) / dz + Hx[i + xs, j + ys, zf - (k + 1)] = Hx[i + xs, j + ys, zf - (k + 1)] + updatecoeffsH[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dEy + RA[1, k] * RB[0, k] * HPhi[0, i, j, k] + RB[1, k] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, k] * HPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dEy + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEy + + +############################################# +# Magnetic field PML updates - Hy component # +############################################# +cpdef update_pml_2order_hy_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hy field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, k + zs] + dEz = (Ez[i + 1 + xs, j + ys, k + zs] - Ez[i + xs, j + ys, k + zs]) / dx + Hy[i + xs, j + ys, k + zs] = Hy[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dEz + RA[1, i] * RB[0, i] * HPhi[0, i, j, k] + RB[1, i] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, i] * HPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dEz + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEz + + +cpdef update_pml_2order_hy_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ez, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hy field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEz + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, xf - (i + 1), j + ys, k + zs] + dEz = (Ez[xf - i, j + ys, k + zs] - Ez[xf - (i + 1), j + ys, k + zs]) / dx + Hy[xf - (i + 1), j + ys, k + zs] = Hy[xf - (i + 1), j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dEz + RA[1, i] * RB[0, i] * HPhi[0, i, j, k] + RB[1, i] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, i] * HPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dEz + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEz + + +cpdef update_pml_2order_hy_zplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hy field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, k + zs] + dEx = (Ex[i + xs, j + ys, k + 1 + zs] - Ex[i + xs, j + ys, k + zs]) / dz + Hy[i + xs, j + ys, k + zs] = Hy[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dEx + RA[1, k] * RB[0, k] * HPhi[0, i, j, k] + RB[1, k] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, k] * HPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dEx + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEx + + +cpdef update_pml_2order_hy_zminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hy, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dz): + """This function updates the Hy field components in the z stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[4, i + xs, j + ys, zf - (k + 1)] + dEx = (Ex[i + xs, j + ys, zf - k] - Ex[i + xs, j + ys, zf - (k + 1)]) / dz + Hy[i + xs, j + ys, zf - (k + 1)] = Hy[i + xs, j + ys, zf - (k + 1)] - updatecoeffsH[listIndex, 4] * ((RA[0, k] * RA[1, k] - 1) * dEx + RA[1, k] * RB[0, k] * HPhi[0, i, j, k] + RB[1, k] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, k] * HPhi[1, i, j, k] - RF[1, k] * (RA[0, k] * dEx + RB[0, k] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, k] * HPhi[0, i, j, k] - RF[0, k] * dEx + + +############################################# +# Magnetic field PML updates - Hz component # +############################################# +cpdef update_pml_2order_hz_xplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hz field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, j + ys, k + zs] + dEy = (Ey[i + 1 + xs, j + ys, k + zs] - Ey[i + xs, j + ys, k + zs]) / dx + Hz[i + xs, j + ys, k + zs] = Hz[i + xs, j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dEy + RA[1, i] * RB[0, i] * HPhi[0, i, j, k] + RB[1, i] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, i] * HPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dEy + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEy + + +cpdef update_pml_2order_hz_xminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ey, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dx): + """This function updates the Hz field components in the x stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEy + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, xf - (i + 1), j + ys, k + zs] + dEy = (Ey[xf - i, j + ys, k + zs] - Ey[xf - (i + 1), j + ys, k + zs]) / dx + Hz[xf - (i + 1), j + ys, k + zs] = Hz[xf - (i + 1), j + ys, k + zs] - updatecoeffsH[listIndex, 4] * ((RA[0, i] * RA[1, i] - 1) * dEy + RA[1, i] * RB[0, i] * HPhi[0, i, j, k] + RB[1, i] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, i] * HPhi[1, i, j, k] - RF[1, i] * (RA[0, i] * dEy + RB[0, i] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, i] * HPhi[0, i, j, k] - RF[0, i] * dEy + + +cpdef update_pml_2order_hz_yplus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hz field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, j + ys, k + zs] + dEx = (Ex[i + xs, j + 1 + ys, k + zs] - Ex[i + xs, j + ys, k + zs]) / dy + Hz[i + xs, j + ys, k + zs] = Hz[i + xs, j + ys, k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dEx + RA[1, j] * RB[0, j] * HPhi[0, i, j, k] + RB[1, j] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, j] * HPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dEx + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEx + + +cpdef update_pml_2order_hz_yminus(int xs, int xf, int ys, int yf, int zs, int zf, int nthreads, floattype_t[:, :] updatecoeffsH, np.uint32_t[:, :, :, :] ID, floattype_t[:, :, :] Hz, floattype_t[:, :, :] Ex, floattype_t[:, :, :, :] HPhi, floattype_t[:, :] RA, floattype_t[:, :] RB, floattype_t[:, :] RE, floattype_t[:, :] RF, float dy): + """This function updates the Hz field components in the y stretching direction. + + Args: + xs, xf, ys, yf, zs, zf (int): Cell coordinates of entire box + nthreads (int): Number of threads to use + updatecoeffs, ID, E, H (memoryviews): Access to update coeffients, ID and field component arrays + EPhi, HPhi, RA, RB, RE, RF (memoryviews): Access to PML coefficient arrays + dx, dy, dz (float): Spatial discretisation + """ + + cdef int i, j, k, nx, ny, nz, listIndex + cdef float dEx + nx = xf - xs + ny = yf - ys + nz = zf - zs + + for i in prange(0, nx, nogil=True, schedule='static', chunksize=1, num_threads=nthreads): + for j in range(0, ny): + for k in range(0, nz): + listIndex = ID[5, i + xs, yf - (j + 1), k + zs] + dEx = (Ex[i + xs, yf - j, k + zs] - Ex[i + xs, yf - (j + 1), k + zs]) / dy + Hz[i + xs, yf - (j + 1), k + zs] = Hz[i + xs, yf - (j + 1), k + zs] + updatecoeffsH[listIndex, 4] * ((RA[0, j] * RA[1, j] - 1) * dEx + RA[1, j] * RB[0, j] * HPhi[0, i, j, k] + RB[1, j] * HPhi[1, i, j, k]) + HPhi[1, i, j, k] = RE[1, j] * HPhi[1, i, j, k] - RF[1, j] * (RA[0, j] * dEx + RB[0, j] * HPhi[0, i, j, k]) + HPhi[0, i, j, k] = RE[0, j] * HPhi[0, i, j, k] - RF[0, j] * dEx + diff --git a/gprMax/pml_call_updates.py b/gprMax/pml_call_updates.py new file mode 100644 index 00000000..17205bed --- /dev/null +++ b/gprMax/pml_call_updates.py @@ -0,0 +1,118 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +from .pml_1order_update import * +from .pml_2order_update import * + + +def update_pml_electric(G): + """This functions updates electric field components with the PML correction.""" + + for pml in G.pmls: + if pml.direction == 'xminus': + if len(pml.CFS) == 1: + update_pml_1order_ey_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hz, pml.EPhiyxz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + update_pml_1order_ez_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hy, pml.EPhizxy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + elif len(pml.CFS) == 2: + update_pml_2order_ey_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hz, pml.EPhiyxz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + update_pml_2order_ez_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hy, pml.EPhizxy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + elif pml.direction == 'xplus': + if len(pml.CFS) == 1: + update_pml_1order_ey_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hz, pml.EPhiyxz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + update_pml_1order_ez_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hy, pml.EPhizxy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + elif len(pml.CFS) == 2: + update_pml_2order_ey_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hz, pml.EPhiyxz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + update_pml_2order_ez_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hy, pml.EPhizxy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dx) + elif pml.direction == 'yminus': + if len(pml.CFS) == 1: + update_pml_1order_ex_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hz, pml.EPhixyz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + update_pml_1order_ez_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hx, pml.EPhizyx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + elif len(pml.CFS) == 2: + update_pml_2order_ex_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hz, pml.EPhixyz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + update_pml_2order_ez_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hx, pml.EPhizyx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + elif pml.direction == 'yplus': + if len(pml.CFS) == 1: + update_pml_1order_ex_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hz, pml.EPhixyz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + update_pml_1order_ez_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hx, pml.EPhizyx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + elif len(pml.CFS) == 2: + update_pml_2order_ex_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hz, pml.EPhixyz, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + update_pml_2order_ez_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ez, G.Hx, pml.EPhizyx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dy) + elif pml.direction == 'zminus': + if len(pml.CFS) == 1: + update_pml_1order_ex_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hy, pml.EPhixzy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + update_pml_1order_ey_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hx, pml.EPhiyzx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + elif len(pml.CFS) == 2: + update_pml_2order_ex_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hy, pml.EPhixzy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + update_pml_2order_ey_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hx, pml.EPhiyzx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + elif pml.direction == 'zplus': + if len(pml.CFS) == 1: + update_pml_1order_ex_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hy, pml.EPhixzy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + update_pml_1order_ey_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hx, pml.EPhiyzx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + elif len(pml.CFS) == 2: + update_pml_2order_ex_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ex, G.Hy, pml.EPhixzy, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + update_pml_2order_ey_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsE, G.ID, G.Ey, G.Hx, pml.EPhiyzx, pml.ERA, pml.ERB, pml.ERE, pml.ERF, G.dz) + + +def update_pml_magnetic(G): + """This functions updates magnetic field components with the PML correction.""" + + for pml in G.pmls: + if pml.direction == 'xminus': + if len(pml.CFS) == 1: + update_pml_1order_hy_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ez, pml.HPhiyxz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + update_pml_1order_hz_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ey, pml.HPhizxy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + elif len(pml.CFS) == 2: + update_pml_2order_hy_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ez, pml.HPhiyxz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + update_pml_2order_hz_xminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ey, pml.HPhizxy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + elif pml.direction == 'xplus': + if len(pml.CFS) == 1: + update_pml_1order_hy_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ez, pml.HPhiyxz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + update_pml_1order_hz_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ey, pml.HPhizxy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + elif len(pml.CFS) == 2: + update_pml_2order_hy_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ez, pml.HPhiyxz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + update_pml_2order_hz_xplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ey, pml.HPhizxy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dx) + elif pml.direction == 'yminus': + if len(pml.CFS) == 1: + update_pml_1order_hx_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ez, pml.HPhixyz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + update_pml_1order_hz_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ex, pml.HPhizyx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + elif len(pml.CFS) == 2: + update_pml_2order_hx_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ez, pml.HPhixyz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + update_pml_2order_hz_yminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ex, pml.HPhizyx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + elif pml.direction == 'yplus': + if len(pml.CFS) == 1: + update_pml_1order_hx_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ez, pml.HPhixyz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + update_pml_1order_hz_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ex, pml.HPhizyx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + elif len(pml.CFS) == 2: + update_pml_2order_hx_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ez, pml.HPhixyz, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + update_pml_2order_hz_yplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hz, G.Ex, pml.HPhizyx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dy) + elif pml.direction == 'zminus': + if len(pml.CFS) == 1: + update_pml_1order_hx_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ey, pml.HPhixzy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + update_pml_1order_hy_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ex, pml.HPhiyzx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + elif len(pml.CFS) == 2: + update_pml_2order_hx_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ey, pml.HPhixzy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + update_pml_2order_hy_zminus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ex, pml.HPhiyzx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + elif pml.direction == 'zplus': + if len(pml.CFS) == 1: + update_pml_1order_hx_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ey, pml.HPhixzy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + update_pml_1order_hy_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ex, pml.HPhiyzx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + elif len(pml.CFS) == 2: + update_pml_2order_hx_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hx, G.Ey, pml.HPhixzy, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + update_pml_2order_hy_zplus(pml.xs, pml.xf, pml.ys, pml.yf, pml.zs, pml.zf, G.nthreads, G.updatecoeffsH, G.ID, G.Hy, G.Ex, pml.HPhiyzx, pml.HRA, pml.HRB, pml.HRE, pml.HRF, G.dz) + + diff --git a/gprMax/receivers.py b/gprMax/receivers.py new file mode 100644 index 00000000..657a38eb --- /dev/null +++ b/gprMax/receivers.py @@ -0,0 +1,31 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +class Rx: + """Receiever output points.""" + + def __init__(self, positionx=None, positiony=None, positionz=None): + """ + Args: + positionx (float): x-coordinate of location in model. + positiony (float): y-coordinate of location in model. + positionz (float): z-coordinate of location in model. + """ + self.positionx = positionx + self.positiony = positiony + self.positionz = positionz \ No newline at end of file diff --git a/gprMax/snapshots.py b/gprMax/snapshots.py new file mode 100644 index 00000000..32acde19 --- /dev/null +++ b/gprMax/snapshots.py @@ -0,0 +1,144 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys +import numpy as np +from struct import pack + +from .constants import floattype +from .utilities import rvalue + + +class Snapshot: + """Snapshots of the electric and magnetic field values.""" + + # Set string for byte order + if sys.byteorder == 'little': + byteorder = 'LittleEndian' + else: + byteorder = 'BigEndian' + + # Set format text and string depending on float type + if np.dtype(floattype).name == 'float32': + floatname = 'Float32' + floatstring = 'f' + elif np.dtype(floattype).name == 'float64': + floatname = 'Float64' + floatstring = 'd' + + def __init__(self, xs=None, ys=None, zs=None, xf=None, yf=None, zf=None, dx=None, dy=None, dz=None, time=None, filename=None): + """ + Args: + xs, xf, ys, yf, zs, zf (float): Extent of the volume. + dx, dy, dz (float): Spatial discretisation. + time (int): Iteration number to take the snapshot on. + filename (str): Filename to save to. + """ + self.xs = xs + self.ys = ys + self.zs = zs + self.xf = xf + self.yf = yf + self.zf = zf + self.dx = dx + self.dy = dy + self.dz = dz + self.time = time + self.filename = filename + + def prepare_file(self, modelrun, numbermodelruns, G): + """Prepares a VTK ImageData (.vti) file for a snapshot. + + Args: + modelrun (int): Current model run number. + numbermodelruns (int): Total number of model runs. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + # No Python 3 support for VTK at time of writing (03/2015) + self.vtk_nx = self.xf - self.xs + self.vtk_ny = self.yf - self.ys + self.vtk_nz = self.zf - self.zs + + # Construct filename from user-supplied name and model run number + if numbermodelruns == 1: + self.filename = G.inputdirectory + self.filename + '.vti' + else: + self.filename = G.inputdirectory + self.filename + '_' + str(modelrun) + '.vti' + + # Calculate number of cells according to requested sampling + self.vtk_xscells = rvalue(self.xs / self.dx) + self.vtk_xfcells = rvalue(self.xf / self.dx) + self.vtk_yscells = rvalue(self.ys / self.dy) + self.vtk_yfcells = rvalue(self.yf / self.dz) + self.vtk_zscells = rvalue(self.zs / self.dz) + self.vtk_zfcells = rvalue(self.zf / self.dz) + vtk_hfield_offset = 3 * np.dtype(floattype).itemsize * (self.vtk_xfcells - self.vtk_xscells) * (self.vtk_yfcells - self.vtk_yscells) * (self.vtk_zfcells - self.vtk_zscells) + np.dtype(np.uint32).itemsize +# vtk_current_offset = 2 * vtk_hfield_offset + + self.filehandle = open(self.filename, 'wb') + self.filehandle.write('\n'.encode('utf-8')) + self.filehandle.write('\n'.format(Snapshot.byteorder).encode('utf-8')) + self.filehandle.write('\n'.format(self.vtk_xscells, self.vtk_xfcells, self.vtk_yscells, self.vtk_yfcells, self.vtk_zscells, self.vtk_zfcells, self.dx * G.dx, self.dy * G.dy, self.dz * G.dz).encode('utf-8')) + self.filehandle.write('\n'.format(self.vtk_xscells, self.vtk_xfcells, self.vtk_yscells, self.vtk_yfcells, self.vtk_zscells, self.vtk_zfcells).encode('utf-8')) + self.filehandle.write('\n'.encode('utf-8')) +# self.filehandle.write('\n'.encode('utf-8')) + self.filehandle.write('\n'.format(Snapshot.floatname).encode('utf-8')) + self.filehandle.write('\n'.format(Snapshot.floatname, vtk_hfield_offset).encode('utf-8')) +# self.filehandle.write('\n'.format(Snapshot.floatname, vtk_current_offset).encode('utf-8')) + self.filehandle.write('\n\n\n\n_'.encode('utf-8')) + + def write_snapshot(self, Ex, Ey, Ez, Hx, Hy, Hz, G): + """Writes electric and magnetic field values to VTK ImageData (.vti) file. + + Args: + Ex, Ey, Ez, Hx, Hy, Hz (memory view): Electric and magnetic field values. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + datasize = 3 * np.dtype(floattype).itemsize * (self.vtk_xfcells - self.vtk_xscells) * (self.vtk_yfcells - self.vtk_yscells) * (self.vtk_zfcells - self.vtk_zscells) + # Write number of bytes of appended data as UInt32 + self.filehandle.write(pack('I', datasize)) + for k in range(self.zs, self.zf, self.dz): + for j in range(self.ys, self.yf, self.dy): + for i in range(self.xs, self.xf, self.dx): + # The electric field component value at a point comes from average of the 4 electric field component values in that cell + self.filehandle.write(pack(Snapshot.floatstring, (Ex[i, j, k] + Ex[i, j + 1, k] + Ex[i, j, k + 1] + Ex[i, j + 1, k + 1]) / 4)) + self.filehandle.write(pack(Snapshot.floatstring, (Ey[i, j, k] + Ey[i + 1, j, k] + Ey[i, j, k + 1] + Ey[i + 1, j, k + 1]) / 4)) + self.filehandle.write(pack(Snapshot.floatstring, (Ez[i, j, k] + Ez[i + 1, j, k] + Ez[i, j + 1, k] + Ez[i + 1, j + 1, k]) / 4)) + + self.filehandle.write(pack('I', datasize)) + for k in range(self.zs, self.zf, self.dz): + for j in range(self.ys, self.yf, self.dy): + for i in range(self.xs, self.xf, self.dx): + # The magnetic field component value at a point comes from average of 2 magnetic field component values in that cell and the following cell + self.filehandle.write(pack(Snapshot.floatstring, (Hx[i, j, k] + Hx[i + 1, j, k]) / 2)) + self.filehandle.write(pack(Snapshot.floatstring, (Hy[i, j, k] + Hy[i, j + 1, k]) / 2)) + self.filehandle.write(pack(Snapshot.floatstring, (Hz[i, j, k] + Hz[i, j, k + 1]) / 2)) + + # self.filehandle.write(pack('I', datasize)) + # for k in range(self.zs, self.zf, self.dz): + # for j in range(self.ys, self.yf, self.dy): + # for i in range(self.xs, self.xf, self.dx): + # self.filehandle.write(pack(Snapshot.floatstring, Ix[i, j, k])) + # self.filehandle.write(pack(Snapshot.floatstring, Iy[i, j, k])) + # self.filehandle.write(pack(Snapshot.floatstring, Iz[i, j, k])) + + self.filehandle.write('\n\n'.encode('utf-8')) + self.filehandle.close() + diff --git a/gprMax/sources.py b/gprMax/sources.py new file mode 100644 index 00000000..6f631f4e --- /dev/null +++ b/gprMax/sources.py @@ -0,0 +1,158 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np + +from .utilities import rvalue + + +class VoltageSource: + """Voltage sources.""" + + def __init__(self): + self.polarisation = None + self.positionx = None + self.positiony = None + self.positionz = None + self.start = None + self.stop = None + self.resistance = None + self.waveformID = None + + def update_fields(self, abstime, timestep, updatecoeffsE, ID, Ex, Ey, Ez, G): + """Updates electric field values for a voltage source. + + Args: + abstime (float): Absolute time. + timestep (int): Iteration number. + updatecoeffsE (memory view): numpy array of electric field update coefficients. + ID (memory view): numpy array of numeric IDs corresponding to materials in the model. + Ex, Ey, Ez (memory view): numpy array of electric field values. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + if abstime >= self.start and abstime <= self.stop: + # Set the time of the waveform evaluation to account for any delay in the start + time = abstime - self.start + i = self.positionx + j = self.positiony + k = self.positionz + waveform = next(x for x in G.waveforms if x.ID == self.waveformID) + + if self.polarisation is 'x': + if self.resistance != 0: + Ex[i, j, k] -= updatecoeffsE[ID[0, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (self.resistance * G.dy * G.dz)) + else: + Ex[i, j, k] = -1 * waveform.amp * waveform.calculate_value(time, G.dt) / G.dx + + elif self.polarisation is 'y': + if self.resistance != 0: + Ey[i, j, k] -= updatecoeffsE[ID[1, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (self.resistance * G.dx * G.dz)) + else: + Ey[i, j, k] = -1 * waveform.amp * waveform.calculate_value(time, G.dt) / G.dy + + elif self.polarisation is 'z': + if self.resistance != 0: + Ez[i, j, k] -= updatecoeffsE[ID[2, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (self.resistance * G.dx * G.dy)) + else: + Ez[i, j, k] = -1 * waveform.amp * waveform.calculate_value(time, G.dt) / G.dz + + +class HertzianDipole: + """Hertzian dipoles, i.e. normal additive source (current density).""" + + def __init__(self): + self.polarisation = None + self.positionx = None + self.positiony = None + self.positionz = None + self.start = None + self.stop = None + self.waveformID = None + + def update_fields(self, abstime, timestep, updatecoeffsE, ID, Ex, Ey, Ez, G): + """Updates electric field values for a Hertzian dipole. + + Args: + abstime (float): Absolute time. + timestep (int): Iteration number. + updatecoeffsE (memory view): numpy array of electric field update coefficients. + ID (memory view): numpy array of numeric IDs corresponding to materials in the model. + Ex, Ey, Ez (memory view): numpy array of electric field values. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + if abstime >= self.start and abstime <= self.stop: + # Set the time of the waveform evaluation to account for any delay in the start + time = abstime - self.start + i = self.positionx + j = self.positiony + k = self.positionz + waveform = next(x for x in G.waveforms if x.ID == self.waveformID) + + if self.polarisation is 'x': + Ex[i, j, k] -= updatecoeffsE[ID[0, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (G.dy * G.dz)) + + elif self.polarisation is 'y': + Ey[i, j, k] -= updatecoeffsE[ID[1, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (G.dx * G.dz)) + + elif self.polarisation is 'z': + Ez[i, j, k] -= updatecoeffsE[ID[2, i, j, k], 4] * waveform.amp * waveform.calculate_value(time, G.dt) * (1 / (G.dx * G.dy)) + + +class MagneticDipole: + """Magnetic dipoles, i.e. current on a small loop.""" + + def __init__(self): + self.polarisation = None + self.positionx = None + self.positiony = None + self.positionz = None + self.start = None + self.stop = None + self.waveformID = None + + def update_fields(self, abstime, timestep, updatecoeffsH, ID, Hx, Hy, Hz, G): + """Updates electric field values for a magnetic dipole. + + Args: + abstime (float): Absolute time. + timestep (int): Iteration number. + updatecoeffsH (memory view): numpy array of magnetic field update coefficients. + ID (memory view): numpy array of numeric IDs corresponding to materials in the model. + Hx, Hy, Hz (memory view): numpy array of magnetic field values. + G (class): Grid class instance - holds essential parameters describing the model. + """ + + if abstime >= self.start and abstime <= self.stop: + # Set the time of the waveform evaluation to account for any delay in the start + time = abstime - self.start + i = self.positionx + j = self.positiony + k = self.positionz + waveform = next(x for x in G.waveforms if x.ID == self.waveformID) + + if self.polarisation is 'x': + Hx[i, j, k] -= waveform.amp * waveform.calculate_value(time, G.dt) * (G.dt / (G.dx * G.dy * G.dz)) + + elif self.polarisation is 'y': + Hy[i, j, k] -= waveform.amp * waveform.calculate_value(time, G.dt) * (G.dt / (G.dx * G.dy * G.dz)) + + elif self.polarisation is 'z': + Hz[i, j, k] -= waveform.amp * waveform.calculate_value(time, G.dt) * (G.dt / (G.dx * G.dy * G.dz)) + diff --git a/gprMax/utilities.py b/gprMax/utilities.py new file mode 100644 index 00000000..85db5d27 --- /dev/null +++ b/gprMax/utilities.py @@ -0,0 +1,119 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import sys +import decimal as d +from pyfiglet import Figlet + + +class ListStream: + """A list can be streamed into. Required when temporarily redirecting stdio to capture output from users Python code blocks.""" + + def __init__(self): + self.data = [] + + def write(self, s): + self.data.append(s) + + +def logo(version): + """Print gprMax logo, version, and licencing/copyright information. + + Args: + version (str): Version number. + """ + + licenseinfo = """ +Copyright (C) 2015: The University of Edinburgh + Authors: Craig Warren and Antonis Giannopoulos + +gprMax is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +gprMax is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with gprMax. If not, see .""" + width = 65 + url = 'www.gprmax.com' + print('\n{} {} {}'.format('*'*round((width - len(url))/2), url, '*'*round((width - len(url))/2))) + gprMaxlogo = Figlet(font='standard', width=width, justify='center') + print('{}'.format(gprMaxlogo.renderText('gprMax'))) + print('{} v{} {}'.format('*'*round((width - len(version))/2), (version), '*'*round((width - len(version))/2))) + print(licenseinfo) + print('\n{}\n'.format('*'*(width+3))) + + +def update_progress(progress): + """Displays or updates a console progress bar. + + Args: + progress (float): Number between zero and one to signify progress. + """ + + # Modify this to change the length of the progress bar + barLength = 50 + block = rvalue(barLength * progress) + text = '\r|{}| {:2.1f}%'.format( '#' * block + '-' * (barLength - block), progress * 100) + sys.stdout.write(text) + sys.stdout.flush() + + +def rvalue(value): + """Rounds half values downward. + + Args: + value (float): Number to round. + + Returns: + Rounded value (float). + """ + + return int(d.Decimal(value).quantize(d.Decimal('1'),rounding=d.ROUND_HALF_DOWN)) + + +def human_size(size, a_kilobyte_is_1024_bytes=True): + """Convert a file size to human-readable form. + + Args: + size (int): file size in bytes + a_kilobyte_is_1024_bytes (boolean) - true for multiples of 1024, false for multiples of 1000 + + Returns: + Human-readable (string). + """ + + suffixes = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], 1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']} + + if size < 0: + raise ValueError('Number must be non-negative.') + + multiple = 1024 if a_kilobyte_is_1024_bytes else 1000 + for suffix in suffixes[multiple]: + size /= multiple + if size < multiple: + return '{0:.1f} {1}'.format(size, suffix) + + raise ValueError('Number is too large.') + + diff --git a/gprMax/waveforms.py b/gprMax/waveforms.py new file mode 100644 index 00000000..95139932 --- /dev/null +++ b/gprMax/waveforms.py @@ -0,0 +1,102 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np + +from .utilities import rvalue + + +class Waveform: + """Definitions of waveform shapes that can be used with sources.""" + + waveformtypes = ['gaussian', 'gaussiandot', 'gaussiandotdot', 'ricker', 'sine', 'contsine', 'impulse', 'user'] + + def __init__(self): + self.ID = None + self.type = None + self.amp = 1 + self.freq = 0 + self.uservalues = None + + def calculate_value(self, time, dt): + """Calculates value of the waveform at a specific time. + + Args: + time (float): Absolute time. + dt (float): Absolute time discretisation. + + Returns: + waveform (float): Calculated value for waveform. + """ + + chi = 1 / self.freq + zeta = 2 * np.pi * np.pi * self.freq * self.freq + delay = time - chi + + if self.type == 'gaussian': + waveform = np.exp(-zeta * delay * delay) + + elif self.type == 'gaussiandot': + waveform = -2 * zeta * delay * np.exp(-zeta * delay * delay) + + elif self.type == 'gaussiandotnorm': + normalise = np.sqrt(np.exp(1) / (2 * zeta)) + waveform = -2 * zeta * delay * np.exp(-zeta * delay * delay) * normalise + + elif self.type == 'gaussiandotdot': + waveform = 2 * zeta * (2 * zeta * delay * delay - 1) * np.exp(-zeta * delay * delay) + + elif self.type == 'gaussiandotdotnorm': + normalise = 1 / (2 * zeta) + waveform = 2 * zeta * (2 * zeta * delay * delay - 1) * np.exp(-zeta * delay * delay) * normalise + + elif self.type == 'gaussiandotdotdot': + waveform = zeta * zeta * (3 * delay - 2 * zeta * delay * delay * delay) * np.exp(-zeta * delay * delay) + + elif self.type == 'ricker': + normalise = 1 / (2 * zeta) + waveform = - (2 * zeta * (2 * zeta * delay * delay - 1) * np.exp(-zeta * delay * delay)) * normalise + + elif self.type == 'sine': + waveform = np.sin(2 * np.pi * self.freq * time) + if time * self.freq > 1: + waveform = 0 + + elif self.type == 'contsine': + rampamp = 0.25 + ramp = rampamp * time * self.freq + if ramp > 1: + ramp = 1 + waveform = ramp * np.sin(2 * np.pi * self.freq * time) + + elif self.type == 'impulse': + # time < G.dt condition required to do impulsive magnetic dipole + if time == 0 or time < dt: + waveform = 1 + elif time >= dt: + waveform = 0 + + elif self.type == 'user': + index = rvalue(time / dt) + # Check to see if there are still user specified values and if not use zero + if index > len(self.uservalues) - 1: + waveform = 0 + else: + waveform = self.uservalues[index] + + return waveform \ No newline at end of file diff --git a/gprMax/yee_cell_build.pyx b/gprMax/yee_cell_build.pyx new file mode 100644 index 00000000..f71a1d6c --- /dev/null +++ b/gprMax/yee_cell_build.pyx @@ -0,0 +1,332 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np +from .materials import Material +from .yee_cell_setget_rigid cimport get_rigid_Ex, get_rigid_Ey, get_rigid_Ez, get_rigid_Hx, get_rigid_Hy, get_rigid_Hz + + +cpdef build_ex_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Ex components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2, numID3, numID4 + + for i in range(0, G.nx): + for j in range(1, G.ny): + for k in range(1, G.nz): + + # If rigid is True do not average + if get_rigid_Ex(i, j, k, rigidE): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i, j - 1, k] + numID3 = solid[i, j - 1, k - 1] + numID4 = solid[i, j, k - 1] + + # If all values are the same no need to average + if numID1 == numID2 and numID1 == numID3 and numID1 == numID4: + ID[0, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + '|' + G.materials[numID3].ID + '|' + G.materials[numID4].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1]) and + x.ID.count(tmp[2]) == requiredID.count(tmp[2]) and + x.ID.count(tmp[3]) == requiredID.count(tmp[3])] + + if material: + ID[0, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er, G.materials[numID3].er, G.materials[numID4].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se, G.materials[numID3].se, G.materials[numID4].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr, G.materials[numID3].mr, G.materials[numID4].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm, G.materials[numID3].sm, G.materials[numID4].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[0, i, j, k] = newNumID + +cpdef build_ey_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Ey components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2, numID3, numID4 + + for i in range(1, G.nx): + for j in range(0, G.ny): + for k in range(1, G.nz): + + # If rigid is True do not average + if get_rigid_Ey(i, j, k, rigidE): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i - 1, j, k] + numID3 = solid[i - 1, j, k - 1] + numID4 = solid[i, j, k - 1] + + # If all values are the same no need to average + if numID1 == numID2 and numID1 == numID3 and numID1 == numID4: + ID[1, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + '|' + G.materials[numID3].ID + '|' + G.materials[numID4].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1]) and + x.ID.count(tmp[2]) == requiredID.count(tmp[2]) and + x.ID.count(tmp[3]) == requiredID.count(tmp[3])] + + if material: + ID[1, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er, G.materials[numID3].er, G.materials[numID4].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se, G.materials[numID3].se, G.materials[numID4].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr, G.materials[numID3].mr, G.materials[numID4].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm, G.materials[numID3].sm, G.materials[numID4].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[1, i, j, k] = newNumID + +cpdef build_ez_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidE, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Ez components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2, numID3, numID4 + + for i in range(1, G.nx): + for j in range(1, G.ny): + for k in range(0, G.nz): + + # If rigid is True do not average + if get_rigid_Ez(i, j, k, rigidE): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i - 1, j, k] + numID3 = solid[i - 1, j - 1, k] + numID4 = solid[i, j - 1, k] + + # If all values are the same no need to average + if numID1 == numID2 and numID1 == numID3 and numID1 == numID4: + ID[2, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + '|' + G.materials[numID3].ID + '|' + G.materials[numID4].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1]) and + x.ID.count(tmp[2]) == requiredID.count(tmp[2]) and + x.ID.count(tmp[3]) == requiredID.count(tmp[3])] + + if material: + ID[2, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er, G.materials[numID3].er, G.materials[numID4].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se, G.materials[numID3].se, G.materials[numID4].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr, G.materials[numID3].mr, G.materials[numID4].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm, G.materials[numID3].sm, G.materials[numID4].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[2, i, j, k] = newNumID + +cpdef build_hx_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Hx components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2 + + for i in range(1, G.nx): + for j in range(0, G.ny): + for k in range(0, G.nz): + + # If rigid is True do not average + if get_rigid_Hx(i, j, k, rigidH): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i - 1, j, k] + + # If all values are the same no need to average + if numID1 == numID2: + ID[3, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + (x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1])) or + (x.ID.count(tmp[0]) % 2 == 0 and x.ID.count(tmp[1]) % 2 == 0)] + + if material: + ID[3, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[3, i, j, k] = newNumID + +cpdef build_hy_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Hy components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2 + + for i in range(0, G.nx): + for j in range(1, G.ny): + for k in range(0, G.nz): + + # If rigid is True do not average + if get_rigid_Hy(i, j, k, rigidH): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i, j - 1, k] + + # If all values are the same no need to average + if numID1 == numID2: + ID[4, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + (x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1])) or + (x.ID.count(tmp[0]) % 2 == 0 and x.ID.count(tmp[1]) % 2 == 0)] + + if material: + ID[4, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[4, i, j, k] = newNumID + +cpdef build_hz_component(np.uint32_t[:, :, :] solid, np.int8_t[:, :, :, :] rigidH, np.uint32_t[:, :, :, :] ID, G): + """This function builds the Hz components in the ID array. + + Args: + solid, rigid, ID (memoryviews): Access to solid, rigid and ID arrays + """ + + cdef int i, j, k, numID1, numID2 + + for i in range(0, G.nx): + for j in range(0, G.ny): + for k in range(1, G.nz): + + # If rigid is True do not average + if get_rigid_Hz(i, j, k, rigidH): + pass + else: + numID1 = solid[i, j, k] + numID2 = solid[i, j, k - 1] + + # If all values are the same no need to average + if numID1 == numID2: + ID[5, i, j, k] = numID1 + else: + # Averaging is required + # Make an ID composed of the names of the four materials that will be averaged + requiredID = G.materials[numID1].ID + '|' + G.materials[numID2].ID + # Check if this material already exists + tmp = requiredID.split('|') + material = [x for x in G.materials if + (x.ID.count(tmp[0]) == requiredID.count(tmp[0]) and + x.ID.count(tmp[1]) == requiredID.count(tmp[1])) or + (x.ID.count(tmp[0]) % 2 == 0 and x.ID.count(tmp[1]) % 2 == 0)] + + if material: + ID[5, i, j, k] = material[0].numID + else: + # Create new material + newNumID = len(G.materials) + m = Material(newNumID, requiredID, G) + # Create averaged constituents for material + m.er = np.mean((G.materials[numID1].er, G.materials[numID2].er), axis=0) + m.se = np.mean((G.materials[numID1].se, G.materials[numID2].se), axis=0) + m.mr = np.mean((G.materials[numID1].mr, G.materials[numID2].mr), axis=0) + m.sm = np.mean((G.materials[numID1].sm, G.materials[numID2].sm), axis=0) + + # Append the new material object to the materials list + G.materials.append(m) + ID[5, i, j, k] = newNumID diff --git a/gprMax/yee_cell_setget_rigid.pxd b/gprMax/yee_cell_setget_rigid.pxd new file mode 100644 index 00000000..f6065665 --- /dev/null +++ b/gprMax/yee_cell_setget_rigid.pxd @@ -0,0 +1,44 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np + +# Get and set functions for the rigid electric component array. The rigid array is 4D with the 1st dimension holding +# the 12 electric edge components of a cell - Ex1, Ex2, Ex3, Ex4, Ey1, Ey2, Ey3, Ey4, Ez1, Ez2, Ez3, Ez4 +cdef bint get_rigid_Ex(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef bint get_rigid_Ey(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef bint get_rigid_Ez(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef void set_rigid_Ex(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef void set_rigid_Ey(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef void set_rigid_Ez(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef void set_rigid_E(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) +cdef void unset_rigid_E(int i, int j, int k, np.int8_t[:, :, :, :] rigidE) + +# Get and set functions for the rigid magnetic component array. The rigid array is 4D with the 1st dimension holding +# the 6 magnetic edge components - Hx1, Hx2, Hy1, Hy2, Hz1, Hz2 +cdef bint get_rigid_Hx(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef bint get_rigid_Hy(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef bint get_rigid_Hz(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef void set_rigid_Hx(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef void set_rigid_Hy(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef void set_rigid_Hz(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef void set_rigid_H(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) +cdef void unset_rigid_H(int i, int j, int k, np.int8_t[:, :, :, :] rigidH) + + diff --git a/gprMax/yee_cell_setget_rigid.pyx b/gprMax/yee_cell_setget_rigid.pyx new file mode 100644 index 00000000..653dba48 --- /dev/null +++ b/gprMax/yee_cell_setget_rigid.pyx @@ -0,0 +1,157 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +cimport numpy as np + +# Get and set functions for the rigid electric component array. The rigid array is 4D with the 1st dimension holding +# the 12 electric edge components of a cell - Ex1, Ex2, Ex3, Ex4, Ey1, Ey2, Ey3, Ey4, Ez1, Ez2, Ez3, Ez4 +cdef bint get_rigid_Ex(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + cdef bint result + result = False + if rigidE[0, i, j, k]: + result = True + if j != 0: + if rigidE[1, i, j - 1, k]: + result = True + if k != 0: + if rigidE[3, i, j, k - 1]: + result = True + if j != 0 and k != 0: + if rigidE[2, i, j - 1, k - 1]: + result = True + return result + +cdef bint get_rigid_Ey(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + cdef bint result + result = False + if rigidE[4, i, j, k]: + result = True + if i != 0: + if rigidE[7, i - 1, j, k]: + result = True + if k != 0: + if rigidE[5, i, j, k - 1]: + result = True + if i != 0 and k != 0: + if rigidE[6, i - 1, j, k - 1]: + result = True + return result + +cdef bint get_rigid_Ez(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + cdef bint result + result = False + if rigidE[8, i, j, k]: + result = True + if i != 0: + if rigidE[9, i - 1, j, k]: + result = True + if j != 0: + if rigidE[11, i, j - 1, k]: + result = True + if i != 0 and j != 0: + if rigidE[10, i - 1, j - 1, k]: + result = True + return result + +cdef void set_rigid_Ex(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + rigidE[0, i, j, k] = True + if j != 0: + rigidE[1, i, j - 1, k] = True + if k != 0: + rigidE[3, i, j, k - 1] = True + if j != 0 and k != 0: + rigidE[2, i, j - 1, k - 1] = True + +cdef void set_rigid_Ey(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + rigidE[4, i, j, k] = True + if i != 0: + rigidE[7, i - 1, j, k] = True + if k != 0: + rigidE[5, i, j, k - 1] = True + if i != 0 and k != 0: + rigidE[6, i - 1, j, k - 1] = True + +cdef void set_rigid_Ez(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + rigidE[8, i, j, k] = True + if i != 0: + rigidE[9, i - 1, j, k] = True + if j != 0: + rigidE[11, i, j - 1, k] = True + if i != 0 and j != 0: + rigidE[10, i - 1, j - 1, k] = True + +cdef void set_rigid_E(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + rigidE[:, i, j, k] = True + +cdef void unset_rigid_E(int i, int j, int k, np.int8_t[:, :, :, :] rigidE): + rigidE[:, i, j, k] = False + +# Get and set functions for the rigid magnetic component array. The rigid array is 4D with the 1st dimension holding +# the 6 magnetic edge components - Hx1, Hx2, Hy1, Hy2, Hz1, Hz2 +cdef bint get_rigid_Hx(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + cdef bint result + result = False + if rigidH[0, i, j, k]: + result = True + if i != 0: + if rigidH[1, i - 1, j, k]: + result = True + return result + +cdef bint get_rigid_Hy(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + cdef bint result + result = False + if rigidH[2, i, j, k]: + result = True + if j != 0: + if rigidH[3, i, j - 1, k]: + result = True + return result + +cdef bint get_rigid_Hz(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + cdef bint result + result = False + if rigidH[4, i, j, k]: + result = True + if k != 0: + if rigidH[5, i, j, k - 1]: + result = True + return result + +cdef void set_rigid_Hx(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + rigidH[0, i, j, k] = True + if i != 0: + rigidH[1, i - 1, j, k] = True + +cdef void set_rigid_Hy(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + rigidH[2, i, j, k] = True + if j != 0: + rigidH[3, i, j - 1, k] = True + +cdef void set_rigid_Hz(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + rigidH[4, i, j, k] = True + if k != 0: + rigidH[5, i, j, k - 1] = True + +cdef void set_rigid_H(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + rigidH[:, i, j, k] = True + +cdef void unset_rigid_H(int i, int j, int k, np.int8_t[:, :, :, :] rigidH): + rigidH[:, i, j, k] = False + diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..b381ce0b --- /dev/null +++ b/setup.py @@ -0,0 +1,136 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup + from distutils.extension import Extension + +try: + import numpy as np +except ImportError: + raise ImportError('The numpy package is required to build gprMax.') + +import glob, os, re, shutil, sys + +# Main package name +packagename = 'gprMax' + +# Read version number from gprMax/gprMax.py +version = re.search('^__version__\s*=\s*\'(.*)\'', + open(os.path.join(packagename, 'gprMax.py')).read(), + re.M).group(1) + +# Mac OS X - need to install gcc (via HomeBrew) and set it to be used. This is required because the default compiler LLVM (clang) does not support OpenMP +if sys.platform == 'darwin': + # Try to find a HomeBrew installed gcc + os.environ['CC'] = glob.glob('/usr/local/bin/gcc-[4-5]*')[0].split(os.sep)[-1] + +# Either Cythonize or just compile the .c files if --no-cython is given +if '--no-cython' in sys.argv: + USE_CYTHON = False + sys.argv.remove('--no-cython') +else: + USE_CYTHON = True + +# Build a list of all the files that need to be Cythonized looking in gprMax directory and user_libs +cythonfiles = [] +for root, dirs, files in os.walk(os.path.join(os.getcwd(), packagename)): + for file in files: + if file.endswith('.pyx'): + cythonfiles.append(os.path.join(packagename, file)) +for root, dirs, files in os.walk(os.path.join(os.getcwd(), 'user_libs')): + for file in files: + if file.endswith('.pyx'): + cythonfiles.append(os.path.join('user_libs', file)) + +# Option to cleanup Cython files +if 'cleanall' in sys.argv: + USE_CYTHON = False + print('Deleting Cython files...') + for file in cythonfiles: + tmp = os.path.splitext(file) + cfile = tmp[0] + '.c' + if sys.platform == 'win32': + libfile = tmp[0] + '.pyd' + else: + libfile = tmp[0] + '.so' + try: + os.remove(cfile) + except OSError: + pass + try: + os.remove(libfile) + except OSError: + pass + shutil.rmtree('build', ignore_errors=True) + # Now do a normal clean + sys.argv[1] = 'clean' # this is what distutils understands + +# Build a list of all the extensions +if sys.platform == 'win32': + compile_args = ['/O2', '/openmp', '/w'] + linker_args = ['/openmp'] +else: + compile_args = ['-O3', '-fopenmp', '-w'] + linker_args = ['-fopenmp'] + +extensions = [] +for file in cythonfiles: + tmp = os.path.splitext(file) + if USE_CYTHON: + fileext = tmp[1] + else: + fileext = '.c' + extension = Extension(tmp[0].replace(os.sep, '.'), + [tmp[0] + fileext], + language='c', + include_dirs=[np.get_include()], + extra_compile_args=compile_args, + extra_link_args=linker_args) + extensions.append(extension) + +if USE_CYTHON: + from Cython.Build import cythonize + extensions = cythonize(extensions, + compiler_directives={ + 'boundscheck': False, + 'wraparound': False, + 'embedsignature': True, + 'language_level': 3 + }, + annotate=False) + +setup(name=packagename, + version=version, + author='Craig Warren and Antonis Giannopoulos', + url='http://www.gprmax.com', + description='Electromagnetic Modelling Software based on the Finite-Difference Time-Domain (FDTD) method', + license='GPLv3+', + classifiers=[ + 'Environment :: Console', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows :: Windows 7', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Cython', + 'Programming Language :: Python :: 3 :: Only' + ], + ext_modules=extensions, + include_dirs=[np.get_include()]) diff --git a/setup_dev.py b/setup_dev.py new file mode 100644 index 00000000..ba6e453a --- /dev/null +++ b/setup_dev.py @@ -0,0 +1,99 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +from setuptools import setup, Extension +#import py2exe, os, sys, re +import os, sys, re +from cx_Freeze import setup, Executable + +#sys.argv.append('py2exe') + +# Main package name +packagename = 'gprMax' + +# Read version number from gprMax/gprMax.py +version = re.search('^__version__\s*=\s*\'(.*)\'', + open(os.path.join(packagename, 'gprMax.py')).read(), + re.M).group(1) + +includes = [] +include_files = [] +excludes = [] +packages = ['gprMax'] + +options = { + 'build_exe': { + 'path': [], + 'includes': includes, + 'include_files': include_files, + 'excludes': excludes, + 'packages': packages, + 'optimize': 2, + } + } + +executables = [ + Executable('gprMax/gprMax.py'), + ] + +setup(name=packagename, + version=version, + author='Craig Warren and Antonis Giannopoulos', + url='http://www.gprmax.com', + description='Electromagnetic Modelling Software based on the Finite-Difference Time-Domain (FDTD) method', + license='GPLv3+', + classifiers=[ + 'Environment :: Console', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows :: Windows 7', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Cython', + 'Programming Language :: Python :: 3 :: Only' + ], + options=options, + executables=executables + ) + +#setup(name=packagename, +# version=version, +# author='Craig Warren and Antonis Giannopoulos', +# url='http://www.gprmax.com', +# description='Electromagnetic Modelling Software based on the Finite-Difference Time-Domain (FDTD) method', +# license='GPLv3+', +# classifiers=[ +# 'Environment :: Console', +# 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', +# 'Operating System :: MacOS :: MacOS X', +# 'Operating System :: Microsoft :: Windows :: Windows 7', +# 'Operating System :: POSIX :: Linux', +# 'Programming Language :: Cython', +# 'Programming Language :: Python :: 3 :: Only' +# ], +# console=[{'script':'gprMax\gprMax.py'}], +# options = {"py2exe": {"compressed": False, +# "optimize": 2, +# "includes": includes, +# "excludes": excludes, +# "packages": packages, +# "dll_excludes": dll_excludes, +# "bundle_files": 1, +# } +# }, +# zipfile = None, +# ) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.in b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.in new file mode 100755 index 00000000..45a87360 --- /dev/null +++ b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.in @@ -0,0 +1,13 @@ +#title: Hertzian dipole in free-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + +#waveform: gaussiandot 1 1e9 myWave +#hertzian_dipole: z 0.050 0.050 0.050 myWave +#rx: 0.070 0.070 0.070 + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: diff --git a/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.out b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.out new file mode 100644 index 00000000..b874ea2f Binary files /dev/null and b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs.out differ diff --git a/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical.pdf b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical.pdf new file mode 100644 index 00000000..4cd34746 Binary files /dev/null and b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical.pdf differ diff --git a/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical_diffs.pdf b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical_diffs.pdf new file mode 100644 index 00000000..3cf23aaa Binary files /dev/null and b/tests/analytical/hertzian_dipole_fs/hertzian_dipole_fs_vs_analytical_diffs.pdf differ diff --git a/tests/analytical_solutions.py b/tests/analytical_solutions.py new file mode 100644 index 00000000..ac3fc6b0 --- /dev/null +++ b/tests/analytical_solutions.py @@ -0,0 +1,157 @@ +import numpy as np + +from gprMax.constants import c, e0 +from gprMax.utilities import rvalue +from gprMax.waveforms import Waveform + + +def hertzian_dipole_fs(timewindow, dt, dxdydz, rx): + """Analytical solution of a z-directed Hertzian dipole in free space with a Gaussian current waveform (http://dx.doi.org/10.1016/0021-9991(83)90103-1). + + Args: + timewindow (float): Length of time window (seconds). + dt (float): Time step (seconds). + dxdydz (float): Tuple of spatial resolution (metres). + rx (float): Tuple of coordinates of receiver position relative to transmitter position (metres). + + Returns: + fields (float): Array contain electric and magnetic field components. + """ + + # Waveform + w = Waveform() + w.type = 'gaussiandot' + w.amp = 1 + w.freq = 1e9 + + # Waveform integral + wint = Waveform() + wint.type = 'gaussian' + wint.amp = w.amp + wint.freq = w.freq + + # Waveform first derivative + wdot = Waveform() + wdot.type = 'gaussiandotdot' + wdot.amp = w.amp + wdot.freq = w.freq + + # Time + iterations = rvalue(timewindow / dt) + time = np.linspace(0, timewindow, iterations) + + # Spatial resolution + dx = dxdydz[0] + dy = dxdydz[1] + dz = dxdydz[2] + + # Coordinates of Rx relative to Tx + x = rx[0] + y = rx[1] + z = rx[2] + if z == 0: + sign_z = 1 + else: + sign_z = np.sign(z) + + # Coordinates of Rx for Ex FDTD component + Ex_x = x + 0.5 * dx + Ex_y = y + Ex_z = z - 0.5 * dz + Er_x = np.sqrt((Ex_x**2 + Ex_y**2 + Ex_z**2)) + tau_Ex = Er_x / c + + # Coordinates of Rx for Ey FDTD component + Ey_x = x + Ey_y = y + 0.5 * dy + Ey_z = z - 0.5 * dz + Er_y = np.sqrt((Ey_x**2 + Ey_y**2 + Ey_z**2)) + tau_Ey = Er_y / c + + # Coordinates of Rx for Ez FDTD component + Ez_x = x + Ez_y = y + Ez_z = z + Er_z = np.sqrt((Ez_x**2 + Ez_y**2 + Ez_z**2)) + tau_Ez = Er_z / c + + # Coordinates of Rx for Hx FDTD component + Hx_x = x + Hx_y = y + 0.5 * dy + Hx_z = z + Hr_x = np.sqrt((Hx_x**2 + Hx_y**2 + Hx_z**2)) + tau_Hx = Hr_x / c + + # Coordinates of Rx for Hy FDTD component + Hy_x = x + 0.5 * dx + Hy_y = y + Hy_z = z + Hr_y = np.sqrt((Hy_x**2 + Hy_y**2 + Hy_z**2)) + tau_Hy = Hr_y / c + + # Coordinates of Rx for Hz FDTD component + Hz_x = x + 0.5 * dx + Hz_y = y + 0.5 * dy + Hz_z = z - 0.5 * dz + Hr_z = np.sqrt((Hz_x**2 + Hz_y**2 + Hz_z**2)) + tau_Hz = Hr_z / c + + # Initialise fields + fields = np.zeros((iterations, 6)) + + # Calculate fields + for timestep in range(iterations): + + # Calculate values for waveform + fint_Ex = wint.calculate_value((timestep * dt) - tau_Ex, dt) * dx + f_Ex = w.calculate_value((timestep * dt) - tau_Ex, dt) * dx + fdot_Ex = wdot.calculate_value((timestep * dt) - tau_Ex, dt) * dx + + fint_Ey = wint.calculate_value((timestep * dt) - tau_Ey, dt) * dy + f_Ey= w.calculate_value((timestep * dt) - tau_Ey, dt) * dy + fdot_Ey = wdot.calculate_value((timestep * dt) - tau_Ey, dt) * dy + + fint_Ez = wint.calculate_value((timestep * dt) - tau_Ez, dt) * dz + f_Ez = w.calculate_value((timestep * dt) - tau_Ez, dt) * dz + fdot_Ez = wdot.calculate_value((timestep * dt) - tau_Ez, dt) * dz + + fint_Hx = wint.calculate_value((timestep * dt) - tau_Hx, dt) * dx + f_Hx = w.calculate_value((timestep * dt) - tau_Hx, dt) * dx + fdot_Hx = wdot.calculate_value((timestep * dt) - tau_Hx, dt) * dx + + fint_Hy = wint.calculate_value((timestep * dt) - tau_Hy, dt) * dy + f_Hy= w.calculate_value((timestep * dt) - tau_Hy, dt) * dy + fdot_Hy = wdot.calculate_value((timestep * dt) - tau_Hy, dt) * dy + + fint_Hz = wint.calculate_value((timestep * dt) - tau_Hz, dt) * dz + f_Hz = w.calculate_value((timestep * dt) - tau_Hz, dt) * dz + fdot_Hz = wdot.calculate_value((timestep * dt) - tau_Hz, dt) * dz + + # Ex + fields[timestep, 0] = ((Ex_x * Ex_z) / (4 * np.pi * e0 * Er_x**5)) * (3 * (fint_Ex + (tau_Ex * f_Ex)) + (tau_Ex**2 * fdot_Ex)) + + # Ey + try: + tmp = Ey_y / Ey_x + except ZeroDivisionError: + tmp = 0 + fields[timestep, 1] = tmp * ((Ey_x * Ey_z) / (4 * np.pi * e0 * Er_y**5)) * (3 * (fint_Ey + (tau_Ey * f_Ey)) + (tau_Ey**2 * fdot_Ey)) + + # Ez + fields[timestep, 2] = (1 / (4 * np.pi * e0 * Er_z**5)) * ((2 * Ez_z**2 - (Ez_x**2 + Ez_y**2)) * (fint_Ez + (tau_Ez * f_Ez)) - (Ez_x**2 + Ez_y**2) * tau_Ez**2 * fdot_Ez) + + # Hx + fields[timestep, 3] = - (Hx_y / (4 * np.pi * Hr_x**3)) * (f_Hx + (tau_Hx * fdot_Hx)) + + # Hy + try: + tmp = Hy_x / Hy_y + except ZeroDivisionError: + tmp = 0 + fields[timestep, 4] = - tmp * (- (Hy_y / (4 * np.pi * Hr_y**3)) * (f_Hy + (tau_Hy * fdot_Hy))) + + # Hz + fields[timestep, 5] = 0 + + return fields + diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in new file mode 100755 index 00000000..a9cb2d1b --- /dev/null +++ b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in @@ -0,0 +1,10 @@ +#title: GSSI 1.5GHz 'like' antenna in free-space +#domain: 0.250 0.187 0.183 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 8E-9 + +#python: +from user_libs.antennas import antenna_like_GSSI_1500 +antenna_like_GSSI_1500(0.125, 0.094, 0.100) +#end_python: + diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out new file mode 100644 index 00000000..0fec10c6 Binary files /dev/null and b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out differ diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in new file mode 100644 index 00000000..714eec52 --- /dev/null +++ b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in @@ -0,0 +1,82 @@ +#title: GSSI 1.5GHz 'like' antenna in free-space +#domain: 0.250 0.187 0.183 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 8E-9 +#material: 1.7 0.59 1.0 0.0 absorber +#material: 3.0 0.0 1.0 0.0 pcb +#material: 2.35 0.0 1.0 0.0 hdpe +#box: 0.039999999999999994 0.04 0.10400000000000001 0.21000000000000002 0.148 0.14700000000000002 hdpe +#box: 0.041999999999999996 0.042 0.10400000000000001 0.20800000000000002 0.146 0.14500000000000002 free_space +#box: 0.065 0.042 0.10400000000000001 0.18500000000000003 0.146 0.131 pec +#box: 0.067 0.044000000000000004 0.10400000000000001 0.124 0.144 0.128 pcb +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.129 absorber +#box: 0.126 0.044000000000000004 0.10400000000000001 0.183 0.144 0.128 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.129 absorber +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.10600000000000001 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.10600000000000001 pcb +#plate: 0.08499999999999999 0.079 0.10400000000000001 0.105 0.08 0.10400000000000001 pec +#plate: 0.08499999999999999 0.10700000000000001 0.10400000000000001 0.105 0.10800000000000001 0.10400000000000001 pec +#plate: 0.144 0.079 0.10400000000000001 0.16399999999999998 0.08 0.10400000000000001 pec +#plate: 0.144 0.10700000000000001 0.10400000000000001 0.16399999999999998 0.10800000000000001 0.10400000000000001 pec +#plate: 0.086 0.08 0.10400000000000001 0.104 0.081 0.10400000000000001 pec +#plate: 0.086 0.10600000000000001 0.10400000000000001 0.104 0.10700000000000001 0.10400000000000001 pec +#plate: 0.145 0.08 0.10400000000000001 0.16299999999999998 0.081 0.10400000000000001 pec +#plate: 0.145 0.10600000000000001 0.10400000000000001 0.16299999999999998 0.10700000000000001 0.10400000000000001 pec +#plate: 0.087 0.081 0.10400000000000001 0.103 0.082 0.10400000000000001 pec +#plate: 0.087 0.10500000000000001 0.10400000000000001 0.103 0.10600000000000001 0.10400000000000001 pec +#plate: 0.146 0.081 0.10400000000000001 0.16199999999999998 0.082 0.10400000000000001 pec +#plate: 0.146 0.10500000000000001 0.10400000000000001 0.16199999999999998 0.10600000000000001 0.10400000000000001 pec +#plate: 0.087 0.082 0.10400000000000001 0.103 0.083 0.10400000000000001 pec +#plate: 0.087 0.10400000000000001 0.10400000000000001 0.103 0.10500000000000001 0.10400000000000001 pec +#plate: 0.146 0.082 0.10400000000000001 0.16199999999999998 0.083 0.10400000000000001 pec +#plate: 0.146 0.10400000000000001 0.10400000000000001 0.16199999999999998 0.10500000000000001 0.10400000000000001 pec +#plate: 0.088 0.083 0.10400000000000001 0.102 0.084 0.10400000000000001 pec +#plate: 0.088 0.10300000000000001 0.10400000000000001 0.102 0.10400000000000001 0.10400000000000001 pec +#plate: 0.147 0.083 0.10400000000000001 0.16099999999999998 0.084 0.10400000000000001 pec +#plate: 0.147 0.10300000000000001 0.10400000000000001 0.16099999999999998 0.10400000000000001 0.10400000000000001 pec +#plate: 0.089 0.084 0.10400000000000001 0.10099999999999999 0.085 0.10400000000000001 pec +#plate: 0.089 0.10200000000000001 0.10400000000000001 0.10099999999999999 0.10300000000000001 0.10400000000000001 pec +#plate: 0.148 0.084 0.10400000000000001 0.15999999999999998 0.085 0.10400000000000001 pec +#plate: 0.148 0.10200000000000001 0.10400000000000001 0.15999999999999998 0.10300000000000001 0.10400000000000001 pec +#plate: 0.089 0.085 0.10400000000000001 0.10099999999999999 0.08600000000000001 0.10400000000000001 pec +#plate: 0.089 0.101 0.10400000000000001 0.10099999999999999 0.10200000000000001 0.10400000000000001 pec +#plate: 0.148 0.085 0.10400000000000001 0.15999999999999998 0.08600000000000001 0.10400000000000001 pec +#plate: 0.148 0.101 0.10400000000000001 0.15999999999999998 0.10200000000000001 0.10400000000000001 pec +#plate: 0.09 0.08600000000000001 0.10400000000000001 0.09999999999999999 0.08700000000000001 0.10400000000000001 pec +#plate: 0.09 0.1 0.10400000000000001 0.09999999999999999 0.101 0.10400000000000001 pec +#plate: 0.149 0.08600000000000001 0.10400000000000001 0.15899999999999997 0.08700000000000001 0.10400000000000001 pec +#plate: 0.149 0.1 0.10400000000000001 0.15899999999999997 0.101 0.10400000000000001 pec +#plate: 0.091 0.087 0.10400000000000001 0.09899999999999999 0.088 0.10400000000000001 pec +#plate: 0.091 0.099 0.10400000000000001 0.09899999999999999 0.1 0.10400000000000001 pec +#plate: 0.15 0.087 0.10400000000000001 0.15799999999999997 0.088 0.10400000000000001 pec +#plate: 0.15 0.099 0.10400000000000001 0.15799999999999997 0.1 0.10400000000000001 pec +#plate: 0.092 0.088 0.10400000000000001 0.09799999999999999 0.089 0.10400000000000001 pec +#plate: 0.092 0.098 0.10400000000000001 0.09799999999999999 0.099 0.10400000000000001 pec +#plate: 0.151 0.088 0.10400000000000001 0.15699999999999997 0.089 0.10400000000000001 pec +#plate: 0.151 0.098 0.10400000000000001 0.15699999999999997 0.099 0.10400000000000001 pec +#plate: 0.092 0.089 0.10400000000000001 0.09799999999999999 0.09 0.10400000000000001 pec +#plate: 0.092 0.09700000000000002 0.10400000000000001 0.09799999999999999 0.09800000000000002 0.10400000000000001 pec +#plate: 0.151 0.089 0.10400000000000001 0.15699999999999997 0.09 0.10400000000000001 pec +#plate: 0.151 0.09700000000000002 0.10400000000000001 0.15699999999999997 0.09800000000000002 0.10400000000000001 pec +#plate: 0.093 0.09 0.10400000000000001 0.097 0.091 0.10400000000000001 pec +#plate: 0.093 0.09600000000000002 0.10400000000000001 0.097 0.09700000000000002 0.10400000000000001 pec +#plate: 0.152 0.09 0.10400000000000001 0.15599999999999997 0.091 0.10400000000000001 pec +#plate: 0.152 0.09600000000000002 0.10400000000000001 0.15599999999999997 0.09700000000000002 0.10400000000000001 pec +#plate: 0.094 0.091 0.10400000000000001 0.096 0.092 0.10400000000000001 pec +#plate: 0.094 0.09500000000000001 0.10400000000000001 0.096 0.09600000000000002 0.10400000000000001 pec +#plate: 0.153 0.091 0.10400000000000001 0.15499999999999997 0.092 0.10400000000000001 pec +#plate: 0.153 0.09500000000000001 0.10400000000000001 0.15499999999999997 0.09600000000000002 0.10400000000000001 pec +#plate: 0.08399999999999999 0.10800000000000001 0.10400000000000001 0.10599999999999998 0.12300000000000001 0.10400000000000001 pec +#plate: 0.143 0.10800000000000001 0.10400000000000001 0.16499999999999998 0.12300000000000001 0.10400000000000001 pec +#edge: 0.095 0.092 0.10400000000000001 0.095 0.093 0.10400000000000001 pec +#edge: 0.095 0.094 0.10400000000000001 0.095 0.095 0.10400000000000001 pec +#edge: 0.154 0.092 0.10400000000000001 0.154 0.093 0.10400000000000001 pec +#edge: 0.154 0.094 0.10400000000000001 0.154 0.095 0.10400000000000001 pec +#plate: 0.08399999999999999 0.064 0.10400000000000001 0.10599999999999998 0.079 0.10400000000000001 pec +#plate: 0.143 0.064 0.10400000000000001 0.16499999999999998 0.079 0.10400000000000001 pec +#box: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.10400000000000001 hdpe +#geometry_view: 0.03899999999999999 0.039 0.099 0.21100000000000002 0.149 0.14800000000000002 0.001 0.001 0.001 antenna_like_GSSI_1500 n +#geometry_view: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.11 0.001 0.001 0.001 antenna_like_GSSI_1500_pcb f +#waveform: gaussian 1.0 1500000000.0 myGaussian +#voltage_source: y 0.154 0.093 0.10400000000000001 50 myGaussian +#rx: 0.095 0.093 0.10400000000000001 diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_real.txt b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_real.txt new file mode 100644 index 00000000..9a1d82cc --- /dev/null +++ b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_real.txt @@ -0,0 +1,4096 @@ + 0.0000000e+00 0.0000000e+00 + 1.9536020e-03 0.0000000e+00 + 3.9072039e-03 0.0000000e+00 + 5.8608059e-03 -6.6442141e-05 + 7.8144078e-03 1.1487377e-04 + 9.7680098e-03 9.0052560e-06 + 1.1721612e-02 -6.9847490e-05 + 1.3675214e-02 -4.7826233e-05 + 1.5628816e-02 -1.1161977e-04 + 1.7582418e-02 3.5491303e-05 + 1.9536020e-02 -4.9037024e-05 + 2.1489621e-02 -1.5914331e-04 + 2.3443223e-02 -6.2885443e-05 + 2.5396825e-02 -8.8539071e-05 + 2.7350427e-02 -4.2983070e-05 + 2.9304029e-02 -3.6248047e-05 + 3.1257631e-02 -1.5119749e-04 + 3.3211233e-02 8.0214885e-06 + 3.5164835e-02 -1.5770549e-04 + 3.7118437e-02 -1.2334930e-04 + 3.9072039e-02 2.4669861e-05 + 4.1025641e-02 -3.7837210e-06 + 4.2979243e-02 -2.7469814e-05 + 4.4932845e-02 -1.2561954e-05 + 4.6886447e-02 7.8247350e-05 + 4.8840049e-02 6.5382699e-05 + 5.0793651e-02 2.0961814e-05 + 5.2747253e-02 -5.5772047e-05 + 5.4700855e-02 1.2683033e-04 + 5.6654457e-02 -7.9760839e-05 + 5.8608059e-02 -5.4561257e-05 + 6.0561661e-02 9.2549816e-05 + 6.2515263e-02 7.5220373e-05 + 6.4468864e-02 6.7350234e-06 + 6.6422466e-02 -8.3317536e-05 + 6.8376068e-02 5.0626187e-05 + 7.0329670e-02 4.7447861e-05 + 7.2283272e-02 -3.2842698e-05 + 7.4236874e-02 1.0594419e-05 + 7.6190476e-02 -3.1404884e-05 + 7.8144078e-02 -5.0172140e-05 + 8.0097680e-02 -9.8376746e-07 + 8.2051282e-02 5.8269303e-06 + 8.4004884e-02 -2.2702326e-05 + 8.5958486e-02 1.8540233e-05 + 8.7912088e-02 -1.0397665e-04 + 8.9865690e-02 -1.0147940e-04 + 9.1819292e-02 1.2705735e-04 + 9.3772894e-02 1.1880884e-05 + 9.5726496e-02 -1.7178093e-05 + 9.7680098e-02 -1.9978047e-05 + 9.9633700e-02 -6.1977350e-05 + 1.0158730e-01 6.2734094e-05 + 1.0354090e-01 -3.0269768e-07 + 1.0549451e-01 -3.5112931e-05 + 1.0744811e-01 3.9048001e-05 + 1.0940171e-01 -2.1945582e-05 + 1.1135531e-01 1.3477614e-04 + 1.1330891e-01 3.5339954e-05 + 1.1526252e-01 -3.7307489e-05 + 1.1721612e-01 -1.8691582e-05 + 1.1916972e-01 -1.4907861e-05 + 1.2112332e-01 8.7782327e-06 + 1.2307692e-01 -4.8204605e-05 + 1.2503053e-01 -4.3134419e-06 + 1.2698413e-01 1.5762982e-04 + 1.2893773e-01 8.5436420e-05 + 1.3089133e-01 -1.4680837e-05 + 1.3284493e-01 9.2776839e-05 + 1.3479853e-01 -2.2702326e-07 + 1.3675214e-01 1.5664605e-05 + 1.3870574e-01 1.4567326e-04 + 1.4065934e-01 1.6875396e-05 + 1.4261294e-01 1.2857084e-04 + 1.4456654e-01 1.3197619e-04 + 1.4652015e-01 -6.8561024e-05 + 1.4847375e-01 -1.4302465e-05 + 1.5042735e-01 -1.2410605e-05 + 1.5238095e-01 4.5480326e-05 + 1.5433455e-01 7.2647443e-05 + 1.5628816e-01 2.8831954e-05 + 1.5824176e-01 9.0960653e-05 + 1.6019536e-01 3.3750791e-05 + 1.6214896e-01 -2.3610419e-05 + 1.6410256e-01 -5.2291024e-05 + 1.6605617e-01 1.0011726e-04 + 1.6800977e-01 2.3080698e-05 + 1.6996337e-01 4.8355954e-05 + 1.7191697e-01 7.0150187e-05 + 1.7387057e-01 1.1048465e-04 + 1.7582418e-01 1.4643000e-04 + 1.7777778e-01 5.1534280e-05 + 1.7973138e-01 -6.1296280e-05 + 1.8168498e-01 3.6853442e-05 + 1.8363858e-01 1.2788977e-05 + 1.8559219e-01 9.1187676e-05 + 1.8754579e-01 1.0276586e-04 + 1.8949939e-01 1.1805210e-04 + 1.9145299e-01 1.9675349e-04 + 1.9340659e-01 1.0064698e-05 + 1.9536020e-01 9.4290327e-05 + 1.9731380e-01 2.1642884e-04 + 1.9926740e-01 2.3216912e-04 + 2.0122100e-01 1.9365084e-04 + 2.0317460e-01 1.1472242e-04 + 2.0512821e-01 2.1718559e-04 + 2.0708181e-01 1.3977065e-04 + 2.0903541e-01 1.7987810e-04 + 2.1098901e-01 2.0969382e-04 + 2.1294261e-01 3.4439428e-04 + 2.1489621e-01 3.8677196e-04 + 2.1684982e-01 3.6626419e-04 + 2.1880342e-01 3.3099991e-04 + 2.2075702e-01 3.2260005e-04 + 2.2271062e-01 3.0390847e-04 + 2.2466422e-01 3.3311880e-04 + 2.2661783e-01 2.5502280e-04 + 2.2857143e-01 2.9543294e-04 + 2.3052503e-01 4.3580898e-04 + 2.3247863e-01 2.0462363e-04 + 2.3443223e-01 2.3110968e-04 + 2.3638584e-01 3.8132340e-04 + 2.3833944e-01 2.9111949e-04 + 2.4029304e-01 4.6214368e-04 + 2.4224664e-01 5.5007736e-04 + 2.4420024e-01 4.7379754e-04 + 2.4615385e-01 5.8254168e-04 + 2.4810745e-01 5.5204489e-04 + 2.5006105e-01 4.1620931e-04 + 2.5201465e-01 5.9775224e-04 + 2.5396825e-01 5.1541847e-04 + 2.5592186e-01 4.9892145e-04 + 2.5787546e-01 5.2245619e-04 + 2.5982906e-01 5.8670378e-04 + 2.6178266e-01 6.5011894e-04 + 2.6373626e-01 6.1848703e-04 + 2.6568987e-01 6.3195708e-04 + 2.6764347e-01 7.2276638e-04 + 2.6959707e-01 7.1489624e-04 + 2.7155067e-01 7.1164224e-04 + 2.7350427e-01 7.6514406e-04 + 2.7545788e-01 8.1153248e-04 + 2.7741148e-01 8.3597532e-04 + 2.7936508e-01 8.6268839e-04 + 2.8131868e-01 8.6896936e-04 + 2.8327228e-01 8.7578006e-04 + 2.8522589e-01 7.8943555e-04 + 2.8717949e-01 7.5386857e-04 + 2.8913309e-01 8.8758527e-04 + 2.9108669e-01 8.6359648e-04 + 2.9304029e-01 1.0723065e-03 + 2.9499389e-01 9.6136783e-04 + 2.9694750e-01 9.4948695e-04 + 2.9890110e-01 1.1133221e-03 + 3.0085470e-01 9.0975788e-04 + 3.0280830e-01 1.0405233e-03 + 3.0476190e-01 1.0950089e-03 + 3.0671551e-01 8.7540169e-04 + 3.0866911e-01 1.1211922e-03 + 3.1062271e-01 1.0408260e-03 + 3.1257631e-01 9.5243825e-04 + 3.1452991e-01 1.1273218e-03 + 3.1648352e-01 1.0281883e-03 + 3.1843712e-01 9.8248099e-04 + 3.2039072e-01 1.0881982e-03 + 3.2234432e-01 1.1739373e-03 + 3.2429792e-01 1.2025422e-03 + 3.2625153e-01 1.0284154e-03 + 3.2820513e-01 8.9356355e-04 + 3.3015873e-01 9.6008137e-04 + 3.3211233e-01 9.3541150e-04 + 3.3406593e-01 9.3813578e-04 + 3.3601954e-01 1.1478296e-03 + 3.3797314e-01 1.2215365e-03 + 3.3992674e-01 1.1600889e-03 + 3.4188034e-01 1.0172156e-03 + 3.4383394e-01 8.9742295e-04 + 3.4578755e-01 1.1095383e-03 + 3.4774115e-01 1.1274732e-03 + 3.4969475e-01 1.0194101e-03 + 3.5164835e-01 1.1205868e-03 + 3.5360195e-01 9.9072951e-04 + 3.5555556e-01 9.6931364e-04 + 3.5750916e-01 1.0096481e-03 + 3.5946276e-01 7.9079769e-04 + 3.6141636e-01 1.0343936e-03 + 3.6336996e-01 8.8554206e-04 + 3.6532357e-01 8.3536992e-04 + 3.6727717e-01 1.0398422e-03 + 3.6923077e-01 8.5285071e-04 + 3.7118437e-01 9.5047071e-04 + 3.7313797e-01 8.9598513e-04 + 3.7509158e-01 7.3086355e-04 + 3.7704518e-01 8.2174853e-04 + 3.7899878e-01 7.6030090e-04 + 3.8095238e-01 5.8693080e-04 + 3.8290598e-01 6.9181555e-04 + 3.8485958e-01 7.0604234e-04 + 3.8681319e-01 7.3131759e-04 + 3.8876679e-01 7.6022522e-04 + 3.9072039e-01 4.6585173e-04 + 3.9267399e-01 5.1988326e-04 + 3.9462759e-01 5.6861759e-04 + 3.9658120e-01 4.7788396e-04 + 3.9853480e-01 5.6105015e-04 + 4.0048840e-01 4.6380852e-04 + 4.0244200e-01 5.1072666e-04 + 4.0439560e-01 4.5949508e-04 + 4.0634921e-01 3.8987461e-04 + 4.0830281e-01 3.0504359e-04 + 4.1025641e-01 2.8218991e-04 + 4.1221001e-01 3.1435154e-04 + 4.1416361e-01 3.2638377e-04 + 4.1611722e-01 1.5853791e-04 + 4.1807082e-01 1.6164056e-04 + 4.2002442e-01 1.9856968e-04 + 4.2197802e-01 1.4302465e-05 + 4.2393162e-01 5.1534280e-05 + 4.2588523e-01 -2.9361675e-05 + 4.2783883e-01 1.8161861e-05 + 4.2979243e-01 8.6193164e-05 + 4.3174603e-01 -1.6005140e-04 + 4.3369963e-01 -2.3194210e-04 + 4.3565324e-01 -2.2702326e-04 + 4.3760684e-01 -3.8419903e-04 + 4.3956044e-01 -3.4023219e-04 + 4.4151404e-01 -3.5915080e-04 + 4.4346764e-01 -3.5491303e-04 + 4.4542125e-01 -3.1162726e-04 + 4.4737485e-01 -4.3838191e-04 + 4.4932845e-01 -4.2445782e-04 + 4.5128205e-01 -5.5749345e-04 + 4.5323565e-01 -4.8802433e-04 + 4.5518926e-01 -4.7780829e-04 + 4.5714286e-01 -5.5060708e-04 + 4.5909646e-01 -5.5310433e-04 + 4.6105006e-01 -5.5597996e-04 + 4.6300366e-01 -6.4209745e-04 + 4.6495726e-01 -5.7512559e-04 + 4.6691087e-01 -5.7194727e-04 + 4.6886447e-01 -5.9502796e-04 + 4.7081807e-01 -6.7932927e-04 + 4.7277167e-01 -6.5859448e-04 + 4.7472527e-01 -6.0297378e-04 + 4.7667888e-01 -4.9400261e-04 + 4.7863248e-01 -6.9105880e-04 + 4.8058608e-01 -6.2620582e-04 + 4.8253968e-01 -6.3453001e-04 + 4.8449328e-01 -6.9749113e-04 + 4.8644689e-01 -7.0748015e-04 + 4.8840049e-01 -7.1096117e-04 + 4.9035409e-01 -6.5942689e-04 + 4.9230769e-01 -7.1232331e-04 + 4.9426129e-01 -7.1678811e-04 + 4.9621490e-01 -6.5655127e-04 + 4.9816850e-01 -7.2337178e-04 + 5.0012210e-01 -6.4179476e-04 + 5.0207570e-01 -5.2169945e-04 + 5.0402930e-01 -6.5193513e-04 + 5.0598291e-01 -5.9722252e-04 + 5.0793651e-01 -6.0115759e-04 + 5.0989011e-01 -6.2476801e-04 + 5.1184371e-01 -4.3111717e-04 + 5.1379731e-01 -6.4845410e-04 + 5.1575092e-01 -5.9979545e-04 + 5.1770452e-01 -4.4087917e-04 + 5.1965812e-01 -4.8416494e-04 + 5.2161172e-01 -4.3883596e-04 + 5.2356532e-01 -3.2078387e-04 + 5.2551893e-01 -3.6142103e-04 + 5.2747253e-01 -2.6009298e-04 + 5.2942613e-01 -3.0708680e-04 + 5.3137973e-01 -2.5736870e-04 + 5.3333333e-01 -1.9796428e-04 + 5.3528694e-01 -2.3300154e-04 + 5.3724054e-01 -1.4037605e-04 + 5.3919414e-01 -5.9555768e-05 + 5.4114774e-01 -1.4241926e-04 + 5.4310134e-01 -3.2312977e-05 + 5.4505495e-01 3.8064233e-05 + 5.4700855e-01 1.0541447e-04 + 5.4896215e-01 1.7881865e-04 + 5.5091575e-01 1.0155507e-04 + 5.5286935e-01 3.5514005e-04 + 5.5482295e-01 2.9361675e-04 + 5.5677656e-01 3.0300038e-04 + 5.5873016e-01 5.8375248e-04 + 5.6068376e-01 4.7621912e-04 + 5.6263736e-01 4.5987345e-04 + 5.6459096e-01 8.5474257e-04 + 5.6654457e-01 7.3373918e-04 + 5.6849817e-01 7.0286401e-04 + 5.7045177e-01 9.2958457e-04 + 5.7240537e-01 7.5636583e-04 + 5.7435897e-01 1.0027617e-03 + 5.7631258e-01 9.3548718e-04 + 5.7826618e-01 8.6889369e-04 + 5.8021978e-01 1.1285326e-03 + 5.8217338e-01 1.1724238e-03 + 5.8412698e-01 1.1065114e-03 + 5.8608059e-01 1.1422297e-03 + 5.8803419e-01 1.2556656e-03 + 5.8998779e-01 1.3101512e-03 + 5.9194139e-01 1.2881300e-03 + 5.9389499e-01 1.3458696e-03 + 5.9584860e-01 1.5284719e-03 + 5.9780220e-01 1.5433041e-03 + 5.9975580e-01 1.6344161e-03 + 6.0170940e-01 1.6504591e-03 + 6.0366300e-01 1.4882888e-03 + 6.0561661e-01 1.6447835e-03 + 6.0757021e-01 1.7674518e-03 + 6.0952381e-01 1.6664264e-03 + 6.1147741e-01 1.9724538e-03 + 6.1343101e-01 1.9689727e-03 + 6.1538462e-01 1.9483136e-03 + 6.1733822e-01 1.9917507e-03 + 6.1929182e-01 1.9093413e-03 + 6.2124542e-01 2.1028408e-03 + 6.2319902e-01 2.2579733e-03 + 6.2515263e-01 2.2244496e-03 + 6.2710623e-01 2.3264587e-03 + 6.2905983e-01 2.3036050e-03 + 6.3101343e-01 2.2684164e-03 + 6.3296703e-01 2.4686509e-03 + 6.3492063e-01 2.3702742e-03 + 6.3687424e-01 2.4240787e-03 + 6.3882784e-01 2.5178393e-03 + 6.4078144e-01 2.5074719e-03 + 6.4273504e-01 2.6672206e-03 + 6.4468864e-01 2.6102378e-03 + 6.4664225e-01 2.6455777e-03 + 6.4859585e-01 2.4546512e-03 + 6.5054945e-01 2.5365309e-03 + 6.5250305e-01 2.6339995e-03 + 6.5445665e-01 2.6455777e-03 + 6.5641026e-01 2.5917732e-03 + 6.5836386e-01 2.6781177e-03 + 6.6031746e-01 2.7205711e-03 + 6.6227106e-01 2.7629487e-03 + 6.6422466e-01 2.8128939e-03 + 6.6617827e-01 2.8260612e-03 + 6.6813187e-01 2.7852727e-03 + 6.7008547e-01 2.7320736e-03 + 6.7203907e-01 2.8564823e-03 + 6.7399267e-01 2.9721128e-03 + 6.7594628e-01 2.9550104e-03 + 6.7789988e-01 2.9655292e-03 + 6.7985348e-01 2.9052923e-03 + 6.8180708e-01 3.0026096e-03 + 6.8376068e-01 3.2404543e-03 + 6.8571429e-01 3.0717004e-03 + 6.8766789e-01 3.1778716e-03 + 6.8962149e-01 3.2761727e-03 + 6.9157509e-01 3.2188871e-03 + 6.9352869e-01 3.2577081e-03 + 6.9548230e-01 3.2935021e-03 + 6.9743590e-01 3.3130261e-03 + 6.9938950e-01 3.1354939e-03 + 7.0134310e-01 3.1920227e-03 + 7.0329670e-01 3.2822266e-03 + 7.0525031e-01 3.2098062e-03 + 7.0720391e-01 3.2119251e-03 + 7.0915751e-01 3.2856320e-03 + 7.1111111e-01 3.2056441e-03 + 7.1306471e-01 3.1062836e-03 + 7.1501832e-01 3.1594070e-03 + 7.1697192e-01 3.1429100e-03 + 7.1892552e-01 3.4356187e-03 + 7.2087912e-01 3.3968734e-03 + 7.2283272e-01 3.4123866e-03 + 7.2478632e-01 3.3709170e-03 + 7.2673993e-01 3.1773419e-03 + 7.2869353e-01 3.2811672e-03 + 7.3064713e-01 3.4064840e-03 + 7.3260073e-01 3.3093181e-03 + 7.3455433e-01 3.4176838e-03 + 7.3650794e-01 3.4754991e-03 + 7.3846154e-01 3.2984209e-03 + 7.4041514e-01 3.2919129e-03 + 7.4236874e-01 3.1565314e-03 + 7.4432234e-01 3.2269086e-03 + 7.4627595e-01 3.3006155e-03 + 7.4822955e-01 3.1509315e-03 + 7.5018315e-01 3.1510072e-03 + 7.5213675e-01 3.2268329e-03 + 7.5409035e-01 3.2463569e-03 + 7.5604396e-01 3.3613821e-03 + 7.5799756e-01 3.1851363e-03 + 7.5995116e-01 3.1701528e-03 + 7.6190476e-01 3.2887346e-03 + 7.6385836e-01 3.1773419e-03 + 7.6581197e-01 3.1998928e-03 + 7.6776557e-01 3.3778791e-03 + 7.6971917e-01 3.2719349e-03 + 7.7167277e-01 3.2792753e-03 + 7.7362637e-01 3.3272529e-03 + 7.7557998e-01 3.1960334e-03 + 7.7753358e-01 3.2716322e-03 + 7.7948718e-01 3.1519153e-03 + 7.8144078e-01 3.3675874e-03 + 7.8339438e-01 3.4244945e-03 + 7.8534799e-01 3.3479877e-03 + 7.8730159e-01 3.3691765e-03 + 7.8925519e-01 3.2333409e-03 + 7.9120879e-01 3.2055684e-03 + 7.9316239e-01 3.3043235e-03 + 7.9511600e-01 3.3246043e-03 + 7.9706960e-01 3.1430614e-03 + 7.9902320e-01 3.3347447e-03 + 8.0097680e-01 3.2064765e-03 + 8.0293040e-01 3.3220314e-03 + 8.0488400e-01 3.4288836e-03 + 8.0683761e-01 3.2877508e-03 + 8.0879121e-01 3.3392095e-03 + 8.1074481e-01 3.3482904e-03 + 8.1269841e-01 3.3865060e-03 + 8.1465201e-01 3.4946447e-03 + 8.1660562e-01 3.4199541e-03 + 8.1855922e-01 3.5377791e-03 + 8.2051282e-01 3.4654344e-03 + 8.2246642e-01 3.4186676e-03 + 8.2442002e-01 3.7085763e-03 + 8.2637363e-01 3.6779282e-03 + 8.2832723e-01 3.4945690e-03 + 8.3028083e-01 3.7406622e-03 + 8.3223443e-01 3.6244263e-03 + 8.3418803e-01 3.6637014e-03 + 8.3614164e-01 3.6864794e-03 + 8.3809524e-01 3.6967711e-03 + 8.4004884e-01 3.7906074e-03 + 8.4200244e-01 3.8251149e-03 + 8.4395604e-01 3.7679807e-03 + 8.4590965e-01 3.9058595e-03 + 8.4786325e-01 3.8183042e-03 + 8.4981685e-01 3.7527702e-03 + 8.5177045e-01 3.7048682e-03 + 8.5372405e-01 3.6462206e-03 + 8.5567766e-01 3.9189512e-03 + 8.5763126e-01 4.0228522e-03 + 8.5958486e-01 3.9782799e-03 + 8.6153846e-01 4.0615218e-03 + 8.6349206e-01 4.0841484e-03 + 8.6544567e-01 4.0594029e-03 + 8.6739927e-01 4.0715865e-03 + 8.6935287e-01 4.0043119e-03 + 8.7130647e-01 4.0709811e-03 + 8.7326007e-01 4.2000817e-03 + 8.7521368e-01 4.2184705e-03 + 8.7716728e-01 4.4078836e-03 + 8.7912088e-01 4.3317551e-03 + 8.8107448e-01 4.4025107e-03 + 8.8302808e-01 4.4127268e-03 + 8.8498168e-01 4.3779922e-03 + 8.8693529e-01 4.5725511e-03 + 8.8888889e-01 4.5729295e-03 + 8.9084249e-01 4.4300562e-03 + 8.9279609e-01 4.6968085e-03 + 8.9474969e-01 4.6026696e-03 + 8.9670330e-01 4.6016858e-03 + 8.9865690e-01 4.7739965e-03 + 9.0061050e-01 4.6613929e-03 + 9.0256410e-01 4.8501249e-03 + 9.0451770e-01 4.8854649e-03 + 9.0647131e-01 4.7995744e-03 + 9.0842491e-01 4.8878108e-03 + 9.1037851e-01 4.8220497e-03 + 9.1233211e-01 4.9233778e-03 + 9.1428571e-01 4.9453233e-03 + 9.1623932e-01 4.8983295e-03 + 9.1819292e-01 5.0526297e-03 + 9.2014652e-01 5.2319024e-03 + 9.2210012e-01 5.1560766e-03 + 9.2405372e-01 5.2119243e-03 + 9.2600733e-01 5.2735233e-03 + 9.2796093e-01 5.2106379e-03 + 9.2991453e-01 5.2077622e-03 + 9.3186813e-01 5.3512409e-03 + 9.3382173e-01 5.3284629e-03 + 9.3577534e-01 5.3559327e-03 + 9.3772894e-01 5.3675866e-03 + 9.3968254e-01 5.3554030e-03 + 9.4163614e-01 5.5290001e-03 + 9.4358974e-01 5.5326325e-03 + 9.4554335e-01 5.5127301e-03 + 9.4749695e-01 5.6136041e-03 + 9.4945055e-01 5.7030513e-03 + 9.5140415e-01 5.8530380e-03 + 9.5335775e-01 5.7907580e-03 + 9.5531136e-01 5.8098279e-03 + 9.5726496e-01 5.8731674e-03 + 9.5921856e-01 5.9340096e-03 + 9.6117216e-01 5.9402149e-03 + 9.6312576e-01 6.0165704e-03 + 9.6507937e-01 6.0042355e-03 + 9.6703297e-01 5.8982913e-03 + 9.6898657e-01 5.9779765e-03 + 9.7094017e-01 6.0585697e-03 + 9.7289377e-01 5.9506580e-03 + 9.7484737e-01 6.0410133e-03 + 9.7680098e-01 6.3163925e-03 + 9.7875458e-01 6.2037133e-03 + 9.8070818e-01 6.3891913e-03 + 9.8266178e-01 6.4556334e-03 + 9.8461538e-01 6.3191168e-03 + 9.8656899e-01 6.4076558e-03 + 9.8852259e-01 6.3819265e-03 + 9.9047619e-01 6.5827664e-03 + 9.9242979e-01 6.5585506e-03 + 9.9438339e-01 6.5519669e-03 + 9.9633700e-01 6.5898798e-03 + 9.9829060e-01 6.5754260e-03 + 1.0002442e+00 6.6465600e-03 + 1.0021978e+00 6.6454249e-03 + 1.0041514e+00 6.6368736e-03 + 1.0061050e+00 6.6492843e-03 + 1.0080586e+00 6.7377476e-03 + 1.0100122e+00 6.8776697e-03 + 1.0119658e+00 6.9767275e-03 + 1.0139194e+00 6.9458523e-03 + 1.0158730e+00 7.0044243e-03 + 1.0178266e+00 7.0052567e-03 + 1.0197802e+00 6.9921650e-03 + 1.0217338e+00 7.0963687e-03 + 1.0236874e+00 7.0995471e-03 + 1.0256410e+00 7.0229645e-03 + 1.0275946e+00 7.2972843e-03 + 1.0295482e+00 7.3059869e-03 + 1.0315018e+00 7.3391323e-03 + 1.0334554e+00 7.4883622e-03 + 1.0354090e+00 7.3544942e-03 + 1.0373626e+00 7.5354317e-03 + 1.0393162e+00 7.6218519e-03 + 1.0412698e+00 7.5930199e-03 + 1.0432234e+00 7.7138720e-03 + 1.0451770e+00 7.7451255e-03 + 1.0471306e+00 7.7058505e-03 + 1.0490842e+00 7.9837270e-03 + 1.0510379e+00 7.8371456e-03 + 1.0529915e+00 7.9312846e-03 + 1.0549451e+00 8.0331424e-03 + 1.0568987e+00 8.0015105e-03 + 1.0588523e+00 8.0269371e-03 + 1.0608059e+00 8.1137356e-03 + 1.0627595e+00 8.1253895e-03 + 1.0647131e+00 8.2474523e-03 + 1.0666667e+00 8.3101107e-03 + 1.0686203e+00 8.3876770e-03 + 1.0705739e+00 8.4656974e-03 + 1.0725275e+00 8.4520760e-03 + 1.0744811e+00 8.5695227e-03 + 1.0764347e+00 8.5129939e-03 + 1.0783883e+00 8.5670254e-03 + 1.0803419e+00 8.6303649e-03 + 1.0822955e+00 8.6846991e-03 + 1.0842491e+00 8.8725987e-03 + 1.0862027e+00 8.8380155e-03 + 1.0881563e+00 8.7568925e-03 + 1.0901099e+00 8.8398317e-03 + 1.0920635e+00 8.9405543e-03 + 1.0940171e+00 8.9780132e-03 + 1.0959707e+00 8.9513001e-03 + 1.0979243e+00 9.0138072e-03 + 1.0998779e+00 9.2270577e-03 + 1.1018315e+00 9.3669040e-03 + 1.1037851e+00 9.2950890e-03 + 1.1057387e+00 9.4321354e-03 + 1.1076923e+00 9.3913469e-03 + 1.1096459e+00 9.4626322e-03 + 1.1115995e+00 9.5473118e-03 + 1.1135531e+00 9.4936587e-03 + 1.1155067e+00 9.5668358e-03 + 1.1174603e+00 9.6765637e-03 + 1.1194139e+00 9.6758070e-03 + 1.1213675e+00 9.7880322e-03 + 1.1233211e+00 9.8034697e-03 + 1.1252747e+00 9.8379773e-03 + 1.1272283e+00 9.9516403e-03 + 1.1291819e+00 9.9135004e-03 + 1.1311355e+00 9.9253056e-03 + 1.1330891e+00 1.0075444e-02 + 1.1350427e+00 1.0148091e-02 + 1.1369963e+00 1.0198036e-02 + 1.1389499e+00 1.0112373e-02 + 1.1409035e+00 1.0091411e-02 + 1.1428571e+00 1.0308218e-02 + 1.1448107e+00 1.0371558e-02 + 1.1467643e+00 1.0421503e-02 + 1.1487179e+00 1.0538495e-02 + 1.1506716e+00 1.0466832e-02 + 1.1526252e+00 1.0488021e-02 + 1.1545788e+00 1.0637705e-02 + 1.1565324e+00 1.0570733e-02 + 1.1584860e+00 1.0543112e-02 + 1.1604396e+00 1.0670245e-02 + 1.1623932e+00 1.0697336e-02 + 1.1643468e+00 1.0738579e-02 + 1.1663004e+00 1.0872220e-02 + 1.1682540e+00 1.0890381e-02 + 1.1702076e+00 1.0905970e-02 + 1.1721612e+00 1.0892122e-02 + 1.1741148e+00 1.0911570e-02 + 1.1760684e+00 1.1031893e-02 + 1.1780220e+00 1.0999277e-02 + 1.1799756e+00 1.1181879e-02 + 1.1819292e+00 1.1159480e-02 + 1.1838828e+00 1.1236138e-02 + 1.1858364e+00 1.1322709e-02 + 1.1877900e+00 1.1307423e-02 + 1.1897436e+00 1.1386654e-02 + 1.1916972e+00 1.1370763e-02 + 1.1936508e+00 1.1280105e-02 + 1.1956044e+00 1.1373941e-02 + 1.1975580e+00 1.1318547e-02 + 1.1995116e+00 1.1358125e-02 + 1.2014652e+00 1.1543906e-02 + 1.2034188e+00 1.1622531e-02 + 1.2053724e+00 1.1441745e-02 + 1.2073260e+00 1.1521960e-02 + 1.2092796e+00 1.1587494e-02 + 1.2112332e+00 1.1491463e-02 + 1.2131868e+00 1.1398989e-02 + 1.2151404e+00 1.1523928e-02 + 1.2170940e+00 1.1597635e-02 + 1.2190476e+00 1.1464599e-02 + 1.2210012e+00 1.1387638e-02 + 1.2229548e+00 1.1390060e-02 + 1.2249084e+00 1.1547538e-02 + 1.2268620e+00 1.1542468e-02 + 1.2288156e+00 1.1448859e-02 + 1.2307692e+00 1.1484728e-02 + 1.2327228e+00 1.1398232e-02 + 1.2346764e+00 1.1413821e-02 + 1.2366300e+00 1.1388395e-02 + 1.2385836e+00 1.1347606e-02 + 1.2405372e+00 1.1412686e-02 + 1.2424908e+00 1.1357066e-02 + 1.2444444e+00 1.1239619e-02 + 1.2463980e+00 1.1277834e-02 + 1.2483516e+00 1.1230008e-02 + 1.2503053e+00 1.1170907e-02 + 1.2522589e+00 1.0969083e-02 + 1.2542125e+00 1.0909073e-02 + 1.2561661e+00 1.0975515e-02 + 1.2581197e+00 1.0845431e-02 + 1.2600733e+00 1.0804869e-02 + 1.2620269e+00 1.0747887e-02 + 1.2639805e+00 1.0521847e-02 + 1.2659341e+00 1.0430659e-02 + 1.2678877e+00 1.0347493e-02 + 1.2698413e+00 1.0310791e-02 + 1.2717949e+00 1.0358163e-02 + 1.2737485e+00 1.0301105e-02 + 1.2757021e+00 1.0375871e-02 + 1.2776557e+00 1.0464107e-02 + 1.2796093e+00 1.0381093e-02 + 1.2815629e+00 1.0250706e-02 + 1.2835165e+00 1.0542355e-02 + 1.2854701e+00 1.0456616e-02 + 1.2874237e+00 1.0556052e-02 + 1.2893773e+00 1.0403417e-02 + 1.2913309e+00 1.0116156e-02 + 1.2932845e+00 1.0198188e-02 + 1.2952381e+00 9.9714670e-03 + 1.2971917e+00 9.8531122e-03 + 1.2991453e+00 9.6733854e-03 + 1.3010989e+00 9.5359607e-03 + 1.3030525e+00 9.6646829e-03 + 1.3050061e+00 9.3624392e-03 + 1.3069597e+00 9.1409402e-03 + 1.3089133e+00 9.0875141e-03 + 1.3108669e+00 8.9518298e-03 + 1.3128205e+00 8.7705896e-03 + 1.3147741e+00 8.7558331e-03 + 1.3167277e+00 8.4285412e-03 + 1.3186813e+00 8.4529084e-03 + 1.3206349e+00 8.3652017e-03 + 1.3225885e+00 8.1589133e-03 + 1.3245421e+00 8.1725347e-03 + 1.3264957e+00 7.9903863e-03 + 1.3284493e+00 7.6972993e-03 + 1.3304029e+00 7.6210195e-03 + 1.3323565e+00 7.5185563e-03 + 1.3343101e+00 7.4762543e-03 + 1.3362637e+00 7.3095436e-03 + 1.3382173e+00 6.9985974e-03 + 1.3401709e+00 6.9693870e-03 + 1.3421245e+00 6.6602570e-03 + 1.3440781e+00 6.4894599e-03 + 1.3460317e+00 6.5091352e-03 + 1.3479853e+00 6.1976593e-03 + 1.3499389e+00 6.1424170e-03 + 1.3518926e+00 6.0903530e-03 + 1.3538462e+00 5.7162943e-03 + 1.3557998e+00 5.5806101e-03 + 1.3577534e+00 5.5021357e-03 + 1.3597070e+00 5.2517291e-03 + 1.3616606e+00 5.0375705e-03 + 1.3636142e+00 4.8006338e-03 + 1.3655678e+00 4.7355538e-03 + 1.3675214e+00 4.6184855e-03 + 1.3694750e+00 4.2897558e-03 + 1.3714286e+00 4.1771523e-03 + 1.3733822e+00 4.0296629e-03 + 1.3753358e+00 3.7281760e-03 + 1.3772894e+00 3.8531901e-03 + 1.3792430e+00 3.5652489e-03 + 1.3811966e+00 3.4145055e-03 + 1.3831502e+00 3.3305826e-03 + 1.3851038e+00 3.0460467e-03 + 1.3870574e+00 2.9824802e-03 + 1.3890110e+00 2.9378323e-03 + 1.3909646e+00 2.6016866e-03 + 1.3929182e+00 2.5797410e-03 + 1.3948718e+00 2.3244155e-03 + 1.3968254e+00 2.2746217e-03 + 1.3987790e+00 2.3391720e-03 + 1.4007326e+00 2.0163449e-03 + 1.4026862e+00 1.9197087e-03 + 1.4046398e+00 1.6803505e-03 + 1.4065934e+00 1.4164738e-03 + 1.4085470e+00 1.5348286e-03 + 1.4105006e+00 1.4009605e-03 + 1.4124542e+00 1.3806041e-03 + 1.4144078e+00 1.3103783e-03 + 1.4163614e+00 1.0704903e-03 + 1.4183150e+00 1.0518744e-03 + 1.4202686e+00 8.1448378e-04 + 1.4222222e+00 7.5598745e-04 + 1.4241758e+00 7.9147876e-04 + 1.4261294e+00 6.0070355e-04 + 1.4280830e+00 5.1594819e-04 + 1.4300366e+00 5.2427238e-04 + 1.4319902e+00 3.1109754e-04 + 1.4339438e+00 1.7919703e-04 + 1.4358974e+00 3.0020042e-04 + 1.4378510e+00 1.1336028e-04 + 1.4398046e+00 5.7588234e-05 + 1.4417582e+00 1.1351163e-04 + 1.4437118e+00 1.1199814e-04 + 1.4456654e+00 2.7386573e-04 + 1.4476190e+00 1.2017098e-04 + 1.4495726e+00 1.8464558e-05 + 1.4515263e+00 -1.6042977e-05 + 1.4534799e+00 9.0657955e-05 + 1.4554335e+00 2.5169312e-04 + 1.4573871e+00 1.6867828e-04 + 1.4593407e+00 2.8726010e-04 + 1.4612943e+00 2.8998438e-04 + 1.4632479e+00 3.4530238e-04 + 1.4652015e+00 6.1296280e-04 + 1.4671551e+00 6.8591294e-04 + 1.4691087e+00 6.4156773e-04 + 1.4710623e+00 8.0608392e-04 + 1.4730159e+00 9.3866550e-04 + 1.4749695e+00 1.0586095e-03 + 1.4769231e+00 1.1869533e-03 + 1.4788767e+00 1.2776112e-03 + 1.4808303e+00 1.6755830e-03 + 1.4827839e+00 1.8474396e-03 + 1.4847375e+00 2.1570237e-03 + 1.4866911e+00 2.2886972e-03 + 1.4886447e+00 2.5793626e-03 + 1.4905983e+00 3.1326940e-03 + 1.4925519e+00 3.3547227e-03 + 1.4945055e+00 3.6118644e-03 + 1.4964591e+00 3.9287889e-03 + 1.4984127e+00 4.4127268e-03 + 1.5003663e+00 4.8676057e-03 + 1.5023199e+00 5.2682261e-03 + 1.5042735e+00 5.6192797e-03 + 1.5062271e+00 6.1367414e-03 + 1.5081807e+00 6.5993391e-03 + 1.5101343e+00 7.3113598e-03 + 1.5120879e+00 7.8259458e-03 + 1.5140415e+00 8.5418258e-03 + 1.5159951e+00 9.3155211e-03 + 1.5179487e+00 9.9425593e-03 + 1.5199023e+00 1.0464637e-02 + 1.5218559e+00 1.1376892e-02 + 1.5238095e+00 1.2111615e-02 + 1.5257631e+00 1.2896737e-02 + 1.5277167e+00 1.3719999e-02 + 1.5296703e+00 1.4188727e-02 + 1.5316239e+00 1.4978541e-02 + 1.5335775e+00 1.5830105e-02 + 1.5355311e+00 1.6612351e-02 + 1.5374847e+00 1.7418435e-02 + 1.5394383e+00 1.8172001e-02 + 1.5413919e+00 1.8964993e-02 + 1.5433455e+00 2.0323652e-02 + 1.5452991e+00 2.1121941e-02 + 1.5472527e+00 2.2420590e-02 + 1.5492063e+00 2.3694645e-02 + 1.5511600e+00 2.4846939e-02 + 1.5531136e+00 2.6520176e-02 + 1.5550672e+00 2.8101923e-02 + 1.5570208e+00 2.9522710e-02 + 1.5589744e+00 3.1273286e-02 + 1.5609280e+00 3.3375597e-02 + 1.5628816e+00 3.5173924e-02 + 1.5648352e+00 3.6862145e-02 + 1.5667888e+00 3.8620970e-02 + 1.5687424e+00 4.0719876e-02 + 1.5706960e+00 4.2984357e-02 + 1.5726496e+00 4.4928206e-02 + 1.5746032e+00 4.6884844e-02 + 1.5765568e+00 4.8815298e-02 + 1.5785104e+00 5.0950754e-02 + 1.5804640e+00 5.3223484e-02 + 1.5824176e+00 5.5098091e-02 + 1.5843712e+00 5.7142587e-02 + 1.5863248e+00 5.8766787e-02 + 1.5882784e+00 6.0639123e-02 + 1.5902320e+00 6.2693835e-02 + 1.5921856e+00 6.4443806e-02 + 1.5941392e+00 6.6113638e-02 + 1.5960928e+00 6.7750173e-02 + 1.5980464e+00 6.9864970e-02 + 1.6000000e+00 7.3353712e-02 + 1.6019536e+00 7.7371192e-02 + 1.6039072e+00 8.0846388e-02 + 1.6058608e+00 8.5191992e-02 + 1.6078144e+00 8.8652659e-02 + 1.6097680e+00 9.2441828e-02 + 1.6117216e+00 9.6910554e-02 + 1.6136752e+00 1.0063404e-01 + 1.6156288e+00 1.0496746e-01 + 1.6175824e+00 1.0972299e-01 + 1.6195360e+00 1.1394017e-01 + 1.6214896e+00 1.1854186e-01 + 1.6234432e+00 1.2302844e-01 + 1.6253968e+00 1.2851514e-01 + 1.6273504e+00 1.3286029e-01 + 1.6293040e+00 1.3714021e-01 + 1.6312576e+00 1.4174175e-01 + 1.6332112e+00 1.4621781e-01 + 1.6351648e+00 1.5044158e-01 + 1.6371184e+00 1.5472869e-01 + 1.6390720e+00 1.5967250e-01 + 1.6410256e+00 1.6433268e-01 + 1.6429792e+00 1.7082100e-01 + 1.6449328e+00 1.7600909e-01 + 1.6468864e+00 1.8194363e-01 + 1.6488400e+00 1.8828235e-01 + 1.6507937e+00 1.9421181e-01 + 1.6527473e+00 2.0031723e-01 + 1.6547009e+00 2.0678451e-01 + 1.6566545e+00 2.1343637e-01 + 1.6586081e+00 2.2027189e-01 + 1.6605617e+00 2.2792371e-01 + 1.6625153e+00 2.3564197e-01 + 1.6644689e+00 2.4334434e-01 + 1.6664225e+00 2.4961427e-01 + 1.6683761e+00 2.5679343e-01 + 1.6703297e+00 2.6569690e-01 + 1.6722833e+00 2.7303626e-01 + 1.6742369e+00 2.8058228e-01 + 1.6761905e+00 2.8793731e-01 + 1.6781441e+00 2.9621556e-01 + 1.6800977e+00 3.0505191e-01 + 1.6820513e+00 3.1392731e-01 + 1.6840049e+00 3.2215774e-01 + 1.6859585e+00 3.3086468e-01 + 1.6879121e+00 3.4006707e-01 + 1.6898657e+00 3.4903328e-01 + 1.6918193e+00 3.5737381e-01 + 1.6937729e+00 3.6501799e-01 + 1.6957265e+00 3.7294223e-01 + 1.6976801e+00 3.8155822e-01 + 1.6996337e+00 3.8815544e-01 + 1.7015873e+00 3.9619797e-01 + 1.7035409e+00 4.0432487e-01 + 1.7054945e+00 4.1194543e-01 + 1.7074481e+00 4.1934057e-01 + 1.7094017e+00 4.2875575e-01 + 1.7113553e+00 4.3694531e-01 + 1.7133089e+00 4.4445902e-01 + 1.7152625e+00 4.5314509e-01 + 1.7172161e+00 4.6013680e-01 + 1.7191697e+00 4.6976939e-01 + 1.7211233e+00 4.7916831e-01 + 1.7230769e+00 4.8934932e-01 + 1.7250305e+00 4.9944595e-01 + 1.7269841e+00 5.0968765e-01 + 1.7289377e+00 5.2036228e-01 + 1.7308913e+00 5.2987426e-01 + 1.7328449e+00 5.3908618e-01 + 1.7347985e+00 5.4891447e-01 + 1.7367521e+00 5.5842932e-01 + 1.7387057e+00 5.6666088e-01 + 1.7406593e+00 5.7440956e-01 + 1.7426129e+00 5.8382300e-01 + 1.7445665e+00 5.9217186e-01 + 1.7465201e+00 5.9975852e-01 + 1.7484737e+00 6.0715661e-01 + 1.7504274e+00 6.1527904e-01 + 1.7523810e+00 6.2225433e-01 + 1.7543346e+00 6.2903567e-01 + 1.7562882e+00 6.3622807e-01 + 1.7582418e+00 6.4207899e-01 + 1.7601954e+00 6.4757197e-01 + 1.7621490e+00 6.4937529e-01 + 1.7641026e+00 6.5384757e-01 + 1.7660562e+00 6.6150726e-01 + 1.7680098e+00 6.6890890e-01 + 1.7699634e+00 6.7468271e-01 + 1.7719170e+00 6.7985150e-01 + 1.7738706e+00 6.8568441e-01 + 1.7758242e+00 6.9005899e-01 + 1.7777778e+00 6.9472477e-01 + 1.7797314e+00 6.9909649e-01 + 1.7816850e+00 7.0304805e-01 + 1.7836386e+00 7.0650244e-01 + 1.7855922e+00 7.0938601e-01 + 1.7875458e+00 7.1299061e-01 + 1.7894994e+00 7.1578663e-01 + 1.7914530e+00 7.1744708e-01 + 1.7934066e+00 7.1814714e-01 + 1.7953602e+00 7.1811914e-01 + 1.7973138e+00 7.1881588e-01 + 1.7992674e+00 7.1989378e-01 + 1.8012210e+00 7.1999171e-01 + 1.8031746e+00 7.1976779e-01 + 1.8051282e+00 7.1935952e-01 + 1.8070818e+00 7.1872734e-01 + 1.8090354e+00 7.1682677e-01 + 1.8109890e+00 7.1494710e-01 + 1.8129426e+00 7.1259506e-01 + 1.8148962e+00 7.0914650e-01 + 1.8168498e+00 7.0520659e-01 + 1.8188034e+00 7.0083889e-01 + 1.8207570e+00 6.9519479e-01 + 1.8227106e+00 6.8778709e-01 + 1.8246642e+00 6.7970355e-01 + 1.8266178e+00 6.7194473e-01 + 1.8285714e+00 6.6474938e-01 + 1.8305250e+00 6.5584560e-01 + 1.8324786e+00 6.4672396e-01 + 1.8344322e+00 6.3726208e-01 + 1.8363858e+00 6.2855219e-01 + 1.8383394e+00 6.1830950e-01 + 1.8402930e+00 6.0750773e-01 + 1.8422466e+00 5.9600439e-01 + 1.8442002e+00 5.8621515e-01 + 1.8461538e+00 5.7483977e-01 + 1.8481074e+00 5.6358464e-01 + 1.8500611e+00 5.5377632e-01 + 1.8520147e+00 5.4126999e-01 + 1.8539683e+00 5.2798890e-01 + 1.8559219e+00 5.1505145e-01 + 1.8578755e+00 5.0216652e-01 + 1.8598291e+00 4.8965065e-01 + 1.8617827e+00 4.7198726e-01 + 1.8637363e+00 4.5306722e-01 + 1.8656899e+00 4.3340640e-01 + 1.8676435e+00 4.1224715e-01 + 1.8695971e+00 3.9191827e-01 + 1.8715507e+00 3.7274079e-01 + 1.8735043e+00 3.5030839e-01 + 1.8754579e+00 3.2877675e-01 + 1.8774115e+00 3.0781395e-01 + 1.8793651e+00 2.8773231e-01 + 1.8813187e+00 2.6727191e-01 + 1.8832723e+00 2.4673932e-01 + 1.8852259e+00 2.2649778e-01 + 1.8871795e+00 2.0493753e-01 + 1.8891331e+00 1.8452852e-01 + 1.8910867e+00 1.7128640e-01 + 1.8930403e+00 1.6044861e-01 + 1.8949939e+00 1.5056674e-01 + 1.8969475e+00 1.3846171e-01 + 1.8989011e+00 1.2871091e-01 + 1.9008547e+00 1.2294437e-01 + 1.9028083e+00 1.1823666e-01 + 1.9047619e+00 1.2460194e-01 + 1.9067155e+00 1.1360668e-01 + 1.9086691e+00 9.2636690e-02 + 1.9106227e+00 7.0223062e-02 + 1.9125763e+00 4.6274227e-02 + 1.9145299e+00 2.4955229e-02 + 1.9164835e+00 1.0964467e-03 + 1.9184371e+00 -2.2739785e-02 + 1.9203907e+00 -4.7488120e-02 + 1.9223443e+00 -7.5143261e-02 + 1.9242979e+00 -1.0042767e-01 + 1.9262515e+00 -1.2609447e-01 + 1.9282051e+00 -1.5200055e-01 + 1.9301587e+00 -1.7639601e-01 + 1.9321123e+00 -2.0267433e-01 + 1.9340659e+00 -2.2821854e-01 + 1.9360195e+00 -2.5260606e-01 + 1.9379731e+00 -2.8053378e-01 + 1.9399267e+00 -3.0693469e-01 + 1.9418803e+00 -3.3096404e-01 + 1.9438339e+00 -3.5425981e-01 + 1.9457875e+00 -3.7933127e-01 + 1.9477411e+00 -4.0219675e-01 + 1.9496947e+00 -4.2378515e-01 + 1.9516484e+00 -4.4554420e-01 + 1.9536020e+00 -4.6441225e-01 + 1.9555556e+00 -4.8280643e-01 + 1.9575092e+00 -5.0288724e-01 + 1.9594628e+00 -5.2199859e-01 + 1.9614164e+00 -5.4181765e-01 + 1.9633700e+00 -5.6139931e-01 + 1.9653236e+00 -5.8408272e-01 + 1.9672772e+00 -6.0416467e-01 + 1.9692308e+00 -6.2283112e-01 + 1.9711844e+00 -6.3839470e-01 + 1.9731380e+00 -6.5478389e-01 + 1.9750916e+00 -6.7282944e-01 + 1.9770452e+00 -6.9189115e-01 + 1.9789988e+00 -7.1048019e-01 + 1.9809524e+00 -7.2911494e-01 + 1.9829060e+00 -7.4904932e-01 + 1.9848596e+00 -7.6597973e-01 + 1.9868132e+00 -7.8314050e-01 + 1.9887668e+00 -7.9946211e-01 + 1.9907204e+00 -8.1708691e-01 + 1.9926740e+00 -8.3012546e-01 + 1.9946276e+00 -8.4361306e-01 + 1.9965812e+00 -8.5757325e-01 + 1.9985348e+00 -8.7016979e-01 + 2.0004884e+00 -8.8280984e-01 + 2.0024420e+00 -8.9384059e-01 + 2.0043956e+00 -9.0612618e-01 + 2.0063492e+00 -9.1601259e-01 + 2.0083028e+00 -9.2642373e-01 + 2.0102564e+00 -9.3717071e-01 + 2.0122100e+00 -9.4531956e-01 + 2.0141636e+00 -9.5212708e-01 + 2.0161172e+00 -9.5870659e-01 + 2.0180708e+00 -9.6505166e-01 + 2.0200244e+00 -9.7115268e-01 + 2.0219780e+00 -9.7648667e-01 + 2.0239316e+00 -9.8083787e-01 + 2.0258852e+00 -9.8522669e-01 + 2.0278388e+00 -9.8911855e-01 + 2.0297924e+00 -9.9336441e-01 + 2.0317460e+00 -9.9637255e-01 + 2.0336996e+00 -9.9830527e-01 + 2.0356532e+00 -9.9947172e-01 + 2.0376068e+00 -9.9894843e-01 + 2.0395604e+00 -9.9941549e-01 + 2.0415140e+00 -9.9975739e-01 + 2.0434676e+00 -1.0000000e+00 + 2.0454212e+00 -9.9966552e-01 + 2.0473748e+00 -9.9959211e-01 + 2.0493284e+00 -9.9894079e-01 + 2.0512821e+00 -9.9725953e-01 + 2.0532357e+00 -9.9508654e-01 + 2.0551893e+00 -9.9302274e-01 + 2.0571429e+00 -9.9009316e-01 + 2.0590965e+00 -9.8644792e-01 + 2.0610501e+00 -9.8285853e-01 + 2.0630037e+00 -9.7876424e-01 + 2.0649573e+00 -9.7366727e-01 + 2.0669109e+00 -9.6899051e-01 + 2.0688645e+00 -9.6379002e-01 + 2.0708181e+00 -9.5848865e-01 + 2.0727717e+00 -9.5325205e-01 + 2.0747253e+00 -9.4653315e-01 + 2.0766789e+00 -9.4043825e-01 + 2.0786325e+00 -9.3442880e-01 + 2.0805861e+00 -9.2836243e-01 + 2.0825397e+00 -9.2401312e-01 + 2.0844933e+00 -9.1652279e-01 + 2.0864469e+00 -9.0835177e-01 + 2.0884005e+00 -9.0012535e-01 + 2.0903541e+00 -8.9146987e-01 + 2.0923077e+00 -8.8367207e-01 + 2.0942613e+00 -8.7514349e-01 + 2.0962149e+00 -8.6675891e-01 + 2.0981685e+00 -8.5843019e-01 + 2.1001221e+00 -8.5132285e-01 + 2.1020757e+00 -8.4231524e-01 + 2.1040293e+00 -8.3368268e-01 + 2.1059829e+00 -8.2408270e-01 + 2.1079365e+00 -8.1383578e-01 + 2.1098901e+00 -8.0510295e-01 + 2.1118437e+00 -7.9485929e-01 + 2.1137973e+00 -7.8505286e-01 + 2.1157509e+00 -7.7206834e-01 + 2.1177045e+00 -7.5943193e-01 + 2.1196581e+00 -7.4726507e-01 + 2.1216117e+00 -7.3469275e-01 + 2.1235653e+00 -7.2011233e-01 + 2.1255189e+00 -7.0681338e-01 + 2.1274725e+00 -6.9486243e-01 + 2.1294261e+00 -6.8291215e-01 + 2.1313797e+00 -6.6994276e-01 + 2.1333333e+00 -6.5713464e-01 + 2.1352869e+00 -6.4440015e-01 + 2.1372405e+00 -6.3230405e-01 + 2.1391941e+00 -6.2016511e-01 + 2.1411477e+00 -6.0584994e-01 + 2.1431013e+00 -5.9085346e-01 + 2.1450549e+00 -5.7655372e-01 + 2.1470085e+00 -5.6253594e-01 + 2.1489621e+00 -5.4844181e-01 + 2.1509158e+00 -5.3331464e-01 + 2.1528694e+00 -5.1866687e-01 + 2.1548230e+00 -5.0665031e-01 + 2.1567766e+00 -4.9477790e-01 + 2.1587302e+00 -4.8164294e-01 + 2.1606838e+00 -4.6772111e-01 + 2.1626374e+00 -4.5483035e-01 + 2.1645910e+00 -4.4325187e-01 + 2.1665446e+00 -4.3185863e-01 + 2.1684982e+00 -4.2024639e-01 + 2.1704518e+00 -4.0794392e-01 + 2.1724054e+00 -3.9438072e-01 + 2.1743590e+00 -3.8276212e-01 + 2.1763126e+00 -3.7183867e-01 + 2.1782662e+00 -3.6182278e-01 + 2.1802198e+00 -3.5140643e-01 + 2.1821734e+00 -3.3671991e-01 + 2.1841270e+00 -3.2162415e-01 + 2.1860806e+00 -3.0650077e-01 + 2.1880342e+00 -2.9152972e-01 + 2.1899878e+00 -2.7538330e-01 + 2.1919414e+00 -2.6127305e-01 + 2.1938950e+00 -2.4692276e-01 + 2.1958486e+00 -2.3330605e-01 + 2.1978022e+00 -2.1919187e-01 + 2.1997558e+00 -2.0602860e-01 + 2.2017094e+00 -1.9371206e-01 + 2.2036630e+00 -1.8216717e-01 + 2.2056166e+00 -1.7083576e-01 + 2.2075702e+00 -1.5804043e-01 + 2.2095238e+00 -1.4660405e-01 + 2.2114774e+00 -1.3710245e-01 + 2.2134310e+00 -1.2778352e-01 + 2.2153846e+00 -1.1910488e-01 + 2.2173382e+00 -1.1016584e-01 + 2.2192918e+00 -1.0228185e-01 + 2.2212454e+00 -9.7621212e-02 + 2.2231990e+00 -9.7637331e-02 + 2.2251526e+00 -9.3856864e-02 + 2.2271062e+00 -8.3969471e-02 + 2.2290598e+00 -7.2848661e-02 + 2.2310134e+00 -6.1943448e-02 + 2.2329670e+00 -4.9463374e-02 + 2.2349206e+00 -3.7726196e-02 + 2.2368742e+00 -2.5231895e-02 + 2.2388278e+00 -1.2584580e-02 + 2.2407814e+00 -8.5027778e-04 + 2.2427350e+00 1.0870025e-02 + 2.2446886e+00 2.1947776e-02 + 2.2466422e+00 3.4181303e-02 + 2.2485958e+00 4.4532656e-02 + 2.2505495e+00 5.4801220e-02 + 2.2525031e+00 6.5182237e-02 + 2.2544567e+00 7.5788915e-02 + 2.2564103e+00 8.5615920e-02 + 2.2583639e+00 9.5026639e-02 + 2.2603175e+00 1.0446702e-01 + 2.2622711e+00 1.1255526e-01 + 2.2642247e+00 1.2056736e-01 + 2.2661783e+00 1.2836985e-01 + 2.2681319e+00 1.3559993e-01 + 2.2700855e+00 1.4414759e-01 + 2.2720391e+00 1.5222280e-01 + 2.2739927e+00 1.6099809e-01 + 2.2759463e+00 1.6828750e-01 + 2.2778999e+00 1.7494412e-01 + 2.2798535e+00 1.8129404e-01 + 2.2818071e+00 1.8739673e-01 + 2.2837607e+00 1.9550161e-01 + 2.2857143e+00 2.0404540e-01 + 2.2876679e+00 2.1251254e-01 + 2.2896215e+00 2.1987036e-01 + 2.2915751e+00 2.2925127e-01 + 2.2935287e+00 2.3721554e-01 + 2.2954823e+00 2.4510271e-01 + 2.2974359e+00 2.5182283e-01 + 2.2993895e+00 2.5929643e-01 + 2.3013431e+00 2.6621519e-01 + 2.3032967e+00 2.7260469e-01 + 2.3052503e+00 2.7858138e-01 + 2.3072039e+00 2.8404734e-01 + 2.3091575e+00 2.9073106e-01 + 2.3111111e+00 2.9718979e-01 + 2.3130647e+00 3.0321794e-01 + 2.3150183e+00 3.0863926e-01 + 2.3169719e+00 3.1483745e-01 + 2.3189255e+00 3.2120620e-01 + 2.3208791e+00 3.2676555e-01 + 2.3228327e+00 3.3102814e-01 + 2.3247863e+00 3.3535218e-01 + 2.3267399e+00 3.3980592e-01 + 2.3286935e+00 3.4430817e-01 + 2.3306471e+00 3.4802984e-01 + 2.3326007e+00 3.5198428e-01 + 2.3345543e+00 3.5577481e-01 + 2.3365079e+00 3.5883819e-01 + 2.3384615e+00 3.6289615e-01 + 2.3404151e+00 3.6662962e-01 + 2.3423687e+00 3.6921459e-01 + 2.3443223e+00 3.7238118e-01 + 2.3462759e+00 3.7434690e-01 + 2.3482295e+00 3.7738008e-01 + 2.3501832e+00 3.8130047e-01 + 2.3521368e+00 3.8482100e-01 + 2.3540904e+00 3.8796277e-01 + 2.3560440e+00 3.9160695e-01 + 2.3579976e+00 3.9473843e-01 + 2.3599512e+00 3.9751735e-01 + 2.3619048e+00 4.0010261e-01 + 2.3638584e+00 4.0260903e-01 + 2.3658120e+00 4.0490461e-01 + 2.3677656e+00 4.0667736e-01 + 2.3697192e+00 4.0836134e-01 + 2.3716728e+00 4.1015097e-01 + 2.3736264e+00 4.1117590e-01 + 2.3755800e+00 4.1230769e-01 + 2.3775336e+00 4.1370676e-01 + 2.3794872e+00 4.1460690e-01 + 2.3814408e+00 4.1547216e-01 + 2.3833944e+00 4.1660546e-01 + 2.3853480e+00 4.1705066e-01 + 2.3873016e+00 4.1720867e-01 + 2.3892552e+00 4.1709356e-01 + 2.3912088e+00 4.1645313e-01 + 2.3931624e+00 4.1651110e-01 + 2.3951160e+00 4.1685542e-01 + 2.3970696e+00 4.1706065e-01 + 2.3990232e+00 4.1701146e-01 + 2.4009768e+00 4.1655567e-01 + 2.4029304e+00 4.1646100e-01 + 2.4048840e+00 4.1585220e-01 + 2.4068376e+00 4.1515236e-01 + 2.4087912e+00 4.1467789e-01 + 2.4107448e+00 4.1389799e-01 + 2.4126984e+00 4.1316629e-01 + 2.4146520e+00 4.1228756e-01 + 2.4166056e+00 4.1099640e-01 + 2.4185592e+00 4.0989481e-01 + 2.4205128e+00 4.0835915e-01 + 2.4224664e+00 4.0688229e-01 + 2.4244200e+00 4.0517961e-01 + 2.4263736e+00 4.0286314e-01 + 2.4283272e+00 4.0064709e-01 + 2.4302808e+00 3.9824662e-01 + 2.4322344e+00 3.9593575e-01 + 2.4341880e+00 3.9318771e-01 + 2.4361416e+00 3.9069522e-01 + 2.4380952e+00 3.8817557e-01 + 2.4400488e+00 3.8535034e-01 + 2.4420024e+00 3.8239510e-01 + 2.4439560e+00 3.7949715e-01 + 2.4459096e+00 3.7663757e-01 + 2.4478632e+00 3.7371517e-01 + 2.4498168e+00 3.7059345e-01 + 2.4517705e+00 3.6701602e-01 + 2.4537241e+00 3.6335239e-01 + 2.4556777e+00 3.5926559e-01 + 2.4576313e+00 3.5504455e-01 + 2.4595849e+00 3.5053065e-01 + 2.4615385e+00 3.4643280e-01 + 2.4634921e+00 3.4300490e-01 + 2.4654457e+00 3.3911645e-01 + 2.4673993e+00 3.3463819e-01 + 2.4693529e+00 3.3090131e-01 + 2.4713065e+00 3.2732993e-01 + 2.4732601e+00 3.2268231e-01 + 2.4752137e+00 3.1841798e-01 + 2.4771673e+00 3.1504684e-01 + 2.4791209e+00 3.1123512e-01 + 2.4810745e+00 3.0697071e-01 + 2.4830281e+00 3.0297942e-01 + 2.4849817e+00 2.9914953e-01 + 2.4869353e+00 2.9544890e-01 + 2.4888889e+00 2.9190658e-01 + 2.4908425e+00 2.8707167e-01 + 2.4927961e+00 2.8169568e-01 + 2.4947497e+00 2.7613997e-01 + 2.4967033e+00 2.6995411e-01 + 2.4986569e+00 2.6296891e-01 + 2.5006105e+00 2.5713207e-01 + 2.5025641e+00 2.5196963e-01 + 2.5045177e+00 2.4610388e-01 + 2.5064713e+00 2.3960216e-01 + 2.5084249e+00 2.3391833e-01 + 2.5103785e+00 2.2838442e-01 + 2.5123321e+00 2.2342032e-01 + 2.5142857e+00 2.1799129e-01 + 2.5162393e+00 2.1263490e-01 + 2.5181929e+00 2.0669719e-01 + 2.5201465e+00 2.0096417e-01 + 2.5221001e+00 1.9467305e-01 + 2.5240537e+00 1.8800507e-01 + 2.5260073e+00 1.8049673e-01 + 2.5279609e+00 1.7492498e-01 + 2.5299145e+00 1.7037679e-01 + 2.5318681e+00 1.6764434e-01 + 2.5338217e+00 1.6688117e-01 + 2.5357753e+00 1.6200463e-01 + 2.5377289e+00 1.5539674e-01 + 2.5396825e+00 1.4879460e-01 + 2.5416361e+00 1.4259270e-01 + 2.5435897e+00 1.3692605e-01 + 2.5455433e+00 1.3096283e-01 + 2.5474969e+00 1.2465340e-01 + 2.5494505e+00 1.1860512e-01 + 2.5514042e+00 1.1251485e-01 + 2.5533578e+00 1.0719773e-01 + 2.5553114e+00 1.0182061e-01 + 2.5572650e+00 9.6793788e-02 + 2.5592186e+00 9.2004808e-02 + 2.5611722e+00 8.7227104e-02 + 2.5631258e+00 8.2188020e-02 + 2.5650794e+00 7.6903297e-02 + 2.5670330e+00 7.1285228e-02 + 2.5689866e+00 6.5391931e-02 + 2.5709402e+00 5.9800500e-02 + 2.5728938e+00 5.4651234e-02 + 2.5748474e+00 5.0080196e-02 + 2.5768010e+00 4.4674696e-02 + 2.5787546e+00 3.9012585e-02 + 2.5807082e+00 3.3623507e-02 + 2.5826618e+00 2.7763507e-02 + 2.5846154e+00 2.1935139e-02 + 2.5865690e+00 1.5787803e-02 + 2.5885226e+00 1.0024893e-02 + 2.5904762e+00 5.3251333e-03 + 2.5924298e+00 4.1401475e-04 + 2.5943834e+00 -4.8555735e-03 + 2.5963370e+00 -9.9408188e-03 + 2.5982906e+00 -1.5126938e-02 + 2.6002442e+00 -1.9130191e-02 + 2.6021978e+00 -2.4720941e-02 + 2.6041514e+00 -2.9706221e-02 + 2.6061050e+00 -3.4165865e-02 + 2.6080586e+00 -3.8795021e-02 + 2.6100122e+00 -4.2930174e-02 + 2.6119658e+00 -4.7561070e-02 + 2.6139194e+00 -5.2146410e-02 + 2.6158730e+00 -5.6061729e-02 + 2.6178266e+00 -6.0142851e-02 + 2.6197802e+00 -6.3730953e-02 + 2.6217338e+00 -6.6800913e-02 + 2.6236874e+00 -7.0254845e-02 + 2.6256410e+00 -7.3306038e-02 + 2.6275946e+00 -7.6734770e-02 + 2.6295482e+00 -7.9439903e-02 + 2.6315018e+00 -8.2597797e-02 + 2.6334554e+00 -8.5865343e-02 + 2.6354090e+00 -8.9112229e-02 + 2.6373626e+00 -9.1687203e-02 + 2.6393162e+00 -9.4444552e-02 + 2.6412698e+00 -9.6478529e-02 + 2.6432234e+00 -9.9395853e-02 + 2.6451770e+00 -1.0262473e-01 + 2.6471306e+00 -1.0585096e-01 + 2.6490842e+00 -1.0903382e-01 + 2.6510379e+00 -1.1171171e-01 + 2.6529915e+00 -1.1487279e-01 + 2.6549451e+00 -1.1780116e-01 + 2.6568987e+00 -1.2001698e-01 + 2.6588523e+00 -1.2291403e-01 + 2.6608059e+00 -1.2535997e-01 + 2.6627595e+00 -1.2756248e-01 + 2.6647131e+00 -1.2930761e-01 + 2.6666667e+00 -1.3128399e-01 + 2.6686203e+00 -1.3309216e-01 + 2.6705739e+00 -1.3497797e-01 + 2.6725275e+00 -1.3663856e-01 + 2.6744811e+00 -1.3795560e-01 + 2.6764347e+00 -1.3974061e-01 + 2.6783883e+00 -1.4116041e-01 + 2.6803419e+00 -1.4259974e-01 + 2.6822955e+00 -1.4386683e-01 + 2.6842491e+00 -1.4454034e-01 + 2.6862027e+00 -1.4505379e-01 + 2.6881563e+00 -1.4613268e-01 + 2.6901099e+00 -1.4757844e-01 + 2.6920635e+00 -1.4892892e-01 + 2.6940171e+00 -1.5017914e-01 + 2.6959707e+00 -1.5128618e-01 + 2.6979243e+00 -1.5244332e-01 + 2.6998779e+00 -1.5319575e-01 + 2.7018315e+00 -1.5410066e-01 + 2.7037851e+00 -1.5490039e-01 + 2.7057387e+00 -1.5573220e-01 + 2.7076923e+00 -1.5662002e-01 + 2.7096459e+00 -1.5717403e-01 + 2.7115995e+00 -1.5788317e-01 + 2.7135531e+00 -1.5841063e-01 + 2.7155067e+00 -1.5894050e-01 + 2.7174603e+00 -1.5902609e-01 + 2.7194139e+00 -1.5940658e-01 + 2.7213675e+00 -1.6009612e-01 + 2.7233211e+00 -1.6058725e-01 + 2.7252747e+00 -1.6089532e-01 + 2.7272283e+00 -1.6153991e-01 + 2.7291819e+00 -1.6182543e-01 + 2.7311355e+00 -1.6191730e-01 + 2.7330891e+00 -1.6215431e-01 + 2.7350427e+00 -1.6235251e-01 + 2.7369963e+00 -1.6247964e-01 + 2.7389499e+00 -1.6265717e-01 + 2.7409035e+00 -1.6256364e-01 + 2.7428571e+00 -1.6244226e-01 + 2.7448107e+00 -1.6228569e-01 + 2.7467643e+00 -1.6215628e-01 + 2.7487179e+00 -1.6196475e-01 + 2.7506716e+00 -1.6157155e-01 + 2.7526252e+00 -1.6134740e-01 + 2.7545788e+00 -1.6118341e-01 + 2.7565324e+00 -1.6073156e-01 + 2.7584860e+00 -1.6045648e-01 + 2.7604396e+00 -1.6008099e-01 + 2.7623932e+00 -1.5972320e-01 + 2.7643468e+00 -1.5928694e-01 + 2.7663004e+00 -1.5884341e-01 + 2.7682540e+00 -1.5850756e-01 + 2.7702076e+00 -1.5813525e-01 + 2.7721612e+00 -1.5751895e-01 + 2.7741148e+00 -1.5707232e-01 + 2.7760684e+00 -1.5645671e-01 + 2.7780220e+00 -1.5591882e-01 + 2.7799756e+00 -1.5543034e-01 + 2.7819292e+00 -1.5505219e-01 + 2.7838828e+00 -1.5459716e-01 + 2.7858364e+00 -1.5398564e-01 + 2.7877900e+00 -1.5292635e-01 + 2.7897436e+00 -1.5225194e-01 + 2.7916972e+00 -1.5142837e-01 + 2.7936508e+00 -1.5055918e-01 + 2.7956044e+00 -1.4996634e-01 + 2.7975580e+00 -1.4923790e-01 + 2.7995116e+00 -1.4843833e-01 + 2.8014652e+00 -1.4762157e-01 + 2.8034188e+00 -1.4682457e-01 + 2.8053724e+00 -1.4616181e-01 + 2.8073260e+00 -1.4541158e-01 + 2.8092796e+00 -1.4466248e-01 + 2.8112332e+00 -1.4394493e-01 + 2.8131868e+00 -1.4306431e-01 + 2.8151404e+00 -1.4252361e-01 + 2.8170940e+00 -1.4183535e-01 + 2.8190476e+00 -1.4117827e-01 + 2.8210012e+00 -1.4066331e-01 + 2.8229548e+00 -1.4026072e-01 + 2.8249084e+00 -1.3983763e-01 + 2.8268620e+00 -1.3942505e-01 + 2.8288156e+00 -1.3900506e-01 + 2.8307692e+00 -1.3853247e-01 + 2.8327228e+00 -1.3769483e-01 + 2.8346764e+00 -1.3683441e-01 + 2.8366300e+00 -1.3611225e-01 + 2.8385836e+00 -1.3517192e-01 + 2.8405372e+00 -1.3406896e-01 + 2.8424908e+00 -1.3319720e-01 + 2.8444444e+00 -1.3219897e-01 + 2.8463980e+00 -1.3122641e-01 + 2.8483516e+00 -1.3034571e-01 + 2.8503053e+00 -1.2917449e-01 + 2.8522589e+00 -1.2799185e-01 + 2.8542125e+00 -1.2725146e-01 + 2.8561661e+00 -1.2625528e-01 + 2.8581197e+00 -1.2533742e-01 + 2.8600733e+00 -1.2428199e-01 + 2.8620269e+00 -1.2329580e-01 + 2.8639805e+00 -1.2229864e-01 + 2.8659341e+00 -1.2130594e-01 + 2.8678877e+00 -1.2029448e-01 + 2.8698413e+00 -1.1938518e-01 + 2.8717949e+00 -1.1847852e-01 + 2.8737485e+00 -1.1752048e-01 + 2.8757021e+00 -1.1644931e-01 + 2.8776557e+00 -1.1543754e-01 + 2.8796093e+00 -1.1442267e-01 + 2.8815629e+00 -1.1324397e-01 + 2.8835165e+00 -1.1229531e-01 + 2.8854701e+00 -1.1108657e-01 + 2.8874237e+00 -1.0992708e-01 + 2.8893773e+00 -1.0845885e-01 + 2.8913309e+00 -1.0691713e-01 + 2.8932845e+00 -1.0545972e-01 + 2.8952381e+00 -1.0388297e-01 + 2.8971917e+00 -1.0232143e-01 + 2.8991453e+00 -1.0090351e-01 + 2.9010989e+00 -9.9649136e-02 + 2.9030525e+00 -9.7830679e-02 + 2.9050061e+00 -9.6554506e-02 + 2.9069597e+00 -9.4977375e-02 + 2.9089133e+00 -9.3574826e-02 + 2.9108669e+00 -9.2166373e-02 + 2.9128205e+00 -9.0615880e-02 + 2.9147741e+00 -8.8834126e-02 + 2.9167277e+00 -8.7043139e-02 + 2.9186813e+00 -8.5367178e-02 + 2.9206349e+00 -8.3841884e-02 + 2.9225885e+00 -8.1860652e-02 + 2.9245421e+00 -8.0097968e-02 + 2.9264957e+00 -7.8733937e-02 + 2.9284493e+00 -7.7071824e-02 + 2.9304029e+00 -7.5385949e-02 + 2.9323565e+00 -7.3776278e-02 + 2.9343101e+00 -7.2112803e-02 + 2.9362637e+00 -7.0974887e-02 + 2.9382173e+00 -6.9195403e-02 + 2.9401709e+00 -6.7787253e-02 + 2.9421245e+00 -6.6334456e-02 + 2.9440781e+00 -6.4436542e-02 + 2.9460317e+00 -6.3029300e-02 + 2.9479853e+00 -6.1376571e-02 + 2.9499389e+00 -6.0141337e-02 + 2.9518926e+00 -5.8663491e-02 + 2.9538462e+00 -5.6612866e-02 + 2.9557998e+00 -5.4479680e-02 + 2.9577534e+00 -5.2617105e-02 + 2.9597070e+00 -5.0449109e-02 + 2.9616606e+00 -4.8126964e-02 + 2.9636142e+00 -4.6162002e-02 + 2.9655678e+00 -4.4419447e-02 + 2.9675214e+00 -4.2440031e-02 + 2.9694750e+00 -4.0348087e-02 + 2.9714286e+00 -3.8663121e-02 + 2.9733822e+00 -3.7061169e-02 + 2.9753358e+00 -3.5237113e-02 + 2.9772894e+00 -3.3362430e-02 + 2.9792430e+00 -3.1619194e-02 + 2.9811966e+00 -2.9918185e-02 + 2.9831502e+00 -2.8276731e-02 + 2.9851038e+00 -2.6614845e-02 + 2.9870574e+00 -2.4820302e-02 + 2.9890110e+00 -2.3217442e-02 + 2.9909646e+00 -2.1829876e-02 + 2.9929182e+00 -2.0423164e-02 + 2.9948718e+00 -1.9673836e-02 + 2.9968254e+00 -1.8338788e-02 + 2.9987790e+00 -1.6862682e-02 + 3.0007326e+00 -1.4931244e-02 + 3.0026862e+00 -1.3031892e-02 + 3.0046398e+00 -1.1574705e-02 + 3.0065934e+00 -9.9259866e-03 + 3.0085470e+00 -8.3816987e-03 + 3.0105006e+00 -6.9468361e-03 + 3.0124542e+00 -5.5389135e-03 + 3.0144078e+00 -4.0090794e-03 + 3.0163614e+00 -2.4630510e-03 + 3.0183150e+00 -1.0419611e-03 + 3.0202686e+00 4.3981973e-04 + 3.0222222e+00 1.7296145e-03 + 3.0241758e+00 2.8069913e-03 + 3.0261294e+00 4.0491869e-03 + 3.0280830e+00 5.2304646e-03 + 3.0300366e+00 6.9164150e-03 + 3.0319902e+00 8.7562115e-03 + 3.0339438e+00 1.0247754e-02 + 3.0358974e+00 1.2184187e-02 + 3.0378510e+00 1.3873694e-02 + 3.0398046e+00 1.5464749e-02 + 3.0417582e+00 1.7057393e-02 + 3.0437118e+00 1.8534028e-02 + 3.0456654e+00 1.9702668e-02 + 3.0476190e+00 2.1219032e-02 + 3.0495726e+00 2.2582382e-02 + 3.0515263e+00 2.4050239e-02 + 3.0534799e+00 2.5399211e-02 + 3.0554335e+00 2.6485517e-02 + 3.0573871e+00 2.7873462e-02 + 3.0593407e+00 2.9242109e-02 + 3.0612943e+00 3.0665469e-02 + 3.0632479e+00 3.2068776e-02 + 3.0652015e+00 3.3275632e-02 + 3.0671551e+00 3.4529859e-02 + 3.0691087e+00 3.5712045e-02 + 3.0710623e+00 3.6628841e-02 + 3.0730159e+00 3.7910311e-02 + 3.0749695e+00 3.9039752e-02 + 3.0769231e+00 4.0029044e-02 + 3.0788767e+00 4.1127155e-02 + 3.0808303e+00 4.1839100e-02 + 3.0827839e+00 4.2707086e-02 + 3.0847375e+00 4.3807695e-02 + 3.0866911e+00 4.4501326e-02 + 3.0886447e+00 4.5355539e-02 + 3.0905983e+00 4.5940654e-02 + 3.0925519e+00 4.6394625e-02 + 3.0945055e+00 4.7385506e-02 + 3.0964591e+00 4.8230562e-02 + 3.0984127e+00 4.9094234e-02 + 3.1003663e+00 5.0152011e-02 + 3.1023199e+00 5.1250425e-02 + 3.1042735e+00 5.2163967e-02 + 3.1062271e+00 5.3018634e-02 + 3.1081807e+00 5.3888435e-02 + 3.1101343e+00 5.4759372e-02 + 3.1120879e+00 5.5433480e-02 + 3.1140415e+00 5.6024270e-02 + 3.1159951e+00 5.6867964e-02 + 3.1179487e+00 5.7382096e-02 + 3.1199023e+00 5.7848327e-02 + 3.1218559e+00 5.8435711e-02 + 3.1238095e+00 5.8958622e-02 + 3.1257631e+00 5.9608059e-02 + 3.1277167e+00 6.0022755e-02 + 3.1296703e+00 6.0190147e-02 + 3.1316239e+00 6.0348609e-02 + 3.1335775e+00 6.0095251e-02 + 3.1355311e+00 5.9953665e-02 + 3.1374847e+00 5.9421068e-02 + 3.1394383e+00 5.9597314e-02 + 3.1413919e+00 6.0086019e-02 + 3.1433455e+00 6.0343539e-02 + 3.1452991e+00 6.0852223e-02 + 3.1472527e+00 6.1507260e-02 + 3.1492063e+00 6.1693571e-02 + 3.1511600e+00 6.2111294e-02 + 3.1531136e+00 6.2485579e-02 + 3.1550672e+00 6.2721986e-02 + 3.1570208e+00 6.3103234e-02 + 3.1589744e+00 6.3498557e-02 + 3.1609280e+00 6.3702273e-02 + 3.1628816e+00 6.4169941e-02 + 3.1648352e+00 6.4309863e-02 + 3.1667888e+00 6.4611576e-02 + 3.1687424e+00 6.4657435e-02 + 3.1706960e+00 6.4843746e-02 + 3.1726496e+00 6.5132822e-02 + 3.1746032e+00 6.5363856e-02 + 3.1765568e+00 6.5299381e-02 + 3.1785104e+00 6.5439152e-02 + 3.1804640e+00 6.5513464e-02 + 3.1824176e+00 6.5525950e-02 + 3.1843712e+00 6.5528599e-02 + 3.1863248e+00 6.5497119e-02 + 3.1882784e+00 6.5545096e-02 + 3.1902320e+00 6.5495302e-02 + 3.1921856e+00 6.5389888e-02 + 3.1941392e+00 6.5333510e-02 + 3.1960928e+00 6.5214323e-02 + 3.1980464e+00 6.5088931e-02 + 3.2000000e+00 6.4948933e-02 + 3.2019536e+00 6.4838297e-02 + 3.2039072e+00 6.4565415e-02 + 3.2058608e+00 6.4247280e-02 + 3.2078144e+00 6.4023738e-02 + 3.2097680e+00 6.3886161e-02 + 3.2117216e+00 6.3489098e-02 + 3.2136752e+00 6.3111180e-02 + 3.2156288e+00 6.2674765e-02 + 3.2175824e+00 6.2209065e-02 + 3.2195360e+00 6.1957069e-02 + 3.2214896e+00 6.1405176e-02 + 3.2234432e+00 6.1202368e-02 + 3.2253968e+00 6.0744235e-02 + 3.2273504e+00 6.0176828e-02 + 3.2293040e+00 5.9820251e-02 + 3.2312576e+00 5.9331545e-02 + 3.2332112e+00 5.8769360e-02 + 3.2351648e+00 5.8294125e-02 + 3.2371184e+00 5.7627433e-02 + 3.2390720e+00 5.6960666e-02 + 3.2410256e+00 5.6270591e-02 + 3.2429792e+00 5.5644914e-02 + 3.2449328e+00 5.4899597e-02 + 3.2468864e+00 5.4292159e-02 + 3.2488400e+00 5.3798383e-02 + 3.2507937e+00 5.3228555e-02 + 3.2527473e+00 5.2343239e-02 + 3.2547009e+00 5.1800805e-02 + 3.2566545e+00 5.1251409e-02 + 3.2586081e+00 5.0545745e-02 + 3.2605617e+00 5.0101763e-02 + 3.2625153e+00 4.9288944e-02 + 3.2644689e+00 4.8776704e-02 + 3.2664225e+00 4.8002176e-02 + 3.2683761e+00 4.7351074e-02 + 3.2703297e+00 4.6777991e-02 + 3.2722833e+00 4.5911519e-02 + 3.2742369e+00 4.5028626e-02 + 3.2761905e+00 4.4024351e-02 + 3.2781441e+00 4.2848370e-02 + 3.2800977e+00 4.1911899e-02 + 3.2820513e+00 4.1063665e-02 + 3.2840049e+00 4.0110015e-02 + 3.2859585e+00 3.9181036e-02 + 3.2879121e+00 3.8258489e-02 + 3.2898657e+00 3.7244377e-02 + 3.2918193e+00 3.6493157e-02 + 3.2937729e+00 3.5529443e-02 + 3.2957265e+00 3.4634063e-02 + 3.2976801e+00 3.3827601e-02 + 3.2996337e+00 3.2784580e-02 + 3.3015873e+00 3.2049555e-02 + 3.3035409e+00 3.1034534e-02 + 3.3054945e+00 3.0241163e-02 + 3.3074481e+00 2.9172565e-02 + 3.3094017e+00 2.8322287e-02 + 3.3113553e+00 2.7612612e-02 + 3.3133089e+00 2.6977325e-02 + 3.3152625e+00 2.6349530e-02 + 3.3172161e+00 2.5576062e-02 + 3.3191697e+00 2.4658056e-02 + 3.3211233e+00 2.3554874e-02 + 3.3230769e+00 2.2637851e-02 + 3.3250305e+00 2.1674894e-02 + 3.3269841e+00 2.0598123e-02 + 3.3289377e+00 1.9802861e-02 + 3.3308913e+00 1.8800553e-02 + 3.3328449e+00 1.8009225e-02 + 3.3347985e+00 1.7301443e-02 + 3.3367521e+00 1.6485143e-02 + 3.3387057e+00 1.5509926e-02 + 3.3406593e+00 1.4550526e-02 + 3.3426129e+00 1.3777285e-02 + 3.3445665e+00 1.3276699e-02 + 3.3465201e+00 1.2482269e-02 + 3.3484737e+00 1.1556695e-02 + 3.3504274e+00 1.0759465e-02 + 3.3523810e+00 9.5159070e-03 + 3.3543346e+00 8.4112118e-03 + 3.3562882e+00 7.3310351e-03 + 3.3582418e+00 6.2642528e-03 + 3.3601954e+00 5.3452626e-03 + 3.3621490e+00 4.4146186e-03 + 3.3641026e+00 3.2983453e-03 + 3.3660562e+00 2.5584008e-03 + 3.3680098e+00 1.4901807e-03 + 3.3699634e+00 6.9635601e-04 + 3.3719170e+00 -9.6182188e-05 + 3.3738706e+00 -9.7756216e-04 + 3.3758242e+00 -1.7736571e-03 + 3.3777778e+00 -2.6111459e-03 + 3.3797314e+00 -3.7141005e-03 + 3.3816850e+00 -4.6044101e-03 + 3.3836386e+00 -5.7526937e-03 + 3.3855922e+00 -6.6196199e-03 + 3.3875458e+00 -7.3059869e-03 + 3.3894994e+00 -8.0513042e-03 + 3.3914530e+00 -8.8283292e-03 + 3.3934066e+00 -9.5957435e-03 + 3.3953602e+00 -1.0364747e-02 + 3.3973138e+00 -1.1133448e-02 + 3.3992674e+00 -1.1989325e-02 + 3.4012210e+00 -1.2612807e-02 + 3.4031746e+00 -1.3057924e-02 + 3.4051282e+00 -1.3890797e-02 + 3.4070818e+00 -1.4588439e-02 + 3.4090354e+00 -1.5208061e-02 + 3.4109890e+00 -1.5572812e-02 + 3.4129426e+00 -1.6009075e-02 + 3.4148962e+00 -1.6697939e-02 + 3.4168498e+00 -1.7429105e-02 + 3.4188034e+00 -1.8330388e-02 + 3.4207570e+00 -1.9298718e-02 + 3.4227106e+00 -2.0015581e-02 + 3.4246642e+00 -2.0816898e-02 + 3.4266178e+00 -2.1533610e-02 + 3.4285714e+00 -2.2169956e-02 + 3.4305250e+00 -2.3147065e-02 + 3.4324786e+00 -2.3772741e-02 + 3.4344322e+00 -2.4264095e-02 + 3.4363858e+00 -2.4820226e-02 + 3.4383394e+00 -2.5412530e-02 + 3.4402930e+00 -2.6025871e-02 + 3.4422466e+00 -2.6629450e-02 + 3.4442002e+00 -2.7222435e-02 + 3.4461538e+00 -2.7698957e-02 + 3.4481074e+00 -2.7988336e-02 + 3.4500611e+00 -2.8482035e-02 + 3.4520147e+00 -2.8837781e-02 + 3.4539683e+00 -2.9094544e-02 + 3.4559219e+00 -2.8821360e-02 + 3.4578755e+00 -2.9044448e-02 + 3.4598291e+00 -2.9441890e-02 + 3.4617827e+00 -2.9934606e-02 + 3.4637363e+00 -3.0411430e-02 + 3.4656899e+00 -3.0937216e-02 + 3.4676435e+00 -3.1301362e-02 + 3.4695971e+00 -3.1936497e-02 + 3.4715507e+00 -3.2519493e-02 + 3.4735043e+00 -3.2891357e-02 + 3.4754579e+00 -3.3443402e-02 + 3.4774115e+00 -3.3815644e-02 + 3.4793651e+00 -3.4338782e-02 + 3.4813187e+00 -3.4794039e-02 + 3.4832723e+00 -3.5222432e-02 + 3.4852259e+00 -3.5550329e-02 + 3.4871795e+00 -3.5913188e-02 + 3.4891331e+00 -3.6287019e-02 + 3.4910867e+00 -3.6597739e-02 + 3.4930403e+00 -3.6899074e-02 + 3.4949939e+00 -3.7160756e-02 + 3.4969475e+00 -3.7472535e-02 + 3.4989011e+00 -3.7667245e-02 + 3.5008547e+00 -3.7904182e-02 + 3.5028083e+00 -3.8022612e-02 + 3.5047619e+00 -3.8244263e-02 + 3.5067155e+00 -3.8615975e-02 + 3.5086691e+00 -3.8741973e-02 + 3.5106227e+00 -3.8832329e-02 + 3.5125763e+00 -3.8977775e-02 + 3.5145299e+00 -3.9169988e-02 + 3.5164835e+00 -3.9116108e-02 + 3.5184371e+00 -3.9318385e-02 + 3.5203907e+00 -3.9518469e-02 + 3.5223443e+00 -3.9715222e-02 + 3.5242979e+00 -3.9851814e-02 + 3.5262515e+00 -3.9962602e-02 + 3.5282051e+00 -4.0054470e-02 + 3.5301587e+00 -4.0153528e-02 + 3.5321123e+00 -4.0145809e-02 + 3.5340659e+00 -4.0310250e-02 + 3.5360195e+00 -4.0308131e-02 + 3.5379731e+00 -4.0162761e-02 + 3.5399267e+00 -4.0139907e-02 + 3.5418803e+00 -4.0046525e-02 + 3.5438339e+00 -4.0167150e-02 + 3.5457875e+00 -4.0102221e-02 + 3.5477411e+00 -3.9882690e-02 + 3.5496947e+00 -3.9782194e-02 + 3.5516484e+00 -3.9803307e-02 + 3.5536020e+00 -3.9892224e-02 + 3.5555556e+00 -3.9668153e-02 + 3.5575092e+00 -3.9569927e-02 + 3.5594628e+00 -3.9604889e-02 + 3.5614164e+00 -3.9520436e-02 + 3.5633700e+00 -3.9159318e-02 + 3.5653236e+00 -3.8929040e-02 + 3.5672772e+00 -3.8880457e-02 + 3.5692308e+00 -3.8826880e-02 + 3.5711844e+00 -3.8637770e-02 + 3.5731380e+00 -3.8399774e-02 + 3.5750916e+00 -3.8303213e-02 + 3.5770452e+00 -3.8031466e-02 + 3.5789988e+00 -3.7971986e-02 + 3.5809524e+00 -3.7917425e-02 + 3.5829060e+00 -3.7673526e-02 + 3.5848596e+00 -3.7394288e-02 + 3.5868132e+00 -3.7231134e-02 + 3.5887668e+00 -3.6706407e-02 + 3.5907204e+00 -3.6328186e-02 + 3.5926740e+00 -3.6140968e-02 + 3.5946276e+00 -3.5677462e-02 + 3.5965812e+00 -3.5603679e-02 + 3.5985348e+00 -3.5186184e-02 + 3.6004884e+00 -3.4884697e-02 + 3.6024420e+00 -3.4775801e-02 + 3.6043956e+00 -3.4401137e-02 + 3.6063492e+00 -3.4098137e-02 + 3.6083028e+00 -3.3688133e-02 + 3.6102564e+00 -3.3189817e-02 + 3.6122100e+00 -3.2980274e-02 + 3.6141636e+00 -3.2653512e-02 + 3.6161172e+00 -3.2385625e-02 + 3.6180708e+00 -3.2194093e-02 + 3.6200244e+00 -3.1861655e-02 + 3.6219780e+00 -3.1591573e-02 + 3.6239316e+00 -3.1404128e-02 + 3.6258852e+00 -3.1135862e-02 + 3.6278388e+00 -3.0741447e-02 + 3.6297924e+00 -3.0390015e-02 + 3.6317460e+00 -3.0030864e-02 + 3.6336996e+00 -2.9670956e-02 + 3.6356532e+00 -2.9263979e-02 + 3.6376068e+00 -2.8955228e-02 + 3.6395604e+00 -2.8584877e-02 + 3.6415140e+00 -2.8244720e-02 + 3.6434676e+00 -2.7947623e-02 + 3.6454212e+00 -2.7696384e-02 + 3.6473748e+00 -2.7178771e-02 + 3.6493284e+00 -2.6993293e-02 + 3.6512821e+00 -2.6616812e-02 + 3.6532357e+00 -2.6391681e-02 + 3.6551893e+00 -2.6112291e-02 + 3.6571429e+00 -2.5679282e-02 + 3.6590965e+00 -2.5403524e-02 + 3.6610501e+00 -2.5183615e-02 + 3.6630037e+00 -2.4712239e-02 + 3.6649573e+00 -2.4207869e-02 + 3.6669109e+00 -2.3706980e-02 + 3.6688645e+00 -2.3401406e-02 + 3.6708181e+00 -2.2973089e-02 + 3.6727717e+00 -2.2457973e-02 + 3.6747253e+00 -2.2340829e-02 + 3.6766789e+00 -2.1885194e-02 + 3.6786325e+00 -2.1594377e-02 + 3.6805861e+00 -2.1358802e-02 + 3.6825397e+00 -2.0924582e-02 + 3.6844933e+00 -2.0524416e-02 + 3.6864469e+00 -2.0270150e-02 + 3.6884005e+00 -2.0020273e-02 + 3.6903541e+00 -1.9706981e-02 + 3.6923077e+00 -1.9238935e-02 + 3.6942613e+00 -1.8815688e-02 + 3.6962149e+00 -1.8502320e-02 + 3.6981685e+00 -1.8209914e-02 + 3.7001221e+00 -1.7887617e-02 + 3.7020757e+00 -1.7754959e-02 + 3.7040293e+00 -1.7496077e-02 + 3.7059829e+00 -1.7036128e-02 + 3.7079365e+00 -1.6754090e-02 + 3.7098901e+00 -1.6470008e-02 + 3.7118437e+00 -1.6208174e-02 + 3.7137973e+00 -1.5971465e-02 + 3.7157509e+00 -1.5748225e-02 + 3.7177045e+00 -1.5539893e-02 + 3.7196581e+00 -1.5267995e-02 + 3.7216117e+00 -1.5245596e-02 + 3.7235653e+00 -1.4955536e-02 + 3.7255189e+00 -1.4789128e-02 + 3.7274725e+00 -1.4487262e-02 + 3.7294261e+00 -1.4191829e-02 + 3.7313797e+00 -1.3845468e-02 + 3.7333333e+00 -1.3540348e-02 + 3.7352869e+00 -1.3308103e-02 + 3.7372405e+00 -1.3025384e-02 + 3.7391941e+00 -1.2836046e-02 + 3.7411477e+00 -1.2473944e-02 + 3.7431013e+00 -1.2272499e-02 + 3.7450549e+00 -1.1898365e-02 + 3.7470085e+00 -1.1766691e-02 + 3.7489621e+00 -1.1635850e-02 + 3.7509158e+00 -1.1393692e-02 + 3.7528694e+00 -1.1165458e-02 + 3.7548230e+00 -1.1012747e-02 + 3.7567766e+00 -1.0745843e-02 + 3.7587302e+00 -1.0401298e-02 + 3.7606838e+00 -1.0344542e-02 + 3.7626374e+00 -1.0475988e-02 + 3.7645910e+00 -1.0706720e-02 + 3.7665446e+00 -1.0882663e-02 + 3.7684982e+00 -1.0767865e-02 + 3.7704518e+00 -1.0604483e-02 + 3.7724054e+00 -1.0409319e-02 + 3.7743590e+00 -1.0145291e-02 + 3.7763126e+00 -9.8573499e-03 + 3.7782662e+00 -9.7560976e-03 + 3.7802198e+00 -9.5384579e-03 + 3.7821734e+00 -9.2620193e-03 + 3.7841270e+00 -9.0449094e-03 + 3.7860806e+00 -9.0054073e-03 + 3.7880342e+00 -8.8987064e-03 + 3.7899878e+00 -8.7248822e-03 + 3.7919414e+00 -8.4308114e-03 + 3.7938950e+00 -8.3287267e-03 + 3.7958486e+00 -8.2664466e-03 + 3.7978022e+00 -7.9531545e-03 + 3.7997558e+00 -7.9907647e-03 + 3.8017094e+00 -7.7887140e-03 + 3.8036630e+00 -7.5601772e-03 + 3.8056166e+00 -7.5701663e-03 + 3.8075702e+00 -7.2535445e-03 + 3.8095238e+00 -7.1432112e-03 + 3.8114774e+00 -7.1071902e-03 + 3.8134310e+00 -6.8059303e-03 + 3.8153846e+00 -6.9194419e-03 + 3.8173382e+00 -6.7432719e-03 + 3.8192918e+00 -6.5128433e-03 + 3.8212454e+00 -6.4995246e-03 + 3.8231990e+00 -6.2936145e-03 + 3.8251526e+00 -6.1924378e-03 + 3.8271062e+00 -6.1283415e-03 + 3.8290598e+00 -5.9524742e-03 + 3.8310134e+00 -5.9430906e-03 + 3.8329670e+00 -5.8089955e-03 + 3.8349206e+00 -5.7086512e-03 + 3.8368742e+00 -5.5859073e-03 + 3.8388278e+00 -5.4200290e-03 + 3.8407814e+00 -5.4104940e-03 + 3.8427350e+00 -5.3852944e-03 + 3.8446886e+00 -5.4149588e-03 + 3.8466422e+00 -5.1958057e-03 + 3.8485958e+00 -5.2114703e-03 + 3.8505495e+00 -5.1101422e-03 + 3.8525031e+00 -5.1153638e-03 + 3.8544567e+00 -4.9178535e-03 + 3.8564103e+00 -4.9625771e-03 + 3.8583639e+00 -4.9906523e-03 + 3.8603175e+00 -4.8904594e-03 + 3.8622711e+00 -4.9341992e-03 + 3.8642247e+00 -4.7675641e-03 + 3.8661783e+00 -4.8367305e-03 + 3.8681319e+00 -4.8367305e-03 + 3.8700855e+00 -4.7893584e-03 + 3.8720391e+00 -4.7507644e-03 + 3.8739927e+00 -4.6432311e-03 + 3.8759463e+00 -4.5489407e-03 + 3.8778999e+00 -4.6114478e-03 + 3.8798535e+00 -4.5954048e-03 + 3.8818071e+00 -4.4249104e-03 + 3.8837607e+00 -4.4413317e-03 + 3.8857143e+00 -4.4544991e-03 + 3.8876679e+00 -4.3563493e-03 + 3.8896215e+00 -4.3750409e-03 + 3.8915751e+00 -4.3695167e-03 + 3.8935287e+00 -4.2884694e-03 + 3.8954823e+00 -4.2594861e-03 + 3.8974359e+00 -4.2059086e-03 + 3.8993895e+00 -4.2046978e-03 + 3.9013431e+00 -4.1604283e-03 + 3.9032967e+00 -4.0765053e-03 + 3.9052503e+00 -4.1275099e-03 + 3.9072039e+00 -3.9935662e-03 + 3.9091575e+00 -4.0453275e-03 + 3.9111111e+00 -4.0898240e-03 + 3.9130647e+00 -3.9000326e-03 + 3.9150183e+00 -3.9424859e-03 + 3.9169719e+00 -3.8706709e-03 + 3.9189255e+00 -3.8660548e-03 + 3.9208791e+00 -3.9149404e-03 + 3.9228327e+00 -3.9438481e-03 + 3.9247863e+00 -3.9433183e-03 + 3.9267399e+00 -3.8124016e-03 + 3.9286935e+00 -3.7404352e-03 + 3.9306471e+00 -3.7075169e-03 + 3.9326007e+00 -3.5186335e-03 + 3.9345543e+00 -3.6379721e-03 + 3.9365079e+00 -3.7616241e-03 + 3.9384615e+00 -3.5352062e-03 + 3.9404151e+00 -3.4138244e-03 + 3.9423687e+00 -3.6580258e-03 + 3.9443223e+00 -3.4524184e-03 + 3.9462759e+00 -3.4195757e-03 + 3.9482295e+00 -3.4387970e-03 + 3.9501832e+00 -3.4654344e-03 + 3.9521368e+00 -3.4751207e-03 + 3.9540904e+00 -3.4207108e-03 + 3.9560440e+00 -3.3476093e-03 + 3.9579976e+00 -3.2455245e-03 + 3.9599512e+00 -3.1192239e-03 + 3.9619048e+00 -3.1074187e-03 + 3.9638584e+00 -3.1024242e-03 + 3.9658120e+00 -3.0621654e-03 + 3.9677656e+00 -3.0669329e-03 + 3.9697192e+00 -2.9827073e-03 + 3.9716728e+00 -3.0493007e-03 + 3.9736264e+00 -2.9537996e-03 + 3.9755800e+00 -3.0228904e-03 + 3.9775336e+00 -3.0152473e-03 + 3.9794872e+00 -2.8875845e-03 + 3.9814408e+00 -2.9630319e-03 + 3.9833944e+00 -2.8623849e-03 + 3.9853480e+00 -2.8616282e-03 + 3.9873016e+00 -2.7017281e-03 + 3.9892552e+00 -2.7332087e-03 + 3.9912088e+00 -2.6860635e-03 + 3.9931624e+00 -2.7028633e-03 + 3.9951160e+00 -2.6304428e-03 + 3.9970696e+00 -2.5948759e-03 + 3.9990232e+00 -2.6669179e-03 + 4.0009768e+00 -2.6095567e-03 + 4.0029304e+00 -2.6491344e-03 + 4.0048840e+00 -2.5640764e-03 + 4.0068376e+00 -2.4049331e-03 + 4.0087912e+00 -2.4647159e-03 + 4.0107448e+00 -2.4024358e-03 + 4.0126984e+00 -2.4533647e-03 + 4.0146520e+00 -2.5754275e-03 + 4.0166056e+00 -2.4118194e-03 + 4.0185592e+00 -2.3989548e-03 + 4.0205128e+00 -2.2591841e-03 + 4.0224664e+00 -2.1176730e-03 + 4.0244200e+00 -2.1261485e-03 + 4.0263736e+00 -1.9620864e-03 + 4.0283272e+00 -1.9907670e-03 + 4.0302808e+00 -2.1207756e-03 + 4.0322344e+00 -1.9133520e-03 + 4.0341880e+00 -1.7784245e-03 + 4.0361416e+00 -1.7312794e-03 + 4.0380952e+00 -1.7346091e-03 + 4.0400488e+00 -1.6730857e-03 + 4.0420024e+00 -1.6212488e-03 + 4.0439560e+00 -1.5160613e-03 + 4.0459096e+00 -1.5003967e-03 + 4.0478632e+00 -1.3254375e-03 + 4.0498168e+00 -1.3009190e-03 + 4.0517705e+00 -1.1872560e-03 + 4.0537241e+00 -1.2090502e-03 + 4.0556777e+00 -1.2319796e-03 + 4.0576313e+00 -1.0896360e-03 + 4.0595849e+00 -1.1600132e-03 + 4.0615385e+00 -1.0754849e-03 + 4.0634921e+00 -1.0470313e-03 + 4.0654457e+00 -1.1463918e-03 + 4.0673993e+00 -7.1663676e-04 + 4.0693529e+00 -7.5159834e-04 + 4.0713065e+00 -7.9987862e-04 + 4.0732601e+00 -6.2961117e-04 + 4.0752137e+00 -4.4610071e-04 + 4.0771673e+00 -3.6573447e-04 + 4.0791209e+00 -2.4541214e-04 + 4.0810745e+00 -1.5278665e-04 + 4.0830281e+00 -2.5199582e-05 + 4.0849817e+00 1.3575991e-04 + 4.0869353e+00 1.2440875e-04 + 4.0888889e+00 1.7601870e-04 + 4.0908425e+00 2.5222284e-04 + 4.0927961e+00 3.6611284e-04 + 4.0947497e+00 3.9471777e-04 + 4.0967033e+00 3.0928135e-04 + 4.0986569e+00 4.8749461e-04 + 4.1006105e+00 6.4081099e-04 + 4.1025641e+00 6.1144931e-04 + 4.1045177e+00 8.0752173e-04 + 4.1064713e+00 7.5674420e-04 + 4.1084249e+00 8.3309969e-04 + 4.1103785e+00 1.0465016e-03 + 4.1123321e+00 9.5190853e-04 + 4.1142857e+00 9.1535778e-04 + 4.1162393e+00 9.6318402e-04 + 4.1181929e+00 9.6681639e-04 + 4.1201465e+00 1.1102951e-03 + 4.1221001e+00 1.1998936e-03 + 4.1240537e+00 1.2776869e-03 + 4.1260073e+00 1.2835138e-03 + 4.1279609e+00 1.3653179e-03 + 4.1299145e+00 1.3639557e-03 + 4.1318681e+00 1.2754923e-03 + 4.1338217e+00 1.3166592e-03 + 4.1357753e+00 1.4290357e-03 + 4.1377289e+00 1.4876077e-03 + 4.1396825e+00 1.3737934e-03 + 4.1416361e+00 1.3719016e-03 + 4.1435897e+00 1.4562785e-03 + 4.1455433e+00 1.4904077e-03 + 4.1474969e+00 1.4218467e-03 + 4.1494505e+00 1.3748529e-03 + 4.1514042e+00 1.5063750e-03 + 4.1533578e+00 1.4518137e-03 + 4.1553114e+00 1.2944110e-03 + 4.1572650e+00 1.3783339e-03 + 4.1592186e+00 1.3345941e-03 + 4.1611722e+00 1.2664114e-03 + 4.1631258e+00 1.3389832e-03 + 4.1650794e+00 1.2944110e-03 + 4.1670330e+00 1.2443145e-03 + 4.1689866e+00 1.2025422e-03 + 4.1709402e+00 1.2025422e-03 + 4.1728938e+00 1.2273634e-03 + 4.1748474e+00 1.1340569e-03 + 4.1768010e+00 1.0879711e-03 + 4.1787546e+00 1.0658742e-03 + 4.1807082e+00 9.8444853e-04 + 4.1826618e+00 9.5425443e-04 + 4.1846154e+00 8.9855806e-04 + 4.1865690e+00 8.0994332e-04 + 4.1885226e+00 8.6473160e-04 + 4.1904762e+00 7.1103685e-04 + 4.1924298e+00 5.9760089e-04 + 4.1943834e+00 6.0887638e-04 + 4.1963370e+00 5.1080233e-04 + 4.1982906e+00 4.2574429e-04 + 4.2002442e+00 4.4201429e-04 + 4.2021978e+00 3.3508633e-04 + 4.2041514e+00 3.9146377e-04 + 4.2061050e+00 3.9123675e-04 + 4.2080586e+00 3.2918373e-04 + 4.2100122e+00 2.6758475e-04 + 4.2119658e+00 3.2774591e-04 + 4.2139194e+00 2.0424526e-04 + 4.2158730e+00 -4.7599210e-05 + 4.2178266e+00 -1.1199814e-05 + 4.2197802e+00 1.7109986e-04 + 4.2217338e+00 2.9513024e-05 + 4.2236874e+00 -1.4605163e-05 + 4.2256410e+00 -1.2660330e-04 + 4.2275946e+00 -1.1260354e-04 + 4.2295482e+00 -7.9155443e-05 + 4.2315018e+00 -1.7284038e-04 + 4.2334554e+00 -9.2776839e-05 + 4.2354090e+00 -2.2278549e-04 + 4.2373626e+00 -2.3784470e-04 + 4.2393162e+00 -2.5229852e-04 + 4.2412698e+00 -2.3602852e-04 + 4.2432234e+00 -3.8873949e-04 + 4.2451770e+00 -3.6588582e-04 + 4.2471306e+00 -3.9169080e-04 + 4.2490842e+00 -3.3864303e-04 + 4.2510379e+00 -2.6115242e-04 + 4.2529915e+00 -4.0016633e-04 + 4.2549451e+00 -4.0349601e-04 + 4.2568987e+00 -4.6668415e-04 + 4.2588523e+00 -4.8582978e-04 + 4.2608059e+00 -2.1695856e-04 + 4.2627595e+00 -2.8181154e-04 + 4.2647131e+00 -3.0844894e-04 + 4.2666667e+00 -2.6879554e-04 + 4.2686203e+00 -3.8397201e-04 + 4.2705739e+00 -3.1866498e-04 + 4.2725275e+00 -3.9411238e-04 + 4.2744811e+00 -4.4496559e-04 + 4.2764347e+00 -2.2778000e-04 + 4.2783883e+00 -2.5403903e-04 + 4.2803419e+00 -2.4889317e-04 + 4.2822955e+00 -1.8252670e-04 + 4.2842491e+00 -7.4085257e-05 + 4.2862027e+00 -8.6874234e-05 + 4.2881563e+00 -1.5543526e-04 + 4.2901099e+00 -1.9410489e-04 + 4.2920635e+00 -6.9317769e-05 + 4.2940171e+00 -1.5891628e-06 + 4.2959707e+00 9.5803816e-05 + 4.2979243e+00 2.6644963e-04 + 4.2998779e+00 2.8294666e-04 + 4.3018315e+00 3.9123675e-04 + 4.3037851e+00 4.2695508e-04 + 4.3057387e+00 2.8627633e-04 + 4.3076923e+00 3.6391829e-04 + 4.3096459e+00 4.4034945e-04 + 4.3115995e+00 5.5514754e-04 + 4.3135531e+00 7.7256015e-04 + 4.3155067e+00 8.0744606e-04 + 4.3174603e+00 9.1702262e-04 + 4.3194139e+00 7.8353294e-04 + 4.3213675e+00 8.1561890e-04 + 4.3233211e+00 9.7990806e-04 + 4.3252747e+00 1.0213020e-03 + 4.3272283e+00 1.1692455e-03 + 4.3291819e+00 1.2604331e-03 + 4.3311355e+00 1.2328120e-03 + 4.3330891e+00 1.3688746e-03 + 4.3350427e+00 1.4421274e-03 + 4.3369963e+00 1.4801160e-03 + 4.3389499e+00 1.5847737e-03 + 4.3409035e+00 1.7525439e-03 + 4.3428571e+00 1.8273859e-03 + 4.3448107e+00 1.9550486e-03 + 4.3467643e+00 2.0612955e-03 + 4.3487179e+00 2.0925491e-03 + 4.3506716e+00 2.2795406e-03 + 4.3526252e+00 2.1616398e-03 + 4.3545788e+00 2.2989889e-03 + 4.3565324e+00 2.3702742e-03 + 4.3584860e+00 2.4591159e-03 + 4.3604396e+00 2.6017622e-03 + 4.3623932e+00 2.5820112e-03 + 4.3643468e+00 2.5330499e-03 + 4.3663004e+00 2.4590403e-03 + 4.3682540e+00 2.2976267e-03 + 4.3702076e+00 2.3992575e-03 + 4.3721612e+00 2.5632440e-03 + 4.3741148e+00 2.5599900e-03 + 4.3760684e+00 2.6514046e-03 + 4.3780220e+00 2.6964309e-03 + 4.3799756e+00 2.8074453e-03 + 4.3819292e+00 2.8719956e-03 + 4.3838828e+00 2.8016940e-03 + 4.3858364e+00 3.0735922e-03 + 4.3877900e+00 3.1335264e-03 + 4.3897436e+00 3.2319031e-03 + 4.3916972e+00 3.2689079e-03 + 4.3936508e+00 3.2133629e-03 + 4.3956044e+00 3.3956626e-03 + 4.3975580e+00 3.5209037e-03 + 4.3995116e+00 3.3675874e-03 + 4.4014652e+00 3.5638111e-03 + 4.4034188e+00 3.5231740e-03 + 4.4053724e+00 3.7175059e-03 + 4.4073260e+00 3.8297310e-03 + 4.4092796e+00 3.7362731e-03 + 4.4112332e+00 3.8021099e-03 + 4.4131868e+00 3.7340786e-03 + 4.4151404e+00 3.7287814e-03 + 4.4170940e+00 3.8704439e-03 + 4.4190476e+00 3.7408893e-03 + 4.4210012e+00 3.7866723e-03 + 4.4229548e+00 3.8967029e-03 + 4.4249084e+00 3.7937100e-03 + 4.4268620e+00 3.9441508e-03 + 4.4288156e+00 3.8863355e-03 + 4.4307692e+00 3.9406697e-03 + 4.4327228e+00 3.9342374e-03 + 4.4346764e+00 3.9028325e-03 + 4.4366300e+00 3.8816437e-03 + 4.4385836e+00 3.8571252e-03 + 4.4405372e+00 3.9084324e-03 + 4.4424908e+00 3.9564100e-03 + 4.4444444e+00 3.8445632e-03 + 4.4463980e+00 3.9220538e-03 + 4.4483516e+00 3.9781286e-03 + 4.4503053e+00 3.8264014e-03 + 4.4522589e+00 3.7383163e-03 + 4.4542125e+00 3.9707882e-03 + 4.4561661e+00 3.7550404e-03 + 4.4581197e+00 3.8245852e-03 + 4.4600733e+00 3.8805086e-03 + 4.4620269e+00 3.6727066e-03 + 4.4639805e+00 3.7962829e-03 + 4.4659341e+00 3.7477000e-03 + 4.4678877e+00 3.7612457e-03 + 4.4698413e+00 3.7377109e-03 + 4.4717949e+00 3.5595734e-03 + 4.4737485e+00 3.5342224e-03 + 4.4757021e+00 3.5822757e-03 + 4.4776557e+00 3.4108731e-03 + 4.4796093e+00 3.4502238e-03 + 4.4815629e+00 3.3045506e-03 + 4.4835165e+00 3.4754991e-03 + 4.4854701e+00 3.3376960e-03 + 4.4874237e+00 3.2282708e-03 + 4.4893773e+00 3.2433300e-03 + 4.4913309e+00 3.2276654e-03 + 4.4932845e+00 3.2787456e-03 + 4.4952381e+00 3.2350058e-03 + 4.4971917e+00 3.1109754e-03 + 4.4991453e+00 3.0625438e-03 + 4.5010989e+00 3.0091176e-03 + 4.5030525e+00 2.8225802e-03 + 4.5050061e+00 2.8070669e-03 + 4.5069597e+00 2.7948833e-03 + 4.5089133e+00 2.7815647e-03 + 4.5108669e+00 2.6542803e-03 + 4.5128205e+00 2.5761086e-03 + 4.5147741e+00 2.6740313e-03 + 4.5167277e+00 2.6626045e-03 + 4.5186813e+00 2.4688779e-03 + 4.5206349e+00 2.3970629e-03 + 4.5225885e+00 2.3075401e-03 + 4.5245421e+00 2.2451844e-03 + 4.5264957e+00 2.2941457e-03 + 4.5284493e+00 2.1396942e-03 + 4.5304029e+00 2.1365159e-03 + 4.5323565e+00 2.1434023e-03 + 4.5343101e+00 1.9386273e-03 + 4.5362637e+00 1.9200871e-03 + 4.5382173e+00 1.9103251e-03 + 4.5401709e+00 1.8141429e-03 + 4.5421245e+00 1.7579168e-03 + 4.5440781e+00 1.5906006e-03 + 4.5460317e+00 1.5388393e-03 + 4.5479853e+00 1.6026329e-03 + 4.5499389e+00 1.3741718e-03 + 4.5518926e+00 1.2956217e-03 + 4.5538462e+00 1.1322407e-03 + 4.5557998e+00 1.1040898e-03 + 4.5577534e+00 1.2498387e-03 + 4.5597070e+00 9.8172425e-04 + 4.5616606e+00 9.9012411e-04 + 4.5636142e+00 9.2254685e-04 + 4.5655678e+00 7.4024718e-04 + 4.5675214e+00 8.3128350e-04 + 4.5694750e+00 6.8122113e-04 + 4.5714286e+00 5.7921201e-04 + 4.5733822e+00 5.5363406e-04 + 4.5753358e+00 3.3190801e-04 + 4.5772894e+00 2.6750907e-04 + 4.5792430e+00 1.1290623e-04 + 4.5811966e+00 -8.8614746e-05 + 4.5831502e+00 -4.0939861e-05 + 4.5851038e+00 -7.7414932e-05 + 4.5870574e+00 -3.6982089e-04 + 4.5890110e+00 -5.5189354e-04 + 4.5909646e+00 -6.4875680e-04 + 4.5929182e+00 -5.5378540e-04 + 4.5948718e+00 -6.7478880e-04 + 4.5968254e+00 -1.0508150e-03 + 4.5987790e+00 -1.0503609e-03 + 4.6007326e+00 -1.0125994e-03 + 4.6026862e+00 -1.0757876e-03 + 4.6046398e+00 -1.2512765e-03 + 4.6065934e+00 -1.3918039e-03 + 4.6085470e+00 -1.2928218e-03 + 4.6105006e+00 -1.5093263e-03 + 4.6124542e+00 -1.7099392e-03 + 4.6144078e+00 -1.7240146e-03 + 4.6163614e+00 -1.9076765e-03 + 4.6183150e+00 -1.9386273e-03 + 4.6202686e+00 -2.0561497e-03 + 4.6222222e+00 -2.0651549e-03 + 4.6241758e+00 -2.1539967e-03 + 4.6261294e+00 -2.1723856e-03 + 4.6280830e+00 -2.3602095e-03 + 4.6300366e+00 -2.3873009e-03 + 4.6319902e+00 -2.4691050e-03 + 4.6339438e+00 -2.4309651e-03 + 4.6358974e+00 -2.4222625e-03 + 4.6378510e+00 -2.5274499e-03 + 4.6398046e+00 -2.6317293e-03 + 4.6417582e+00 -2.5246500e-03 + 4.6437118e+00 -2.6354373e-03 + 4.6456654e+00 -2.6214376e-03 + 4.6476190e+00 -2.5521198e-03 + 4.6495726e+00 -2.6579883e-03 + 4.6515263e+00 -2.6912094e-03 + 4.6534799e+00 -2.7000633e-03 + 4.6554335e+00 -2.6997606e-03 + 4.6573871e+00 -2.7767972e-03 + 4.6593407e+00 -2.9758966e-03 + 4.6612943e+00 -2.6997606e-03 + 4.6632479e+00 -2.7153495e-03 + 4.6652015e+00 -2.7742999e-03 + 4.6671551e+00 -2.7186035e-03 + 4.6691087e+00 -2.7587867e-03 + 4.6710623e+00 -2.5577197e-03 + 4.6730159e+00 -2.6004758e-03 + 4.6749695e+00 -2.7570461e-03 + 4.6769231e+00 -2.5354714e-03 + 4.6788767e+00 -2.4426946e-03 + 4.6808303e+00 -2.3417449e-03 + 4.6827839e+00 -2.3949440e-03 + 4.6847375e+00 -2.4557863e-03 + 4.6866911e+00 -2.4870398e-03 + 4.6886447e+00 -2.4872668e-03 + 4.6905983e+00 -2.4156788e-03 + 4.6925519e+00 -2.2795406e-03 + 4.6945055e+00 -2.2348926e-03 + 4.6964591e+00 -2.1250134e-03 + 4.6984127e+00 -2.0590253e-03 + 4.7003663e+00 -2.0463120e-03 + 4.7023199e+00 -1.8643150e-03 + 4.7042735e+00 -1.7781218e-03 + 4.7062271e+00 -1.8744554e-03 + 4.7081807e+00 -1.6969232e-03 + 4.7101343e+00 -1.5046345e-03 + 4.7120879e+00 -1.3778798e-03 + 4.7140415e+00 -1.4183657e-03 + 4.7159951e+00 -1.3191565e-03 + 4.7179487e+00 -1.1393541e-03 + 4.7199023e+00 -1.0284154e-03 + 4.7218559e+00 -1.0308369e-03 + 4.7238095e+00 -8.2394308e-04 + 4.7257631e+00 -7.2216099e-04 + 4.7277167e+00 -5.7066080e-04 + 4.7296703e+00 -5.0043494e-04 + 4.7316239e+00 -3.6679391e-04 + 4.7335775e+00 -3.4386456e-04 + 4.7355311e+00 -1.6186758e-04 + 4.7374847e+00 -2.5040666e-04 + 4.7394383e+00 -1.2607358e-04 + 4.7413919e+00 -6.8561024e-05 + 4.7433455e+00 -4.7674885e-06 + 4.7452991e+00 2.0401824e-04 + 4.7472527e+00 2.4783373e-04 + 4.7492063e+00 3.3168098e-04 + 4.7511600e+00 4.0758243e-04 + 4.7531136e+00 5.9457392e-04 + 4.7550672e+00 7.1830159e-04 + 4.7570208e+00 9.7120550e-04 + 4.7589744e+00 1.1106735e-03 + 4.7609280e+00 1.1625861e-03 + 4.7628816e+00 1.1496458e-03 + 4.7648352e+00 1.3525289e-03 + 4.7667888e+00 1.4468949e-03 + 4.7687424e+00 1.4887429e-03 + 4.7706960e+00 1.5787954e-03 + 4.7726496e+00 1.5424717e-03 + 4.7746032e+00 1.6734641e-03 + 4.7765568e+00 1.8391911e-03 + 4.7785104e+00 1.7687382e-03 + 4.7804640e+00 2.0340527e-03 + 4.7824176e+00 2.0322365e-03 + 4.7843712e+00 2.0048424e-03 + 4.7863248e+00 2.2239199e-03 + 4.7882784e+00 2.3873766e-03 + 4.7902320e+00 2.3886631e-03 + 4.7921856e+00 2.3687607e-03 + 4.7941392e+00 2.3748146e-03 + 4.7960928e+00 2.3505232e-03 + 4.7980464e+00 2.4773535e-03 + 4.8000000e+00 2.4572241e-03 + 4.8019536e+00 2.5201095e-03 + 4.8039072e+00 2.7435761e-03 + 4.8058608e+00 2.7030903e-03 + 4.8078144e+00 2.6200754e-03 + 4.8097680e+00 2.6063784e-03 + 4.8117216e+00 2.5542387e-03 + 4.8136752e+00 2.7490247e-03 + 4.8156288e+00 2.6254483e-03 + 4.8175824e+00 2.5882922e-03 + 4.8195360e+00 2.7601488e-03 + 4.8214896e+00 2.7858024e-03 + 4.8234432e+00 2.8170560e-03 + 4.8253968e+00 2.6889392e-03 + 4.8273504e+00 2.6140972e-03 + 4.8293040e+00 2.7578029e-03 + 4.8312576e+00 2.7054362e-03 + 4.8332112e+00 2.6022163e-03 + 4.8351648e+00 2.6427021e-03 + 4.8371184e+00 2.6276429e-03 + 4.8390720e+00 2.7118685e-03 + 4.8410256e+00 2.4647915e-03 + 4.8429792e+00 2.3125346e-03 + 4.8449328e+00 2.5652872e-03 + 4.8468864e+00 2.4027385e-03 + 4.8488400e+00 2.4658510e-03 + 4.8507937e+00 2.3693661e-03 + 4.8527473e+00 2.3845766e-03 + 4.8547009e+00 2.5421308e-03 + 4.8566545e+00 2.3236587e-03 + 4.8586081e+00 2.3538528e-03 + 4.8605617e+00 2.3317559e-03 + 4.8625153e+00 2.2364061e-03 + 4.8644689e+00 2.2155957e-03 + 4.8664225e+00 2.1624722e-03 + 4.8683761e+00 2.0232313e-03 + 4.8703297e+00 2.0077937e-03 + 4.8722833e+00 1.9398381e-03 + 4.8742369e+00 1.8942821e-03 + 4.8761905e+00 1.9128980e-03 + 4.8781441e+00 1.7816785e-03 + 4.8800977e+00 1.7494412e-03 + 4.8820513e+00 1.7296145e-03 + 4.8840049e+00 1.6261676e-03 + 4.8859585e+00 1.7659383e-03 + 4.8879121e+00 1.6739938e-03 + 4.8898657e+00 1.4841267e-03 + 4.8918193e+00 1.5414879e-03 + 4.8937729e+00 1.4479544e-03 + 4.8957265e+00 1.4766350e-03 + 4.8976801e+00 1.3942255e-03 + 4.8996337e+00 1.2916110e-03 + 4.9015873e+00 1.2963028e-03 + 4.9035409e+00 1.0417341e-03 + 4.9054945e+00 9.1664425e-04 + 4.9074481e+00 9.8482690e-04 + 4.9094017e+00 7.9821378e-04 + 4.9113553e+00 8.4096983e-04 + 4.9133089e+00 9.9322676e-04 + 4.9152625e+00 7.8943555e-04 + 4.9172161e+00 7.7081964e-04 + 4.9191697e+00 6.4520010e-04 + 4.9211233e+00 5.7255266e-04 + 4.9230769e+00 5.5234759e-04 + 4.9250305e+00 5.4561257e-04 + 4.9269841e+00 5.5151517e-04 + 4.9289377e+00 5.0391596e-04 + 4.9308913e+00 3.0345442e-04 + 4.9328449e+00 4.3981973e-04 + 4.9347985e+00 2.3254749e-04 + 4.9367521e+00 1.0927386e-04 + 4.9387057e+00 1.7503493e-04 + 4.9406593e+00 1.5293800e-04 + 4.9426129e+00 8.2106746e-05 + 4.9445665e+00 5.6528792e-05 + 4.9465201e+00 -4.5101954e-05 + 4.9484737e+00 -9.9814560e-05 + 4.9504274e+00 -1.8676447e-04 + 4.9523810e+00 -2.6206052e-04 + 4.9543346e+00 -2.7469814e-05 + 4.9562882e+00 -1.1623591e-04 + 4.9582418e+00 -2.7076307e-04 + 4.9601954e+00 -3.9282591e-04 + 4.9621490e+00 -4.6865168e-04 + 4.9641026e+00 -4.1409043e-04 + 4.9660562e+00 -6.0690885e-04 + 4.9680098e+00 -6.9537224e-04 + 4.9699634e+00 -8.3718611e-04 + 4.9719170e+00 -8.0684066e-04 + 4.9738706e+00 -8.5829927e-04 + 4.9758242e+00 -9.3200616e-04 + 4.9777778e+00 -9.8482690e-04 + 4.9797314e+00 -9.7052444e-04 + 4.9816850e+00 -1.1533538e-03 + 4.9836386e+00 -1.1233868e-03 + 4.9855922e+00 -1.3239997e-03 + 4.9875458e+00 -1.4568839e-03 + 4.9894994e+00 -1.4820835e-03 + 4.9914530e+00 -1.5172721e-03 + 4.9934066e+00 -1.6744479e-03 + 4.9953602e+00 -1.6792154e-03 + 4.9973138e+00 -1.7728246e-03 + 4.9992674e+00 -1.7595059e-03 + 5.0012210e+00 -1.6697561e-03 + 5.0031746e+00 -1.7648031e-03 + 5.0051282e+00 -1.9620864e-03 + 5.0070818e+00 -2.1428725e-03 + 5.0090354e+00 -2.2423087e-03 + 5.0109890e+00 -2.3217669e-03 + 5.0129426e+00 -2.4357326e-03 + 5.0148962e+00 -2.4783373e-03 + 5.0168498e+00 -2.5449307e-03 + 5.0188034e+00 -2.6712313e-03 + 5.0207570e+00 -2.8502770e-03 + 5.0227106e+00 -2.7150468e-03 + 5.0246642e+00 -2.8486122e-03 + 5.0266178e+00 -2.9332162e-03 + 5.0285714e+00 -3.1082511e-03 + 5.0305250e+00 -3.2197952e-03 + 5.0324786e+00 -3.2509731e-03 + 5.0344322e+00 -3.3875654e-03 + 5.0363858e+00 -3.3645604e-03 + 5.0383394e+00 -3.5365683e-03 + 5.0402930e+00 -3.6540150e-03 + 5.0422466e+00 -3.6431179e-03 + 5.0442002e+00 -3.8038504e-03 + 5.0461538e+00 -3.8911787e-03 + 5.0481074e+00 -3.9443021e-03 + 5.0500611e+00 -4.1070021e-03 + 5.0520147e+00 -4.1097264e-03 + 5.0539683e+00 -4.2528267e-03 + 5.0559219e+00 -4.4034945e-03 + 5.0578755e+00 -4.3973649e-03 + 5.0598291e+00 -4.6718360e-03 + 5.0617827e+00 -4.6211341e-03 + 5.0637363e+00 -4.7026355e-03 + 5.0656899e+00 -4.8201578e-03 + 5.0676435e+00 -5.0566404e-03 + 5.0695971e+00 -5.1848329e-03 + 5.0715507e+00 -5.2161621e-03 + 5.0735043e+00 -5.2076109e-03 + 5.0754579e+00 -5.5734210e-03 + 5.0774115e+00 -5.6336579e-03 + 5.0793651e+00 -5.5845452e-03 + 5.0813187e+00 -5.6939704e-03 + 5.0832723e+00 -5.7525424e-03 + 5.0852259e+00 -5.8344221e-03 + 5.0871795e+00 -6.0217920e-03 + 5.0891331e+00 -6.0210352e-03 + 5.0910867e+00 -6.1504385e-03 + 5.0930403e+00 -6.3022414e-03 + 5.0949939e+00 -6.1403738e-03 + 5.0969475e+00 -6.2439721e-03 + 5.0989011e+00 -6.3373543e-03 + 5.1008547e+00 -6.5717180e-03 + 5.1028083e+00 -6.5931338e-03 + 5.1047619e+00 -6.4723575e-03 + 5.1067155e+00 -6.7044509e-03 + 5.1086691e+00 -6.7133048e-03 + 5.1106227e+00 -6.7904927e-03 + 5.1125763e+00 -6.9201230e-03 + 5.1145299e+00 -6.7941251e-03 + 5.1164835e+00 -7.0189538e-03 + 5.1184371e+00 -7.1400329e-03 + 5.1203907e+00 -7.1104442e-03 + 5.1223443e+00 -7.4179093e-03 + 5.1242979e+00 -7.3893044e-03 + 5.1262515e+00 -7.2496094e-03 + 5.1282051e+00 -7.3376945e-03 + 5.1301587e+00 -7.4325902e-03 + 5.1321123e+00 -7.4354658e-03 + 5.1340659e+00 -7.4441684e-03 + 5.1360195e+00 -7.3827207e-03 + 5.1379731e+00 -7.6370625e-03 + 5.1399267e+00 -7.7672225e-03 + 5.1418803e+00 -7.7100883e-03 + 5.1438339e+00 -7.6801212e-03 + 5.1457875e+00 -7.6729321e-03 + 5.1477411e+00 -7.6414516e-03 + 5.1496947e+00 -7.7126612e-03 + 5.1516484e+00 -7.6522730e-03 + 5.1536020e+00 -7.8046056e-03 + 5.1555556e+00 -7.6938183e-03 + 5.1575092e+00 -7.7320339e-03 + 5.1594628e+00 -7.7984003e-03 + 5.1614164e+00 -7.6554513e-03 + 5.1633700e+00 -7.8717288e-03 + 5.1653236e+00 -8.0153589e-03 + 5.1672772e+00 -7.6970723e-03 + 5.1692308e+00 -7.7378608e-03 + 5.1711844e+00 -7.6776239e-03 + 5.1731380e+00 -7.6762618e-03 + 5.1750916e+00 -7.7103153e-03 + 5.1770452e+00 -7.5454964e-03 + 5.1789988e+00 -7.7386175e-03 + 5.1809524e+00 -7.6615810e-03 + 5.1829060e+00 -7.6441759e-03 + 5.1848596e+00 -7.7597307e-03 + 5.1868132e+00 -7.5743284e-03 + 5.1887668e+00 -7.4155634e-03 + 5.1907204e+00 -7.5482207e-03 + 5.1926740e+00 -7.4243417e-03 + 5.1946276e+00 -7.5243076e-03 + 5.1965812e+00 -7.5159834e-03 + 5.1985348e+00 -7.3388296e-03 + 5.2004884e+00 -7.3025815e-03 + 5.2024420e+00 -7.2541499e-03 + 5.2043956e+00 -7.2340962e-03 + 5.2063492e+00 -7.1841511e-03 + 5.2083028e+00 -7.0292455e-03 + 5.2102564e+00 -7.0489209e-03 + 5.2122100e+00 -7.0908445e-03 + 5.2141636e+00 -6.9744572e-03 + 5.2161172e+00 -6.9126312e-03 + 5.2180708e+00 -6.7980602e-03 + 5.2200244e+00 -6.7264722e-03 + 5.2219780e+00 -6.6716082e-03 + 5.2239316e+00 -6.4490497e-03 + 5.2258852e+00 -6.4134071e-03 + 5.2278388e+00 -6.4769736e-03 + 5.2297924e+00 -6.2744689e-03 + 5.2317460e+00 -6.1882000e-03 + 5.2336996e+00 -6.2090862e-03 + 5.2356532e+00 -6.1074554e-03 + 5.2376068e+00 -6.0326891e-03 + 5.2395604e+00 -6.0964826e-03 + 5.2415140e+00 -6.0831639e-03 + 5.2434676e+00 -5.9219774e-03 + 5.2454212e+00 -5.7142511e-03 + 5.2473748e+00 -5.6257877e-03 + 5.2493284e+00 -5.6262418e-03 + 5.2512821e+00 -5.4839739e-03 + 5.2532357e+00 -5.4176074e-03 + 5.2551893e+00 -5.1329959e-03 + 5.2571429e+00 -5.1522929e-03 + 5.2590965e+00 -5.1423795e-03 + 5.2610501e+00 -5.0257652e-03 + 5.2630037e+00 -4.7781585e-03 + 5.2649573e+00 -4.5758051e-03 + 5.2669109e+00 -4.5197304e-03 + 5.2688645e+00 -4.6511012e-03 + 5.2708181e+00 -4.5251033e-03 + 5.2727717e+00 -4.4387588e-03 + 5.2747253e+00 -4.3256255e-03 + 5.2766789e+00 -4.1784388e-03 + 5.2786325e+00 -4.1250126e-03 + 5.2805861e+00 -3.9617829e-03 + 5.2825397e+00 -3.8845950e-03 + 5.2844933e+00 -3.8410065e-03 + 5.2864469e+00 -3.8999569e-03 + 5.2884005e+00 -3.8617413e-03 + 5.2903541e+00 -3.8802059e-03 + 5.2923077e+00 -3.8326823e-03 + 5.2942613e+00 -3.7146302e-03 + 5.2962149e+00 -3.6497016e-03 + 5.2981685e+00 -3.5168173e-03 + 5.3001221e+00 -3.5224929e-03 + 5.3020757e+00 -3.3320961e-03 + 5.3040293e+00 -3.4086786e-03 + 5.3059829e+00 -3.2038279e-03 + 5.3079365e+00 -3.0875920e-03 + 5.3098901e+00 -3.0639816e-03 + 5.3118437e+00 -2.9111193e-03 + 5.3137973e+00 -2.7778566e-03 + 5.3157509e+00 -2.8075210e-03 + 5.3177045e+00 -2.6523127e-03 + 5.3196581e+00 -2.6707773e-03 + 5.3216117e+00 -2.6255997e-03 + 5.3235653e+00 -2.4221112e-03 + 5.3255189e+00 -2.5313093e-03 + 5.3274725e+00 -2.2644813e-03 + 5.3294261e+00 -2.3131400e-03 + 5.3313797e+00 -2.2877891e-03 + 5.3333333e+00 -2.2098444e-03 + 5.3352869e+00 -2.1577047e-03 + 5.3372405e+00 -2.1190351e-03 + 5.3391941e+00 -1.9470271e-03 + 5.3411477e+00 -1.8603799e-03 + 5.3431013e+00 -2.0021938e-03 + 5.3450549e+00 -1.8214833e-03 + 5.3470085e+00 -1.9859238e-03 + 5.3489621e+00 -1.8733959e-03 + 5.3509158e+00 -1.8065754e-03 + 5.3528694e+00 -1.7989323e-03 + 5.3548230e+00 -1.6319189e-03 + 5.3567766e+00 -1.5770549e-03 + 5.3587302e+00 -1.5509472e-03 + 5.3606838e+00 -1.5080398e-03 + 5.3626374e+00 -1.5482986e-03 + 5.3645910e+00 -1.4224521e-03 + 5.3665446e+00 -1.4995643e-03 + 5.3684982e+00 -1.5019859e-03 + 5.3704518e+00 -1.2699681e-03 + 5.3724054e+00 -1.2521846e-03 + 5.3743590e+00 -1.2688330e-03 + 5.3763126e+00 -1.1261110e-03 + 5.3782662e+00 -1.2826057e-03 + 5.3802198e+00 -1.2587683e-03 + 5.3821734e+00 -1.1495701e-03 + 5.3841270e+00 -1.1448026e-03 + 5.3860806e+00 -1.1525971e-03 + 5.3880342e+00 -1.1008358e-03 + 5.3899878e+00 -1.0201669e-03 + 5.3919414e+00 -1.0649661e-03 + 5.3938950e+00 -1.1458621e-03 + 5.3958486e+00 -1.0029888e-03 + 5.3978022e+00 -9.6787583e-04 + 5.3997558e+00 -1.0329558e-03 + 5.4017094e+00 -9.9799425e-04 + 5.4036630e+00 -9.1482806e-04 + 5.4056166e+00 -1.0138859e-03 + 5.4075702e+00 -9.7430816e-04 + 5.4095238e+00 -1.0454421e-03 + 5.4114774e+00 -8.9318518e-04 + 5.4134310e+00 -1.0160804e-03 + 5.4153846e+00 -1.1277759e-03 + 5.4173382e+00 -1.0273559e-03 + 5.4192918e+00 -1.1011385e-03 + 5.4212454e+00 -1.1345109e-03 + 5.4231990e+00 -1.0445340e-03 + 5.4251526e+00 -9.8830792e-04 + 5.4271062e+00 -8.5496960e-04 + 5.4290598e+00 -1.0295505e-03 + 5.4310134e+00 -9.9118355e-04 + 5.4329670e+00 -9.1013625e-04 + 5.4349206e+00 -1.1127167e-03 + 5.4368742e+00 -1.0647391e-03 + 5.4388278e+00 -1.0088914e-03 + 5.4407814e+00 -1.0339396e-03 + 5.4427350e+00 -1.0365125e-03 + 5.4446886e+00 -1.1989855e-03 + 5.4466422e+00 -1.1586510e-03 + 5.4485958e+00 -1.0482421e-03 + 5.4505495e+00 -1.1478296e-03 + 5.4525031e+00 -1.1469972e-03 + 5.4544567e+00 -1.1748454e-03 + 5.4564103e+00 -1.2602061e-03 + 5.4583639e+00 -1.0480907e-03 + 5.4603175e+00 -1.1199814e-03 + 5.4622711e+00 -1.2095043e-03 + 5.4642247e+00 -1.0511177e-03 + 5.4661783e+00 -1.1554727e-03 + 5.4681319e+00 -1.1674293e-03 + 5.4700855e+00 -1.2279688e-03 + 5.4720391e+00 -1.2437848e-03 + 5.4739927e+00 -1.2365957e-03 + 5.4759463e+00 -1.3388318e-03 + 5.4778999e+00 -1.2172230e-03 + 5.4798535e+00 -1.1194517e-03 + 5.4818071e+00 -1.0797983e-03 + 5.4837607e+00 -1.1396568e-03 + 5.4857143e+00 -1.3177187e-03 + 5.4876679e+00 -1.4537813e-03 + 5.4896215e+00 -1.2657303e-03 + 5.4915751e+00 -1.3563126e-03 + 5.4935287e+00 -1.2997082e-03 + 5.4954823e+00 -1.1895262e-03 + 5.4974359e+00 -1.3744745e-03 + 5.4993895e+00 -1.2593737e-03 + 5.5013431e+00 -1.3731880e-03 + 5.5032967e+00 -1.3090918e-03 + 5.5052503e+00 -1.3361832e-03 + 5.5072039e+00 -1.3813609e-03 + 5.5091575e+00 -1.3706151e-03 + 5.5111111e+00 -1.2952434e-03 + 5.5130647e+00 -1.3524532e-03 + 5.5150183e+00 -1.3037189e-03 + 5.5169719e+00 -1.4838240e-03 + 5.5189255e+00 -1.5544283e-03 + 5.5208791e+00 -1.4450787e-03 + 5.5228327e+00 -1.4612730e-03 + 5.5247863e+00 -1.4181386e-03 + 5.5267399e+00 -1.3103026e-03 + 5.5286935e+00 -1.3812095e-03 + 5.5306471e+00 -1.4733053e-03 + 5.5326007e+00 -1.4754998e-03 + 5.5345543e+00 -1.4870780e-03 + 5.5365079e+00 -1.3179457e-03 + 5.5384615e+00 -1.4445490e-03 + 5.5404151e+00 -1.4901807e-03 + 5.5423687e+00 -1.3958903e-03 + 5.5443223e+00 -1.4197278e-03 + 5.5462759e+00 -1.3654692e-03 + 5.5482295e+00 -1.3424642e-03 + 5.5501832e+00 -1.4533272e-03 + 5.5521368e+00 -1.3635774e-03 + 5.5540904e+00 -1.5061480e-03 + 5.5560440e+00 -1.4552191e-03 + 5.5579976e+00 -1.2817733e-03 + 5.5599512e+00 -1.3534370e-03 + 5.5619048e+00 -1.4593055e-03 + 5.5638584e+00 -1.4660405e-03 + 5.5658120e+00 -1.5185586e-03 + 5.5677656e+00 -1.4331978e-03 + 5.5697192e+00 -1.5038777e-03 + 5.5716728e+00 -1.4957049e-03 + 5.5736264e+00 -1.3750799e-03 + 5.5755800e+00 -1.4871537e-03 + 5.5775336e+00 -1.5007751e-03 + 5.5794872e+00 -1.5350556e-03 + 5.5814408e+00 -1.5446663e-03 + 5.5833944e+00 -1.4531759e-03 + 5.5853480e+00 -1.5386880e-03 + 5.5873016e+00 -1.5803089e-03 + 5.5892552e+00 -1.6046761e-03 + 5.5912088e+00 -1.5187856e-03 + 5.5931624e+00 -1.4093604e-03 + 5.5951160e+00 -1.4922239e-03 + 5.5970696e+00 -1.5594984e-03 + 5.5990232e+00 -1.4457598e-03 + 5.6009768e+00 -1.5890871e-03 + 5.6029304e+00 -1.5825791e-03 + 5.6048840e+00 -1.4304736e-03 + 5.6068376e+00 -1.5349043e-03 + 5.6087912e+00 -1.5143208e-03 + 5.6107448e+00 -1.5925682e-03 + 5.6126984e+00 -1.6064923e-03 + 5.6146520e+00 -1.4959319e-03 + 5.6166056e+00 -1.5240828e-03 + 5.6185592e+00 -1.3028865e-03 + 5.6205128e+00 -1.4527975e-03 + 5.6224664e+00 -1.5169694e-03 + 5.6244200e+00 -1.2945623e-03 + 5.6263736e+00 -1.4053497e-03 + 5.6283272e+00 -1.5840170e-03 + 5.6302808e+00 -1.4078469e-03 + 5.6322344e+00 -1.4389491e-03 + 5.6341880e+00 -1.4616514e-03 + 5.6361416e+00 -1.3803014e-03 + 5.6380952e+00 -1.4313060e-03 + 5.6400488e+00 -1.3834797e-03 + 5.6420024e+00 -1.4323654e-03 + 5.6439560e+00 -1.4643000e-03 + 5.6459096e+00 -1.3027351e-03 + 5.6478632e+00 -1.1578943e-03 + 5.6498168e+00 -1.1292137e-03 + 5.6517705e+00 -1.2122285e-03 + 5.6537241e+00 -1.4512084e-03 + 5.6556777e+00 -1.3846905e-03 + 5.6576313e+00 -1.2193419e-03 + 5.6595849e+00 -1.2515792e-03 + 5.6615385e+00 -1.1196787e-03 + 5.6634921e+00 -1.1345866e-03 + 5.6654457e+00 -1.2449956e-03 + 5.6673993e+00 -1.2183582e-03 + 5.6693529e+00 -1.3220321e-03 + 5.6713065e+00 -1.2755680e-03 + 5.6732601e+00 -1.2459793e-03 + 5.6752137e+00 -1.1864236e-03 + 5.6771673e+00 -1.1208895e-03 + 5.6791209e+00 -1.1296677e-03 + 5.6810745e+00 -1.0640580e-03 + 5.6830281e+00 -1.1120356e-03 + 5.6849817e+00 -1.1890722e-03 + 5.6869353e+00 -1.1937640e-03 + 5.6888889e+00 -1.1992882e-03 + 5.6908425e+00 -1.1827155e-03 + 5.6927961e+00 -1.0890306e-03 + 5.6947497e+00 -1.2539251e-03 + 5.6967033e+00 -1.3050810e-03 + 5.6986569e+00 -1.3634260e-03 + 5.7006105e+00 -1.3187024e-03 + 5.7025641e+00 -1.3674368e-03 + 5.7045177e+00 -1.3876418e-03 + 5.7064713e+00 -1.3598693e-03 + 5.7084249e+00 -1.2848003e-03 + 5.7103785e+00 -1.4112523e-03 + 5.7123321e+00 -1.3929390e-03 + 5.7142857e+00 -1.3970255e-03 + 5.7162393e+00 -1.4676297e-03 + 5.7181929e+00 -1.2989514e-03 + 5.7201465e+00 -1.3454155e-03 + 5.7221001e+00 -1.4195008e-03 + 5.7240537e+00 -1.2939569e-03 + 5.7260073e+00 -1.4167765e-03 + 5.7279609e+00 -1.3737177e-03 + 5.7299145e+00 -1.3861283e-03 + 5.7318681e+00 -1.4751215e-03 + 5.7338217e+00 -1.5893898e-03 + 5.7357753e+00 -1.5532175e-03 + 5.7377289e+00 -1.5303638e-03 + 5.7396825e+00 -1.5783414e-03 + 5.7416361e+00 -1.7324145e-03 + 5.7435897e+00 -1.7763813e-03 + 5.7455433e+00 -1.7987053e-03 + 5.7474969e+00 -1.8836120e-03 + 5.7494505e+00 -1.8208022e-03 + 5.7514042e+00 -1.9463461e-03 + 5.7533578e+00 -2.0441174e-03 + 5.7553114e+00 -1.8854282e-03 + 5.7572650e+00 -1.9863778e-03 + 5.7592186e+00 -2.0818033e-03 + 5.7611722e+00 -2.0246691e-03 + 5.7631258e+00 -2.1023111e-03 + 5.7650794e+00 -2.1935744e-03 + 5.7670330e+00 -2.2265685e-03 + 5.7689866e+00 -2.2774217e-03 + 5.7709402e+00 -2.1621695e-03 + 5.7728938e+00 -2.2333792e-03 + 5.7748474e+00 -2.2480600e-03 + 5.7768010e+00 -2.1862340e-03 + 5.7787546e+00 -2.3658094e-03 + 5.7807082e+00 -2.3079185e-03 + 5.7826618e+00 -2.3711823e-03 + 5.7846154e+00 -2.3354639e-03 + 5.7865690e+00 -2.2246766e-03 + 5.7885226e+00 -2.4977099e-03 + 5.7904762e+00 -2.4380028e-03 + 5.7924298e+00 -2.3511286e-03 + 5.7943834e+00 -2.3626311e-03 + 5.7963370e+00 -2.4209004e-03 + 5.7982906e+00 -2.5966164e-03 + 5.8002442e+00 -2.4774292e-03 + 5.8021978e+00 -2.3444692e-03 + 5.8041514e+00 -2.4145437e-03 + 5.8061050e+00 -2.3919171e-03 + 5.8080586e+00 -2.4006196e-03 + 5.8100122e+00 -2.4190842e-03 + 5.8119658e+00 -2.4190842e-03 + 5.8139194e+00 -2.3121562e-03 + 5.8158730e+00 -2.3804902e-03 + 5.8178266e+00 -2.2214226e-03 + 5.8197802e+00 -2.3181345e-03 + 5.8217338e+00 -2.5095908e-03 + 5.8236874e+00 -2.5777734e-03 + 5.8256410e+00 -2.4163599e-03 + 5.8275946e+00 -2.2812054e-03 + 5.8295482e+00 -2.2700812e-03 + 5.8315018e+00 -2.3844253e-03 + 5.8334554e+00 -2.2041688e-03 + 5.8354090e+00 -2.3968359e-03 + 5.8373626e+00 -2.4426189e-03 + 5.8393162e+00 -2.2500275e-03 + 5.8412698e+00 -2.2774973e-03 + 5.8432234e+00 -2.1610344e-03 + 5.8451770e+00 -2.1356835e-03 + 5.8471306e+00 -2.1066245e-03 + 5.8490842e+00 -1.9368111e-03 + 5.8510379e+00 -1.9514163e-03 + 5.8529915e+00 -1.9527784e-03 + 5.8549451e+00 -1.8573530e-03 + 5.8568987e+00 -1.9258383e-03 + 5.8588523e+00 -1.7857650e-03 + 5.8608059e+00 -1.7268146e-03 + 5.8627595e+00 -1.6588590e-03 + 5.8647131e+00 -1.6201893e-03 + 5.8666667e+00 -1.6217028e-03 + 5.8686203e+00 -1.6570428e-03 + 5.8705739e+00 -1.5647200e-03 + 5.8725275e+00 -1.4574893e-03 + 5.8744811e+00 -1.4919212e-03 + 5.8764347e+00 -1.5616173e-03 + 5.8783883e+00 -1.3283131e-03 + 5.8803419e+00 -1.2210068e-03 + 5.8822955e+00 -1.3824960e-03 + 5.8842491e+00 -1.3507884e-03 + 5.8862027e+00 -1.3395129e-03 + 5.8881563e+00 -1.1936126e-03 + 5.8901099e+00 -1.0973548e-03 + 5.8920635e+00 -1.1698509e-03 + 5.8940171e+00 -9.1081732e-04 + 5.8959707e+00 -7.9813811e-04 + 5.8979243e+00 -8.6200732e-04 + 5.8998779e+00 -6.7372936e-04 + 5.9018315e+00 -6.8659401e-04 + 5.9037851e+00 -7.3328513e-04 + 5.9057387e+00 -6.3808671e-04 + 5.9076923e+00 -6.1341685e-04 + 5.9096459e+00 -4.2006870e-04 + 5.9115995e+00 -4.7485698e-04 + 5.9135531e+00 -4.2339838e-04 + 5.9155067e+00 -2.9550861e-04 + 5.9174603e+00 -3.3039452e-04 + 5.9194139e+00 -3.1631908e-04 + 5.9213675e+00 -4.0591759e-04 + 5.9233211e+00 -3.9645829e-04 + 5.9252747e+00 -3.9305294e-04 + 5.9272283e+00 -3.8366931e-04 + 5.9291819e+00 -3.1276238e-04 + 5.9311355e+00 -2.5767140e-04 + 5.9330891e+00 -1.6784586e-04 + 5.9350427e+00 -1.2758707e-04 + 5.9369963e+00 -1.4347870e-04 + 5.9389499e+00 -4.0939861e-05 + 5.9409035e+00 1.0397665e-04 + 5.9428571e+00 8.2636467e-05 + 5.9448107e+00 1.0662526e-04 + 5.9467643e+00 2.0409391e-04 + 5.9487179e+00 2.2513140e-04 + 5.9506716e+00 1.5535958e-04 + 5.9526252e+00 3.1223266e-04 + 5.9545788e+00 2.4268786e-04 + 5.9565324e+00 2.8536824e-04 + 5.9584860e+00 4.0985266e-04 + 5.9604396e+00 4.3058745e-04 + 5.9623932e+00 5.1746168e-04 + 5.9643468e+00 3.8033963e-04 + 5.9663004e+00 3.3818898e-04 + 5.9682540e+00 6.7660499e-04 + 5.9702076e+00 5.8208764e-04 + 5.9721612e+00 5.6982838e-04 + 5.9741148e+00 6.7849685e-04 + 5.9760684e+00 5.5257461e-04 + 5.9780220e+00 5.9510364e-04 + 5.9799756e+00 6.3672457e-04 + 5.9819292e+00 5.2828313e-04 + 5.9838828e+00 6.9423713e-04 + 5.9858364e+00 7.2874466e-04 + 5.9877900e+00 6.6669164e-04 + 5.9897436e+00 8.5640741e-04 + 5.9916972e+00 6.7244290e-04 + 5.9936508e+00 8.3612667e-04 + 5.9956044e+00 6.2499503e-04 + 5.9975580e+00 6.9862624e-04 + 5.9995116e+00 7.8966257e-04 + 6.0014652e+00 7.7657090e-04 + 6.0034188e+00 8.8372588e-04 + 6.0053724e+00 8.5474257e-04 + 6.0073260e+00 8.6874234e-04 + 6.0092796e+00 9.0415797e-04 + 6.0112332e+00 8.5035346e-04 + 6.0131868e+00 7.4456062e-04 + 6.0151404e+00 9.0673090e-04 + 6.0170940e+00 9.8649174e-04 + 6.0190476e+00 9.0552011e-04 + 6.0210012e+00 1.0488475e-03 + 6.0229548e+00 1.0228155e-03 + 6.0249084e+00 8.4944536e-04 + 6.0268620e+00 8.7320713e-04 + 6.0288156e+00 8.6624508e-04 + 6.0307692e+00 9.4396271e-04 + 6.0327228e+00 8.9553108e-04 + 6.0346764e+00 8.5451555e-04 + 6.0366300e+00 1.0626959e-03 + 6.0385836e+00 9.7597299e-04 + 6.0405372e+00 9.4804913e-04 + 6.0424908e+00 8.8062322e-04 + 6.0444444e+00 8.1796480e-04 + 6.0463980e+00 9.4275192e-04 + 6.0483516e+00 1.0192588e-03 + 6.0503053e+00 8.2469983e-04 + 6.0522589e+00 9.3208183e-04 + 6.0542125e+00 8.6609374e-04 + 6.0561661e+00 8.6079653e-04 + 6.0581197e+00 1.1123383e-03 + 6.0600733e+00 1.0154750e-03 + 6.0620269e+00 9.2617923e-04 + 6.0639805e+00 8.6011546e-04 + 6.0659341e+00 7.6839806e-04 + 6.0678877e+00 8.8387722e-04 + 6.0698413e+00 7.9178146e-04 + 6.0717949e+00 8.7933676e-04 + 6.0737485e+00 8.8947713e-04 + 6.0757021e+00 8.2908894e-04 + 6.0776557e+00 8.5330476e-04 + 6.0796093e+00 8.6685048e-04 + 6.0815629e+00 8.2886192e-04 + 6.0835165e+00 8.4490490e-04 + 6.0854701e+00 7.2768522e-04 + 6.0874237e+00 7.3078787e-04 + 6.0893773e+00 7.8973825e-04 + 6.0913309e+00 6.2938415e-04 + 6.0932845e+00 7.8527346e-04 + 6.0952381e+00 7.8724099e-04 + 6.0971917e+00 6.5443238e-04 + 6.0991453e+00 7.1277736e-04 + 6.1010989e+00 5.2434806e-04 + 6.1030525e+00 5.0172140e-04 + 6.1050061e+00 5.5022871e-04 + 6.1069597e+00 4.6047885e-04 + 6.1089133e+00 4.6623010e-04 + 6.1108669e+00 4.1129047e-04 + 6.1128205e+00 3.1964875e-04 + 6.1147741e+00 4.4231698e-04 + 6.1167277e+00 3.8987461e-04 + 6.1186813e+00 3.8412336e-04 + 6.1206349e+00 3.9774475e-04 + 6.1225885e+00 3.2502163e-04 + 6.1245421e+00 3.8170177e-04 + 6.1264957e+00 4.1053373e-04 + 6.1284493e+00 1.8404019e-04 + 6.1304029e+00 2.5502280e-04 + 6.1323565e+00 3.0928135e-04 + 6.1343101e+00 1.3227889e-04 + 6.1362637e+00 2.7606028e-04 + 6.1382173e+00 1.5339205e-04 + 6.1401709e+00 9.7544327e-05 + 6.1421245e+00 1.0359828e-04 + 6.1440781e+00 6.2809769e-06 + 6.1460317e+00 -9.9965909e-05 + 6.1479853e+00 -7.2042048e-05 + 6.1499389e+00 -5.5090978e-05 + 6.1518926e+00 -6.4398931e-05 + 6.1538462e+00 -7.3858234e-05 + 6.1557998e+00 -1.8411586e-04 + 6.1577534e+00 -1.2660330e-04 + 6.1597070e+00 -1.5172721e-04 + 6.1616606e+00 -1.5952168e-04 + 6.1636142e+00 -2.1378024e-04 + 6.1655678e+00 -2.0878572e-04 + 6.1675214e+00 -2.3512042e-04 + 6.1694750e+00 -3.5718326e-04 + 6.1714286e+00 -1.9539135e-04 + 6.1733822e+00 -1.8002944e-04 + 6.1753358e+00 -3.1949740e-04 + 6.1772894e+00 -1.6148921e-04 + 6.1792430e+00 -1.9418056e-04 + 6.1811966e+00 -3.5574545e-04 + 6.1831502e+00 -2.1362889e-04 + 6.1851038e+00 -2.4949856e-04 + 6.1870574e+00 -2.4866614e-04 + 6.1890110e+00 -1.9629945e-04 + 6.1909646e+00 -3.3175666e-04 + 6.1929182e+00 -4.1560391e-04 + 6.1948718e+00 -3.7315056e-04 + 6.1968254e+00 -2.5820112e-04 + 6.1987790e+00 -2.6417940e-04 + 6.2007326e+00 -4.0614461e-04 + 6.2026862e+00 -2.4094735e-04 + 6.2046398e+00 -3.0269768e-04 + 6.2065934e+00 -3.0875163e-04 + 6.2085470e+00 -2.9323838e-04 + 6.2105006e+00 -2.7613596e-04 + 6.2124542e+00 -2.1786665e-04 + 6.2144078e+00 -2.4526079e-04 + 6.2163614e+00 -3.1601638e-04 + 6.2183150e+00 -2.6841717e-04 + 6.2202686e+00 -2.6251456e-04 + 6.2222222e+00 -1.6088382e-04 + 6.2241758e+00 -2.1113163e-04 + 6.2261294e+00 -2.5933624e-04 + 6.2280830e+00 -1.5445149e-04 + 6.2300366e+00 -1.6519726e-04 + 6.2319902e+00 -3.2063252e-04 + 6.2339438e+00 -3.0852461e-04 + 6.2358974e+00 -1.8547800e-04 + 6.2378510e+00 -2.9293568e-04 + 6.2398046e+00 -2.0046154e-04 + 6.2417582e+00 -2.8143317e-04 + 6.2437118e+00 -1.1790075e-04 + 6.2456654e+00 -2.0416958e-04 + 6.2476190e+00 -1.2297093e-04 + 6.2495726e+00 -6.8712373e-05 + 6.2515263e+00 -5.5242327e-05 + 6.2534799e+00 7.5598745e-05 + 6.2554335e+00 1.3000865e-04 + 6.2573871e+00 1.8842931e-05 + 6.2593407e+00 -6.6744838e-05 + 6.2612943e+00 2.8756280e-05 + 6.2632479e+00 4.8431629e-06 + 6.2652015e+00 1.0760903e-04 + 6.2671551e+00 8.8917443e-05 + 6.2691087e+00 6.8409676e-05 + 6.2710623e+00 1.4355437e-04 + 6.2730159e+00 8.3393211e-05 + 6.2749695e+00 1.8562935e-04 + 6.2769231e+00 3.2320545e-04 + 6.2788767e+00 9.4895723e-05 + 6.2808303e+00 2.1060191e-04 + 6.2827839e+00 2.0613712e-04 + 6.2847375e+00 1.9599675e-04 + 6.2866911e+00 2.5093638e-04 + 6.2886447e+00 3.2449191e-04 + 6.2905983e+00 3.5218875e-04 + 6.2925519e+00 3.2396219e-04 + 6.2945055e+00 2.6069838e-04 + 6.2964591e+00 3.5090229e-04 + 6.2984127e+00 4.9422964e-04 + 6.3003663e+00 3.2827563e-04 + 6.3023199e+00 4.2006870e-04 + 6.3042735e+00 4.6963545e-04 + 6.3062271e+00 5.7906066e-04 + 6.3081807e+00 7.1512327e-04 + 6.3101343e+00 4.9006754e-04 + 6.3120879e+00 6.8439945e-04 + 6.3140415e+00 5.4788280e-04 + 6.3159951e+00 5.2404536e-04 + 6.3179487e+00 6.1326550e-04 + 6.3199023e+00 4.6819764e-04 + 6.3218559e+00 3.7980991e-04 + 6.3238095e+00 6.2514638e-04 + 6.3257631e+00 4.1832819e-04 + 6.3277167e+00 6.2348155e-04 + 6.3296703e+00 5.8049847e-04 + 6.3316239e+00 5.3312629e-04 + 6.3335775e+00 6.5261620e-04 + 6.3355311e+00 4.8991619e-04 + 6.3374847e+00 4.9914847e-04 + 6.3394383e+00 6.2257345e-04 + 6.3413919e+00 4.9528908e-04 + 6.3433455e+00 4.1166884e-04 + 6.3452991e+00 5.3032633e-04 + 6.3472527e+00 3.7277219e-04 + 6.3492063e+00 5.0883480e-04 + 6.3511600e+00 4.4708447e-04 + 6.3531136e+00 6.0569806e-04 + 6.3550672e+00 6.3589215e-04 + 6.3570208e+00 6.2151401e-04 + 6.3589744e+00 5.1958057e-04 + 6.3609280e+00 4.1787415e-04 + 6.3628816e+00 4.5321410e-04 + 6.3648352e+00 4.0712838e-04 + 6.3667888e+00 3.0118419e-04 + 6.3687424e+00 2.9883828e-04 + 6.3706960e+00 3.5090229e-04 + 6.3726496e+00 1.1457107e-04 + 6.3746032e+00 5.7966606e-05 + 6.3765568e+00 2.2815838e-04 + 6.3785104e+00 7.9760839e-05 + 6.3804640e+00 1.7897000e-04 + 6.3824176e+00 1.3053837e-04 + 6.3843712e+00 1.8933740e-04 + 6.3863248e+00 1.4726242e-04 + 6.3882784e+00 1.2963028e-04 + 6.3902320e+00 2.6940093e-04 + 6.3921856e+00 1.0874414e-04 + 6.3941392e+00 4.7901908e-05 + 6.3960928e+00 -1.2531684e-04 + 6.3980464e+00 1.7707814e-05 + 6.4000000e+00 -1.1434405e-04 + 6.4019536e+00 -9.7544327e-05 + 6.4039072e+00 -6.3717862e-05 + 6.4058608e+00 -5.5696373e-05 + 6.4078144e+00 -1.9940210e-04 + 6.4097680e+00 -1.3295996e-04 + 6.4117216e+00 -1.6398647e-04 + 6.4136752e+00 -2.2914214e-04 + 6.4156288e+00 -7.9533815e-05 + 6.4175824e+00 -1.9145628e-04 + 6.4195360e+00 -2.6054703e-04 + 6.4214896e+00 -3.9539884e-04 + 6.4234432e+00 -3.2532433e-04 + 6.4253968e+00 -4.4791689e-04 + 6.4273504e+00 -3.8752870e-04 + 6.4293040e+00 -3.9600424e-04 + 6.4312576e+00 -3.4621047e-04 + 6.4332112e+00 -2.6750907e-04 + 6.4351648e+00 -4.1620931e-04 + 6.4371184e+00 -4.6509498e-04 + 6.4390720e+00 -5.4947196e-04 + 6.4410256e+00 -5.8087685e-04 + 6.4429792e+00 -4.2127950e-04 + 6.4449328e+00 -5.4008833e-04 + 6.4468864e+00 -4.7917043e-04 + 6.4488400e+00 -4.5397084e-04 + 6.4507937e+00 -4.5563568e-04 + 6.4527473e+00 -5.6400145e-04 + 6.4547009e+00 -5.4697471e-04 + 6.4566545e+00 -4.8015419e-04 + 6.4586081e+00 -6.3241113e-04 + 6.4605617e+00 -7.3964178e-04 + 6.4625153e+00 -6.0448727e-04 + 6.4644689e+00 -6.6305927e-04 + 6.4664225e+00 -6.5231350e-04 + 6.4683761e+00 -5.8814159e-04 + 6.4703297e+00 -5.9964410e-04 + 6.4722833e+00 -6.2605448e-04 + 6.4742369e+00 -4.9551610e-04 + 6.4761905e+00 -6.7705903e-04 + 6.4781441e+00 -5.5953666e-04 + 6.4800977e+00 -5.3691001e-04 + 6.4820513e+00 -5.9419554e-04 + 6.4840049e+00 -4.7750559e-04 + 6.4859585e+00 -5.1867247e-04 + 6.4879121e+00 -5.6506089e-04 + 6.4898657e+00 -4.8121364e-04 + 6.4918193e+00 -4.9937550e-04 + 6.4937729e+00 -4.0145280e-04 + 6.4957265e+00 -5.1504010e-04 + 6.4976801e+00 -5.0966722e-04 + 6.4996337e+00 -4.5911671e-04 + 6.5015873e+00 -5.0315922e-04 + 6.5035409e+00 -4.1636066e-04 + 6.5054945e+00 -4.9203508e-04 + 6.5074481e+00 -6.1969782e-04 + 6.5094017e+00 -3.8911787e-04 + 6.5113553e+00 -3.1094619e-04 + 6.5133089e+00 -5.0134303e-04 + 6.5152625e+00 -3.4446996e-04 + 6.5172161e+00 -3.3591875e-04 + 6.5191697e+00 -3.3115126e-04 + 6.5211233e+00 -1.8040782e-04 + 6.5230769e+00 -3.7133438e-04 + 6.5250305e+00 -2.2354224e-04 + 6.5269841e+00 -1.9637512e-04 + 6.5289377e+00 -4.2165787e-04 + 6.5308913e+00 -2.8211424e-04 + 6.5328449e+00 -2.7250359e-04 + 6.5347985e+00 -2.0061289e-04 + 6.5367521e+00 -1.2145744e-04 + 6.5387057e+00 -2.5146610e-04 + 6.5406593e+00 -1.6708912e-04 + 6.5426129e+00 -7.6885211e-05 + 6.5445665e+00 -2.3943386e-04 + 6.5465201e+00 -1.3182484e-04 + 6.5484737e+00 -4.9264047e-05 + 6.5504274e+00 -9.7771350e-05 + 6.5523810e+00 1.3931661e-04 + 6.5543346e+00 -3.5339954e-05 + 6.5562882e+00 -3.3296745e-06 + 6.5582418e+00 2.2399628e-05 + 6.5601954e+00 4.2756047e-05 + 6.5621490e+00 1.5581363e-04 + 6.5641026e+00 2.2006121e-04 + 6.5660562e+00 1.3886256e-04 + 6.5680098e+00 4.2634968e-04 + 6.5699634e+00 2.0341284e-04 + 6.5719170e+00 2.2944484e-04 + 6.5738706e+00 1.9115358e-04 + 6.5758242e+00 1.1600889e-04 + 6.5777778e+00 2.9815721e-04 + 6.5797314e+00 3.2645945e-04 + 6.5816850e+00 3.3160531e-04 + 6.5836386e+00 3.8488010e-04 + 6.5855922e+00 4.5207898e-04 + 6.5875458e+00 4.1673903e-04 + 6.5894994e+00 3.6058861e-04 + 6.5914530e+00 2.6016866e-04 + 6.5934066e+00 5.1110503e-04 + 6.5953602e+00 4.7130029e-04 + 6.5973138e+00 4.7523536e-04 + 6.5992674e+00 5.6445550e-04 + 6.6012210e+00 5.2828313e-04 + 6.6031746e+00 5.6082313e-04 + 6.6051282e+00 6.2643285e-04 + 6.6070818e+00 5.2328861e-04 + 6.6090354e+00 7.2200964e-04 + 6.6109890e+00 6.2665987e-04 + 6.6129426e+00 5.9215234e-04 + 6.6148962e+00 6.5375131e-04 + 6.6168498e+00 6.9453983e-04 + 6.6188034e+00 7.5182536e-04 + 6.6207570e+00 7.1005308e-04 + 6.6227106e+00 6.5783773e-04 + 6.6246642e+00 6.9022638e-04 + 6.6266178e+00 8.6533699e-04 + 6.6285714e+00 7.5909011e-04 + 6.6305250e+00 8.0941360e-04 + 6.6324786e+00 8.6208299e-04 + 6.6344322e+00 7.7588983e-04 + 6.6363858e+00 7.6567378e-04 + 6.6383394e+00 6.9605331e-04 + 6.6402930e+00 8.2417011e-04 + 6.6422466e+00 7.5454964e-04 + 6.6442002e+00 8.9795267e-04 + 6.6461538e+00 1.0213776e-03 + 6.6481074e+00 9.7839457e-04 + 6.6500611e+00 9.3927090e-04 + 6.6520147e+00 9.0650388e-04 + 6.6539683e+00 9.5387606e-04 + 6.6559219e+00 9.7786485e-04 + 6.6578755e+00 8.5232099e-04 + 6.6598291e+00 8.4815890e-04 + 6.6617827e+00 8.6859099e-04 + 6.6637363e+00 8.5761820e-04 + 6.6656899e+00 8.3544560e-04 + 6.6676435e+00 9.2943323e-04 + 6.6695971e+00 8.1493783e-04 + 6.6715507e+00 7.3366350e-04 + 6.6735043e+00 8.5701281e-04 + 6.6754579e+00 7.7361959e-04 + 6.6774115e+00 9.6144350e-04 + 6.6793651e+00 9.2201713e-04 + 6.6813187e+00 8.5428853e-04 + 6.6832723e+00 9.4343299e-04 + 6.6852259e+00 8.7676383e-04 + 6.6871795e+00 8.6079653e-04 + 6.6891331e+00 7.6552243e-04 + 6.6910867e+00 7.5803066e-04 + 6.6930403e+00 8.8667718e-04 + 6.6949939e+00 8.4694811e-04 + 6.6969475e+00 8.6806127e-04 + 6.6989011e+00 8.2961867e-04 + 6.7008547e+00 7.8118704e-04 + 6.7028083e+00 8.5845062e-04 + 6.7047619e+00 8.2099178e-04 + 6.7067155e+00 8.0782443e-04 + 6.7086691e+00 8.1917560e-04 + 6.7106227e+00 8.0169480e-04 + 6.7125763e+00 9.4676267e-04 + 6.7145299e+00 8.2454848e-04 + 6.7164835e+00 7.3290676e-04 + 6.7184371e+00 7.4947945e-04 + 6.7203907e+00 7.0626936e-04 + 6.7223443e+00 9.3480611e-04 + 6.7242979e+00 7.8315457e-04 + 6.7262515e+00 5.0701861e-04 + 6.7282051e+00 6.2158968e-04 + 6.7301587e+00 6.8598862e-04 + 6.7321123e+00 5.8783889e-04 + 6.7340659e+00 6.3574080e-04 + 6.7360195e+00 4.7742992e-04 + 6.7379731e+00 6.0993582e-04 + 6.7399267e+00 6.1750327e-04 + 6.7418803e+00 6.0138461e-04 + 6.7438339e+00 6.8038871e-04 + 6.7457875e+00 5.0414299e-04 + 6.7477411e+00 5.1352661e-04 + 6.7496947e+00 4.8234875e-04 + 6.7516484e+00 3.6664256e-04 + 6.7536020e+00 4.8628382e-04 + 6.7555556e+00 5.5620699e-04 + 6.7575092e+00 4.2952801e-04 + 6.7594628e+00 5.1617522e-04 + 6.7614164e+00 4.4587368e-04 + 6.7633700e+00 4.5888968e-04 + 6.7653236e+00 5.1950489e-04 + 6.7672772e+00 2.6766042e-04 + 6.7692308e+00 3.8336661e-04 + 6.7711844e+00 5.3978564e-04 + 6.7731380e+00 4.6040317e-04 + 6.7750916e+00 4.8416494e-04 + 6.7770452e+00 4.0962563e-04 + 6.7789988e+00 2.7083875e-04 + 6.7809524e+00 3.9449075e-04 + 6.7829060e+00 4.0009066e-04 + 6.7848596e+00 1.5505689e-04 + 6.7868132e+00 3.7579917e-04 + 6.7887668e+00 2.3330424e-04 + 6.7907204e+00 3.6717229e-04 + 6.7926740e+00 3.0186526e-04 + 6.7946276e+00 3.0587601e-04 + 6.7965812e+00 4.2566861e-04 + 6.7985348e+00 3.8003694e-04 + 6.8004884e+00 2.1098028e-04 + 6.8024420e+00 2.8922763e-04 + 6.8043956e+00 2.0311014e-04 + 6.8063492e+00 3.4749694e-04 + 6.8083028e+00 3.1450289e-04 + 6.8102564e+00 5.8344978e-05 + 6.8122100e+00 3.3274042e-04 + 6.8141636e+00 2.6137945e-04 + 6.8161172e+00 1.1782507e-04 + 6.8180708e+00 2.1037489e-04 + 6.8200244e+00 2.1188838e-04 + 6.8219780e+00 2.9323838e-04 + 6.8239316e+00 2.9270866e-04 + 6.8258852e+00 1.4877591e-04 + 6.8278388e+00 2.4397433e-04 + 6.8297924e+00 2.0106693e-04 + 6.8317460e+00 1.7072149e-04 + 6.8336996e+00 1.3644098e-04 + 6.8356532e+00 7.5901443e-05 + 6.8376068e+00 1.0836577e-04 + 6.8395604e+00 1.2630061e-04 + 6.8415140e+00 3.0723814e-05 + 6.8434676e+00 1.3379237e-04 + 6.8454212e+00 1.1979261e-04 + 6.8473748e+00 4.0788512e-05 + 6.8493284e+00 2.7923861e-05 + 6.8512821e+00 -1.2713303e-05 + 6.8532357e+00 -1.9675349e-06 + 6.8551893e+00 -9.9965909e-05 + 6.8571429e+00 -1.6254865e-04 + 6.8590965e+00 -1.5361907e-04 + 6.8610501e+00 -2.1234242e-04 + 6.8630037e+00 -2.3216912e-04 + 6.8649573e+00 -9.0355257e-05 + 6.8669109e+00 -3.1177861e-04 + 6.8688645e+00 -2.7893591e-04 + 6.8708181e+00 -1.1926289e-04 + 6.8727717e+00 -3.2154061e-04 + 6.8747253e+00 -2.9263298e-04 + 6.8766789e+00 -3.0300038e-04 + 6.8786325e+00 -3.8359363e-04 + 6.8805861e+00 -4.2044708e-04 + 6.8825397e+00 -4.7205703e-04 + 6.8844933e+00 -4.7251108e-04 + 6.8864469e+00 -3.7428568e-04 + 6.8884005e+00 -5.1140773e-04 + 6.8903541e+00 -4.0077173e-04 + 6.8923077e+00 -5.4394773e-04 + 6.8942613e+00 -5.8337410e-04 + 6.8962149e+00 -5.4969899e-04 + 6.8981685e+00 -7.1837727e-04 + 6.9001221e+00 -5.8776322e-04 + 6.9020757e+00 -6.6063769e-04 + 6.9040293e+00 -7.9745704e-04 + 6.9059829e+00 -7.3048518e-04 + 6.9079365e+00 -7.4319848e-04 + 6.9098901e+00 -7.2972843e-04 + 6.9118437e+00 -7.3313378e-04 + 6.9137973e+00 -8.9795267e-04 + 6.9157509e+00 -9.8565932e-04 + 6.9177045e+00 -9.1399564e-04 + 6.9196581e+00 -8.6397485e-04 + 6.9216117e+00 -9.2829811e-04 + 6.9235653e+00 -1.0175939e-03 + 6.9255189e+00 -1.0097995e-03 + 6.9274725e+00 -1.0989439e-03 + 6.9294261e+00 -1.0113886e-03 + 6.9313797e+00 -1.1656888e-03 + 6.9333333e+00 -1.2023909e-03 + 6.9352869e+00 -1.1115816e-03 + 6.9372405e+00 -1.1325434e-03 + 6.9391941e+00 -1.1759048e-03 + 6.9411477e+00 -1.2390173e-03 + 6.9431013e+00 -1.1563051e-03 + 6.9450549e+00 -1.2658817e-03 + 6.9470085e+00 -1.3566910e-03 + 6.9489621e+00 -1.4482570e-03 + 6.9509158e+00 -1.4446247e-03 + 6.9528694e+00 -1.4816295e-03 + 6.9548230e+00 -1.4643757e-03 + 6.9567766e+00 -1.4014146e-03 + 6.9587302e+00 -1.3882472e-03 + 6.9606838e+00 -1.5783414e-03 + 6.9626374e+00 -1.5294557e-03 + 6.9645910e+00 -1.5879520e-03 + 6.9665446e+00 -1.5170451e-03 + 6.9684982e+00 -1.5609363e-03 + 6.9704518e+00 -1.6151191e-03 + 6.9724054e+00 -1.4893483e-03 + 6.9743590e+00 -1.4667973e-03 + 6.9763126e+00 -1.5252179e-03 + 6.9782662e+00 -1.5421690e-03 + 6.9802198e+00 -1.6201893e-03 + 6.9821734e+00 -1.6218542e-03 + 6.9841270e+00 -1.5390664e-03 + 6.9860806e+00 -1.6380485e-03 + 6.9880342e+00 -1.6703615e-03 + 6.9899878e+00 -1.4134468e-03 + 6.9919414e+00 -1.6574211e-03 + 6.9938950e+00 -1.5383096e-03 + 6.9958486e+00 -1.6578752e-03 + 6.9978022e+00 -1.6269244e-03 + 6.9997558e+00 -1.5053912e-03 + 7.0017094e+00 -1.6325243e-03 + 7.0036630e+00 -1.5809900e-03 + 7.0056166e+00 -1.5501905e-03 + 7.0075702e+00 -1.5810657e-03 + 7.0095238e+00 -1.5210558e-03 + 7.0114774e+00 -1.5898439e-03 + 7.0134310e+00 -1.5557904e-03 + 7.0153846e+00 -1.4523435e-03 + 7.0173382e+00 -1.5329367e-03 + 7.0192918e+00 -1.5626768e-03 + 7.0212454e+00 -1.4326681e-03 + 7.0231990e+00 -1.4750458e-03 + 7.0251526e+00 -1.3737177e-03 + 7.0271062e+00 -1.3580531e-03 + 7.0290598e+00 -1.3655449e-03 + 7.0310134e+00 -1.2753410e-03 + 7.0329670e+00 -1.2233527e-03 + 7.0349206e+00 -1.3146917e-03 + 7.0368742e+00 -1.0487718e-03 + 7.0388278e+00 -1.1712130e-03 + 7.0407814e+00 -1.0816902e-03 + 7.0427350e+00 -1.0291721e-03 + 7.0446886e+00 -1.1307272e-03 + 7.0466422e+00 -1.0234965e-03 + 7.0485958e+00 -1.0554311e-03 + 7.0505495e+00 -1.0243289e-03 + 7.0525031e+00 -9.7680541e-04 + 7.0544567e+00 -9.6333537e-04 + 7.0564103e+00 -8.8614746e-04 + 7.0583639e+00 -8.2409443e-04 + 7.0603175e+00 -8.8168267e-04 + 7.0622711e+00 -8.2046206e-04 + 7.0642247e+00 -8.4535894e-04 + 7.0661783e+00 -7.6620350e-04 + 7.0681319e+00 -4.3255498e-04 + 7.0700855e+00 -5.6922299e-04 + 7.0720391e+00 -4.4678178e-04 + 7.0739927e+00 -4.5094387e-04 + 7.0759463e+00 -5.8292006e-04 + 7.0778999e+00 -4.7901908e-04 + 7.0798535e+00 -3.6989656e-04 + 7.0818071e+00 -4.3119284e-04 + 7.0837607e+00 -3.5604815e-04 + 7.0857143e+00 -3.5521573e-04 + 7.0876679e+00 -2.1173703e-04 + 7.0896215e+00 -1.9735889e-04 + 7.0915751e+00 -1.9955345e-04 + 7.0935287e+00 -9.9965909e-05 + 7.0954823e+00 -1.4612730e-04 + 7.0974359e+00 -1.0957656e-04 + 7.0993895e+00 4.1620931e-05 + 7.1013431e+00 -2.1491535e-05 + 7.1032967e+00 4.4496559e-05 + 7.1052503e+00 7.8096001e-05 + 7.1072039e+00 4.9339722e-05 + 7.1091575e+00 1.3855986e-04 + 7.1111111e+00 -5.6453117e-05 + 7.1130647e+00 5.2215350e-05 + 7.1150183e+00 2.2883945e-04 + 7.1169719e+00 1.2811679e-04 + 7.1189255e+00 1.8419154e-04 + 7.1208791e+00 2.2384493e-04 + 7.1228327e+00 2.3368261e-04 + 7.1247863e+00 3.9623126e-04 + 7.1267399e+00 3.3319447e-04 + 7.1286935e+00 2.9308703e-04 + 7.1306471e+00 3.2994047e-04 + 7.1326007e+00 3.1117321e-04 + 7.1345543e+00 4.4980875e-04 + 7.1365079e+00 5.5196922e-04 + 7.1384615e+00 4.8545140e-04 + 7.1404151e+00 3.0156256e-04 + 7.1423687e+00 4.7107326e-04 + 7.1443223e+00 5.2707233e-04 + 7.1462759e+00 6.0819531e-04 + 7.1482295e+00 6.4769736e-04 + 7.1501832e+00 6.0115759e-04 + 7.1521368e+00 7.8103569e-04 + 7.1540904e+00 6.1341685e-04 + 7.1560440e+00 7.2004211e-04 + 7.1579976e+00 7.4410657e-04 + 7.1599512e+00 6.5919987e-04 + 7.1619048e+00 7.3805262e-04 + 7.1638584e+00 8.1342434e-04 + 7.1658120e+00 7.1746917e-04 + 7.1677656e+00 8.8349885e-04 + 7.1697192e+00 8.6465592e-04 + 7.1716728e+00 9.4464378e-04 + 7.1736264e+00 8.5943439e-04 + 7.1755800e+00 9.6144350e-04 + 7.1775336e+00 9.3692499e-04 + 7.1794872e+00 9.3631960e-04 + 7.1814408e+00 8.3733746e-04 + 7.1833944e+00 9.7400546e-04 + 7.1853480e+00 1.0826739e-03 + 7.1873016e+00 1.0377990e-03 + 7.1892552e+00 1.1058303e-03 + 7.1912088e+00 1.0685985e-03 + 7.1931624e+00 1.1223273e-03 + 7.1951160e+00 1.0284154e-03 + 7.1970696e+00 1.0681444e-03 + 7.1990232e+00 1.1395811e-03 + 7.2009768e+00 1.0557338e-03 + 7.2029304e+00 1.0858523e-03 + 7.2048840e+00 1.1850614e-03 + 7.2068376e+00 1.2510495e-03 + 7.2087912e+00 1.2962271e-03 + 7.2107448e+00 1.2900218e-03 + 7.2126984e+00 1.3059135e-03 + 7.2146520e+00 1.1911910e-03 + 7.2166056e+00 1.3001622e-03 + 7.2185592e+00 1.4131441e-03 + 7.2205128e+00 1.3560099e-03 + 7.2224664e+00 1.3758366e-03 + 7.2244200e+00 1.4716404e-03 + 7.2263736e+00 1.4471219e-03 + 7.2283272e+00 1.4779971e-03 + 7.2302808e+00 1.2620980e-03 + 7.2322344e+00 1.2608115e-03 + 7.2341880e+00 1.2487793e-03 + 7.2361416e+00 1.2046611e-03 + 7.2380952e+00 1.3771988e-03 + 7.2400488e+00 1.4202575e-03 + 7.2420024e+00 1.3266483e-03 + 7.2439560e+00 1.3589612e-03 + 7.2459096e+00 1.3942255e-03 + 7.2478632e+00 1.5194667e-03 + 7.2498168e+00 1.4350897e-03 + 7.2517705e+00 1.2561197e-03 + 7.2537241e+00 1.2506711e-03 + 7.2556777e+00 1.2686060e-03 + 7.2576313e+00 1.1805210e-03 + 7.2595849e+00 1.3129512e-03 + 7.2615385e+00 1.1762832e-03 + 7.2634921e+00 1.1532782e-03 + 7.2654457e+00 1.2802598e-03 + 7.2673993e+00 1.0512690e-03 + 7.2693529e+00 1.1681860e-03 + 7.2713065e+00 1.2113204e-03 + 7.2732601e+00 1.1505539e-03 + 7.2752137e+00 1.1882397e-03 + 7.2771673e+00 1.0309883e-03 + 7.2791209e+00 1.0054103e-03 + 7.2810745e+00 1.1731805e-03 + 7.2830281e+00 1.0046536e-03 + 7.2849817e+00 9.5274095e-04 + 7.2869353e+00 1.1165761e-03 + 7.2888889e+00 1.0334856e-03 + 7.2908425e+00 9.7037309e-04 + 7.2927961e+00 9.9163760e-04 + 7.2947497e+00 8.2182420e-04 + 7.2967033e+00 9.8005941e-04 + 7.2986569e+00 8.3287267e-04 + 7.3006105e+00 7.5636583e-04 + 7.3025641e+00 7.3994448e-04 + 7.3045177e+00 7.0044243e-04 + 7.3064713e+00 7.7747899e-04 + 7.3084249e+00 6.8318866e-04 + 7.3103785e+00 6.3755699e-04 + 7.3123321e+00 8.0245155e-04 + 7.3142857e+00 6.9870192e-04 + 7.3162393e+00 5.1617522e-04 + 7.3181929e+00 5.6581764e-04 + 7.3201465e+00 4.9725661e-04 + 7.3221001e+00 5.4947196e-04 + 7.3240537e+00 4.4390615e-04 + 7.3260073e+00 2.7621163e-04 + 7.3279609e+00 3.3985382e-04 + 7.3299145e+00 2.7916293e-04 + 7.3318681e+00 2.1907745e-04 + 7.3338217e+00 1.9909940e-04 + 7.3357753e+00 9.7468653e-05 + 7.3377289e+00 1.7541331e-04 + 7.3396825e+00 1.4975968e-04 + 7.3416361e+00 -1.3137079e-04 + 7.3435897e+00 3.9502047e-05 + 7.3455433e+00 -8.3090513e-05 + 7.3474969e+00 -1.0261451e-04 + 7.3494505e+00 1.2864651e-06 + 7.3514042e+00 -3.2956210e-04 + 7.3533578e+00 -1.9221303e-04 + 7.3553114e+00 -7.7717629e-05 + 7.3572650e+00 -2.7659000e-04 + 7.3592186e+00 -2.1907745e-04 + 7.3611722e+00 -4.7879205e-04 + 7.3631258e+00 -3.8291256e-04 + 7.3650794e+00 -2.3655824e-04 + 7.3670330e+00 -4.7243540e-04 + 7.3689866e+00 -4.8635950e-04 + 7.3709402e+00 -4.5518164e-04 + 7.3728938e+00 -4.7985150e-04 + 7.3748474e+00 -4.6221936e-04 + 7.3768010e+00 -5.8360113e-04 + 7.3787546e+00 -7.1058280e-04 + 7.3807082e+00 -6.3097331e-04 + 7.3826618e+00 -5.9389285e-04 + 7.3846154e+00 -6.7690769e-04 + 7.3865690e+00 -6.1826001e-04 + 7.3885226e+00 -6.7418341e-04 + 7.3904762e+00 -7.1497192e-04 + 7.3924298e+00 -7.1981508e-04 + 7.3943834e+00 -6.5443238e-04 + 7.3963370e+00 -7.1043145e-04 + 7.3982906e+00 -7.2647443e-04 + 7.4002442e+00 -6.2408694e-04 + 7.4021978e+00 -7.5106862e-04 + 7.4041514e+00 -7.7097099e-04 + 7.4061050e+00 -7.9601922e-04 + 7.4080586e+00 -8.5527229e-04 + 7.4100122e+00 -9.2784406e-04 + 7.4119658e+00 -8.1395406e-04 + 7.4139194e+00 -8.1062439e-04 + 7.4158730e+00 -8.4846160e-04 + 7.4178266e+00 -8.6450457e-04 + 7.4197802e+00 -8.9485002e-04 + 7.4217338e+00 -7.9170578e-04 + 7.4236874e+00 -7.9586787e-04 + 7.4256410e+00 -7.3146894e-04 + 7.4275946e+00 -8.6526132e-04 + 7.4295482e+00 -8.8735825e-04 + 7.4315018e+00 -7.8179243e-04 + 7.4334554e+00 -8.4074280e-04 + 7.4354090e+00 -9.1929285e-04 + 7.4373626e+00 -8.2553225e-04 + 7.4393162e+00 -7.2617173e-04 + 7.4412698e+00 -7.1830159e-04 + 7.4432234e+00 -7.4418225e-04 + 7.4451770e+00 -7.9806243e-04 + 7.4471306e+00 -8.6072085e-04 + 7.4490842e+00 -7.3684183e-04 + 7.4510379e+00 -7.7490606e-04 + 7.4529915e+00 -9.5198420e-04 + 7.4549451e+00 -7.5772797e-04 + 7.4568987e+00 -7.4017150e-04 + 7.4588523e+00 -8.1652699e-04 + 7.4608059e+00 -8.2507820e-04 + 7.4627595e+00 -6.9771815e-04 + 7.4647131e+00 -7.8731666e-04 + 7.4666667e+00 -7.7884113e-04 + 7.4686203e+00 -7.8300322e-04 + 7.4705739e+00 -8.8993118e-04 + 7.4725275e+00 -7.9556518e-04 + 7.4744811e+00 -6.8455080e-04 + 7.4764347e+00 -7.0838824e-04 + 7.4783883e+00 -5.9699550e-04 + 7.4803419e+00 -7.3252838e-04 + 7.4822955e+00 -6.6366466e-04 + 7.4842491e+00 -6.9908029e-04 + 7.4862027e+00 -9.0166071e-04 + 7.4881563e+00 -7.8497076e-04 + 7.4901099e+00 -6.7804280e-04 + 7.4920635e+00 -7.1028011e-04 + 7.4940171e+00 -5.7126620e-04 + 7.4959707e+00 -7.4554438e-04 + 7.4979243e+00 -7.8368429e-04 + 7.4998779e+00 -5.9525499e-04 + 7.5018315e+00 -7.2170694e-04 + 7.5037851e+00 -6.5481076e-04 + 7.5057387e+00 -5.0081331e-04 + 7.5076923e+00 -6.7214020e-04 + 7.5096459e+00 -5.8004443e-04 + 7.5115995e+00 -7.0975038e-04 + 7.5135531e+00 -6.5844313e-04 + 7.5155067e+00 -5.3115875e-04 + 7.5174603e+00 -5.2911554e-04 + 7.5194139e+00 -5.2374266e-04 + 7.5213675e+00 -5.3176415e-04 + 7.5233211e+00 -6.3301652e-04 + 7.5252747e+00 -6.2060592e-04 + 7.5272283e+00 -6.3127601e-04 + 7.5291819e+00 -6.6843215e-04 + 7.5311355e+00 -4.6940843e-04 + 7.5330891e+00 -5.1443471e-04 + 7.5350427e+00 -4.2990638e-04 + 7.5369963e+00 -4.0281494e-04 + 7.5389499e+00 -4.8257578e-04 + 7.5409035e+00 -4.9831605e-04 + 7.5428571e+00 -5.7641206e-04 + 7.5448107e+00 -4.2491187e-04 + 7.5467643e+00 -3.2048117e-04 + 7.5487179e+00 -5.5938531e-04 + 7.5506716e+00 -4.1257694e-04 + 7.5526252e+00 -3.6966954e-04 + 7.5545788e+00 -5.1049964e-04 + 7.5565324e+00 -3.2532433e-04 + 7.5584860e+00 -4.5888968e-04 + 7.5604396e+00 -3.9933391e-04 + 7.5623932e+00 -2.7076307e-04 + 7.5643468e+00 -3.6073996e-04 + 7.5663004e+00 -3.2063252e-04 + 7.5682540e+00 -2.8975735e-04 + 7.5702076e+00 -4.8968917e-04 + 7.5721612e+00 -3.1117321e-04 + 7.5741148e+00 -2.8726010e-04 + 7.5760684e+00 -3.9827447e-04 + 7.5780220e+00 -1.9440758e-04 + 7.5799756e+00 -1.8192131e-04 + 7.5819292e+00 -1.2266823e-04 + 7.5838828e+00 -8.9598513e-05 + 7.5858364e+00 -1.9039684e-04 + 7.5877900e+00 -1.4521921e-04 + 7.5897436e+00 -1.7753219e-04 + 7.5916972e+00 -2.9747614e-04 + 7.5936508e+00 -1.3076540e-04 + 7.5956044e+00 -2.4859047e-04 + 7.5975580e+00 -2.5297959e-04 + 7.5995116e+00 -2.0462363e-04 + 7.6014652e+00 -1.4718675e-04 + 7.6034188e+00 6.7123210e-05 + 7.6053724e+00 -7.5674420e-05 + 7.6073260e+00 -1.7185661e-04 + 7.6092796e+00 2.2399628e-05 + 7.6112332e+00 -4.7750559e-05 + 7.6131868e+00 -9.6030839e-05 + 7.6151404e+00 1.4764079e-04 + 7.6170940e+00 -7.1209629e-05 + 7.6190476e+00 -7.0452885e-05 + 7.6210012e+00 5.7285536e-05 + 7.6229548e+00 -5.9555768e-05 + 7.6249084e+00 1.3780312e-04 + 7.6268620e+00 2.6940093e-05 + 7.6288156e+00 1.1320893e-04 + 7.6307692e+00 2.6788745e-04 + 7.6327228e+00 9.8982141e-05 + 7.6346764e+00 7.9912187e-05 + 7.6366300e+00 3.6475070e-05 + 7.6385836e+00 1.0253884e-04 + 7.6405372e+00 1.7775921e-04 + 7.6424908e+00 3.2025414e-04 + 7.6444444e+00 3.1624340e-04 + 7.6463980e+00 4.5094387e-04 + 7.6483516e+00 3.8139908e-04 + 7.6503053e+00 4.6554903e-04 + 7.6522589e+00 4.9975387e-04 + 7.6542125e+00 3.0564898e-04 + 7.6561661e+00 5.3653164e-04 + 7.6581197e+00 6.1220606e-04 + 7.6600733e+00 4.2816587e-04 + 7.6620269e+00 4.6282475e-04 + 7.6639805e+00 5.0126736e-04 + 7.6659341e+00 5.9850899e-04 + 7.6678877e+00 6.4368662e-04 + 7.6698413e+00 5.8746052e-04 + 7.6717949e+00 6.7857252e-04 + 7.6737485e+00 7.7543578e-04 + 7.6757021e+00 7.3555536e-04 + 7.6776557e+00 6.4550280e-04 + 7.6796093e+00 7.7392229e-04 + 7.6815629e+00 7.1080983e-04 + 7.6835165e+00 8.1599727e-04 + 7.6854701e+00 8.3703476e-04 + 7.6874237e+00 8.5247234e-04 + 7.6893773e+00 8.5845062e-04 + 7.6913309e+00 8.3294834e-04 + 7.6932845e+00 9.9534564e-04 + 7.6952381e+00 9.3215750e-04 + 7.6971917e+00 9.0264448e-04 + 7.6991453e+00 9.5107611e-04 + 7.7010989e+00 9.6220025e-04 + 7.7030525e+00 1.0838847e-03 + 7.7050061e+00 1.0489231e-03 + 7.7069597e+00 1.1379919e-03 + 7.7089133e+00 1.0508150e-03 + 7.7108669e+00 1.0383287e-03 + 7.7128205e+00 1.1517647e-03 + 7.7147741e+00 1.0371936e-03 + 7.7167277e+00 1.0795713e-03 + 7.7186813e+00 1.1768129e-03 + 7.7206349e+00 1.2008774e-03 + 7.7225885e+00 1.1567592e-03 + 7.7245421e+00 1.2862381e-03 + 7.7264957e+00 1.1593321e-03 + 7.7284493e+00 1.1837750e-03 + 7.7304029e+00 1.2698168e-03 + 7.7323565e+00 1.1865749e-03 + 7.7343101e+00 1.3330806e-03 + 7.7362637e+00 1.3166592e-03 + 7.7382173e+00 1.2943353e-03 + 7.7401709e+00 1.2012557e-03 + 7.7421245e+00 1.1059060e-03 + 7.7440781e+00 1.2331147e-03 + 7.7460317e+00 1.1779480e-03 + 7.7479853e+00 1.2040557e-03 + 7.7499389e+00 1.2069313e-03 + 7.7518926e+00 1.2821517e-03 + 7.7538462e+00 1.4357708e-03 + 7.7557998e+00 1.2786707e-03 + 7.7577534e+00 1.1864236e-03 + 7.7597070e+00 1.1740886e-03 + 7.7616606e+00 1.2831355e-03 + 7.7636142e+00 1.3166592e-03 + 7.7655678e+00 1.2544549e-03 + 7.7675214e+00 1.2762491e-03 + 7.7694750e+00 1.3274050e-03 + 7.7714286e+00 1.1609213e-03 + 7.7733822e+00 1.0312153e-03 + 7.7753358e+00 1.1619807e-03 + 7.7772894e+00 1.1852884e-03 + 7.7792430e+00 1.2756437e-03 + 7.7811966e+00 1.2543035e-03 + 7.7831502e+00 1.0807821e-03 + 7.7851038e+00 1.1956558e-03 + 7.7870574e+00 1.1361757e-03 + 7.7890110e+00 1.0629986e-03 + 7.7909646e+00 1.2475685e-03 + 7.7929182e+00 1.2813193e-03 + 7.7948718e+00 1.1558511e-03 + 7.7968254e+00 1.2796544e-03 + 7.7987790e+00 1.0698849e-03 + 7.8007326e+00 1.0829766e-03 + 7.8026862e+00 1.1165004e-03 + 7.8046398e+00 1.0167615e-03 + 7.8065934e+00 1.1651590e-03 + 7.8085470e+00 9.9012411e-04 + 7.8105006e+00 9.5970299e-04 + 7.8124542e+00 1.1348136e-03 + 7.8144078e+00 8.8872039e-04 + 7.8163614e+00 9.6855690e-04 + 7.8183150e+00 9.8914034e-04 + 7.8202686e+00 7.1088550e-04 + 7.8222222e+00 9.8868630e-04 + 7.8241758e+00 8.5890467e-04 + 7.8261294e+00 8.2886192e-04 + 7.8280830e+00 9.9738885e-04 + 7.8300366e+00 7.2095020e-04 + 7.8319902e+00 6.0849801e-04 + 7.8339438e+00 5.6135285e-04 + 7.8358974e+00 5.4076940e-04 + 7.8378510e+00 7.8398699e-04 + 7.8398046e+00 7.2526364e-04 + 7.8417582e+00 6.4474606e-04 + 7.8437118e+00 7.6688457e-04 + 7.8456654e+00 4.9180805e-04 + 7.8476190e+00 6.1364387e-04 + 7.8495726e+00 5.8912536e-04 + 7.8515263e+00 4.2680373e-04 + 7.8534799e+00 5.5832587e-04 + 7.8554335e+00 4.9612150e-04 + 7.8573871e+00 5.0308354e-04 + 7.8593407e+00 6.3173006e-04 + 7.8612943e+00 3.7360461e-04 + 7.8632479e+00 3.6649122e-04 + 7.8652015e+00 4.3013340e-04 + 7.8671551e+00 1.9917507e-04 + 7.8691087e+00 2.6009298e-04 + 7.8710623e+00 2.4813642e-04 + 7.8730159e+00 2.4828777e-04 + 7.8749695e+00 3.5362656e-04 + 7.8769231e+00 1.8789958e-04 + 7.8788767e+00 2.0818033e-04 + 7.8808303e+00 1.1109005e-04 + 7.8827839e+00 7.3858234e-05 + 7.8847375e+00 7.5069025e-05 + 7.8866911e+00 1.2493847e-04 + 7.8886447e+00 6.6744838e-05 + 7.8905983e+00 9.1490374e-05 + 7.8925519e+00 -1.4635433e-04 + 7.8945055e+00 -1.8176996e-04 + 7.8964591e+00 -1.1048465e-04 + 7.8984127e+00 -1.7881865e-04 + 7.9003663e+00 -2.3693661e-04 + 7.9023199e+00 -1.9039684e-04 + 7.9042735e+00 -1.5233261e-04 + 7.9062271e+00 -1.6171624e-04 + 7.9081807e+00 -2.9051410e-04 + 7.9101343e+00 -2.4261219e-04 + 7.9120879e+00 -1.1063600e-04 + 7.9140415e+00 -3.2055684e-04 + 7.9159951e+00 -3.5559410e-04 + 7.9179487e+00 -2.7288196e-04 + 7.9199023e+00 -3.3463228e-04 + 7.9218559e+00 -2.8567094e-04 + 7.9238095e+00 -2.6523884e-04 + 7.9257631e+00 -3.5506438e-04 + 7.9277167e+00 -3.9486912e-04 + 7.9296703e+00 -3.9449075e-04 + 7.9316239e+00 -3.9880419e-04 + 7.9335775e+00 -3.3281610e-04 + 7.9355311e+00 -3.7156140e-04 + 7.9374847e+00 -3.4212405e-04 + 7.9394383e+00 -4.5994912e-04 + 7.9413919e+00 -4.6418689e-04 + 7.9433455e+00 -4.9725661e-04 + 7.9452991e+00 -5.6725545e-04 + 7.9472527e+00 -4.9748364e-04 + 7.9492063e+00 -4.5450057e-04 + 7.9511600e+00 -3.7549647e-04 + 7.9531136e+00 -4.5593838e-04 + 7.9550672e+00 -4.2703075e-04 + 7.9570208e+00 -4.1658768e-04 + 7.9589744e+00 -5.4039103e-04 + 7.9609280e+00 -5.1973192e-04 + 7.9628816e+00 -5.3433708e-04 + 7.9648352e+00 -3.5748596e-04 + 7.9667888e+00 -2.9013573e-04 + 7.9687424e+00 -4.4375480e-04 + 7.9706960e+00 -4.7281378e-04 + 7.9726496e+00 -3.8843680e-04 + 7.9746032e+00 -3.7602619e-04 + 7.9765568e+00 -4.1696605e-04 + 7.9785104e+00 -3.1457856e-04 + 7.9804640e+00 -3.4810233e-04 + 7.9824176e+00 -3.4810233e-04 + 7.9843712e+00 -4.1318233e-04 + 7.9863248e+00 -3.7421001e-04 + 7.9882784e+00 -3.2244870e-04 + 7.9902320e+00 -2.0999652e-04 + 7.9921856e+00 -1.8124024e-04 + 7.9941392e+00 -3.2161628e-04 + 7.9960928e+00 -3.5763731e-04 + 7.9980464e+00 -1.0337126e-04 + 8.0000000e+00 -1.7329442e-04 diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_real.pdf b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_real.pdf new file mode 100644 index 00000000..5fb550ba Binary files /dev/null and b/tests/experimental/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_real.pdf differ diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti b/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti new file mode 100644 index 00000000..150a920d Binary files /dev/null and b/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti differ diff --git a/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp b/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp new file mode 100644 index 00000000..cf8d9428 Binary files /dev/null and b/tests/experimental/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp differ diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in new file mode 100755 index 00000000..0dba570f --- /dev/null +++ b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in @@ -0,0 +1,10 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 + +#python: +from user_libs.antennas import antenna_like_MALA_1200 +antenna_like_MALA_1200(0.132, 0.095, 0.100) +#end_python: + diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out new file mode 100644 index 00000000..34015f15 Binary files /dev/null and b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out differ diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in new file mode 100644 index 00000000..9d89e5ae --- /dev/null +++ b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in @@ -0,0 +1,77 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 +#material: 6.49 0.252 1.0 0.0 absorber +#material: 3.0 0.0 1.0 0.0 pcb +#material: 2.35 0.0 1.0 0.0 hdpe +#material: 2.26 0.0 1.0 0.0 polypropylene +#material: 3.0 4.255 1.0 0.0 txreslower +#material: 3.0 3.191 1.0 0.0 txresupper +#material: 3.0 13.333 1.0 0.0 rxreslower +#material: 3.0 10.000 1.0 0.0 rxresupper +#box: 0.04000000000000001 0.0405 0.10600000000000001 0.224 0.1495 0.14600000000000002 pec +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.10800000000000001 free_space +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.10800000000000001 free_space +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.14400000000000002 absorber +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.14400000000000002 absorber +#cylinder: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.008 pec +#cylinder: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.008 pec +#cylinder: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.008 pec +#cylinder: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.008 pec +#cylinder: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.007 free_space +#cylinder: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.007 free_space +#cylinder: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.007 free_space +#cylinder: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.007 free_space +#box: 0.094 0.1335 0.10600000000000001 0.096 0.13549999999999998 0.14400000000000002 free_space +#box: 0.094 0.0545 0.10600000000000001 0.096 0.0565 0.14400000000000002 free_space +#box: 0.186 0.1335 0.10600000000000001 0.188 0.13549999999999998 0.14400000000000002 free_space +#box: 0.186 0.0545 0.10600000000000001 0.188 0.0565 0.14400000000000002 free_space +#box: 0.06000000000000001 0.058499999999999996 0.10600000000000001 0.222 0.1315 0.10800000000000001 pcb +#box: 0.07200000000000001 0.0625 0.10600000000000001 0.134 0.1245 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.14300000000000002 absorber +#box: 0.14800000000000002 0.0625 0.10600000000000001 0.21000000000000002 0.1245 0.14300000000000002 pec +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.14300000000000002 free_space +#box: 0.134 0.1185 0.14100000000000001 0.14800000000000002 0.1245 0.14300000000000002 pec +#box: 0.134 0.0625 0.14100000000000001 0.14800000000000002 0.0685 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.10800000000000001 pcb +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.10800000000000001 pcb +#triangle: 0.10300000000000001 0.0915 0.10600000000000001 0.07700000000000001 0.0665 0.10600000000000001 0.129 0.0665 0.10600000000000001 0 pec +#edge: 0.10300000000000001 0.0915 0.10600000000000001 0.10300000000000001 0.0925 0.10600000000000001 pec +#triangle: 0.10300000000000001 0.0945 0.10600000000000001 0.07700000000000001 0.1195 0.10600000000000001 0.129 0.1195 0.10600000000000001 0 pec +#edge: 0.10300000000000001 0.0935 0.10600000000000001 0.10300000000000001 0.0945 0.10600000000000001 pec +#triangle: 0.179 0.0915 0.10600000000000001 0.153 0.0665 0.10600000000000001 0.205 0.0665 0.10600000000000001 0 pec +#edge: 0.179 0.0915 0.10600000000000001 0.179 0.0925 0.10600000000000001 pec +#triangle: 0.179 0.0945 0.10600000000000001 0.153 0.1195 0.10600000000000001 0.205 0.1195 0.10600000000000001 0 pec +#edge: 0.179 0.0935 0.10600000000000001 0.179 0.0945 0.10600000000000001 pec +#edge: 0.08000000000000002 0.0635 0.10600000000000001 0.08000000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.08100000000000002 0.0635 0.10600000000000001 0.08100000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.10300000000000001 0.0635 0.10600000000000001 0.10300000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.10400000000000001 0.0635 0.10600000000000001 0.10400000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.125 0.0635 0.10600000000000001 0.125 0.0665 0.10600000000000001 txreslower +#edge: 0.126 0.0635 0.10600000000000001 0.126 0.0665 0.10600000000000001 txreslower +#edge: 0.08000000000000002 0.1195 0.10600000000000001 0.08000000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.08100000000000002 0.1195 0.10600000000000001 0.08100000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.10300000000000001 0.1195 0.10600000000000001 0.10300000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.10400000000000001 0.1195 0.10600000000000001 0.10400000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.125 0.1195 0.10600000000000001 0.125 0.1235 0.10600000000000001 txresupper +#edge: 0.126 0.1195 0.10600000000000001 0.126 0.1235 0.10600000000000001 txresupper +#edge: 0.15600000000000003 0.0635 0.10600000000000001 0.15600000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.15700000000000003 0.0635 0.10600000000000001 0.15700000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.179 0.0635 0.10600000000000001 0.179 0.0665 0.10600000000000001 rxreslower +#edge: 0.18 0.0635 0.10600000000000001 0.18 0.0665 0.10600000000000001 rxreslower +#edge: 0.201 0.0635 0.10600000000000001 0.201 0.0665 0.10600000000000001 rxreslower +#edge: 0.202 0.0635 0.10600000000000001 0.202 0.0665 0.10600000000000001 rxreslower +#edge: 0.15600000000000003 0.1195 0.10600000000000001 0.15600000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.15700000000000003 0.1195 0.10600000000000001 0.15700000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.179 0.1195 0.10600000000000001 0.179 0.1235 0.10600000000000001 rxresupper +#edge: 0.18 0.1195 0.10600000000000001 0.18 0.1235 0.10600000000000001 rxresupper +#edge: 0.201 0.1195 0.10600000000000001 0.201 0.1235 0.10600000000000001 rxresupper +#edge: 0.202 0.1195 0.10600000000000001 0.202 0.1235 0.10600000000000001 rxresupper +#box: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.10300000000000001 polypropylene +#box: 0.04000000000000001 0.0405 0.10300000000000001 0.224 0.1495 0.10600000000000001 hdpe +#geometry_view: 0.03900000000000001 0.0395 0.099 0.225 0.1505 0.14700000000000002 0.001 0.001 0.001 antenna_like_MALA_1200 n +#geometry_view: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.11 0.001 0.001 0.001 antenna_like_MALA_1200_pcb f +#waveform: gaussian 1.0 978000000.0 myGaussian +#voltage_source: y 0.10300000000000001 0.0925 0.10600000000000001 1000 myGaussian +#rx: 0.179 0.0925 0.10600000000000001 diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_real.txt b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_real.txt new file mode 100644 index 00000000..d6d456c8 --- /dev/null +++ b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_real.txt @@ -0,0 +1,1024 @@ + 0.0000000e+00 -2.9186696e-04 + 6.9250020e-03 1.7532805e-04 + 1.3850004e-02 4.0684682e-04 + 2.0775006e-02 5.4034039e-04 + 2.7700008e-02 6.3856048e-04 + 3.4625010e-02 6.7701702e-04 + 4.1550012e-02 7.1229050e-04 + 4.8475014e-02 7.6224503e-04 + 5.5400016e-02 8.0895154e-04 + 6.2325018e-02 8.5487852e-04 + 6.9250020e-02 8.3422113e-04 + 7.6175022e-02 8.8592958e-04 + 8.3100023e-02 8.7767962e-04 + 9.0025025e-02 8.7189814e-04 + 9.6950027e-02 8.9385475e-04 + 1.0387503e-01 8.6442770e-04 + 1.1080003e-01 9.2672470e-04 + 1.1772503e-01 9.6180330e-04 + 1.2465004e-01 9.4270495e-04 + 1.3157504e-01 9.3464986e-04 + 1.3850004e-01 9.4562817e-04 + 1.4542504e-01 9.7219696e-04 + 1.5235004e-01 1.0087047e-03 + 1.5927504e-01 1.0068858e-03 + 1.6620005e-01 1.0338444e-03 + 1.7312505e-01 1.0422892e-03 + 1.8005005e-01 1.1052358e-03 + 1.8697505e-01 1.1491490e-03 + 1.9390005e-01 1.1640899e-03 + 2.0082506e-01 1.1777316e-03 + 2.0775006e-01 1.2260621e-03 + 2.1467506e-01 1.2602313e-03 + 2.2160006e-01 1.2960894e-03 + 2.2852506e-01 1.4071716e-03 + 2.3545007e-01 1.4581006e-03 + 2.4237507e-01 1.5354684e-03 + 2.4930007e-01 1.6054307e-03 + 2.5622507e-01 1.7027413e-03 + 2.6315007e-01 1.8446797e-03 + 2.7007508e-01 2.0119527e-03 + 2.7700008e-01 2.1449916e-03 + 2.8392508e-01 2.2552943e-03 + 2.9085008e-01 2.3743017e-03 + 2.9777508e-01 2.5535923e-03 + 3.0470009e-01 2.7382747e-03 + 3.1162509e-01 2.9748603e-03 + 3.1855009e-01 3.1525270e-03 + 3.2547509e-01 3.3721580e-03 + 3.3240009e-01 3.6941666e-03 + 3.3932510e-01 3.9700533e-03 + 3.4625010e-01 4.2548395e-03 + 3.5317510e-01 4.4443939e-03 + 3.6010010e-01 4.7066390e-03 + 3.6702510e-01 5.0444979e-03 + 3.7395011e-01 5.3752761e-03 + 3.8087511e-01 5.7969988e-03 + 3.8780011e-01 6.1321294e-03 + 3.9472511e-01 6.4661556e-03 + 4.0165011e-01 6.8611797e-03 + 4.0857512e-01 7.2374302e-03 + 4.1550012e-01 7.6967000e-03 + 4.2242512e-01 8.0320255e-03 + 4.2935012e-01 8.4165259e-03 + 4.3627512e-01 8.8951540e-03 + 4.4320013e-01 9.4252306e-03 + 4.5012513e-01 9.9378979e-03 + 4.5705013e-01 1.0341042e-02 + 4.6397513e-01 1.0777381e-02 + 4.7090013e-01 1.1262180e-02 + 4.7782513e-01 1.1780824e-02 + 4.8475014e-01 1.2351695e-02 + 4.9167514e-01 1.2778225e-02 + 4.9860014e-01 1.3258997e-02 + 5.0552514e-01 1.3766208e-02 + 5.1245014e-01 1.4326491e-02 + 5.1937515e-01 1.4928609e-02 + 5.2630015e-01 1.5464142e-02 + 5.3322515e-01 1.5987787e-02 + 5.4015015e-01 1.6549110e-02 + 5.4707515e-01 1.7230025e-02 + 5.5400016e-01 1.8026179e-02 + 5.6092516e-01 1.8621086e-02 + 5.6785016e-01 1.9222814e-02 + 5.7477516e-01 1.9907431e-02 + 5.8170016e-01 2.0717487e-02 + 5.8862517e-01 2.1578602e-02 + 5.9555017e-01 2.2358321e-02 + 6.0247517e-01 2.3047811e-02 + 6.0940017e-01 2.3941860e-02 + 6.1632517e-01 2.4940626e-02 + 6.2325018e-01 2.6030077e-02 + 6.3017518e-01 2.7085488e-02 + 6.3710018e-01 2.7955762e-02 + 6.4402518e-01 2.8991685e-02 + 6.5095018e-01 3.0147005e-02 + 6.5787519e-01 3.1482461e-02 + 6.6480019e-01 3.2852930e-02 + 6.7172519e-01 3.3992075e-02 + 6.7865019e-01 3.5575484e-02 + 6.8557519e-01 3.7040210e-02 + 6.9250020e-01 3.8918670e-02 + 6.9942520e-01 4.0801416e-02 + 7.0635020e-01 4.2169741e-02 + 7.1327520e-01 4.4383461e-02 + 7.2020020e-01 4.6129141e-02 + 7.2712521e-01 4.8664675e-02 + 7.3405021e-01 5.1596986e-02 + 7.4097521e-01 5.3804794e-02 + 7.4790021e-01 5.7120566e-02 + 7.5482521e-01 5.9945563e-02 + 7.6175022e-01 6.3858971e-02 + 7.6867522e-01 6.8688060e-02 + 7.7560022e-01 7.2852540e-02 + 7.8252522e-01 7.8216838e-02 + 7.8945022e-01 8.3009094e-02 + 7.9637522e-01 8.9491360e-02 + 8.0330023e-01 9.7856503e-02 + 8.1022523e-01 1.0516877e-01 + 8.1715023e-01 1.1419319e-01 + 8.2407523e-01 1.2238703e-01 + 8.3100023e-01 1.3269469e-01 + 8.3792524e-01 1.4547005e-01 + 8.4485024e-01 1.5688827e-01 + 8.5177524e-01 1.6971736e-01 + 8.5870024e-01 1.8213778e-01 + 8.6562524e-01 1.9618436e-01 + 8.7255025e-01 2.1388846e-01 + 8.7947525e-01 2.3094069e-01 + 8.8640025e-01 2.4853112e-01 + 8.9332525e-01 2.6407159e-01 + 9.0025025e-01 2.8185988e-01 + 9.0717526e-01 3.0197655e-01 + 9.1410026e-01 3.2207126e-01 + 9.2102526e-01 3.4189048e-01 + 9.2795026e-01 3.6021411e-01 + 9.3487526e-01 3.7855684e-01 + 9.4180027e-01 3.9878479e-01 + 9.4872527e-01 4.1771339e-01 + 9.5565027e-01 4.3300234e-01 + 9.6257527e-01 4.4929849e-01 + 9.6950027e-01 4.6217682e-01 + 9.7642528e-01 4.7634163e-01 + 9.8335028e-01 4.8834124e-01 + 9.9027528e-01 4.9344933e-01 + 9.9720028e-01 5.0152592e-01 + 1.0041253e+00 5.0277647e-01 + 1.0110503e+00 5.0647752e-01 + 1.0179753e+00 5.0824126e-01 + 1.0249003e+00 4.9892861e-01 + 1.0318253e+00 4.9323542e-01 + 1.0387503e+00 4.7994329e-01 + 1.0456753e+00 4.6971229e-01 + 1.0526003e+00 4.5516357e-01 + 1.0595253e+00 4.2800981e-01 + 1.0664503e+00 4.0506632e-01 + 1.0733753e+00 3.7497557e-01 + 1.0803003e+00 3.4870216e-01 + 1.0872253e+00 3.1865662e-01 + 1.0941503e+00 2.8016390e-01 + 1.1010753e+00 2.4339314e-01 + 1.1080003e+00 2.0143543e-01 + 1.1149253e+00 1.6497207e-01 + 1.1218503e+00 1.2389691e-01 + 1.1287753e+00 7.5497532e-02 + 1.1357003e+00 2.8799013e-02 + 1.1426253e+00 -1.9059569e-02 + 1.1495503e+00 -5.9211771e-02 + 1.1564753e+00 -1.0584267e-01 + 1.1634003e+00 -1.5664083e-01 + 1.1703253e+00 -2.0379148e-01 + 1.1772503e+00 -2.4982760e-01 + 1.1841753e+00 -2.8855613e-01 + 1.1911003e+00 -3.3455229e-01 + 1.1980253e+00 -3.8303008e-01 + 1.2049503e+00 -4.3071677e-01 + 1.2118753e+00 -4.7229499e-01 + 1.2188003e+00 -5.0785787e-01 + 1.2257253e+00 -5.4852605e-01 + 1.2326503e+00 -5.9032064e-01 + 1.2395753e+00 -6.3150117e-01 + 1.2465004e+00 -6.6830187e-01 + 1.2534254e+00 -6.9973652e-01 + 1.2603504e+00 -7.3065396e-01 + 1.2672754e+00 -7.5134221e-01 + 1.2742004e+00 -7.8376628e-01 + 1.2811254e+00 -8.1392650e-01 + 1.2880504e+00 -8.4182289e-01 + 1.2949754e+00 -8.6745543e-01 + 1.3019004e+00 -8.9082414e-01 + 1.3088254e+00 -9.1192900e-01 + 1.3157504e+00 -9.3077003e-01 + 1.3226754e+00 -9.4734722e-01 + 1.3296004e+00 -9.6166056e-01 + 1.3365254e+00 -9.7371007e-01 + 1.3434504e+00 -9.8349573e-01 + 1.3503754e+00 -9.9101756e-01 + 1.3573004e+00 -9.9627555e-01 + 1.3642254e+00 -9.9926969e-01 + 1.3711504e+00 -1.0000000e+00 + 1.3780754e+00 -9.9846647e-01 + 1.3850004e+00 -9.9466909e-01 + 1.3919254e+00 -9.8860788e-01 + 1.3988504e+00 -9.8028283e-01 + 1.4057754e+00 -9.6969394e-01 + 1.4127004e+00 -9.5684120e-01 + 1.4196254e+00 -9.4172463e-01 + 1.4265504e+00 -9.2434422e-01 + 1.4334754e+00 -9.0469997e-01 + 1.4404004e+00 -8.8279187e-01 + 1.4473254e+00 -8.5861994e-01 + 1.4542504e+00 -8.3218417e-01 + 1.4611754e+00 -8.0348456e-01 + 1.4681004e+00 -7.7252111e-01 + 1.4750254e+00 -7.3929382e-01 + 1.4819504e+00 -7.1424061e-01 + 1.4888754e+00 -6.8151611e-01 + 1.4958004e+00 -6.4489983e-01 + 1.5027254e+00 -6.1392504e-01 + 1.5096504e+00 -5.8144647e-01 + 1.5165754e+00 -5.4361686e-01 + 1.5235004e+00 -4.9896323e-01 + 1.5304254e+00 -4.5461563e-01 + 1.5373504e+00 -4.1277504e-01 + 1.5442754e+00 -3.7376900e-01 + 1.5512004e+00 -3.2914330e-01 + 1.5581254e+00 -2.8045680e-01 + 1.5650504e+00 -2.2866701e-01 + 1.5719754e+00 -1.8186118e-01 + 1.5789004e+00 -1.3628427e-01 + 1.5858254e+00 -8.9187606e-02 + 1.5927504e+00 -4.0240223e-02 + 1.5996755e+00 1.1815123e-02 + 1.6066005e+00 6.2355918e-02 + 1.6135255e+00 1.0872346e-01 + 1.6204505e+00 1.5620612e-01 + 1.6273755e+00 2.0204391e-01 + 1.6343005e+00 2.4997233e-01 + 1.6412255e+00 2.9696830e-01 + 1.6481505e+00 3.4049922e-01 + 1.6550755e+00 3.8130369e-01 + 1.6620005e+00 4.2099942e-01 + 1.6689255e+00 4.6091893e-01 + 1.6758505e+00 5.0207574e-01 + 1.6827755e+00 5.3782714e-01 + 1.6897005e+00 5.7078134e-01 + 1.6966255e+00 6.0252371e-01 + 1.7035505e+00 6.3468468e-01 + 1.7104755e+00 6.6729128e-01 + 1.7174005e+00 6.9447116e-01 + 1.7243255e+00 7.2368220e-01 + 1.7312505e+00 7.5074410e-01 + 1.7381755e+00 7.7565686e-01 + 1.7451005e+00 7.9842048e-01 + 1.7520255e+00 8.1903495e-01 + 1.7589505e+00 8.3750027e-01 + 1.7658755e+00 8.5381646e-01 + 1.7728005e+00 8.6798350e-01 + 1.7797255e+00 8.8000139e-01 + 1.7866505e+00 8.8987014e-01 + 1.7935755e+00 8.9758975e-01 + 1.8005005e+00 9.0316021e-01 + 1.8074255e+00 9.0658153e-01 + 1.8143505e+00 9.0785371e-01 + 1.8212755e+00 9.0697674e-01 + 1.8282005e+00 9.0395063e-01 + 1.8351255e+00 8.9877538e-01 + 1.8420505e+00 8.9145098e-01 + 1.8489755e+00 8.8197744e-01 + 1.8559005e+00 8.7035475e-01 + 1.8628255e+00 8.5658292e-01 + 1.8697505e+00 8.4066195e-01 + 1.8766755e+00 8.2259183e-01 + 1.8836005e+00 8.0237257e-01 + 1.8905255e+00 7.8000417e-01 + 1.8974505e+00 7.5548662e-01 + 1.9043755e+00 7.2881993e-01 + 1.9113005e+00 7.0000409e-01 + 1.9182255e+00 6.7080856e-01 + 1.9251505e+00 6.3596720e-01 + 1.9320755e+00 6.0307107e-01 + 1.9390005e+00 5.7025796e-01 + 1.9459255e+00 5.3623743e-01 + 1.9528506e+00 5.0014863e-01 + 1.9597756e+00 4.6052358e-01 + 1.9667006e+00 4.2425244e-01 + 1.9736256e+00 3.8891133e-01 + 1.9805506e+00 3.5168702e-01 + 1.9874756e+00 3.1316571e-01 + 1.9944006e+00 2.7278303e-01 + 2.0013256e+00 2.3463473e-01 + 2.0082506e+00 1.9840691e-01 + 2.0151756e+00 1.6483442e-01 + 2.0221006e+00 1.3004879e-01 + 2.0290256e+00 9.3911134e-02 + 2.0359506e+00 6.0229115e-02 + 2.0428756e+00 2.8802196e-02 + 2.0498006e+00 3.1583734e-04 + 2.0567256e+00 -2.8424841e-02 + 2.0636506e+00 -5.6188710e-02 + 2.0705756e+00 -8.3113226e-02 + 2.0775006e+00 -1.0888158e-01 + 2.0844256e+00 -1.3026374e-01 + 2.0913506e+00 -1.5147057e-01 + 2.0982756e+00 -1.7185228e-01 + 2.1052006e+00 -1.9011849e-01 + 2.1121256e+00 -2.0730778e-01 + 2.1190506e+00 -2.2206691e-01 + 2.1259756e+00 -2.3502397e-01 + 2.1329006e+00 -2.4642237e-01 + 2.1398256e+00 -2.5683071e-01 + 2.1467506e+00 -2.6654294e-01 + 2.1536756e+00 -2.7491789e-01 + 2.1606006e+00 -2.8075348e-01 + 2.1675256e+00 -2.8552436e-01 + 2.1744506e+00 -2.8926614e-01 + 2.1813756e+00 -2.9178790e-01 + 2.1883006e+00 -2.9438106e-01 + 2.1952256e+00 -2.9524094e-01 + 2.2021506e+00 -2.9481298e-01 + 2.2090756e+00 -2.9333468e-01 + 2.2160006e+00 -2.9112843e-01 + 2.2229256e+00 -2.8904742e-01 + 2.2298506e+00 -2.8630330e-01 + 2.2367756e+00 -2.8318189e-01 + 2.2437006e+00 -2.7900715e-01 + 2.2506256e+00 -2.7450870e-01 + 2.2575506e+00 -2.6982747e-01 + 2.2644756e+00 -2.6552462e-01 + 2.2714006e+00 -2.6112154e-01 + 2.2783256e+00 -2.5580512e-01 + 2.2852506e+00 -2.5049779e-01 + 2.2921756e+00 -2.4518618e-01 + 2.2991006e+00 -2.4033292e-01 + 2.3060257e+00 -2.3593153e-01 + 2.3129507e+00 -2.3062102e-01 + 2.3198757e+00 -2.2529395e-01 + 2.3268007e+00 -2.2034923e-01 + 2.3337257e+00 -2.1590074e-01 + 2.3406507e+00 -2.1187203e-01 + 2.3475757e+00 -2.0714460e-01 + 2.3545007e+00 -2.0262226e-01 + 2.3614257e+00 -1.9834864e-01 + 2.3683507e+00 -1.9424022e-01 + 2.3752757e+00 -1.9060290e-01 + 2.3822007e+00 -1.8657035e-01 + 2.3891257e+00 -1.8254937e-01 + 2.3960507e+00 -1.7808809e-01 + 2.4029757e+00 -1.7400741e-01 + 2.4099007e+00 -1.7022275e-01 + 2.4168257e+00 -1.6605652e-01 + 2.4237507e+00 -1.6186040e-01 + 2.4306757e+00 -1.5717760e-01 + 2.4376007e+00 -1.5276946e-01 + 2.4445257e+00 -1.4846797e-01 + 2.4514507e+00 -1.4370099e-01 + 2.4583757e+00 -1.3871106e-01 + 2.4653007e+00 -1.3290133e-01 + 2.4722257e+00 -1.2745186e-01 + 2.4791507e+00 -1.2187541e-01 + 2.4860757e+00 -1.1625724e-01 + 2.4930007e+00 -1.1024146e-01 + 2.4999257e+00 -1.0344180e-01 + 2.5068507e+00 -9.6537677e-02 + 2.5137757e+00 -8.9621606e-02 + 2.5207007e+00 -8.3216773e-02 + 2.5276257e+00 -7.6446797e-02 + 2.5345507e+00 -6.8547356e-02 + 2.5414757e+00 -6.0435040e-02 + 2.5484007e+00 -5.2560543e-02 + 2.5553257e+00 -4.5407821e-02 + 2.5622507e+00 -3.7929648e-02 + 2.5691757e+00 -2.9478173e-02 + 2.5761007e+00 -2.0543718e-02 + 2.5830257e+00 -1.2106665e-02 + 2.5899507e+00 -4.6748084e-03 + 2.5968757e+00 2.6553203e-03 + 2.6038007e+00 1.0808367e-02 + 2.6107257e+00 1.9233013e-02 + 2.6176507e+00 2.7336625e-02 + 2.6245757e+00 3.3782967e-02 + 2.6315007e+00 4.0257893e-02 + 2.6384257e+00 4.6967390e-02 + 2.6453507e+00 5.3930947e-02 + 2.6522757e+00 6.0556645e-02 + 2.6592008e+00 6.5876186e-02 + 2.6661258e+00 7.0718202e-02 + 2.6730508e+00 7.5665454e-02 + 2.6799758e+00 8.0277446e-02 + 2.6869008e+00 8.5093283e-02 + 2.6938258e+00 8.8300637e-02 + 2.7007508e+00 9.1297713e-02 + 2.7076758e+00 9.3966351e-02 + 2.7146008e+00 9.6297713e-02 + 2.7215258e+00 9.8710407e-02 + 2.7284508e+00 9.9810900e-02 + 2.7353758e+00 1.0068449e-01 + 2.7423008e+00 1.0081837e-01 + 2.7492258e+00 1.0080064e-01 + 2.7561508e+00 1.0086943e-01 + 2.7630758e+00 1.0008243e-01 + 2.7700008e+00 9.9057620e-02 + 2.7769258e+00 9.7570027e-02 + 2.7838508e+00 9.5803235e-02 + 2.7907758e+00 9.4140964e-02 + 2.7977008e+00 9.1770885e-02 + 2.8046258e+00 8.9452579e-02 + 2.8115508e+00 8.6752826e-02 + 2.8184758e+00 8.3898922e-02 + 2.8254008e+00 8.0794335e-02 + 2.8323258e+00 7.7645966e-02 + 2.8392508e+00 7.4430622e-02 + 2.8461758e+00 7.1169547e-02 + 2.8531008e+00 6.7554632e-02 + 2.8600258e+00 6.3806938e-02 + 2.8669508e+00 6.0281668e-02 + 2.8738758e+00 5.6702741e-02 + 2.8808008e+00 5.3172405e-02 + 2.8877258e+00 4.9649734e-02 + 2.8946508e+00 4.5755099e-02 + 2.9015758e+00 4.2152852e-02 + 2.9085008e+00 3.8350266e-02 + 2.9154258e+00 3.5103222e-02 + 2.9223508e+00 3.1824152e-02 + 2.9292758e+00 2.8425101e-02 + 2.9362008e+00 2.5103937e-02 + 2.9431258e+00 2.1976225e-02 + 2.9500508e+00 1.9158308e-02 + 2.9569758e+00 1.6515785e-02 + 2.9639008e+00 1.3715019e-02 + 2.9708258e+00 1.1143238e-02 + 2.9777508e+00 8.7077433e-03 + 2.9846758e+00 6.6012732e-03 + 2.9916008e+00 4.7244381e-03 + 2.9985258e+00 2.7657529e-03 + 3.0054508e+00 9.5550214e-04 + 3.0123759e+00 -6.7883591e-04 + 3.0193009e+00 -2.1178381e-03 + 3.0262259e+00 -3.2532155e-03 + 3.0331509e+00 -4.5109783e-03 + 3.0400759e+00 -5.6561647e-03 + 3.0470009e+00 -6.6483045e-03 + 3.0539259e+00 -7.5198779e-03 + 3.0608509e+00 -8.0494348e-03 + 3.0677759e+00 -8.6974146e-03 + 3.0747009e+00 -9.3454593e-03 + 3.0816259e+00 -9.9744056e-03 + 3.0885509e+00 -1.0582824e-02 + 3.0954759e+00 -1.0910809e-02 + 3.1024009e+00 -1.1315318e-02 + 3.1093259e+00 -1.1859036e-02 + 3.1162509e+00 -1.2366506e-02 + 3.1231759e+00 -1.2844355e-02 + 3.1301009e+00 -1.3298493e-02 + 3.1370259e+00 -1.3714109e-02 + 3.1439509e+00 -1.4191048e-02 + 3.1508759e+00 -1.4714304e-02 + 3.1578009e+00 -1.5293491e-02 + 3.1647259e+00 -1.5764973e-02 + 3.1716509e+00 -1.6224243e-02 + 3.1785759e+00 -1.6649279e-02 + 3.1855009e+00 -1.7115240e-02 + 3.1924259e+00 -1.7578017e-02 + 3.1993509e+00 -1.7931077e-02 + 3.2062759e+00 -1.8270755e-02 + 3.2132009e+00 -1.8514031e-02 + 3.2201259e+00 -1.8787904e-02 + 3.2270509e+00 -1.9033260e-02 + 3.2339759e+00 -1.9107055e-02 + 3.2409009e+00 -1.9182214e-02 + 3.2478259e+00 -1.9205989e-02 + 3.2547509e+00 -1.9194556e-02 + 3.2616759e+00 -1.9072756e-02 + 3.2686009e+00 -1.8930298e-02 + 3.2755259e+00 -1.8826296e-02 + 3.2824509e+00 -1.8492789e-02 + 3.2893759e+00 -1.8186111e-02 + 3.2963009e+00 -1.7795570e-02 + 3.3032259e+00 -1.7291152e-02 + 3.3101509e+00 -1.6968754e-02 + 3.3170759e+00 -1.6429323e-02 + 3.3240009e+00 -1.5856503e-02 + 3.3309259e+00 -1.5195661e-02 + 3.3378509e+00 -1.4433091e-02 + 3.3447759e+00 -1.3825516e-02 + 3.3517009e+00 -1.2998246e-02 + 3.3586259e+00 -1.2186631e-02 + 3.3655510e+00 -1.1275627e-02 + 3.3724760e+00 -1.0294206e-02 + 3.3794010e+00 -9.3583864e-03 + 3.3863260e+00 -8.4251656e-03 + 3.3932510e+00 -7.3283097e-03 + 3.4001760e+00 -6.2269066e-03 + 3.4071010e+00 -5.0452124e-03 + 3.4140260e+00 -3.8948941e-03 + 3.4209510e+00 -2.7733533e-03 + 3.4278760e+00 -1.5933481e-03 + 3.4348010e+00 -4.1041964e-04 + 3.4417260e+00 7.3905418e-04 + 3.4486510e+00 2.0080551e-03 + 3.4555760e+00 3.0462518e-03 + 3.4625010e+00 4.1264129e-03 + 3.4694260e+00 5.1269326e-03 + 3.4763510e+00 6.0915941e-03 + 3.4832760e+00 7.1871508e-03 + 3.4902010e+00 8.0148759e-03 + 3.4971260e+00 8.8233727e-03 + 3.5040510e+00 9.5609328e-03 + 3.5109760e+00 1.0175913e-02 + 3.5179010e+00 1.0932116e-02 + 3.5248260e+00 1.1388918e-02 + 3.5317510e+00 1.1772899e-02 + 3.5386760e+00 1.2127257e-02 + 3.5456010e+00 1.2266402e-02 + 3.5525260e+00 1.2527543e-02 + 3.5594510e+00 1.2529752e-02 + 3.5663760e+00 1.2488502e-02 + 3.5733010e+00 1.2380863e-02 + 3.5802260e+00 1.2053982e-02 + 3.5871510e+00 1.1783552e-02 + 3.5940760e+00 1.1483370e-02 + 3.6010010e+00 1.1024620e-02 + 3.6079260e+00 1.0492465e-02 + 3.6148510e+00 9.8626738e-03 + 3.6217760e+00 9.3321424e-03 + 3.6287010e+00 8.7124204e-03 + 3.6356260e+00 7.9860335e-03 + 3.6425510e+00 7.3056386e-03 + 3.6494760e+00 6.5766532e-03 + 3.6564010e+00 5.7849162e-03 + 3.6633260e+00 4.9975315e-03 + 3.6702510e+00 4.1929323e-03 + 3.6771760e+00 3.5440431e-03 + 3.6841010e+00 2.7730285e-03 + 3.6910260e+00 2.0622970e-03 + 3.6979510e+00 1.2977134e-03 + 3.7048760e+00 5.7723788e-04 + 3.7118010e+00 -5.9893465e-05 + 3.7187260e+00 -7.2099519e-04 + 3.7256511e+00 -1.3349357e-03 + 3.7325761e+00 -1.9872028e-03 + 3.7395011e+00 -2.6249838e-03 + 3.7464261e+00 -3.1467455e-03 + 3.7533511e+00 -3.6197220e-03 + 3.7602761e+00 -4.1313499e-03 + 3.7672011e+00 -4.6808497e-03 + 3.7741261e+00 -5.1479148e-03 + 3.7810511e+00 -5.5481356e-03 + 3.7879761e+00 -5.8600104e-03 + 3.7949011e+00 -6.2605561e-03 + 3.8018261e+00 -6.6207613e-03 + 3.8087511e+00 -6.9314668e-03 + 3.8156761e+00 -7.2210602e-03 + 3.8226011e+00 -7.4061323e-03 + 3.8295261e+00 -7.6223853e-03 + 3.8364511e+00 -7.8522801e-03 + 3.8433761e+00 -7.9527738e-03 + 3.8503011e+00 -8.0416396e-03 + 3.8572261e+00 -8.0350786e-03 + 3.8641511e+00 -8.0918540e-03 + 3.8710761e+00 -8.0577498e-03 + 3.8780011e+00 -8.0416396e-03 + 3.8849261e+00 -7.9673899e-03 + 3.8918511e+00 -7.8078472e-03 + 3.8987761e+00 -7.6757828e-03 + 3.9057011e+00 -7.5255944e-03 + 3.9126261e+00 -7.3292841e-03 + 3.9195511e+00 -7.0851631e-03 + 3.9264761e+00 -6.8147330e-03 + 3.9334011e+00 -6.6133559e-03 + 3.9403261e+00 -6.3175913e-03 + 3.9472511e+00 -6.0409900e-03 + 3.9541761e+00 -5.7647135e-03 + 3.9611011e+00 -5.4794076e-03 + 3.9680261e+00 -5.2211901e-03 + 3.9749511e+00 -5.0026634e-03 + 3.9818761e+00 -4.7077433e-03 + 3.9888011e+00 -4.4278290e-03 + 3.9957261e+00 -4.2240483e-03 + 4.0026511e+00 -4.0289723e-03 + 4.0095761e+00 -3.7759517e-03 + 4.0165011e+00 -3.6176432e-03 + 4.0234261e+00 -3.4577758e-03 + 4.0303511e+00 -3.3440951e-03 + 4.0372761e+00 -3.2030012e-03 + 4.0442011e+00 -3.1067949e-03 + 4.0511261e+00 -3.0163700e-03 + 4.0580511e+00 -2.9095752e-03 + 4.0649761e+00 -2.8611147e-03 + 4.0719011e+00 -2.8318826e-03 + 4.0788262e+00 -2.8196050e-03 + 4.0857512e+00 -2.7737430e-03 + 4.0926762e+00 -2.6601273e-03 + 4.0996012e+00 -2.6688320e-03 + 4.1065262e+00 -2.6534364e-03 + 4.1134512e+00 -2.5804859e-03 + 4.1203762e+00 -2.4631025e-03 + 4.1273012e+00 -2.2985579e-03 + 4.1342262e+00 -2.1430427e-03 + 4.1411512e+00 -2.0025984e-03 + 4.1480762e+00 -1.8514356e-03 + 4.1550012e+00 -1.6605171e-03 + 4.1619262e+00 -1.3620891e-03 + 4.1688512e+00 -9.8629336e-04 + 4.1757762e+00 -7.4119787e-04 + 4.1827012e+00 -4.2198259e-04 + 4.1896262e+00 -4.5407302e-05 + 4.1965512e+00 4.1392750e-04 + 4.2034762e+00 9.3698844e-04 + 4.2104012e+00 1.4697285e-03 + 4.2173262e+00 1.9023646e-03 + 4.2242512e+00 2.4219826e-03 + 4.2311762e+00 3.0083799e-03 + 4.2381012e+00 3.6779914e-03 + 4.2450262e+00 4.3362349e-03 + 4.2519512e+00 4.9144472e-03 + 4.2588762e+00 5.5847083e-03 + 4.2658012e+00 6.2551643e-03 + 4.2727262e+00 7.0000000e-03 + 4.2796512e+00 7.8358451e-03 + 4.2865762e+00 8.4868130e-03 + 4.2935012e+00 9.1660387e-03 + 4.3004262e+00 9.9136027e-03 + 4.3073512e+00 1.0631805e-02 + 4.3142762e+00 1.1414057e-02 + 4.3212012e+00 1.2077823e-02 + 4.3281262e+00 1.2634078e-02 + 4.3350512e+00 1.3214499e-02 + 4.3419762e+00 1.3791477e-02 + 4.3489012e+00 1.4463427e-02 + 4.3558262e+00 1.5015461e-02 + 4.3627512e+00 1.5542679e-02 + 4.3696762e+00 1.5995778e-02 + 4.3766012e+00 1.6422177e-02 + 4.3835262e+00 1.6818566e-02 + 4.3904512e+00 1.7182279e-02 + 4.3973762e+00 1.7510524e-02 + 4.4043012e+00 1.7759387e-02 + 4.4112262e+00 1.7965636e-02 + 4.4181512e+00 1.8179940e-02 + 4.4250762e+00 1.8312329e-02 + 4.4320013e+00 1.8296414e-02 + 4.4389263e+00 1.8351695e-02 + 4.4458513e+00 1.8237625e-02 + 4.4527763e+00 1.8175198e-02 + 4.4597013e+00 1.7916851e-02 + 4.4666263e+00 1.7592309e-02 + 4.4735513e+00 1.7370599e-02 + 4.4804763e+00 1.7045018e-02 + 4.4874013e+00 1.6624984e-02 + 4.4943263e+00 1.6066065e-02 + 4.5012513e+00 1.5512083e-02 + 4.5081763e+00 1.5041899e-02 + 4.5151013e+00 1.4399117e-02 + 4.5220263e+00 1.3729895e-02 + 4.5289513e+00 1.2929908e-02 + 4.5358763e+00 1.2203391e-02 + 4.5428013e+00 1.1521437e-02 + 4.5497263e+00 1.0743277e-02 + 4.5566513e+00 1.0007600e-02 + 4.5635763e+00 8.9948032e-03 + 4.5705013e+00 8.1064051e-03 + 4.5774263e+00 7.3181759e-03 + 4.5843513e+00 6.5574899e-03 + 4.5912763e+00 5.7968039e-03 + 4.5982013e+00 4.8352605e-03 + 4.6051263e+00 4.0408601e-03 + 4.6120513e+00 3.3129791e-03 + 4.6189763e+00 2.6584384e-03 + 4.6259013e+00 1.9396518e-03 + 4.6328263e+00 1.1410939e-03 + 4.6397513e+00 5.3040146e-04 + 4.6466763e+00 -2.1177082e-05 + 4.6536013e+00 -5.2585423e-04 + 4.6605263e+00 -1.0394309e-03 + 4.6674513e+00 -1.6086137e-03 + 4.6743763e+00 -2.0628816e-03 + 4.6813013e+00 -2.5537222e-03 + 4.6882263e+00 -2.8589710e-03 + 4.6951513e+00 -3.1690919e-03 + 4.7020763e+00 -3.4488112e-03 + 4.7090013e+00 -3.6756529e-03 + 4.7159263e+00 -3.9555671e-03 + 4.7228513e+00 -4.1098480e-03 + 4.7297763e+00 -4.1370664e-03 + 4.7367013e+00 -4.2270365e-03 + 4.7436263e+00 -4.2903079e-03 + 4.7505513e+00 -4.2992724e-03 + 4.7574763e+00 -4.2450955e-03 + 4.7644013e+00 -4.2979732e-03 + 4.7713263e+00 -4.3014811e-03 + 4.7782513e+00 -4.2293751e-03 + 4.7851764e+00 -4.1661037e-03 + 4.7921014e+00 -4.0586592e-03 + 4.7990264e+00 -3.9662206e-03 + 4.8059514e+00 -3.8865142e-03 + 4.8128764e+00 -3.8440301e-03 + 4.8198014e+00 -3.7356113e-03 + 4.8267264e+00 -3.6412888e-03 + 4.8336514e+00 -3.5413148e-03 + 4.8405764e+00 -3.4697934e-03 + 4.8475014e+00 -3.3987268e-03 + 4.8544264e+00 -3.3756658e-03 + 4.8613514e+00 -3.3810576e-03 + 4.8682764e+00 -3.3110952e-03 + 4.8752014e+00 -3.2782253e-03 + 4.8821264e+00 -3.3179161e-03 + 4.8890514e+00 -3.3953488e-03 + 4.8959764e+00 -3.4087956e-03 + 4.9029014e+00 -3.4962973e-03 + 4.9098264e+00 -3.5377420e-03 + 4.9167514e+00 -3.6052358e-03 + 4.9236764e+00 -3.7845264e-03 + 4.9306014e+00 -3.9030791e-03 + 4.9375264e+00 -4.1210212e-03 + 4.9444514e+00 -4.2263219e-03 + 4.9513764e+00 -4.4392621e-03 + 4.9583014e+00 -4.6892296e-03 + 4.9652264e+00 -4.9916201e-03 + 4.9721514e+00 -5.3027803e-03 + 4.9790764e+00 -5.5046771e-03 + 4.9860014e+00 -5.7964791e-03 + 4.9929264e+00 -6.1291412e-03 + 4.9998514e+00 -6.4892815e-03 + 5.0067764e+00 -6.8849552e-03 + 5.0137014e+00 -7.1977394e-03 + 5.0206264e+00 -7.5478758e-03 + 5.0275514e+00 -7.9440691e-03 + 5.0344764e+00 -8.3299987e-03 + 5.0414014e+00 -8.7265168e-03 + 5.0483264e+00 -9.0172795e-03 + 5.0552514e+00 -9.4076913e-03 + 5.0621764e+00 -9.6889048e-03 + 5.0691014e+00 -9.9856438e-03 + 5.0760264e+00 -1.0281603e-02 + 5.0829514e+00 -1.0529362e-02 + 5.0898764e+00 -1.0723269e-02 + 5.0968014e+00 -1.0897298e-02 + 5.1037264e+00 -1.1050864e-02 + 5.1106514e+00 -1.1139145e-02 + 5.1175764e+00 -1.1202546e-02 + 5.1245014e+00 -1.1203651e-02 + 5.1314264e+00 -1.1134338e-02 + 5.1383515e+00 -1.0975185e-02 + 5.1452765e+00 -1.0793621e-02 + 5.1522015e+00 -1.0581330e-02 + 5.1591265e+00 -1.0294270e-02 + 5.1660515e+00 -9.9443939e-03 + 5.1729765e+00 -9.4693387e-03 + 5.1799015e+00 -9.0359880e-03 + 5.1868265e+00 -8.4401715e-03 + 5.1937515e+00 -7.8973626e-03 + 5.2006765e+00 -7.3350656e-03 + 5.2076015e+00 -6.6112122e-03 + 5.2145265e+00 -5.9401715e-03 + 5.2214515e+00 -5.1359621e-03 + 5.2283765e+00 -4.4336105e-03 + 5.2353015e+00 -3.7402235e-03 + 5.2422265e+00 -2.9918150e-03 + 5.2491515e+00 -2.1180330e-03 + 5.2560765e+00 -1.1616214e-03 + 5.2630015e+00 -3.6410290e-04 + 5.2699265e+00 4.1464207e-04 + 5.2768515e+00 1.2834221e-03 + 5.2837765e+00 2.0423542e-03 + 5.2907015e+00 2.9788229e-03 + 5.2976265e+00 3.7247629e-03 + 5.3045515e+00 4.3685852e-03 + 5.3114765e+00 5.1162791e-03 + 5.3184015e+00 5.7939457e-03 + 5.3253265e+00 6.5398857e-03 + 5.3322515e+00 7.1904638e-03 + 5.3391765e+00 7.7145641e-03 + 5.3461015e+00 8.2484734e-03 + 5.3530265e+00 8.6873457e-03 + 5.3599515e+00 9.2154086e-03 + 5.3668765e+00 9.7260621e-03 + 5.3738015e+00 1.0016110e-02 + 5.3807265e+00 1.0374756e-02 + 5.3876515e+00 1.0628751e-02 + 5.3945765e+00 1.0970313e-02 + 5.4015015e+00 1.1213979e-02 + 5.4084265e+00 1.1327140e-02 + 5.4153515e+00 1.1470053e-02 + 5.4222765e+00 1.1565025e-02 + 5.4292015e+00 1.1675523e-02 + 5.4361265e+00 1.1682539e-02 + 5.4430515e+00 1.1655125e-02 + 5.4499765e+00 1.1598415e-02 + 5.4569015e+00 1.1500650e-02 + 5.4638265e+00 1.1439197e-02 + 5.4707515e+00 1.1284007e-02 + 5.4776765e+00 1.1078082e-02 + 5.4846015e+00 1.0936729e-02 + 5.4915266e+00 1.0755229e-02 + 5.4984516e+00 1.0553397e-02 + 5.5053766e+00 1.0349162e-02 + 5.5123016e+00 1.0063077e-02 + 5.5192266e+00 9.8572821e-03 + 5.5261516e+00 9.6152397e-03 + 5.5330766e+00 9.3937248e-03 + 5.5400016e+00 9.1524620e-03 + 5.5469266e+00 8.9902559e-03 + 5.5538516e+00 8.8583214e-03 + 5.5607766e+00 8.6598025e-03 + 5.5677016e+00 8.5680785e-03 + 5.5746266e+00 8.3886579e-03 + 5.5815516e+00 8.2080031e-03 + 5.5884766e+00 8.1649994e-03 + 5.5954016e+00 8.1069897e-03 + 5.6023266e+00 8.0701572e-03 + 5.6092516e+00 7.9700533e-03 + 5.6161766e+00 7.9514096e-03 + 5.6231016e+00 7.8682604e-03 + 5.6300266e+00 7.7919969e-03 + 5.6369516e+00 7.8071326e-03 + 5.6438766e+00 7.8413668e-03 + 5.6508016e+00 7.8605301e-03 + 5.6577266e+00 7.9376380e-03 + 5.6646516e+00 7.9282837e-03 + 5.6715766e+00 7.9700533e-03 + 5.6785016e+00 7.9662856e-03 + 5.6854266e+00 7.9842146e-03 + 5.6923516e+00 7.9666104e-03 + 5.6992766e+00 7.8864493e-03 + 5.7062016e+00 7.9030791e-03 + 5.7131266e+00 7.8647525e-03 + 5.7200516e+00 7.7128102e-03 + 5.7269766e+00 7.6621411e-03 + 5.7339016e+00 7.5342341e-03 + 5.7408266e+00 7.4159413e-03 + 5.7477516e+00 7.2842666e-03 + 5.7546766e+00 7.0767182e-03 + 5.7616016e+00 6.8426010e-03 + 5.7685266e+00 6.5572301e-03 + 5.7754516e+00 6.3559179e-03 + 5.7823766e+00 6.0435235e-03 + 5.7893016e+00 5.6472002e-03 + 5.7962266e+00 5.3008965e-03 + 5.8031516e+00 4.9126283e-03 + 5.8100766e+00 4.5438483e-03 + 5.8170016e+00 4.1462908e-03 + 5.8239266e+00 3.7374302e-03 + 5.8308516e+00 3.3062882e-03 + 5.8377766e+00 2.7950500e-03 + 5.8447017e+00 2.4270495e-03 + 5.8516267e+00 2.0008445e-03 + 5.8585517e+00 1.5752241e-03 + 5.8654767e+00 1.1054307e-03 + 5.8724017e+00 6.5915292e-04 + 5.8793267e+00 2.9232168e-04 + 5.8862517e+00 -3.8326621e-05 + 5.8931767e+00 -3.5585293e-04 + 5.9001017e+00 -7.1488892e-04 + 5.9070267e+00 -1.0137716e-03 + 5.9139517e+00 -1.3255814e-03 + 5.9208767e+00 -1.5513187e-03 + 5.9278017e+00 -1.7898532e-03 + 5.9347267e+00 -1.9809666e-03 + 5.9416517e+00 -2.1884500e-03 + 5.9485767e+00 -2.4199688e-03 + 5.9555017e+00 -2.5466415e-03 + 5.9624267e+00 -2.6511628e-03 + 5.9693517e+00 -2.7864103e-03 + 5.9762767e+00 -2.8651423e-03 + 5.9832017e+00 -2.9341951e-03 + 5.9901267e+00 -3.0208523e-03 + 5.9970517e+00 -3.0168897e-03 + 6.0039767e+00 -3.0509289e-03 + 6.0109017e+00 -3.0528777e-03 + 6.0178267e+00 -3.0906197e-03 + 6.0247517e+00 -3.0954268e-03 + 6.0316767e+00 -3.0532025e-03 + 6.0386017e+00 -3.0179291e-03 + 6.0455267e+00 -2.8610498e-03 + 6.0524517e+00 -2.7263219e-03 + 6.0593767e+00 -2.6666883e-03 + 6.0663017e+00 -2.5680785e-03 + 6.0732267e+00 -2.4100299e-03 + 6.0801517e+00 -2.2513317e-03 + 6.0870767e+00 -2.0864623e-03 + 6.0940017e+00 -1.8963882e-03 + 6.1009267e+00 -1.6897493e-03 + 6.1078517e+00 -1.4958425e-03 + 6.1147767e+00 -1.1568143e-03 + 6.1217017e+00 -7.9797324e-04 + 6.1286267e+00 -5.3585813e-04 + 6.1355517e+00 -2.2775107e-04 + 6.1424767e+00 1.0133818e-04 + 6.1494017e+00 4.5667143e-04 + 6.1563267e+00 9.1899441e-04 + 6.1632517e+00 1.3401975e-03 + 6.1701767e+00 1.7162531e-03 + 6.1771017e+00 2.0606730e-03 + 6.1840267e+00 2.4919449e-03 + 6.1909517e+00 3.0159153e-03 + 6.1978767e+00 3.4520592e-03 + 6.2048018e+00 3.9156165e-03 + 6.2117268e+00 4.3724828e-03 + 6.2186518e+00 4.7681564e-03 + 6.2255768e+00 5.2022216e-03 + 6.2325018e+00 5.6547356e-03 + 6.2394268e+00 6.0598285e-03 + 6.2463518e+00 6.4360140e-03 + 6.2532768e+00 6.7749773e-03 + 6.2602018e+00 7.0991945e-03 + 6.2671268e+00 7.4110692e-03 + 6.2740518e+00 7.6650643e-03 + 6.2809768e+00 7.9704430e-03 + 6.2879018e+00 8.1032220e-03 + 6.2948268e+00 8.3351955e-03 + 6.3017518e+00 8.5163700e-03 + 6.3086768e+00 8.5918540e-03 + 6.3156018e+00 8.6431727e-03 + 6.3225268e+00 8.7107315e-03 + 6.3294518e+00 8.7622450e-03 + 6.3363768e+00 8.7682214e-03 + 6.3433018e+00 8.7310641e-03 + 6.3502268e+00 8.7233987e-03 + 6.3571518e+00 8.6960504e-03 + 6.3640768e+00 8.6289463e-03 + 6.3710018e+00 8.5958166e-03 + 6.3779268e+00 8.4408211e-03 + 6.3848518e+00 8.3553332e-03 + 6.3917768e+00 8.2193712e-03 + 6.3987018e+00 8.0959465e-03 + 6.4056268e+00 7.9473821e-03 + 6.4125518e+00 7.8051838e-03 + 6.4194768e+00 7.7095622e-03 + 6.4264018e+00 7.5600883e-03 + 6.4333268e+00 7.4647915e-03 + 6.4402518e+00 7.3509809e-03 + 6.4471768e+00 7.2250877e-03 + 6.4541018e+00 7.1484994e-03 + 6.4610268e+00 7.0634663e-03 + 6.4679518e+00 6.9260101e-03 + 6.4748768e+00 6.8377939e-03 + 6.4818018e+00 6.7804339e-03 + 6.4887268e+00 6.7192413e-03 + 6.4956518e+00 6.6892296e-03 + 6.5025768e+00 6.7146940e-03 + 6.5095018e+00 6.7620501e-03 + 6.5164268e+00 6.7222944e-03 + 6.5233518e+00 6.7284656e-03 + 6.5302768e+00 6.7644537e-03 + 6.5372018e+00 6.8177862e-03 + 6.5441268e+00 6.8976874e-03 + 6.5510518e+00 7.0072106e-03 + 6.5579769e+00 7.0781473e-03 + 6.5649019e+00 7.1740938e-03 + 6.5718269e+00 7.3732623e-03 + 6.5787519e+00 7.5370924e-03 + 6.5856769e+00 7.6193322e-03 + 6.5926019e+00 7.7884241e-03 + 6.5995269e+00 7.9430298e-03 + 6.6064519e+00 8.0809406e-03 + 6.6133769e+00 8.2406132e-03 + 6.6203019e+00 8.4169806e-03 + 6.6272269e+00 8.5363778e-03 + 6.6341519e+00 8.6620761e-03 + 6.6410769e+00 8.7979732e-03 + 6.6480019e+00 8.9527088e-03 + 6.6549269e+00 9.0332597e-03 + 6.6618519e+00 9.1804599e-03 + 6.6687769e+00 9.2732233e-03 + 6.6757019e+00 9.3230479e-03 + 6.6826269e+00 9.4138625e-03 + 6.6895519e+00 9.4236716e-03 + 6.6964769e+00 9.4110692e-03 + 6.7034019e+00 9.3921658e-03 + 6.7103269e+00 9.3985319e-03 + 6.7172519e+00 9.3671560e-03 + 6.7241769e+00 9.2402235e-03 + 6.7311019e+00 9.1378459e-03 + 6.7380269e+00 8.9304924e-03 + 6.7449519e+00 8.7465896e-03 + 6.7518769e+00 8.5971807e-03 + 6.7588019e+00 8.3844355e-03 + 6.7657269e+00 8.0869819e-03 + 6.7726519e+00 7.7734832e-03 + 6.7795769e+00 7.5018839e-03 + 6.7865019e+00 7.1937768e-03 + 6.7934269e+00 6.8205794e-03 + 6.8003519e+00 6.4027543e-03 + 6.8072769e+00 5.8972976e-03 + 6.8142019e+00 5.3764454e-03 + 6.8211269e+00 4.9440042e-03 + 6.8280519e+00 4.4556970e-03 + 6.8349769e+00 3.9145121e-03 + 6.8419019e+00 3.2985579e-03 + 6.8488269e+00 2.7281408e-03 + 6.8557519e+00 2.1839678e-03 + 6.8626769e+00 1.6445368e-03 + 6.8696019e+00 1.0593088e-03 + 6.8765269e+00 4.7505522e-04 + 6.8834519e+00 -1.6707808e-04 + 6.8903769e+00 -7.7835520e-04 + 6.8973019e+00 -1.3638431e-03 + 6.9042269e+00 -1.9135377e-03 + 6.9111520e+00 -2.4217227e-03 + 6.9180770e+00 -2.9423152e-03 + 6.9250020e+00 -3.5732753e-03 + 6.9319270e+00 -4.0456671e-03 + 6.9388520e+00 -4.5409250e-03 + 6.9457770e+00 -5.0278030e-03 + 6.9527020e+00 -5.4632324e-03 + 6.9596270e+00 -5.9210731e-03 + 6.9665520e+00 -6.2847863e-03 + 6.9734770e+00 -6.6769521e-03 + 6.9804020e+00 -6.9543978e-03 + 6.9873270e+00 -7.2814083e-03 + 6.9942520e+00 -7.5967910e-03 + 7.0011770e+00 -7.8068728e-03 + 7.0081020e+00 -7.9958425e-03 + 7.0150270e+00 -8.2033909e-03 + 7.0219520e+00 -8.3153177e-03 + 7.0288770e+00 -8.3957386e-03 + 7.0358020e+00 -8.4785631e-03 + 7.0427270e+00 -8.4653761e-03 + 7.0496520e+00 -8.4697934e-03 + 7.0565770e+00 -8.4582954e-03 + 7.0635020e+00 -8.4252306e-03 + 7.0704270e+00 -8.2875146e-03 + 7.0773520e+00 -8.1978693e-03 + 7.0842770e+00 -8.0456671e-03 diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_real.pdf b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_real.pdf new file mode 100644 index 00000000..953e786f Binary files /dev/null and b/tests/experimental/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_real.pdf differ diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti b/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti new file mode 100644 index 00000000..c4916333 Binary files /dev/null and b/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti differ diff --git a/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp b/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp new file mode 100644 index 00000000..83636e94 Binary files /dev/null and b/tests/experimental/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp differ diff --git a/tests/geometry/geometry_averaging.in b/tests/geometry/geometry_averaging.in new file mode 100755 index 00000000..7a5515a9 --- /dev/null +++ b/tests/geometry/geometry_averaging.in @@ -0,0 +1,27 @@ +#title: Test of geometry commands and averaging behaviour +#domain: 0.1 0.1 0.1 +#time_window: 1 +#dx_dy_dz: 0.001 0.001 0.001 + +#material: 2 0 1 0 mat2 +#material: 3 0 1 0 mat3 +#material: 4 0 1 0 mat4 +#material: 5 0 1 0 mat5 + +plate: 0.050 0.010 0.030 0.050 0.030 0.050 mat2 + +box: 0.020 0.020 0.020 0.040 0.040 0.040 mat2 + +cylinder: 0.090 0.020 0.010 0.090 0.080 0.010 0.005 mat3 +cylinder: 0.050 0.050 0.020 0.070 0.070 0.080 0.005 mat3 + +#cylindrical_sector: x 0.050 0.050 0.040 0.050 0.015 0 90 mat3 + +sphere: 0.100 0.100 0.100 0.040 mat4 + +#triangle: 0.020 0.020 0.020 0.020 0.035 0.035 0.020 0.050 0.020 0 mat5 +triangle: 0.020 0.020 0.020 0.020 0.035 0.035 0.020 0.050 0.020 0.010 mat5 + + +#geometry_view: 0 0 0 0.1 0.1 0.1 0.001 0.001 0.001 geometry_averaging_solid n +#geometry_view: 0 0 0 0.1 0.1 0.1 0.001 0.001 0.001 geometry_averaging_IDs f diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.in b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.in new file mode 100644 index 00000000..88d1a889 --- /dev/null +++ b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.in @@ -0,0 +1,88 @@ +#title: GSSI 1.5GHz 'like' antenna in free-space +#domain: 0.250 0.187 0.183 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 8E-9 +#medium: 1.7 0 0 0.59 1.0 0.0 absorber +#medium: 3.0 0 0 0.0 1.0 0.0 pcb +#medium: 2.35 0 0 0.0 1.0 0.0 hdpe +#box: 0.039999999999999994 0.04 0.10400000000000001 0.21000000000000002 0.148 0.14700000000000002 hdpe +#box: 0.041999999999999996 0.042 0.10400000000000001 0.20800000000000002 0.146 0.14500000000000002 free_space +#box: 0.065 0.042 0.10400000000000001 0.18500000000000003 0.146 0.131 pec +#box: 0.067 0.044000000000000004 0.10400000000000001 0.124 0.144 0.128 pcb +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.129 absorber +#box: 0.126 0.044000000000000004 0.10400000000000001 0.183 0.144 0.128 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.129 absorber +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.10600000000000001 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.10600000000000001 pcb +#plate: 0.08499999999999999 0.079 0.10400000000000001 0.105 0.08 0.10400000000000001 pec +#plate: 0.08499999999999999 0.10700000000000001 0.10400000000000001 0.105 0.10800000000000001 0.10400000000000001 pec +#plate: 0.144 0.079 0.10400000000000001 0.16399999999999998 0.08 0.10400000000000001 pec +#plate: 0.144 0.10700000000000001 0.10400000000000001 0.16399999999999998 0.10800000000000001 0.10400000000000001 pec +#plate: 0.086 0.08 0.10400000000000001 0.104 0.081 0.10400000000000001 pec +#plate: 0.086 0.10600000000000001 0.10400000000000001 0.104 0.10700000000000001 0.10400000000000001 pec +#plate: 0.145 0.08 0.10400000000000001 0.16299999999999998 0.081 0.10400000000000001 pec +#plate: 0.145 0.10600000000000001 0.10400000000000001 0.16299999999999998 0.10700000000000001 0.10400000000000001 pec +#plate: 0.087 0.081 0.10400000000000001 0.103 0.082 0.10400000000000001 pec +#plate: 0.087 0.10500000000000001 0.10400000000000001 0.103 0.10600000000000001 0.10400000000000001 pec +#plate: 0.146 0.081 0.10400000000000001 0.16199999999999998 0.082 0.10400000000000001 pec +#plate: 0.146 0.10500000000000001 0.10400000000000001 0.16199999999999998 0.10600000000000001 0.10400000000000001 pec +#plate: 0.087 0.082 0.10400000000000001 0.103 0.083 0.10400000000000001 pec +#plate: 0.087 0.10400000000000001 0.10400000000000001 0.103 0.10500000000000001 0.10400000000000001 pec +#plate: 0.146 0.082 0.10400000000000001 0.16199999999999998 0.083 0.10400000000000001 pec +#plate: 0.146 0.10400000000000001 0.10400000000000001 0.16199999999999998 0.10500000000000001 0.10400000000000001 pec +#plate: 0.088 0.083 0.10400000000000001 0.102 0.084 0.10400000000000001 pec +#plate: 0.088 0.10300000000000001 0.10400000000000001 0.102 0.10400000000000001 0.10400000000000001 pec +#plate: 0.147 0.083 0.10400000000000001 0.16099999999999998 0.084 0.10400000000000001 pec +#plate: 0.147 0.10300000000000001 0.10400000000000001 0.16099999999999998 0.10400000000000001 0.10400000000000001 pec +#plate: 0.089 0.084 0.10400000000000001 0.10099999999999999 0.085 0.10400000000000001 pec +#plate: 0.089 0.10200000000000001 0.10400000000000001 0.10099999999999999 0.10300000000000001 0.10400000000000001 pec +#plate: 0.148 0.084 0.10400000000000001 0.15999999999999998 0.085 0.10400000000000001 pec +#plate: 0.148 0.10200000000000001 0.10400000000000001 0.15999999999999998 0.10300000000000001 0.10400000000000001 pec +#plate: 0.089 0.085 0.10400000000000001 0.10099999999999999 0.08600000000000001 0.10400000000000001 pec +#plate: 0.089 0.101 0.10400000000000001 0.10099999999999999 0.10200000000000001 0.10400000000000001 pec +#plate: 0.148 0.085 0.10400000000000001 0.15999999999999998 0.08600000000000001 0.10400000000000001 pec +#plate: 0.148 0.101 0.10400000000000001 0.15999999999999998 0.10200000000000001 0.10400000000000001 pec +#plate: 0.09 0.08600000000000001 0.10400000000000001 0.09999999999999999 0.08700000000000001 0.10400000000000001 pec +#plate: 0.09 0.1 0.10400000000000001 0.09999999999999999 0.101 0.10400000000000001 pec +#plate: 0.149 0.08600000000000001 0.10400000000000001 0.15899999999999997 0.08700000000000001 0.10400000000000001 pec +#plate: 0.149 0.1 0.10400000000000001 0.15899999999999997 0.101 0.10400000000000001 pec +#plate: 0.091 0.087 0.10400000000000001 0.09899999999999999 0.088 0.10400000000000001 pec +#plate: 0.091 0.099 0.10400000000000001 0.09899999999999999 0.1 0.10400000000000001 pec +#plate: 0.15 0.087 0.10400000000000001 0.15799999999999997 0.088 0.10400000000000001 pec +#plate: 0.15 0.099 0.10400000000000001 0.15799999999999997 0.1 0.10400000000000001 pec +#plate: 0.092 0.088 0.10400000000000001 0.09799999999999999 0.089 0.10400000000000001 pec +#plate: 0.092 0.098 0.10400000000000001 0.09799999999999999 0.099 0.10400000000000001 pec +#plate: 0.151 0.088 0.10400000000000001 0.15699999999999997 0.089 0.10400000000000001 pec +#plate: 0.151 0.098 0.10400000000000001 0.15699999999999997 0.099 0.10400000000000001 pec +#plate: 0.092 0.089 0.10400000000000001 0.09799999999999999 0.09 0.10400000000000001 pec +#plate: 0.092 0.09700000000000002 0.10400000000000001 0.09799999999999999 0.09800000000000002 0.10400000000000001 pec +#plate: 0.151 0.089 0.10400000000000001 0.15699999999999997 0.09 0.10400000000000001 pec +#plate: 0.151 0.09700000000000002 0.10400000000000001 0.15699999999999997 0.09800000000000002 0.10400000000000001 pec +#plate: 0.093 0.09 0.10400000000000001 0.097 0.091 0.10400000000000001 pec +#plate: 0.093 0.09600000000000002 0.10400000000000001 0.097 0.09700000000000002 0.10400000000000001 pec +#plate: 0.152 0.09 0.10400000000000001 0.15599999999999997 0.091 0.10400000000000001 pec +#plate: 0.152 0.09600000000000002 0.10400000000000001 0.15599999999999997 0.09700000000000002 0.10400000000000001 pec +#plate: 0.094 0.091 0.10400000000000001 0.096 0.092 0.10400000000000001 pec +#plate: 0.094 0.09500000000000001 0.10400000000000001 0.096 0.09600000000000002 0.10400000000000001 pec +#plate: 0.153 0.091 0.10400000000000001 0.15499999999999997 0.092 0.10400000000000001 pec +#plate: 0.153 0.09500000000000001 0.10400000000000001 0.15499999999999997 0.09600000000000002 0.10400000000000001 pec +#plate: 0.08399999999999999 0.10800000000000001 0.10400000000000001 0.10599999999999998 0.12300000000000001 0.10400000000000001 pec +#plate: 0.143 0.10800000000000001 0.10400000000000001 0.16499999999999998 0.12300000000000001 0.10400000000000001 pec +#edge: 0.095 0.092 0.10400000000000001 0.095 0.093 0.10400000000000001 pec +#edge: 0.095 0.094 0.10400000000000001 0.095 0.095 0.10400000000000001 pec +#edge: 0.154 0.092 0.10400000000000001 0.154 0.093 0.10400000000000001 pec +#edge: 0.154 0.094 0.10400000000000001 0.154 0.095 0.10400000000000001 pec +#plate: 0.08399999999999999 0.064 0.10400000000000001 0.10599999999999998 0.079 0.10400000000000001 pec +#plate: 0.143 0.064 0.10400000000000001 0.16499999999999998 0.079 0.10400000000000001 pec +#box: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.10400000000000001 hdpe +#geometry_vtk: 0.03899999999999999 0.039 0.099 0.21100000000000002 0.149 0.14800000000000002 0.001 0.001 0.001 antenna_like_GSSI_1500 n +#geometry_vtk: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.11 0.001 0.001 0.001 antenna_like_GSSI_1500_pcb f +#messages: y +#num_of_procs: 8 +#abc_type: pml +#pml_layers: 10 +#voltage_source: 1.0 1500000000.0 gaussian 50 myGaussian +#analysis: 1 antenna_GSSI_1500_fs_proc_oldstyle.out b +#rx: 0.095 0.093 0.10400000000000001 +#tx: y 0.154 0.093 0.10400000000000001 myGaussian 0 8e-09 +#end_analysis: diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.out b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.out new file mode 100644 index 00000000..571e42d2 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle.out differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle_hdf5.out b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle_hdf5.out new file mode 100644 index 00000000..6190b7f2 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_GSSI_1500_fs_proc_oldstyle_hdf5.out differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500.vti b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500.vti new file mode 100644 index 00000000..0d25e970 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500.vti differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500_pcb.vtp b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500_pcb.vtp new file mode 100644 index 00000000..57eb4b48 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/C_code/antenna_like_GSSI_1500_pcb.vtp differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in new file mode 100755 index 00000000..a9cb2d1b --- /dev/null +++ b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.in @@ -0,0 +1,10 @@ +#title: GSSI 1.5GHz 'like' antenna in free-space +#domain: 0.250 0.187 0.183 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 8E-9 + +#python: +from user_libs.antennas import antenna_like_GSSI_1500 +antenna_like_GSSI_1500(0.125, 0.094, 0.100) +#end_python: + diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out new file mode 100644 index 00000000..0fec10c6 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs.out differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in new file mode 100644 index 00000000..714eec52 --- /dev/null +++ b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_proc.in @@ -0,0 +1,82 @@ +#title: GSSI 1.5GHz 'like' antenna in free-space +#domain: 0.250 0.187 0.183 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 8E-9 +#material: 1.7 0.59 1.0 0.0 absorber +#material: 3.0 0.0 1.0 0.0 pcb +#material: 2.35 0.0 1.0 0.0 hdpe +#box: 0.039999999999999994 0.04 0.10400000000000001 0.21000000000000002 0.148 0.14700000000000002 hdpe +#box: 0.041999999999999996 0.042 0.10400000000000001 0.20800000000000002 0.146 0.14500000000000002 free_space +#box: 0.065 0.042 0.10400000000000001 0.18500000000000003 0.146 0.131 pec +#box: 0.067 0.044000000000000004 0.10400000000000001 0.124 0.144 0.128 pcb +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.129 absorber +#box: 0.126 0.044000000000000004 0.10400000000000001 0.183 0.144 0.128 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.129 absorber +#box: 0.07 0.04700000000000001 0.10400000000000001 0.121 0.141 0.10600000000000001 pcb +#box: 0.129 0.04700000000000001 0.10400000000000001 0.18 0.141 0.10600000000000001 pcb +#plate: 0.08499999999999999 0.079 0.10400000000000001 0.105 0.08 0.10400000000000001 pec +#plate: 0.08499999999999999 0.10700000000000001 0.10400000000000001 0.105 0.10800000000000001 0.10400000000000001 pec +#plate: 0.144 0.079 0.10400000000000001 0.16399999999999998 0.08 0.10400000000000001 pec +#plate: 0.144 0.10700000000000001 0.10400000000000001 0.16399999999999998 0.10800000000000001 0.10400000000000001 pec +#plate: 0.086 0.08 0.10400000000000001 0.104 0.081 0.10400000000000001 pec +#plate: 0.086 0.10600000000000001 0.10400000000000001 0.104 0.10700000000000001 0.10400000000000001 pec +#plate: 0.145 0.08 0.10400000000000001 0.16299999999999998 0.081 0.10400000000000001 pec +#plate: 0.145 0.10600000000000001 0.10400000000000001 0.16299999999999998 0.10700000000000001 0.10400000000000001 pec +#plate: 0.087 0.081 0.10400000000000001 0.103 0.082 0.10400000000000001 pec +#plate: 0.087 0.10500000000000001 0.10400000000000001 0.103 0.10600000000000001 0.10400000000000001 pec +#plate: 0.146 0.081 0.10400000000000001 0.16199999999999998 0.082 0.10400000000000001 pec +#plate: 0.146 0.10500000000000001 0.10400000000000001 0.16199999999999998 0.10600000000000001 0.10400000000000001 pec +#plate: 0.087 0.082 0.10400000000000001 0.103 0.083 0.10400000000000001 pec +#plate: 0.087 0.10400000000000001 0.10400000000000001 0.103 0.10500000000000001 0.10400000000000001 pec +#plate: 0.146 0.082 0.10400000000000001 0.16199999999999998 0.083 0.10400000000000001 pec +#plate: 0.146 0.10400000000000001 0.10400000000000001 0.16199999999999998 0.10500000000000001 0.10400000000000001 pec +#plate: 0.088 0.083 0.10400000000000001 0.102 0.084 0.10400000000000001 pec +#plate: 0.088 0.10300000000000001 0.10400000000000001 0.102 0.10400000000000001 0.10400000000000001 pec +#plate: 0.147 0.083 0.10400000000000001 0.16099999999999998 0.084 0.10400000000000001 pec +#plate: 0.147 0.10300000000000001 0.10400000000000001 0.16099999999999998 0.10400000000000001 0.10400000000000001 pec +#plate: 0.089 0.084 0.10400000000000001 0.10099999999999999 0.085 0.10400000000000001 pec +#plate: 0.089 0.10200000000000001 0.10400000000000001 0.10099999999999999 0.10300000000000001 0.10400000000000001 pec +#plate: 0.148 0.084 0.10400000000000001 0.15999999999999998 0.085 0.10400000000000001 pec +#plate: 0.148 0.10200000000000001 0.10400000000000001 0.15999999999999998 0.10300000000000001 0.10400000000000001 pec +#plate: 0.089 0.085 0.10400000000000001 0.10099999999999999 0.08600000000000001 0.10400000000000001 pec +#plate: 0.089 0.101 0.10400000000000001 0.10099999999999999 0.10200000000000001 0.10400000000000001 pec +#plate: 0.148 0.085 0.10400000000000001 0.15999999999999998 0.08600000000000001 0.10400000000000001 pec +#plate: 0.148 0.101 0.10400000000000001 0.15999999999999998 0.10200000000000001 0.10400000000000001 pec +#plate: 0.09 0.08600000000000001 0.10400000000000001 0.09999999999999999 0.08700000000000001 0.10400000000000001 pec +#plate: 0.09 0.1 0.10400000000000001 0.09999999999999999 0.101 0.10400000000000001 pec +#plate: 0.149 0.08600000000000001 0.10400000000000001 0.15899999999999997 0.08700000000000001 0.10400000000000001 pec +#plate: 0.149 0.1 0.10400000000000001 0.15899999999999997 0.101 0.10400000000000001 pec +#plate: 0.091 0.087 0.10400000000000001 0.09899999999999999 0.088 0.10400000000000001 pec +#plate: 0.091 0.099 0.10400000000000001 0.09899999999999999 0.1 0.10400000000000001 pec +#plate: 0.15 0.087 0.10400000000000001 0.15799999999999997 0.088 0.10400000000000001 pec +#plate: 0.15 0.099 0.10400000000000001 0.15799999999999997 0.1 0.10400000000000001 pec +#plate: 0.092 0.088 0.10400000000000001 0.09799999999999999 0.089 0.10400000000000001 pec +#plate: 0.092 0.098 0.10400000000000001 0.09799999999999999 0.099 0.10400000000000001 pec +#plate: 0.151 0.088 0.10400000000000001 0.15699999999999997 0.089 0.10400000000000001 pec +#plate: 0.151 0.098 0.10400000000000001 0.15699999999999997 0.099 0.10400000000000001 pec +#plate: 0.092 0.089 0.10400000000000001 0.09799999999999999 0.09 0.10400000000000001 pec +#plate: 0.092 0.09700000000000002 0.10400000000000001 0.09799999999999999 0.09800000000000002 0.10400000000000001 pec +#plate: 0.151 0.089 0.10400000000000001 0.15699999999999997 0.09 0.10400000000000001 pec +#plate: 0.151 0.09700000000000002 0.10400000000000001 0.15699999999999997 0.09800000000000002 0.10400000000000001 pec +#plate: 0.093 0.09 0.10400000000000001 0.097 0.091 0.10400000000000001 pec +#plate: 0.093 0.09600000000000002 0.10400000000000001 0.097 0.09700000000000002 0.10400000000000001 pec +#plate: 0.152 0.09 0.10400000000000001 0.15599999999999997 0.091 0.10400000000000001 pec +#plate: 0.152 0.09600000000000002 0.10400000000000001 0.15599999999999997 0.09700000000000002 0.10400000000000001 pec +#plate: 0.094 0.091 0.10400000000000001 0.096 0.092 0.10400000000000001 pec +#plate: 0.094 0.09500000000000001 0.10400000000000001 0.096 0.09600000000000002 0.10400000000000001 pec +#plate: 0.153 0.091 0.10400000000000001 0.15499999999999997 0.092 0.10400000000000001 pec +#plate: 0.153 0.09500000000000001 0.10400000000000001 0.15499999999999997 0.09600000000000002 0.10400000000000001 pec +#plate: 0.08399999999999999 0.10800000000000001 0.10400000000000001 0.10599999999999998 0.12300000000000001 0.10400000000000001 pec +#plate: 0.143 0.10800000000000001 0.10400000000000001 0.16499999999999998 0.12300000000000001 0.10400000000000001 pec +#edge: 0.095 0.092 0.10400000000000001 0.095 0.093 0.10400000000000001 pec +#edge: 0.095 0.094 0.10400000000000001 0.095 0.095 0.10400000000000001 pec +#edge: 0.154 0.092 0.10400000000000001 0.154 0.093 0.10400000000000001 pec +#edge: 0.154 0.094 0.10400000000000001 0.154 0.095 0.10400000000000001 pec +#plate: 0.08399999999999999 0.064 0.10400000000000001 0.10599999999999998 0.079 0.10400000000000001 pec +#plate: 0.143 0.064 0.10400000000000001 0.16499999999999998 0.079 0.10400000000000001 pec +#box: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.10400000000000001 hdpe +#geometry_view: 0.03899999999999999 0.039 0.099 0.21100000000000002 0.149 0.14800000000000002 0.001 0.001 0.001 antenna_like_GSSI_1500 n +#geometry_view: 0.039999999999999994 0.04 0.1 0.21000000000000002 0.148 0.11 0.001 0.001 0.001 antenna_like_GSSI_1500_pcb f +#waveform: gaussian 1.0 1500000000.0 myGaussian +#voltage_source: y 0.154 0.093 0.10400000000000001 50 myGaussian +#rx: 0.095 0.093 0.10400000000000001 diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5.pdf b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5.pdf new file mode 100644 index 00000000..c2108ae7 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5.pdf differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5_diffs.pdf b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5_diffs.pdf new file mode 100644 index 00000000..f45aa2c4 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_GSSI_1500_fs_vs_antenna_GSSI_1500_fs_proc_oldstyle_hdf5_diffs.pdf differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti new file mode 100644 index 00000000..150a920d Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500.vti differ diff --git a/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp new file mode 100644 index 00000000..cf8d9428 Binary files /dev/null and b/tests/numerical_oldC/antenna_GSSI_1500_fs/antenna_like_GSSI_1500_pcb.vtp differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.in b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.in new file mode 100644 index 00000000..0f4f8237 --- /dev/null +++ b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.in @@ -0,0 +1,84 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 +#nips_number: 40 +#medium: 6.49 0 0 0.252 1.0 0.0 absorber +#medium: 3.0 0 0 0.0 1.0 0.0 pcb +#medium: 2.35 0 0 0.0 1.0 0.0 hdpe +#medium: 2.26 0 0 0.0 1.0 0.0 polypropylene +#medium: 3.0 0 0 4.255 1.0 0.0 txreslower +#medium: 3.0 0 0 3.191 1.0 0.0 txresupper +#medium: 3.0 0 0 13.333 1.0 0.0 rxreslower +#medium: 3.0 0 0 10.000 1.0 0.0 rxresupper +#box: 0.04000000000000001 0.0405 0.10600000000000001 0.224 0.1495 0.14600000000000002 pec +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.10800000000000001 free_space +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.10800000000000001 free_space +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.14400000000000002 absorber +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.14400000000000002 absorber +#cylinder_new: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.008 pec +#cylinder_new: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.008 pec +#cylinder_new: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.008 pec +#cylinder_new: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.008 pec +#cylinder_new: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.007 free_space +#cylinder_new: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.007 free_space +#cylinder_new: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.007 free_space +#cylinder_new: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.007 free_space +#box: 0.094 0.1335 0.10600000000000001 0.096 0.13549999999999998 0.14400000000000002 free_space +#box: 0.094 0.0545 0.10600000000000001 0.096 0.0565 0.14400000000000002 free_space +#box: 0.186 0.1335 0.10600000000000001 0.188 0.13549999999999998 0.14400000000000002 free_space +#box: 0.186 0.0545 0.10600000000000001 0.188 0.0565 0.14400000000000002 free_space +#box: 0.06000000000000001 0.058499999999999996 0.10600000000000001 0.222 0.1315 0.10800000000000001 pcb +#box: 0.07200000000000001 0.0625 0.10600000000000001 0.134 0.1245 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.14300000000000002 absorber +#box: 0.14800000000000002 0.0625 0.10600000000000001 0.21000000000000002 0.1245 0.14300000000000002 pec +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.14300000000000002 free_space +#box: 0.134 0.1185 0.14100000000000001 0.14800000000000002 0.1245 0.14300000000000002 pec +#box: 0.134 0.0625 0.14100000000000001 0.14800000000000002 0.0685 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.10800000000000001 pcb +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.10800000000000001 pcb +#triangle: 0.10300000000000001 0.0915 0.10600000000000001 0.07700000000000001 0.0665 0.10600000000000001 0.129 0.0665 0.10600000000000001 pec +#edge: 0.10300000000000001 0.0915 0.10600000000000001 0.10300000000000001 0.0925 0.10600000000000001 pec +#triangle: 0.10300000000000001 0.0935 0.10600000000000001 0.07700000000000001 0.1185 0.10600000000000001 0.129 0.1185 0.10600000000000001 pec +#edge: 0.10300000000000001 0.0935 0.10600000000000001 0.10300000000000001 0.0945 0.10600000000000001 pec +#triangle: 0.179 0.0915 0.10600000000000001 0.153 0.0665 0.10600000000000001 0.205 0.0665 0.10600000000000001 pec +#edge: 0.179 0.0915 0.10600000000000001 0.179 0.0925 0.10600000000000001 pec +#triangle: 0.179 0.0935 0.10600000000000001 0.153 0.1185 0.10600000000000001 0.205 0.1185 0.10600000000000001 pec +#edge: 0.179 0.0935 0.10600000000000001 0.179 0.0945 0.10600000000000001 pec +#edge: 0.08000000000000002 0.0635 0.10600000000000001 0.08000000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.08100000000000002 0.0635 0.10600000000000001 0.08100000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.10300000000000001 0.0635 0.10600000000000001 0.10300000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.10400000000000001 0.0635 0.10600000000000001 0.10400000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.125 0.0635 0.10600000000000001 0.125 0.0665 0.10600000000000001 txreslower +#edge: 0.126 0.0635 0.10600000000000001 0.126 0.0665 0.10600000000000001 txreslower +#edge: 0.08000000000000002 0.1195 0.10600000000000001 0.08000000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.08100000000000002 0.1195 0.10600000000000001 0.08100000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.10300000000000001 0.1195 0.10600000000000001 0.10300000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.10400000000000001 0.1195 0.10600000000000001 0.10400000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.125 0.1195 0.10600000000000001 0.125 0.1235 0.10600000000000001 txresupper +#edge: 0.126 0.1195 0.10600000000000001 0.126 0.1235 0.10600000000000001 txresupper +#edge: 0.15600000000000003 0.0635 0.10600000000000001 0.15600000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.15700000000000003 0.0635 0.10600000000000001 0.15700000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.179 0.0635 0.10600000000000001 0.179 0.0665 0.10600000000000001 rxreslower +#edge: 0.18 0.0635 0.10600000000000001 0.18 0.0665 0.10600000000000001 rxreslower +#edge: 0.201 0.0635 0.10600000000000001 0.201 0.0665 0.10600000000000001 rxreslower +#edge: 0.202 0.0635 0.10600000000000001 0.202 0.0665 0.10600000000000001 rxreslower +#edge: 0.15600000000000003 0.1195 0.10600000000000001 0.15600000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.15700000000000003 0.1195 0.10600000000000001 0.15700000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.179 0.1195 0.10600000000000001 0.179 0.1235 0.10600000000000001 rxresupper +#edge: 0.18 0.1195 0.10600000000000001 0.18 0.1235 0.10600000000000001 rxresupper +#edge: 0.201 0.1195 0.10600000000000001 0.201 0.1235 0.10600000000000001 rxresupper +#edge: 0.202 0.1195 0.10600000000000001 0.202 0.1235 0.10600000000000001 rxresupper +#box: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.10300000000000001 polypropylene +#box: 0.04000000000000001 0.0405 0.10300000000000001 0.224 0.1495 0.10600000000000001 hdpe +#geometry_vtk: 0.03900000000000001 0.0395 0.099 0.225 0.1505 0.14700000000000002 0.001 0.001 0.001 antenna_like_MALA_1200 n +#geometry_vtk: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.11 0.001 0.001 0.001 antenna_like_MALA_1200_pcb f +#messages: y +#num_of_procs: 8 +#abc_type: pml +#pml_layers: 10 +#voltage_source: 1.0 978000000.0 gaussian 1000 myGaussian +#analysis: 1 antenna_MALA_1200_fs_proc_oldstyle.out b +#rx: 0.179 0.0925 0.10600000000000001 +#tx: y 0.10300000000000001 0.0925 0.10600000000000001 myGaussian 0 6e-09 +#end_analysis: diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.out b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.out new file mode 100644 index 00000000..4519c740 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle.out differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle_hdf5.out b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle_hdf5.out new file mode 100644 index 00000000..de4ab9fd Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_MALA_1200_fs_proc_oldstyle_hdf5.out differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200.vti b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200.vti new file mode 100644 index 00000000..6d905560 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200.vti differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200_pcb.vtp b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200_pcb.vtp new file mode 100644 index 00000000..d4f6b431 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/C_code/antenna_like_MALA_1200_pcb.vtp differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in new file mode 100755 index 00000000..0dba570f --- /dev/null +++ b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.in @@ -0,0 +1,10 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 + +#python: +from user_libs.antennas import antenna_like_MALA_1200 +antenna_like_MALA_1200(0.132, 0.095, 0.100) +#end_python: + diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out new file mode 100644 index 00000000..34015f15 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs.out differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in new file mode 100644 index 00000000..9d89e5ae --- /dev/null +++ b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_proc.in @@ -0,0 +1,77 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 +#material: 6.49 0.252 1.0 0.0 absorber +#material: 3.0 0.0 1.0 0.0 pcb +#material: 2.35 0.0 1.0 0.0 hdpe +#material: 2.26 0.0 1.0 0.0 polypropylene +#material: 3.0 4.255 1.0 0.0 txreslower +#material: 3.0 3.191 1.0 0.0 txresupper +#material: 3.0 13.333 1.0 0.0 rxreslower +#material: 3.0 10.000 1.0 0.0 rxresupper +#box: 0.04000000000000001 0.0405 0.10600000000000001 0.224 0.1495 0.14600000000000002 pec +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.10800000000000001 free_space +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.10800000000000001 free_space +#box: 0.06000000000000001 0.0425 0.10600000000000001 0.14 0.1475 0.14400000000000002 absorber +#box: 0.14 0.0425 0.10600000000000001 0.222 0.1475 0.14400000000000002 absorber +#cylinder: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.008 pec +#cylinder: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.008 pec +#cylinder: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.008 pec +#cylinder: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.008 pec +#cylinder: 0.095 0.1415 0.10600000000000001 0.095 0.1415 0.14400000000000002 0.007 free_space +#cylinder: 0.095 0.0485 0.10600000000000001 0.095 0.0485 0.14400000000000002 0.007 free_space +#cylinder: 0.187 0.1415 0.10600000000000001 0.187 0.1415 0.14400000000000002 0.007 free_space +#cylinder: 0.187 0.0485 0.10600000000000001 0.187 0.0485 0.14400000000000002 0.007 free_space +#box: 0.094 0.1335 0.10600000000000001 0.096 0.13549999999999998 0.14400000000000002 free_space +#box: 0.094 0.0545 0.10600000000000001 0.096 0.0565 0.14400000000000002 free_space +#box: 0.186 0.1335 0.10600000000000001 0.188 0.13549999999999998 0.14400000000000002 free_space +#box: 0.186 0.0545 0.10600000000000001 0.188 0.0565 0.14400000000000002 free_space +#box: 0.06000000000000001 0.058499999999999996 0.10600000000000001 0.222 0.1315 0.10800000000000001 pcb +#box: 0.07200000000000001 0.0625 0.10600000000000001 0.134 0.1245 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.14300000000000002 absorber +#box: 0.14800000000000002 0.0625 0.10600000000000001 0.21000000000000002 0.1245 0.14300000000000002 pec +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.14300000000000002 free_space +#box: 0.134 0.1185 0.14100000000000001 0.14800000000000002 0.1245 0.14300000000000002 pec +#box: 0.134 0.0625 0.14100000000000001 0.14800000000000002 0.0685 0.14300000000000002 pec +#box: 0.07300000000000001 0.0635 0.10600000000000001 0.133 0.1235 0.10800000000000001 pcb +#box: 0.14900000000000002 0.0635 0.10600000000000001 0.20900000000000002 0.1235 0.10800000000000001 pcb +#triangle: 0.10300000000000001 0.0915 0.10600000000000001 0.07700000000000001 0.0665 0.10600000000000001 0.129 0.0665 0.10600000000000001 0 pec +#edge: 0.10300000000000001 0.0915 0.10600000000000001 0.10300000000000001 0.0925 0.10600000000000001 pec +#triangle: 0.10300000000000001 0.0945 0.10600000000000001 0.07700000000000001 0.1195 0.10600000000000001 0.129 0.1195 0.10600000000000001 0 pec +#edge: 0.10300000000000001 0.0935 0.10600000000000001 0.10300000000000001 0.0945 0.10600000000000001 pec +#triangle: 0.179 0.0915 0.10600000000000001 0.153 0.0665 0.10600000000000001 0.205 0.0665 0.10600000000000001 0 pec +#edge: 0.179 0.0915 0.10600000000000001 0.179 0.0925 0.10600000000000001 pec +#triangle: 0.179 0.0945 0.10600000000000001 0.153 0.1195 0.10600000000000001 0.205 0.1195 0.10600000000000001 0 pec +#edge: 0.179 0.0935 0.10600000000000001 0.179 0.0945 0.10600000000000001 pec +#edge: 0.08000000000000002 0.0635 0.10600000000000001 0.08000000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.08100000000000002 0.0635 0.10600000000000001 0.08100000000000002 0.0665 0.10600000000000001 txreslower +#edge: 0.10300000000000001 0.0635 0.10600000000000001 0.10300000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.10400000000000001 0.0635 0.10600000000000001 0.10400000000000001 0.0665 0.10600000000000001 txreslower +#edge: 0.125 0.0635 0.10600000000000001 0.125 0.0665 0.10600000000000001 txreslower +#edge: 0.126 0.0635 0.10600000000000001 0.126 0.0665 0.10600000000000001 txreslower +#edge: 0.08000000000000002 0.1195 0.10600000000000001 0.08000000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.08100000000000002 0.1195 0.10600000000000001 0.08100000000000002 0.1235 0.10600000000000001 txresupper +#edge: 0.10300000000000001 0.1195 0.10600000000000001 0.10300000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.10400000000000001 0.1195 0.10600000000000001 0.10400000000000001 0.1235 0.10600000000000001 txresupper +#edge: 0.125 0.1195 0.10600000000000001 0.125 0.1235 0.10600000000000001 txresupper +#edge: 0.126 0.1195 0.10600000000000001 0.126 0.1235 0.10600000000000001 txresupper +#edge: 0.15600000000000003 0.0635 0.10600000000000001 0.15600000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.15700000000000003 0.0635 0.10600000000000001 0.15700000000000003 0.0665 0.10600000000000001 rxreslower +#edge: 0.179 0.0635 0.10600000000000001 0.179 0.0665 0.10600000000000001 rxreslower +#edge: 0.18 0.0635 0.10600000000000001 0.18 0.0665 0.10600000000000001 rxreslower +#edge: 0.201 0.0635 0.10600000000000001 0.201 0.0665 0.10600000000000001 rxreslower +#edge: 0.202 0.0635 0.10600000000000001 0.202 0.0665 0.10600000000000001 rxreslower +#edge: 0.15600000000000003 0.1195 0.10600000000000001 0.15600000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.15700000000000003 0.1195 0.10600000000000001 0.15700000000000003 0.1235 0.10600000000000001 rxresupper +#edge: 0.179 0.1195 0.10600000000000001 0.179 0.1235 0.10600000000000001 rxresupper +#edge: 0.18 0.1195 0.10600000000000001 0.18 0.1235 0.10600000000000001 rxresupper +#edge: 0.201 0.1195 0.10600000000000001 0.201 0.1235 0.10600000000000001 rxresupper +#edge: 0.202 0.1195 0.10600000000000001 0.202 0.1235 0.10600000000000001 rxresupper +#box: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.10300000000000001 polypropylene +#box: 0.04000000000000001 0.0405 0.10300000000000001 0.224 0.1495 0.10600000000000001 hdpe +#geometry_view: 0.03900000000000001 0.0395 0.099 0.225 0.1505 0.14700000000000002 0.001 0.001 0.001 antenna_like_MALA_1200 n +#geometry_view: 0.04000000000000001 0.0405 0.1 0.224 0.1495 0.11 0.001 0.001 0.001 antenna_like_MALA_1200_pcb f +#waveform: gaussian 1.0 978000000.0 myGaussian +#voltage_source: y 0.10300000000000001 0.0925 0.10600000000000001 1000 myGaussian +#rx: 0.179 0.0925 0.10600000000000001 diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5.pdf b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5.pdf new file mode 100644 index 00000000..2aa80da8 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5.pdf differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5_diffs.pdf b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5_diffs.pdf new file mode 100644 index 00000000..a60094ac Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_MALA_1200_fs_vs_antenna_MALA_1200_fs_proc_oldstyle_hdf5_diffs.pdf differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti new file mode 100644 index 00000000..c4916333 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200.vti differ diff --git a/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp new file mode 100644 index 00000000..83636e94 Binary files /dev/null and b/tests/numerical_oldC/antenna_MALA_1200_fs/antenna_like_MALA_1200_pcb.vtp differ diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.in b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.in new file mode 100644 index 00000000..ca20ebe2 --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.in @@ -0,0 +1,22 @@ +#title: Hertzian dipole in free-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + + +#medium: 80.10000000000001 4.9 9.231e-12 0 1 0 myWater +#box: 0 0 0 0.100 0.100 0.100 myWater + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: +#messages: y +#num_of_procs: 8 +#abc_type: pml +#pml_layers: 10 +#hertzian_dipole: 1.0 1e9 ricker myWave +#analysis: 1 hertzian_dipole_dispersive_oldstyle.out b +#rx: 0.050 0.070 0.050 +#tx: y 0.050 0.050 0.050 myWave 0 3e-09 +#end_analysis: diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.out b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.out new file mode 100644 index 00000000..b0ae00d6 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle_hdf5.out b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle_hdf5.out new file mode 100644 index 00000000..c46370dd Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_dispersive/C_code/hertzian_dipole_dispersive_oldstyle_hdf5.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.in b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.in new file mode 100755 index 00000000..1ede6484 --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.in @@ -0,0 +1,17 @@ +#title: Hertzian dipole in free-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + +#waveform: gaussiandot 1.0 1e9 myWave +#hertzian_dipole: y 0.050 0.050 0.050 myWave +#rx: 0.050 0.070 0.050 + +#material: 4.9 0 1 0 myWater +#add_dispersion_debye: 1 75.2 9.231e-12 myWater +#box: 0 0 0 0.100 0.100 0.100 myWater + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.out b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.out new file mode 100644 index 00000000..7c096c71 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5.pdf b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5.pdf new file mode 100644 index 00000000..7b1f9487 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5.pdf differ diff --git a/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5_diffs.pdf b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5_diffs.pdf new file mode 100644 index 00000000..eba17a93 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_dispersive/hertzian_dipole_dispersive_vs_hertzian_dipole_dispersive_oldstyle_hdf5_diffs.pdf differ diff --git a/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.in b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.in new file mode 100644 index 00000000..fd3e02ee --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.in @@ -0,0 +1,19 @@ +#title: Hertzian dipole in free-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: +#messages: y +#num_of_procs: 8 +#abc_type: pml +#pml_layers: 10 +#hertzian_dipole: 1.0 1e9 ricker myWave +#analysis: 1 hertzian_dipole_fs_oldstyle.out b +#rx: 0.050 0.070 0.050 +#tx: y 0.050 0.050 0.050 myWave 0 3e-09 +#end_analysis: diff --git a/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.out b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.out new file mode 100644 index 00000000..5f1e48da Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle_hdf5.out b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle_hdf5.out new file mode 100644 index 00000000..11bab932 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_fs/C_code/hertzian_dipole_fs_oldstyle_hdf5.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.in b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.in new file mode 100755 index 00000000..d7c6cea6 --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.in @@ -0,0 +1,13 @@ +#title: Hertzian dipole in free-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + +#waveform: gaussiandot 1.0 1e9 myWave +#hertzian_dipole: y 0.050 0.050 0.050 myWave +#rx: 0.050 0.070 0.050 + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: diff --git a/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.out b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.out new file mode 100644 index 00000000..b54bf30e Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5.pdf b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5.pdf new file mode 100644 index 00000000..4c8de922 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5.pdf differ diff --git a/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5_diffs.pdf b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5_diffs.pdf new file mode 100644 index 00000000..c6fba108 Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_fs/hertzian_dipole_fs_vs_hertzian_dipole_fs_oldstyle_hdf5_diffs.pdf differ diff --git a/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.in b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.in new file mode 100644 index 00000000..40863893 --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.in @@ -0,0 +1,22 @@ +#title: Hertzian dipole over a half-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + + +#medium: 8 0 0 0 1 0 half_space +#box: 0 0 0 0.100 0.100 0.050 half_space + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: +#messages: y +#num_of_procs: 8 +#abc_type: pml +#pml_layers: 10 +#hertzian_dipole: 1.0 1e9 ricker myWave +#analysis: 1 hertzian_dipole_hs_oldstyle.out b +#rx: 0.050 0.070 0.050 +#tx: y 0.050 0.050 0.050 myWave 0 3e-09 +#end_analysis: diff --git a/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.out b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.out new file mode 100644 index 00000000..1973cf9b Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle_hdf5.out b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle_hdf5.out new file mode 100644 index 00000000..5497428f Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_hs/C_code/hertzian_dipole_hs_oldstyle_hdf5.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.in b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.in new file mode 100755 index 00000000..36cd7881 --- /dev/null +++ b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.in @@ -0,0 +1,16 @@ +#title: Hertzian dipole over a half-space +#domain: 0.100 0.100 0.100 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 3e-9 + +#waveform: gaussiandot 1.0 1e9 myWave +#hertzian_dipole: y 0.050 0.050 0.050 myWave +#rx: 0.050 0.070 0.050 + +#material: 8 0 1 0 half_space +#box: 0 0 0 0.100 0.100 0.050 half_space + +python: +for time in range(1,50): + print('#snapshot: 0.001 0.001 0.001 0.099 0.099 0.099 0.001 0.001 0.001 {} {}'.format(0.1e-9 * time, 'snap' + str(time))) +end_python: diff --git a/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.out b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.out new file mode 100644 index 00000000..e19f768e Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs.out differ diff --git a/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5.pdf b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5.pdf new file mode 100644 index 00000000..5e84787a Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5.pdf differ diff --git a/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5_diffs.pdf b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5_diffs.pdf new file mode 100644 index 00000000..f051e3fc Binary files /dev/null and b/tests/numerical_oldC/hertzian_dipole_hs/hertzian_dipole_hs_vs_hertzian_dipole_hs_oldstyle_hdf5_diffs.pdf differ diff --git a/tests/test_compare_analytical.py b/tests/test_compare_analytical.py new file mode 100644 index 00000000..bdffb94e --- /dev/null +++ b/tests/test_compare_analytical.py @@ -0,0 +1,83 @@ +import sys, os +import h5py +import numpy as np +import matplotlib as mpl +import matplotlib.pyplot as plt +from tools.plot_fields import plot_Ascan +from tests.analytical_solutions import hertzian_dipole_fs + +"""Compare field outputs + +Usage: + cd gprMax + python -m tests.test_compare_analytical path_to_model_output + +""" + +modelfile = sys.argv[1] +path = '/rxs/rx1/' +# Key refers to subplot location +fields = {0: 'Ex', 1: 'Ey', 2: 'Ez', 3: 'Hx', 4: 'Hy', 5: 'Hz'} +plotorder = {0: 0, 1: 3, 2: 1, 3: 4, 4: 2, 5: 5} + +# Model results +f = h5py.File(modelfile, 'r') +# Get model/file attributes +floattype = f[path + 'Ex'].dtype +iterations = f.attrs['Iterations'] +dt = f.attrs['dt'] +dxdydz = f.attrs['dx, dy, dz'] +model = np.zeros((iterations, 6), dtype=floattype) +time = np.arange(0, dt * iterations, dt) / 1e-9 +rxpos = f[path + 'Position'] +txpos = f['/txs/tx1/Position'] +rxposrelative = ((rxpos[0] - txpos[0]), (rxpos[1] - txpos[1]), (rxpos[2] - txpos[2])) +# Read fields +for ID, name in fields.items(): + model[:,ID] = f[path + str(name)][:] +f.close() + +# Analytical solution of a dipole in free space +analytical = hertzian_dipole_fs(iterations * dt, dt, dxdydz, rxposrelative) + +# Differences +threshold = 1e-4 # Threshold, below which ignore differences +diffs = np.zeros((iterations, 6), dtype=floattype) +for ID, name in fields.items(): + max = np.amax(np.abs(analytical[:,ID])) + if max < threshold: + diffs[:,ID] = 0 + diffsum = 0 + print('Detected differences of less than {} when comparing {} field component, therefore set as zero.'.format(threshold, fields[ID])) + else: + diffs[:,ID] = (np.abs(analytical[:,ID] - model[:,ID]) / max) * 100 + diffsum = (np.sum(np.abs(analytical[:,ID] - model[:,ID])) / np.sum(np.abs(analytical[:,ID]))) * 100 + print('Total differences in field component {}: {:.1f}%'.format(name, diffsum)) + +# Plot model +fig1, plt1 = plot_Ascan(modelfile + ' versus analytical solution', time, model[:,0], model[:,1], model[:,2], model[:,3], model[:,4], model[:,5]) + +# Add analytical solution and set legend +for index, ax in enumerate(fig1.axes): + if index in [0, 2, 4]: + ax.plot(time, analytical[:,plotorder[index]], 'r', label='analytical', lw=2, ls='--') + else: + ax.plot(time, analytical[:,plotorder[index]], label='analytical', lw=2, ls='--') + ax.set_xlim(0, time[-1]) + handles, existlabels = ax.get_legend_handles_labels() + ax.legend(handles, ['Model', 'Analytical']) + +# Plots of differences +fig2, plt2 = plot_Ascan('Deltas: ' + modelfile + ' versus analytical solution', time, diffs[:,0], diffs[:,1], diffs[:,2], diffs[:,3], diffs[:,4], diffs[:,5]) +[ax.set_xlim(0, time[-1]) for ax in fig2.axes] +[ax.set_ylim(0, np.ceil(np.amax(np.abs(diffs)))) for ax in fig2.axes] +ylabels = ['$E_x$', '$H_x$', '$E_y$', '$H_y$', '$E_z$', '$H_z$'] +ylabels = [ylabel + ', percentage difference [%]' for ylabel in ylabels] +[ax.set_ylabel(ylabels[index]) for index, ax in enumerate(fig2.axes)] + +# Show/print plots +savename = os.path.abspath(os.path.dirname(modelfile)) + os.sep + os.path.splitext(os.path.split(modelfile)[1])[0] + '_vs_analytical' +#fig1.savefig(savename + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +#fig2.savefig(savename + '_diffs.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +plt1.show() +plt2.show() \ No newline at end of file diff --git a/tests/test_compare_experimental.py b/tests/test_compare_experimental.py new file mode 100644 index 00000000..4ca7d755 --- /dev/null +++ b/tests/test_compare_experimental.py @@ -0,0 +1,59 @@ +import sys, os +import h5py +import numpy as np +import matplotlib as mpl +import matplotlib.pyplot as plt + +"""Compare field outputs + +Usage: + cd gprMax + python -m tests.test_compare_experimental path_to_model_output path_to_real_output + +""" + +modelfile = sys.argv[1] +realfile = sys.argv[2] +path = '/rxs/rx1/' +# Key refers to subplot location +fields = {0: 'Ex', 1: 'Ey', 2: 'Ez', 3: 'Hx', 4: 'Hy', 5: 'Hz'} +plotorder = list(fields.keys()) + +# Model results +f = h5py.File(modelfile, 'r') +floattype = f[path + 'Ex'].dtype +model = np.zeros((f.attrs['Iterations'], 6), dtype=floattype) +timemodel = np.zeros((f.attrs['Iterations']), dtype=floattype) +timemodel = np.arange(0, f.attrs['dt'] * f.attrs['Iterations'], f.attrs['dt']) / 1e-9 +for ID, name in fields.items(): + model[:,ID] = f[path + str(name)][:] * -1 + model[:,ID] = model[:,ID] / np.amax(np.abs(model[:,ID])) +f.close() + +# Select model field of interest and find max +modelmax = np.where(np.abs(model[:,1]) == 1)[0][0] + +# Real results +with open(realfile, 'r') as f: + real = np.loadtxt(f) +real[:,1] = real[:,1] / np.amax(np.abs(real[:,1])) +realmax = np.where(np.abs(real[:,1]) == 1)[0][0] + +difftime = - (timemodel[modelmax] - real[realmax,0]) + +# Plot modelled and real data +fig, ax = plt.subplots(num=modelfile + ' versus ' + realfile, figsize=(20, 10), facecolor='w', edgecolor='w') +ax.plot(timemodel + difftime, model[:,1], 'r', lw=2, label='Model') +ax.plot(real[:,0], real[:,1], 'r', ls='--', lw=2, label='Experiment') +ax.set_xlabel('Time [ns]') +ax.set_ylabel('Amplitude') +ax.set_xlim([0, timemodel[-1]]) +ax.set_ylim([-1, 1]) +ax.legend() +[label.set_bbox(dict(facecolor='white', edgecolor='None', alpha=0.65 )) for label in ax.get_xticklabels() + ax.get_yticklabels()] +ax.grid() + +# Show/print plots +savename = os.path.abspath(os.path.dirname(modelfile)) + os.sep + os.path.splitext(os.path.split(modelfile)[1])[0] + '_vs_' + os.path.splitext(os.path.split(realfile)[1])[0] +#fig.savefig(savename + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +plt.show() \ No newline at end of file diff --git a/tests/test_compare_numerical.py b/tests/test_compare_numerical.py new file mode 100644 index 00000000..dec37a24 --- /dev/null +++ b/tests/test_compare_numerical.py @@ -0,0 +1,88 @@ +import sys, os +import h5py +import numpy as np +import matplotlib as mpl +import matplotlib.pyplot as plt +from tools.plot_fields import plot_Ascan + +"""Compare field outputs + +Usage: + cd gprMax + python -m tests.test_compare_numerical path_to_new_file path_to_old_file + +""" + +newfile = sys.argv[1] +oldfile = sys.argv[2] +path = '/rxs/rx1/' +# Key refers to subplot location +fields = {0: 'Ex', 2: 'Ey', 4: 'Ez', 1: 'Hx', 3: 'Hy', 5: 'Hz'} +plotorder = list(fields.keys()) + +# New results +f = h5py.File(newfile, 'r') +floattype = f[path + 'Ex'].dtype +new = np.zeros((f.attrs['Iterations'], 6), dtype=floattype) +timenew = np.zeros((f.attrs['Iterations']), dtype=floattype) +timenew = np.arange(0, f.attrs['dt'] * f.attrs['Iterations'], f.attrs['dt']) / 1e-9 +for ID, name in fields.items(): + new[:,ID] = f[path + str(name)][:] +f.close() + +# Old results +f = h5py.File(oldfile, 'r') +old = np.zeros((f.attrs['Iterations'], 6), dtype=floattype) +timeold = np.zeros((f.attrs['Iterations']), dtype=floattype) +timeold = np.arange(0, f.attrs['dt'] * f.attrs['Iterations'], f.attrs['dt']) / 1e-9 +for ID, name in fields.items(): + old[:,ID] = f[path + str(name)][:] +f.close() + +# Differences +# In case there is any difference in the number of iterations, take the smaller +timesmallest = np.amin((timeold.shape, timenew.shape)) +fieldssmallest = np.amin((old.shape[0], new.shape[0])) + +threshold = 1e-4 # Threshold, below which ignore differences +diffs = np.zeros((fieldssmallest, 6), dtype=floattype) +for ID, name in fields.items(): + max = np.amax(np.abs(new[:fieldssmallest,ID])) + if max < threshold: + diffs[:,ID] = 0 + diffsum = 0 + print('Detected differences of less than {} when comparing {} field component, therefore set as zero.'.format(threshold, fields[ID])) + else: + diffs[:,ID] = (np.abs(new[:fieldssmallest,ID] - old[:fieldssmallest,ID]) / max) * 100 + diffsum = (np.sum(np.abs(new[:fieldssmallest,ID] - old[:fieldssmallest,ID])) / np.sum(np.abs(new[:fieldssmallest,ID]))) * 100 + print('Total differences in field component {}: {:.1f}%'.format(name, diffsum)) + +# Plot new +fig1, plt1 = plot_Ascan(newfile + ' versus ' + oldfile, timenew, new[:,0], new[:,2], new[:,4], new[:,1], new[:,3], new[:,5]) + +# Add old and set legend +for index, ax in enumerate(fig1.axes): + if plotorder[index] in [0, 2, 4]: + ax.plot(timeold, old[:,plotorder[index]], 'r', label='old', lw=2, ls='--') + else: + ax.plot(timeold, old[:,plotorder[index]], label='old', lw=2, ls='--') + ax.set_xlim(0, timeold[-1]) + handles, existlabels = ax.get_legend_handles_labels() + ax.legend(handles, ['Model (new code)', 'Model (old C code)']) + +# Plots of differences +fig2, plt2 = plot_Ascan('Deltas: ' + newfile + ' versus ' + oldfile, timenew[:timesmallest], diffs[:,0], diffs[:,2], diffs[:,4], diffs[:,1], diffs[:,3], diffs[:,5]) +[ax.set_xlim(0, timenew[timesmallest - 1]) for ax in fig2.axes] +[ax.set_ylim(0, np.ceil(np.amax(np.abs(diffs)))) for ax in fig2.axes] +ylabels = ['$E_x$', '$H_x$', '$E_y$', '$H_y$', '$E_z$', '$H_z$'] +ylabels = [ylabel + ', percentage difference [%]' for ylabel in ylabels] +[ax.set_ylabel(ylabels[index]) for index, ax in enumerate(fig2.axes)] + +# Show/print plots +savename = os.path.abspath(os.path.dirname(newfile)) + os.sep + os.path.splitext(os.path.split(newfile)[1])[0] + '_vs_' + os.path.splitext(os.path.split(oldfile)[1])[0] +#fig1.savefig(savename + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +#fig2.savefig(savename + '_diffs.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +plt1.show() +plt2.show() + + diff --git a/tools/MATLAB scripts/outputfiles_mergehdf5.m b/tools/MATLAB scripts/outputfiles_mergehdf5.m new file mode 100644 index 00000000..15d0826b --- /dev/null +++ b/tools/MATLAB scripts/outputfiles_mergehdf5.m @@ -0,0 +1,56 @@ +% outputfiles_mergehdf5.m +% Script to merge gprMax output files of A-scans (traces) into a single +% HDF5 file +% +% Craig Warren + +clear all, clc + +[filenames, pathname] = uigetfile('*.out', 'Select gprMax A-scan output files to merge', 'MultiSelect', 'on'); + +% Combine A-scans (traces) into a single HDF5 output file +if filenames{1} ~= 0 + [pathstr, basefilename, ext] = fileparts(filenames{1}); + outputfile = strcat(fullfile(pathname, basefilename(1:end-1)), '_all.out'); + modelruns = length(filenames); + filename = fullfile(pathname, filenames{1}); + iterations = double(h5readatt(filename, '/', 'Iterations')); + dt = h5readatt(filename, '/', 'dt'); + h5create(outputfile, '/rxs/rx1/Ex', [modelruns iterations]); + h5create(outputfile, '/rxs/rx1/Ey', [modelruns iterations]); + h5create(outputfile, '/rxs/rx1/Ez', [modelruns iterations]); + h5create(outputfile, '/rxs/rx1/Hx', [modelruns iterations]); + h5create(outputfile, '/rxs/rx1/Hy', [modelruns iterations]); + h5create(outputfile, '/rxs/rx1/Hz', [modelruns iterations]); + h5writeatt(outputfile, '/', 'Iterations', iterations); + h5writeatt(outputfile, '/', 'dt', dt); + Ex = zeros(iterations, modelruns); + Ey = zeros(iterations, modelruns); + Ez = zeros(iterations, modelruns); + Hx = zeros(iterations, modelruns); + Hy = zeros(iterations, modelruns); + Hz = zeros(iterations, modelruns); + for rx=1:modelruns + filename = fullfile(pathname, filenames{rx}); + Ex(:, rx) = h5read(filename, '/rxs/rx1/Ex'); + Ey(:, rx) = h5read(filename, '/rxs/rx1/Ey'); + Ez(:, rx) = h5read(filename, '/rxs/rx1/Ez'); + Hx(:, rx) = h5read(filename, '/rxs/rx1/Hx'); + Hy(:, rx) = h5read(filename, '/rxs/rx1/Hy'); + Hz(:, rx) = h5read(filename, '/rxs/rx1/Hz'); + end + h5write(outputfile, '/rxs/rx1/Ex', Ex'); + h5write(outputfile, '/rxs/rx1/Ey', Ey'); + h5write(outputfile, '/rxs/rx1/Ez', Ez'); + h5write(outputfile, '/rxs/rx1/Hx', Hx'); + h5write(outputfile, '/rxs/rx1/Hy', Hy'); + h5write(outputfile, '/rxs/rx1/Hz', Hz'); + prompt = 'Do you want to remove the multiple individual output files? [y] or n: '; + check = input(prompt,'s'); + if isempty(check) || check == 'y' + for f=1:length(filenames) + filename = fullfile(pathname, filenames{f}); + delete(filename); + end + end +end \ No newline at end of file diff --git a/tools/MATLAB scripts/plot_hdf5_Ascan.m b/tools/MATLAB scripts/plot_hdf5_Ascan.m new file mode 100644 index 00000000..cb84374f --- /dev/null +++ b/tools/MATLAB scripts/plot_hdf5_Ascan.m @@ -0,0 +1,88 @@ +% plot_fields_Ascan.m +% Script to save and plot EM fields from a gprMax A-scan +% +% Craig Warren + +clear all, clc + +[filename, pathname] = uigetfile('*.out', 'Select gprMax A-scan output file to plot'); +fullfilename = strcat(pathname, filename); + +if filename ~= 0 + header.title = h5readatt(fullfilename, '/', 'Title'); + header.iterations = double(h5readatt(fullfilename,'/', 'Iterations')); + tmp = h5readatt(fullfilename, '/', 'dx, dy, dz'); + header.dx = tmp(1); + header.dy = tmp(2); + header.dz = tmp(3); + header.dt = h5readatt(fullfilename, '/', 'dt'); + header.ntx = h5readatt(fullfilename, '/', 'ntx'); + header.nrx = h5readatt(fullfilename, '/', 'nrx'); + + % Time vector for plotting + time = linspace(0, (header.iterations)*(header.dt)*1E9, header.iterations); + + % Initialise structure for field arrays + fields.ex = zeros(header.iterations, header.nrx); + fields.ey = zeros(header.iterations, header.nrx); + fields.ez = zeros(header.iterations, header.nrx); + fields.hx = zeros(header.iterations, header.nrx); + fields.hy = zeros(header.iterations, header.nrx); + fields.hz = zeros(header.iterations, header.nrx); + + prompt = 'Would you like to save a PDF of the plot(s)? y or [n]: '; + pdf = input(prompt,'s'); + + % Save and plot fields from each receiver + for n=1:header.nrx + path = strcat('/rxs/rx', num2str(n), '/'); + tmp = h5read(fullfilename, strcat(path, 'Position')); + header.rx(n) = tmp(1); + header.ry(n) = tmp(2); + header.rz(n) = tmp(3); + fields.ex(:,n) = h5read(fullfilename, strcat(path, 'Ex')); + fields.ey(:,n) = h5read(fullfilename, strcat(path, 'Ey')); + fields.ez(:,n) = h5read(fullfilename, strcat(path, 'Ez')); + fields.hx(:,n) = h5read(fullfilename, strcat(path, 'Hx')); + fields.hy(:,n) = h5read(fullfilename, strcat(path, 'Hy')); + fields.hz(:,n) = h5read(fullfilename, strcat(path, 'Hz')); + + fh1=figure('Name', strcat('rx', num2str(n))); + ax1 = subplot(2,3,1); plot(time, fields.ex(:,n), 'r', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [V/m]'), title('E_x') + ax2 = subplot(2,3,2); plot(time, fields.ey(:,n), 'r', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [V/m]'), title('E_y') + ax3 = subplot(2,3,3); plot(time, fields.ez(:,n), 'r', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [V/m]'), title('E_z') + ax4 = subplot(2,3,4); plot(time, fields.hx(:,n), 'b', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [A/m]'), title('H_x') + ax5 = subplot(2,3,5); plot(time, fields.hy(:,n), 'b', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [A/m]'), title('H_y') + ax6 = subplot(2,3,6); plot(time, fields.hz(:,n), 'b', 'LineWidth', 2), grid on, xlabel('Time [ns]'), ylabel('Field strength [A/m]'), title('H_z') + ax1.FontSize = 16; + ax2.FontSize = ax1.FontSize; + ax3.FontSize = ax1.FontSize; + ax4.FontSize = ax1.FontSize; + ax5.FontSize = ax1.FontSize; + ax6.FontSize = ax1.FontSize; + + % Options to create a nice looking figure for display and printing + set(fh1,'Color','white','Menubar','none'); + X = 60; % Paper size + Y = 30; % Paper size + xMargin = 0; % Left/right margins from page borders + yMargin = 0; % Bottom/top margins from page borders + xSize = X - 2*xMargin; % Figure size on paper (width & height) + ySize = Y - 2*yMargin; % Figure size on paper (width & height) + + % Figure size displayed on screen + set(fh1, 'Units','centimeters', 'Position', [0 0 xSize ySize]) + movegui(fh1, 'center') + + % Figure size printed on paper + set(fh1,'PaperUnits', 'centimeters') + set(fh1,'PaperSize', [X Y]) + set(fh1,'PaperPosition', [xMargin yMargin xSize ySize]) + set(fh1,'PaperOrientation', 'portrait') + + % Export to PDF + if pdf == 'y' + print(fh1, '-dpdf', '-r0', strcat(fullfilename(1:end-4), '_rx', num2str(n), '.pdf')); + end + end +end \ No newline at end of file diff --git a/tools/MATLAB scripts/plot_hdf5_Bscan.m b/tools/MATLAB scripts/plot_hdf5_Bscan.m new file mode 100644 index 00000000..4bd284df --- /dev/null +++ b/tools/MATLAB scripts/plot_hdf5_Bscan.m @@ -0,0 +1,65 @@ +% plot_fields_Bscan.m +% Script to plot EM fields from a gprMax B-scan +% +% Craig Warren + +clear all, clc + +[filename, pathname] = uigetfile('*.out', 'Select gprMax output file to plot B-scan', 'MultiSelect', 'on'); +filename = fullfile(pathname, filename); + +% Open file and read fields +if filename ~= 0 + iterations = double(h5readatt(filename, '/', 'Iterations')); + dt = h5readatt(filename, '/', 'dt'); + Ex = h5read(filename, '/rxs/rx1/Ex')'; + Ey = h5read(filename, '/rxs/rx1/Ey')'; + Ez = h5read(filename, '/rxs/rx1/Ez')'; + Hx = h5read(filename, '/rxs/rx1/Hx')'; + Hy = h5read(filename, '/rxs/rx1/Hy')'; + Hz = h5read(filename, '/rxs/rx1/Hz')'; +end + +prompt = 'Would you like to save a PDF of the plot? y or [n]: '; +pdf = input(prompt,'s'); + +prompt = 'Which field do you want to view? Ex, Ey, or Ez: '; +field = input(prompt,'s'); +field = eval(field); +time = 0:dt:iterations * dt; +traces = 0:size(field,2); + +fh1=figure('Name', filename); +clims = [-max(max(abs(field))) max(max(abs(field)))]; +im = imagesc(traces, time, field, clims); +xlabel('Trace number'); +ylabel('Time [s]'); +c = colorbar; +c.Label.String = 'Field strength [V/m]'; +ax = gca; +ax.FontSize = 16; +xlim([0 traces(end)]); + +% Options to create a nice looking figure for display and printing +set(fh1,'Color','white','Menubar','none'); +X = 60; % Paper size +Y = 30; % Paper size +xMargin = 0; % Left/right margins from page borders +yMargin = 0; % Bottom/top margins from page borders +xSize = X - 2*xMargin; % Figure size on paper (width & height) +ySize = Y - 2*yMargin; % Figure size on paper (width & height) + +% Figure size displayed on screen +set(fh1, 'Units','centimeters', 'Position', [0 0 xSize ySize]) +movegui(fh1, 'center') + +% Figure size printed on paper +set(fh1,'PaperUnits', 'centimeters') +set(fh1,'PaperSize', [X Y]) +set(fh1,'PaperPosition', [xMargin yMargin xSize ySize]) +set(fh1,'PaperOrientation', 'portrait') + +% Export to PDF +if pdf == 'y' + print(fh1, '-dpdf', '-r0', strcat(filename(1:end-4), '.pdf')); +end diff --git a/tools/Paraview macros/gprMax_materials.py b/tools/Paraview macros/gprMax_materials.py new file mode 100644 index 00000000..c5b63806 --- /dev/null +++ b/tools/Paraview macros/gprMax_materials.py @@ -0,0 +1,80 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +from paraview.simple import * +from xml.etree import ElementTree as ET + +# Disable automatic camera reset on 'Show' +paraview.simple._DisableFirstRenderCameraReset() + +# Get whatever source is loaded (should be model) +model = GetActiveSource() + +# Get active view +renderview = GetActiveView() + +# Show data in view +Show(model, renderview) + +# Reset view to fit data +renderview.ResetCamera() + +# List to hold material identifiers written in VTK file in tags +materials = [] +with open(model.FileName[0], 'r') as f: + for line in f: + if line.startswith('. + +import argparse, os, sys +import numpy as np + +from gprMax.exceptions import CmdInputError + +"""Converts new to old style input files.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Converts new style input file to old style input file.', usage='cd gprMax; python -m tools.inputfile_old2new inputfile') +parser.add_argument('inputfile', help='name of input file including path') +args = parser.parse_args() + +inputfile = args.inputfile + +with open(inputfile, 'r') as f: + # Strip out any newline characters and comments that must begin with double hashes + inputlines = [line.rstrip() for line in f] + +# New file name base +try: + newfile = inputfile.split('.')[0] +except: + pass +newfile += '_oldstyle' + +print("Attempting to convert inputfile '{}' to use old syntax...\n".format(inputfile)) + +newcommands = ['#add_dispersion_lorenz', '#add_dispersion_drude', '#fractal_box', '#soil_peplinski', '#python', '#end_python', '#add_surface_roughness', '#add_surface_water', '#add_grass', '#magnetic_dipole', '#pml_cfs', '#cylindrical_sector', '#time_step_limit_type'] +materials = {} +debyes = [] +waveforms = [] +badwaveforms = ['gaussiandotdot', 'ricker'] +hertziandipoles = [] +voltagesources = [] +analysiscmds = [] +ompthreadscheck = False +pmlcheck = False +messagescheck = False + +lindex = 0 +while(lindex < len(inputlines)): + + if inputlines[lindex].startswith('#') and not inputlines[lindex].startswith('##'): + cmd = inputlines[lindex].split(':') + cmdname = cmd[0].lower() + params = cmd[1].split() + + if cmdname == '#domain': + domain = (float(params[0]), float(params[1]), float(params[2])) + lindex += 1 + + elif cmdname == '#dx_dy_dz': + dx_dy_dz = (float(params[0]), float(params[1]), float(params[2])) + lindex += 1 + + elif cmdname == '#time_window': + if '.' in params[0] or 'e' in params[0].lower(): + timewindow = float(params[0]) + else: + timewindow = int(params[0]) + lindex += 1 + + elif cmdname == '#messages': + messagescheck = True + + elif cmdname == '#voltage_source': + voltagesources.append(inputlines[lindex]) + inputlines.pop(lindex) + + elif cmdname == '#hertzian_dipole': + hertziandipoles.append(inputlines[lindex]) + inputlines.pop(lindex) + + elif cmdname == '#rx': + analysiscmds.append(inputlines[lindex]) + inputlines.pop(lindex) + + elif cmdname == '#waveform': + waveforms.append(inputlines[lindex]) + inputlines.pop(lindex) + + elif cmdname == '#material': + materials[lindex] = inputlines[lindex] + lindex += 1 + + elif cmdname == '#add_dispersion_debye': + debyes.append(inputlines[lindex]) + inputlines.pop(lindex) + + elif cmdname == '#triangle': + # Syntax of command: #triangle: x1 y1 z1 x2 y2 z2 x3 y3 z3 thickness ID + if float(params[9]) == 0: + replacement = '#triangle: {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[10]) + else: + replacement = '#wedge: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#cylinder': + # Syntax of command: #cylinder: x1 y1 z1 x2 y2 z2 radius ID + replacement = '#cylinder_new: {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#pml_cells': + pmlcheck = True + # Syntax of command: #pml_cells: xminus yminus zminus xplus yplus zplus or #pml_cells: i1 (assumes latter behaviour) + replacement = '#pml_layers: {}'.format(params[0]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#num_threads': + ompthreadscheck = True + # Set number of threads to number of physical CPU cores, i.e. avoid hyperthreading with OpenMP for now + if sys.platform == 'darwin': + nthreads = int(os.popen('sysctl hw.physicalcpu').readlines()[0].split(':')[1].strip()) + elif sys.platform == 'win32': + # Consider using wmi tools to check hyperthreading on Windows + nthreads = os.cpu_count() + elif 'linux' in sys.platform: + lscpu = os.popen('lscpu').readlines() + cpusockets = [item for item in lscpu if item.startswith('Socket(s)')] + cpusockets = int(cpusockets[0].split(':')[1].strip()) + corespersocket = [item for item in lscpu if item.startswith('Core(s) per socket')] + corespersocket = int(corespersocket[0].split(':')[1].strip()) + nthreads = cpusockets * corespersocket + else: + nthreads = os.cpu_count() + # Syntax of command: #num_threads: nthreads + replacement = '#num_of_procs: {}'.format(nthreads) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + analysiscmds.append(replacement) + lindex += 1 + + elif cmdname == '#snapshot': + # Syntax of command: #snapshot: x1 y1 z1 x2 y2 z2 dx dy dz time filename + replacement = '#snapshot: {} {} {} {} {} {} {} {} {} {} {} v'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + analysiscmds.append(replacement) + lindex += 1 + + elif cmdname == '#geometry_view': + # Syntax of command: #geometry_vtk: x1 y1 z1 x2 y2 z2 dx dy dz filename type + replacement = '#geometry_vtk: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname in newcommands: + print("Command '{}' cannot be used in the old version of gprMax.".format(inputlines[lindex])) + inputlines.pop(lindex) + + else: + lindex += 1 + + else: + lindex +=1 + +# If messages not found set to on +if not messagescheck: + cmd = '#messages: y' + print("Command '{}' added.".format(cmd)) + inputlines.append(cmd) + +# Detect number of CPUs/cores on machine and set OpenMP threads if not already set +if not ompthreadscheck: + # Set number of threads to number of physical CPU cores, i.e. avoid hyperthreading with OpenMP for now + if sys.platform == 'darwin': + nthreads = int(os.popen('sysctl hw.physicalcpu').readlines()[0].split(':')[1].strip()) + elif sys.platform == 'win32': + # Consider using wmi tools to check hyperthreading on Windows + nthreads = os.cpu_count() + elif 'linux' in sys.platform: + lscpu = os.popen('lscpu').readlines() + cpusockets = [item for item in lscpu if item.startswith('Socket(s)')] + cpusockets = int(cpusockets[0].split(':')[1].strip()) + corespersocket = [item for item in lscpu if item.startswith('Core(s) per socket')] + corespersocket = int(corespersocket[0].split(':')[1].strip()) + nthreads = cpusockets * corespersocket + else: + nthreads = os.cpu_count() + cmd = '#num_of_procs: {}'.format(nthreads) + print("Command '{}' added.".format(cmd)) + inputlines.append(cmd) + +# Add the default PML if not already set +if not pmlcheck: + cmd1 = '#abc_type: pml' + cmd2 = '#pml_layers: 10' + print("Commands '{}' and '{}' added.".format(cmd1, cmd2)) + inputlines.append(cmd1) + inputlines.append(cmd2) + +# Process materials +for position, material in materials.items(): + params = material.split() + debye = next((debye for debye in debyes if debye.split()[-1] == params[5]), None) + if debye: + if len(debye.split()) > 5: + raise CmdInputError("Command '{}' cannot be used in the old version of gprMax as it only supports materials with a single Debye pole.".format(''.join(debye))) + medium = '#medium: {} {} {} {} {} {} {}'.format(float(params[1]) + float(debye.split()[2]), params[1], float(debye.split()[3]), params[2], params[3], params[4], params[5]) + print("Commands '{}' and '{}', replaced with '{}'".format(material, debye, medium)) + else: + medium = '#medium: {} 0 0 {} {} {} {}'.format(params[1], params[2], params[3], params[4], params[5]) + print("Command '{}', replaced with '{}'".format(material, medium)) + inputlines[position] = medium + + +# Create #analysis block +outputfile = newfile.split(os.sep) +analysis = '#analysis: 1 {} b'.format(outputfile[-1] + '.out') +analysiscmds.insert(0, analysis) + + +# Convert #hertzian_dipole and #waveform to #tx and #hertzian_dipole +for source in hertziandipoles: + params = source.split() + if len(params) > 6: + ID = params[7] + tx = '#tx: {} {} {} {} {} {} {}'.format(params[1], params[2], params[3], params[4], ID, params[5], params[6]) + else: + ID = params[5] + tx = '#tx: {} {} {} {} {} {} {}'.format(params[1], params[2], params[3], params[4], ID, 0, timewindow) + + waveform = next(waveform for waveform in waveforms if waveform.split()[4] == ID) + waveformparams = waveform.split() + if waveformparams[1] is badwaveforms: + raise CmdInputError("Waveform types {} are not compatible between new and old versions of gprMax.".format(''.join(badwaveforms))) + elif waveformparams[1] == 'gaussiandotnorm': + waveformparams[1] = 'ricker' + hertzian = '#hertzian_dipole: {} {} {} {}'.format(waveformparams[2], waveformparams[3], waveformparams[1], waveformparams[4]) + + print("Commands '{}' and '{}', replaced with '{}' and '{}'".format(source, waveform, tx, hertzian)) + inputlines.append(hertzian) + analysiscmds.append(tx) + + +# Convert #voltage_source and #waveform to #tx and #voltage_source +for source in voltagesources: + params = source.split() + if len(params) > 7: + ID = params[8] + tx = '#tx: {} {} {} {} {} {} {}'.format(params[1], params[2], params[3], params[4], ID, params[6], params[7]) + else: + ID = params[6] + tx = '#tx: {} {} {} {} {} {} {}'.format(params[1], params[2], params[3], params[4], ID, 0, timewindow) + + waveform = next(waveform for waveform in waveforms if waveform.split()[4] == ID) + waveformparams = waveform.split() + if waveformparams[1] is badwaveforms: + raise CmdInputError("Waveform types {} are not compatible between new and old versions of gprMax.".format(''.join(badwaveforms))) + elif waveformparams[1] == 'gaussiandotnorm': + waveformparams[1] = 'ricker' + voltagesource = '#voltage_source: {} {} {} {} {}'.format(waveformparams[2], waveformparams[3], waveformparams[1], params[5], waveformparams[4]) + + print("Commands '{}' and '{}', replaced with '{}' and '{}'".format(source, waveform, tx, voltagesource)) + inputlines.append(voltagesource) + analysiscmds.append(tx) + +inputlines += analysiscmds +inputlines.append('#end_analysis:') + + +# Write new input file +newinputfile = newfile + '.in' + +with open(newinputfile, 'w') as f: + for line in inputlines: + f.write('{}\n'.format(line)) + +print("\nWritten new input file: '{}'".format(newinputfile)) diff --git a/tools/inputfile_old2new.py b/tools/inputfile_old2new.py new file mode 100644 index 00000000..9ca78db3 --- /dev/null +++ b/tools/inputfile_old2new.py @@ -0,0 +1,264 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import argparse + +from gprMax.exceptions import CmdInputError + +"""Converts old to new style input files.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Converts old style input file to new style input file.', usage='cd gprMax; python -m tools.inputfile_new2old inputfile') +parser.add_argument('inputfile', help='name of input file including path') +args = parser.parse_args() + +inputfile = args.inputfile + +with open(inputfile, 'r') as f: + # Strip out any newline characters and comments that must begin with double hashes + inputlines = [line.rstrip() for line in f] + +# New file name base +try: + newfile = inputfile.split('.')[0] +except: + pass +newfile += '_newstyle' + +print("Attempting to convert inputfile '{}' to use new syntax...\n".format(inputfile)) + +txs = [] +badwaveforms = ['gaussiandot', 'gaussiandotdot'] +voltagesources = [] +hertziandipoles = [] + +lindex = 0 +while(lindex < len(inputlines)): + + if inputlines[lindex].startswith('#') and not inputlines[lindex].startswith('##'): + cmd = inputlines[lindex].split(':') + cmdname = cmd[0].lower() + params = cmd[1].split() + + if cmdname == '#domain': + domain = (float(params[0]), float(params[1]), float(params[2])) + lindex += 1 + + elif cmdname == '#dx_dy_dz': + dx_dy_dz = (float(params[0]), float(params[1]), float(params[2])) + lindex += 1 + + elif cmdname == '#time_window': + params = params[0].lower() + if '.' in params[0] or 'e' in params[0].lower(): + timewindow = float(params[0]) + else: + timewindow = int(params[0]) + lindex += 1 + + elif cmdname == '#num_of_procs': + # Syntax of old command: #num_of_procs: nthreads + replacement = '#num_threads: {}'.format(params[0]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#tx': + txs.append(inputlines[lindex]) + lindex += 1 + + elif cmdname == '#voltage_source': + voltagesources.append(inputlines[lindex]) + lindex += 1 + + elif cmdname == '#hertzian_dipole': + hertziandipoles.append(inputlines[lindex]) + lindex += 1 + + elif cmdname == '#medium': + # Syntax of old command: #medium: e_rs e_inf tau sig_e mu_r sig_m ID + replacement = '#material: {} {} {} {} {}'.format(params[0], params[3], params[4], params[5], params[6]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + if float(params[1]) > 0: + replacement = '#add_dispersion_debye: 1 {} {} {}'.format(float(params[0]) - float(params[1]), params[2], params[6]) + print("Command '{}' added.".format(replacement)) + inputlines.insert(lindex + 1, replacement) + lindex += 1 + + elif cmdname == '#triangle': + # Syntax of old command: #triangle: x1 y1 z1 x2 y2 z2 x3 y3 z3 ID + replacement = '#triangle: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], 0, params[9]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#wedge': + # Syntax of old command: #wedge: x1 y1 z1 x2 y2 z2 x3 y3 z3 thickness ID + replacement = '#triangle: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#bowtie': + print("Command '{}', is no longer supported. You can create the bowtie shape using two triangle commands.".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + + elif cmdname == '#cylinder': + # Syntax of old command: #cylinder: axis axis_start axis_stop f1 f2 radius ID + if params[0] == 'x': + replacement = '#cylinder: {} {} {} {} {} {} {} {} {} {} {}'.format(params[1], params[3], params[4], params[2], params[3], params[4], params[5], params[6]) + elif params[0] == 'y': + replacement = '#cylinder: {} {} {} {} {} {} {} {} {} {} {}'.format(params[3], params[1], params[4], params[3], params[2], params[4], params[5], params[6]) + elif params[0] =='z': + replacement = '#cylinder: {} {} {} {} {} {} {} {} {} {} {}'.format(params[3], params[4], params[1], params[3], params[4], params[2], params[5], params[6]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#cylinder_new': + # Syntax of old command: #cylinder_new: x1 y1 z1 x2 y2 z2 radius ID + replacement = '#cylinder: {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#cylindrical_segment': + print("Command '{}' has been removed as it is no longer supported. You can create a cylindrical segment by using a #box to cut through a #cylinder.".format(inputlines[lindex])) + inputlines.pop(lindex) + + elif cmdname == '#media_file': + print("Command '{}' has is no longer supported. Please include your materials using the #material command directly in the input file.".format(inputlines[lindex])) + inputlines.pop(lindex) + + elif cmdname == '#pml_layers': + # Syntax of old command: #pml_layers: num_layers + replacement = '#pml_cells: {}'.format(params[0]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname in ['#abc_order', '#abc_type', 'abc_optimisation_angles', '#abc_mixing_parameters', '#abc_stability_factors']: + print("Command '{}' has been removed as Higdon Absorbing Boundary Conditions (ABC) are no longer supported. The default ABC is the (better performing) Perfectly Matched Layer (PML).".format(inputlines[lindex])) + inputlines.pop(lindex) + + elif cmdname == '#analysis': + # Syntax of old command: #analysis: num_model_runs outputfile outputfiletype + if int(params[0]) > 1: + extra = " To run a model multiple times use the command line option -n, e.g. gprMax {} -n {}".format(inputfile, int(params[0])) + else: + extra = '' + print("Command '{}' has been removed as it is no longer required.{}".format(inputlines[lindex], extra)) + inputlines.pop(lindex) + + elif cmdname in ['#end_analysis', '#number_of_media', '#nips_number']: + print("Command '{}' has been removed as it is no longer required.".format(inputlines[lindex])) + inputlines.pop(lindex) + + elif cmdname == '#snapshot': + # Syntax of old command: #snapshot: x1 y1 z1 x2 y2 z2 dx dy dz time filename type + replacement = '#snapshot: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#geometry_file': + # Syntax of old command: #geometry_file: filename + if params[0].endswith('.geo'): + params = params[0].split('.') + replacement = '#geometry_view: 0 0 0 {} {} {} {} {} {} {} n'.format(domain[0], domain[1], domain[2], dx_dy_dz[0], dx_dy_dz[1], dx_dy_dz[2], params[0]) + print("Command '{}', replaced with '{}'. This is a geometry view of the entire domain, sampled at the spatial resolution of the model, using the per Yee cell option (n). You may want to consider taking a smaller geometry view or using a coarser sampling. You may also want to use the per Yee cell edge option (f) to view finer details.".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname == '#geometry_vtk': + # Syntax of old command: #geometry_vtk: x1 y1 z1 x2 y2 z2 dx dy dz filename type + replacement = '#geometry_view: {} {} {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8], params[9], params[10]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) + lindex += 1 + + elif cmdname in ['#transmission_line', '#plane_wave', '#thin_wire', '#huygens_surface']: + raise CmdInputError("Command '{}' has not yet implemented in the new version of gprMax. For now please continue to use the old version.".format(inputlines[lindex])) + + else: + lindex += 1 + + else: + lindex +=1 + +# Convert separate #hertzian_dipole and associated #tx to #waveform and #hertzian_dipole +for source in hertziandipoles: + params = source.split() + if params[3] is badwaveforms: + raise CmdInputError("Waveform types {} are not compatible between new and old versions of gprMax.".format(''.join(badwaveforms))) + elif params[3] == 'ricker': + params[3] = 'gaussiandotnorm' + waveform = '#waveform: {} {} {} {}'.format(params[3], params[1], params[2], params[4]) + tx = next(tx for tx in txs if tx.split()[5] == params[4]) + hertziantx = tx.split() + if float(hertziantx[6]) > 0 or float(hertziantx[7]) != timewindow: + hertzian = '#hertzian_dipole: {} {} {} {} {} {} {}'.format(hertziantx[1], hertziantx[2], hertziantx[3], hertziantx[4], hertziantx[5], hertziantx[6], hertziantx[7]) + else: + hertzian = '#hertzian_dipole: {} {} {} {} {}'.format(hertziantx[1], hertziantx[2], hertziantx[3], hertziantx[4], hertziantx[5]) + + print("Commands '{}' and '{}', replaced with '{}' and '{}'".format(source, tx, waveform, hertzian)) + inputlines.remove(source) + inputlines.remove(tx) + inputlines.append(waveform) + inputlines.append(hertzian) + +# Convert separate #voltage_source and associated #tx to #waveform and #voltage_source +for source in voltagesources: + params = source.split() + if params[3] is badwaveforms: + raise CmdInputError("Waveform types {} are not compatible between new and old versions of gprMax.".format(''.join(badwaveforms))) + elif params[3] == 'ricker': + params[3] = 'gaussiandotnorm' + waveform = '#waveform: {} {} {} {}'.format(params[3], params[1], params[2], params[5]) + tx = next(tx for tx in txs if tx.split()[5] == params[5]) + voltagesourcetx = tx.split() + if float(voltagesourcetx[6]) > 0 or float(voltagesourcetx[7]) != timewindow: + voltagesource = '#voltage_source: {} {} {} {} {} {} {} {}'.format(voltagesourcetx[1], voltagesourcetx[2], voltagesourcetx[3], voltagesourcetx[4], params[4], voltagesourcetx[5], voltagesourcetx[6], voltagesourcetx[7]) + else: + voltagesource = '#voltage_source: {} {} {} {} {} {}'.format(voltagesourcetx[1], voltagesourcetx[2], voltagesourcetx[3], voltagesourcetx[4], params[4], voltagesourcetx[5]) + + print("Commands '{}' and '{}', replaced with '{}' and '{}'".format(source, tx, waveform, voltagesource)) + inputlines.remove(source) + inputlines.remove(tx) + inputlines.append(waveform) + inputlines.append(voltagesource) + +# Write new input file +newinputfile = newfile + '.in' + +with open(newinputfile, 'w') as f: + for line in inputlines: + f.write('{}\n'.format(line)) + +print("\nWritten new input file: '{}'".format(newinputfile)) diff --git a/tools/outputfile_old2hdf5.py b/tools/outputfile_old2hdf5.py new file mode 100644 index 00000000..7c6337ec --- /dev/null +++ b/tools/outputfile_old2hdf5.py @@ -0,0 +1,159 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, struct, argparse +import numpy as np + +from gprMax.grid import FDTDGrid +from gprMax.receivers import Rx +from gprMax.fields_output import prepare_output_file, write_output + +"""Converts old output file to new HDF5 format.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Converts old output file to new HDF5 format.', usage='cd gprMax; python -m tools.outputfile_old2hdf5 outputfile') +parser.add_argument('outputfile', help='name of output file including path') +args = parser.parse_args() + +outputfile = args.outputfile +G = FDTDGrid() + +print("Reading: '{}'".format(outputfile)) + +with open(outputfile, 'rb') as f: + # Get information from file header + f.read(2) + filetype, = struct.unpack('h', f.read(2)) + myshort, = struct.unpack('h', f.read(2)) + myfloat, = struct.unpack('h', f.read(2)) + titlelength, = struct.unpack('h', f.read(2)) + sourcelength, = struct.unpack('h', f.read(2)) + medialength, = struct.unpack('h', f.read(2)) + reserved, = struct.unpack('h', f.read(2)) + G.title = '' + for c in range(titlelength): + tmp, = struct.unpack('c', f.read(1)) + G.title += tmp.decode('utf-8') + G.iterations, = struct.unpack('f', f.read(4)) + G.iterations = int(G.iterations) + G.dx, = struct.unpack('f', f.read(4)) + G.dy, = struct.unpack('f', f.read(4)) + G.dz, = struct.unpack('f', f.read(4)) + G.dt, = struct.unpack('f', f.read(4)) + nsteps, = struct.unpack('h', f.read(2)) + G.txstepx, = struct.unpack('h', f.read(2)) + G.txstepy, = struct.unpack('h', f.read(2)) + G.txstepz, = struct.unpack('h', f.read(2)) + G.rxstepx, = struct.unpack('h', f.read(2)) + G.rxstepy, = struct.unpack('h', f.read(2)) + G.rxstepz, = struct.unpack('h', f.read(2)) + ntx, = struct.unpack('h', f.read(2)) + nrx, = struct.unpack('h', f.read(2)) + nrxbox, = struct.unpack('h', f.read(2)) + + # Display some basic information + print('Model title: {}'.format(G.title)) + print('Spatial discretisation: {:.3f} x {:.3f} x {:.3f} m'.format(G.dx, G.dy, G.dz)) + print('Time step: {:.3e} secs'.format(G.dt)) + print('Time window: {:.3e} secs ({} iterations)'.format(G.iterations * G.dt, G.iterations)) + + # txs + for tx in range(ntx): + polarisation, = struct.unpack('c', f.read(1)) + x, = struct.unpack('h', f.read(2)) + y, = struct.unpack('h', f.read(2)) + z, = struct.unpack('h', f.read(2)) + for c in range(sourcelength): + tmp, = struct.unpack('c', f.read(1)) + start, = struct.unpack('f', f.read(4)) + stop, = struct.unpack('f', f.read(4)) + # Only want transmitter position information so store in a Rx class for ease + t = Rx(positionx=x, positiony=y, positionz=z) + G.txs.append(t) + + # rxs + for r in range(nrx): + x, = struct.unpack('h', f.read(2)) + y, = struct.unpack('h', f.read(2)) + z, = struct.unpack('h', f.read(2)) + r = Rx(positionx=x, positiony=y, positionz=z) + G.rxs.append(r) + + # rxboxes + for rxbox in range(nrxbox): + nrxs, = struct.unpack('h', f.read(2)) + for rx in range(nrxs): + x, = struct.unpack('h', f.read(2)) + y, = struct.unpack('h', f.read(2)) + z, = struct.unpack('h', f.read(2)) + r = Rx(positionx=x, positiony=y, positionz=z) + G.rxs.append(r) + + # Fields + fieldsdata = np.fromfile(f, dtype=np.float32) + ex = np.reshape(fieldsdata[0::9], (len(G.rxs), G.iterations, nsteps), order='F') + ey = np.reshape(fieldsdata[1::9], (len(G.rxs), G.iterations, nsteps), order='F') + ez = np.reshape(fieldsdata[2::9], (len(G.rxs), G.iterations, nsteps), order='F') + hx = np.reshape(fieldsdata[3::9], (len(G.rxs), G.iterations, nsteps), order='F') + hy = np.reshape(fieldsdata[4::9], (len(G.rxs), G.iterations, nsteps), order='F') + hz = np.reshape(fieldsdata[5::9], (len(G.rxs), G.iterations, nsteps), order='F') + ix = np.reshape(fieldsdata[6::9], (len(G.rxs), G.iterations, nsteps), order='F') + iy = np.reshape(fieldsdata[7::9], (len(G.rxs), G.iterations, nsteps), order='F') + iz = np.reshape(fieldsdata[8::9], (len(G.rxs), G.iterations, nsteps), order='F') + + if nsteps == 1: + ex = np.transpose(ex) + ey = np.transpose(ey) + ez = np.transpose(ez) + hx = np.transpose(hx) + hy = np.transpose(hy) + hz = np.transpose(hz) + ix = np.transpose(ix) + iy = np.transpose(iy) + iz = np.transpose(iz) + else: + for i in range(len(G.rxs)): + ex[:,i,:] = ex[i,:,:] + ey[:,i,:] = ey[i,:,:] + ez[:,i,:] = ez[i,:,:] + hx[:,i,:] = hx[i,:,:] + hy[:,i,:] = hy[i,:,:] + hz[:,i,:] = hz[i,:,:] + ix[:,i,:] = ix[i,:,:] + iy[:,i,:] = iy[i,:,:] + iz[:,i,:] = iz[i,:,:] + + # Remove any singleton dimensions + ex = np.squeeze(ex) + ey = np.squeeze(ey) + ez = np.squeeze(ez) + hx = np.squeeze(hx) + hy = np.squeeze(hy) + hz = np.squeeze(hz) + ix = np.squeeze(ix) + iy = np.squeeze(iy) + iz = np.squeeze(iz) + +# Create new HDF5 outputfile +newoutputfile = os.path.splitext(outputfile) +newoutputfile = newoutputfile[0] + '_hdf5.out' +f = prepare_output_file(newoutputfile, G) +write_output(f, np.s_[:], ex, ey, ez, hx, hy, hz, G) + +print("Written: '{}'".format(newoutputfile)) + diff --git a/tools/outputfiles_mergehdf5.py b/tools/outputfiles_mergehdf5.py new file mode 100644 index 00000000..6634a9d9 --- /dev/null +++ b/tools/outputfiles_mergehdf5.py @@ -0,0 +1,71 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, argparse +import h5py +import numpy as np + +"""Merges traces (A-scans) from multiple output files into one new file, then removes the series of output files.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Merges traces (A-scans) from multiple output files into one new file, then removes the series of output files.', usage='cd gprMax; python -m tools.outputfiles_mergehdf5 basefilename modelruns') +parser.add_argument('basefilename', help='base name of output file series including path') +parser.add_argument('modelruns', type=int, help='number of model runs, i.e. number of output files to merge') +args = parser.parse_args() + +basefilename = args.basefilename +modelruns = args.modelruns +outputfile = basefilename + '_all.out' +path = '/rxs/rx1' + +# Combined output file +fout = h5py.File(outputfile, 'w') + +# Add positional data for rxs +for rx in range(modelruns): + fin = h5py.File(basefilename + str(rx + 1) + '.out', 'r') + if rx == 0: + fout.attrs['Iterations'] = fin.attrs['Iterations'] + fout.attrs['dt'] = fin.attrs['dt'] + fields = fout.create_group(path) + fields['Ex'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + fields['Ey'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + fields['Ez'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + fields['Hx'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + fields['Hy'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + fields['Hz'] = np.zeros((fout.attrs['Iterations'], modelruns), dtype=fin[path + '/Ex'].dtype) + + fields[path + '/Ex'][:,rx] = fin[path + '/Ex'][:] + fields[path + '/Ey'][:,rx] = fin[path + '/Ey'][:] + fields[path + '/Ez'][:,rx] = fin[path + '/Ez'][:] + fields[path + '/Hx'][:,rx] = fin[path + '/Hx'][:] + fields[path + '/Hy'][:,rx] = fin[path + '/Hy'][:] + fields[path + '/Hz'][:,rx] = fin[path + '/Hz'][:] + fin.close() + +fout.close() + +check = input('Do you want to remove the multiple individual output files? [y] or n:') +if not check or check == 'y': + for rx in range(modelruns): + file = basefilename + str(rx + 1) + '.out' + os.remove(file) + + + + diff --git a/tools/plot_fields.py b/tools/plot_fields.py new file mode 100644 index 00000000..7355a332 --- /dev/null +++ b/tools/plot_fields.py @@ -0,0 +1,55 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import numpy as np +import matplotlib.pyplot as plt + +def plot_Ascan(figurename, time, Ex, Ey, Ez, Hx, Hy, Hz): + """Plot electric and magnetic fields. + + Args: + figurename (str): Name of figure for titlebar + time (float): Array containing time + Ex, Ey, Ez, Hx, Hy, Hz (float): Arrays containing electric and magnetic field values + + """ + + fig, ((ax1, ax2), (ax3, ax4), (ax5, ax6)) = plt.subplots(nrows=3, ncols=2, sharex=False, sharey='col', subplot_kw=dict(xlabel='Time [ns]'), num=figurename, figsize=(20, 10), facecolor='w', edgecolor='w') + ax1.plot(time, Ex,'r', lw=2, label='Ex') + ax3.plot(time, Ey,'r', lw=2, label='Ey') + ax5.plot(time, Ez,'r', lw=2, label='Ez') + ax2.plot(time, Hx,'b', lw=2, label='Hx') + ax4.plot(time, Hy,'b', lw=2, label='Hy') + ax6.plot(time, Hz,'b', lw=2, label='Hz') + + # Make subplots close to each other +# fig.subplots_adjust(hspace=0) + + # Set ylabels + ylabels = ['$E_x$, field strength [V/m]', '$H_x$, field strength [A/m]', '$E_y$, field strength [V/m]', '$H_y$, field strength [A/m]', '$E_z$, field strength [V/m]', '$H_z$, field strength [A/m]'] + [ax.set_ylabel(ylabels[index]) for index, ax in enumerate(fig.axes)] + + # Turn on grid + [ax.grid() for ax in fig.axes] + + # Hide x ticks for all but bottom plots +# plt.setp([ax.get_xticklabels() for ax in fig.axes[:-2]], visible=False) + + return fig, plt + + diff --git a/tools/plot_hdf5_Ascan.py b/tools/plot_hdf5_Ascan.py new file mode 100644 index 00000000..44fcaf8b --- /dev/null +++ b/tools/plot_hdf5_Ascan.py @@ -0,0 +1,49 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, argparse +import h5py +import numpy as np +from .plot_fields import plot_Ascan + +"""Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Plots electric and magnetic fields from all receiver points in the given output file. Each receiver point is plotted in a new figure window.', usage='cd gprMax; python -m tools.plot_hdf5_Ascan outputfile') +parser.add_argument('outputfile', help='name of output file including path') +args = parser.parse_args() + +file = args.outputfile +f = h5py.File(file, 'r') +nrx = f.attrs['nrx'] +time = np.arange(0, f.attrs['dt'] * f.attrs['Iterations'], f.attrs['dt']) +time = time / 1E-9 + +for rx in range(1, nrx + 1): + path = '/rxs/rx' + str(rx) + '/' + Ex = f[path + 'Ex'][:] + Ey = f[path + 'Ey'][:] + Ez = f[path + 'Ez'][:] + Hx = f[path + 'Hx'][:] + Hy = f[path + 'Hy'][:] + Hz = f[path + 'Hz'][:] + fig, plt = plot_Ascan('rx' + str(rx), time, Ex, Ey, Ez, Hx, Hy, Hz) + #fig.savefig(os.path.splitext(os.path.abspath(file))[0] + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) + plt.show() + +f.close() \ No newline at end of file diff --git a/tools/plot_hdf5_Bscan.py b/tools/plot_hdf5_Bscan.py new file mode 100644 index 00000000..b506b48b --- /dev/null +++ b/tools/plot_hdf5_Bscan.py @@ -0,0 +1,49 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, argparse +import h5py +import numpy as np +import matplotlib.pyplot as plt + +"""Plots B-scan.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Plots B-scan.', usage='cd gprMax; python -m tools.plot_hdf5_Bscan outputfile field') +parser.add_argument('outputfile', help='name of output file including path') +parser.add_argument('field', help='name of field to be plotted, i.e. Ex, Ey, Ez') +args = parser.parse_args() + +file = args.outputfile +field = args.field +path = '/rxs/rx1' + +f = h5py.File(file, 'r') +data = f[path + '/' + field] + +# Plot B-scan image +fig = plt.figure(num=file, figsize=(20, 10), facecolor='w', edgecolor='w') +plt.imshow(data, extent=[0, data.shape[1], data.shape[0]*f.attrs['dt'], 0], interpolation='nearest', aspect='auto', cmap='seismic', vmin=-np.amax(np.abs(data)), vmax=np.amax(np.abs(data))) +plt.xlabel('Trace number') +plt.ylabel('Time [s]') +plt.grid() +cb = plt.colorbar() +cb.set_label('Field strength [V/m]') +plt.show() +#fig.savefig(os.path.splitext(os.path.abspath(file))[0] + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) +f.close() diff --git a/tools/plot_waveform.py b/tools/plot_waveform.py new file mode 100644 index 00000000..038cb66e --- /dev/null +++ b/tools/plot_waveform.py @@ -0,0 +1,78 @@ +# Copyright (C) 2015: The University of Edinburgh +# Authors: Craig Warren and Antonis Giannopoulos +# +# This file is part of gprMax. +# +# gprMax is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# gprMax is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gprMax. If not, see . + +import os, argparse +import numpy as np +import matplotlib.pyplot as plt + +from gprMax.waveforms import Waveform + + +"""Plot waveforms that can be used for sources.""" + +# Parse command line arguments +parser = argparse.ArgumentParser(description='Plot waveforms that can be used for sources.', usage='cd gprMax; python -m tools.plot_waveform type amp freq timewindow dt') +parser.add_argument('type', help='type of waveform, e.g. gaussian, ricker etc...') +parser.add_argument('amp', type=float, help='amplitude of waveform') +parser.add_argument('freq', type=float, help='centre frequency of waveform') +parser.add_argument('timewindow', type=float, help='time window to view waveform') +parser.add_argument('dt', type=float, help='time step to view waveform') +args = parser.parse_args() + +w = Waveform() +w.type = args.type +w.amp = args.amp +w.freq = args.freq +timewindow = args.timewindow +dt = args.dt + +time = np.arange(0, timewindow, dt) +waveform = np.zeros(len(time)) +timeiter = np.nditer(time, flags=['c_index']) + +while not timeiter.finished: + waveform[timeiter.index] = w.calculate_value(timeiter[0], dt) + timeiter.iternext() + +# Calculate frequency spectra of waveform +fs = 1/dt +power = 20*np.log10(np.abs(np.fft.rfft(waveform))) +f = np.linspace(0, fs/2, len(power)) + +# Shift powers so any spectra with negative DC component will start at zero +power -= np.amax(power) + +# Set plotting range to 4 * centre frequency +pltrange = np.where(f > (4 * w.freq))[0][0] + +# Plot waveform +fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, num=w.type, figsize=(20, 10), facecolor='w', edgecolor='w') +ax1.plot(time, waveform,'r', lw=2) +ax1.set_xlabel('Time [ns]') +ax1.set_ylabel('Amplitude') +[label.set_bbox(dict(facecolor='white', edgecolor='None', alpha=0.65 )) for label in ax1.get_xticklabels() + ax1.get_yticklabels()] + +# Plot frequency spectra +ax2.stem(f[0:pltrange]/1e9, power[0:pltrange],'b', lw=2) +ax2.set_xlabel('Frequency [GHz]') +ax2.set_ylabel('Power [dB]') +[ax.grid() for ax in fig.axes] # Turn on grid +plt.show() + +# Save a PDF of the figure +#fig.savefig(os.path.dirname(os.path.abspath(__file__)) + os.sep + w.type + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) \ No newline at end of file diff --git a/user_libs/__init__.py b/user_libs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/user_libs/antennas.py b/user_libs/antennas.py new file mode 100644 index 00000000..0a16bc85 --- /dev/null +++ b/user_libs/antennas.py @@ -0,0 +1,344 @@ +# Copyright (C) 2015, Craig Warren +# +# This module is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. +# To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/. +# +# Please use the attribution at http://dx.doi.org/10.1190/1.3548506 + +from gprMax.exceptions import CmdInputError + + +def antenna_like_GSSI_1500(x, y, z, resolution=0.001): + """Inserts a description of an antenna similar to the GSSI 1.5GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 170mm x 108mm x 45mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field. + + Args: + x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. + resolution (float): Spatial resolution for the antenna model. + """ + + # Antenna geometry properties + casesize = (0.170, 0.108, 0.043) + casethickness = 0.002 + shieldthickness = 0.002 + foamsurroundthickness = 0.003 + pcbthickness = 0.002 + skidthickness = 0.004 + bowtiebase = 0.022 + bowtieheight = 0.014 + patchheight = 0.015 + + excitationfreq = 1.5e9 # GHz + # excitationfreq = 1.71e9 # Value from http://hdl.handle.net/1842/4074 + sourceresistance = 50 # Ohms + # sourceresistance = 4 # Value from http://hdl.handle.net/1842/4074 + + x = x - (casesize[0] / 2) + y = y - (casesize[1] / 2) + + # Coordinates of source excitation point in antenna + tx = x + 0.114, y + 0.053, z + skidthickness + + if resolution == 0.001: + dx = 0.001 + dy = 0.001 + dz = 0.001 + elif resolution == 0.002: + dx = 0.002 + dy = 0.002 + dz = 0.002 + foamsurroundthickness = 0.002 + patchheight = 0.016 + tx = x + 0.112, y + 0.052, z + skidthickness + else: + raise CmdInputError('This antenna module can only be used with a spatial discretisation of 1mm or 2mm') + + # Material definitions + print('#material: 1.7 0.59 1.0 0.0 absorber') + # print('#material: 1.58 0.428 1.0 0.0 absorber') # Value from http://hdl.handle.net/1842/4074 + print('#material: 3.0 0.0 1.0 0.0 pcb') + print('#material: 2.35 0.0 1.0 0.0 hdpe') + + # Antenna geometry + # Plastic case + print('#box: {} {} {} {} {} {} hdpe'.format(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2])) + print('#box: {} {} {} {} {} {} free_space'.format(x + casethickness, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness)) + + # Metallic enclosure + print('#box: {} {} {} {} {} {} pec'.format(x + 0.025, y + casethickness, z + skidthickness, x + casesize[0] - 0.025, y + casesize[1] - casethickness, z + skidthickness + 0.027)) + + # Absorber material, and foam (modelled as PCB material) around edge of absorber + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.025 + shieldthickness, y + casethickness + shieldthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001)) + print('#box: {} {} {} {} {} {} absorber'.format(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.025 + shieldthickness + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness)) + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.086, y + casethickness + shieldthickness, z + skidthickness, x + 0.086 + 0.057, y + casesize[1] - casethickness - shieldthickness, z + skidthickness + 0.027 - shieldthickness - 0.001)) + print('#box: {} {} {} {} {} {} absorber'.format(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + 0.027 - shieldthickness)) + + # PCB + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.025 + shieldthickness + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 - shieldthickness - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness)) + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.086 + foamsurroundthickness, y + casethickness + shieldthickness + foamsurroundthickness, z + skidthickness, x + 0.086 + 0.057 - foamsurroundthickness, y + casesize[1] - casethickness - shieldthickness - foamsurroundthickness, z + skidthickness + pcbthickness)) + + # PCB components + if resolution == 0.001: + # Rx & Tx bowties + a = 0 + b = 0 + while b < 13: + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness)) + b += 1 + if a == 2 or a == 4 or a == 7: + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.045 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.045 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.065 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.104 + a*dx, y + 0.039 + b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.039 + b*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.104 + a*dx, y + 0.067 - b*dx, z + skidthickness, x + 0.124 - a*dx, y + 0.067 - b*dx + dy, z + skidthickness)) + b += 1 + a += 1 + # Rx extension section (upper y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.044, y + 0.068, z + skidthickness, x + 0.044 + bowtiebase, y + 0.068 + patchheight, z + skidthickness)) + # Tx extension section (upper y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.103, y + 0.068, z + skidthickness, x + 0.103 + bowtiebase, y + 0.068 + patchheight, z + skidthickness)) + + # Edges that represent wire between bowtie halves in 1mm model + print('#edge: {} {} {} {} {} {} pec'.format(tx[0] - 0.059, tx[1] - dy, tx[2], tx[0] - 0.059, tx[1], tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0] - 0.059, tx[1] + dy, tx[2], tx[0] - 0.059, tx[1] + 0.002, tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0], tx[1] - dy, tx[2], tx[0], tx[1], tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0], tx[1] + dz, tx[2], tx[0], tx[1] + 0.002, tx[2])) + + elif resolution == 0.002: + # Rx & Tx bowties + for a in range(0,6): + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.044 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.044 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.066 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.103 + a*dx, y + 0.040 + a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.040 + a*dx + dy, z + skidthickness)) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.103 + a*dx, y + 0.064 - a*dx, z + skidthickness, x + 0.125 - a*dx, y + 0.064 - a*dx + dy, z + skidthickness)) + # Rx extension section (upper y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.044, y + 0.066, z + skidthickness, x + 0.044 + bowtiebase, y + 0.066 + patchheight, z + skidthickness)) + # Tx extension section (upper y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.103, y + 0.066, z + skidthickness, x + 0.103 + bowtiebase, y + 0.066 + patchheight, z + skidthickness)) + + # Rx extension section (lower y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.044, y + 0.024, z + skidthickness, x + 0.044 + bowtiebase, y + 0.024 + patchheight, z + skidthickness)) + # Tx extension section (lower y) + print('#plate: {} {} {} {} {} {} pec'.format(x + 0.103, y + 0.024, z + skidthickness, x + 0.103 + bowtiebase, y + 0.024 + patchheight, z + skidthickness)) + + # Skid + print('#box: {} {} {} {} {} {} hdpe'.format(x, y, z, x + casesize[0], y + casesize[1], z + skidthickness)) + + # Geometry views + #print('#geometry_view: {} {} {} {} {} {} {} {} {} antenna_like_GSSI_1500 n'.format(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + skidthickness + casesize[2] + dz, dx, dy, dz)) + #print('#geometry_view: {} {} {} {} {} {} {} {} {} antenna_like_GSSI_1500_pcb f'.format(x, y, z, x + casesize[0], y + casesize[1], z + 0.010, dx, dy, dz)) + + # Excitation + print('#waveform: gaussian 1.0 {} myGaussian'.format(excitationfreq)) + print('#voltage_source: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) + + # Output point - transmitter bowtie + #print('#rx: {} {} {}'.format(tx[0], tx[1], tx[2])) + # Output point - receiver bowtie + print('#rx: {} {} {}'.format(tx[0] - 0.059, tx[1], tx[2])) + + + +def antenna_like_MALA_1200(x, y, z, resolution=0.001): + """Inserts a description of an antenna similar to the MALA 1.2GHz antenna. Can be used with 1mm (default) or 2mm spatial resolution. The external dimensions of the antenna are 184mm x 109mm x 46mm. One output point is defined between the arms of the receiever bowtie. The bowties are aligned with the y axis so the output is the y component of the electric field. + + Args: + x, y, z (float): Coordinates of a location in the model to insert the antenna. Coordinates are relative to the geometric centre of the antenna in the x-y plane and the bottom of the antenna skid in the z direction. + resolution (float): Spatial resolution for the antenna model. + """ + + # Antenna geometry properties + casesize = (0.184, 0.109, 0.040) + casethickness = 0.002 + cavitysize = (0.062, 0.062, 0.037) + cavitythickness = 0.001 + pcbthickness = 0.002 + polypropylenethickness = 0.003; + hdpethickness = 0.003; + skidthickness = 0.006 + bowtieheight = 0.025 + + excitationfreq = 0.978e9 # GHz + sourceresistance = 1000 # Ohms + + x = x - (casesize[0] / 2) + y = y - (casesize[1] / 2) + + # Coordinates of source excitation point in antenna + tx = x + 0.063, y + 0.052, z + skidthickness + + if resolution == 0.001: + dx = 0.001 + dy = 0.001 + dz = 0.001 + elif resolution == 0.002: + dx = 0.002 + dy = 0.002 + dz = 0.002 + cavitysize = (0.062, 0.062, 0.036) + cavitythickness = 0.002 + polypropylenethickness = 0.002; + hdpethickness = 0.004; + bowtieheight = 0.024 + tx = x + 0.062, y + 0.052, z + skidthickness + else: + raise CmdInputError('This antenna module can only be used with a spatial resolution of 1mm or 2mm') + + # SMD resistors - 3 on each Tx & Rx bowtie arm + txres = 470 # Ohms + txrescellupper = txres / 3 # Resistor over 3 cells + txsigupper = ((1 / txrescellupper) * (dy / (dx * dz))) / 2 # Divide by number of parallel edges per resistor + txrescelllower = txres / 4 # Resistor over 4 cells + txsiglower = ((1 / txrescelllower) * (dy / (dx * dz))) / 2 # Divide by number of parallel edges per resistor + rxres = 150 # Ohms + rxrescellupper = rxres / 3 # Resistor over 3 cells + rxsigupper = ((1 / rxrescellupper) * (dy / (dx * dz))) / 2 # Divide by number of parallel edges per resistor + rxrescelllower = rxres / 4 # Resistor over 4 cells + rxsiglower = ((1 / rxrescelllower) * (dy / (dx * dz))) / 2 # Divide by number of parallel edges per resistor + + # Material definitions + print('#material: 6.49 0.252 1.0 0.0 absorber') + print('#material: 3.0 0.0 1.0 0.0 pcb') + print('#material: 2.35 0.0 1.0 0.0 hdpe') + print('#material: 2.26 0.0 1.0 0.0 polypropylene') + print('#material: 3.0 {:.3f} 1.0 0.0 txreslower'.format(txsiglower)) + print('#material: 3.0 {:.3f} 1.0 0.0 txresupper'.format(txsigupper)) + print('#material: 3.0 {:.3f} 1.0 0.0 rxreslower'.format(rxsiglower)) + print('#material: 3.0 {:.3f} 1.0 0.0 rxresupper'.format(rxsigupper)) + + # Antenna geometry + # Shield - metallic enclosure + print('#box: {} {} {} {} {} {} pec'.format(x, y, z + skidthickness, x + casesize[0], y + casesize[1], z + skidthickness + casesize[2])) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casethickness)) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casethickness)) + + # Absorber material + print('#box: {} {} {} {} {} {} absorber'.format(x + 0.020, y + casethickness, z + skidthickness, x + 0.100, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness)) + print('#box: {} {} {} {} {} {} absorber'.format(x + 0.100, y + casethickness, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - casethickness, z + skidthickness + casesize[2] - casethickness)) + + # Shield - cylindrical sections + print('#cylinder: {} {} {} {} {} {} {} pec'.format(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008)) + print('#cylinder: {} {} {} {} {} {} {} pec'.format(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008)) + print('#cylinder: {} {} {} {} {} {} {} pec'.format(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.008)) + print('#cylinder: {} {} {} {} {} {} {} pec'.format(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.008)) + print('#cylinder: {} {} {} {} {} {} {} free_space'.format(x + 0.055, y + casesize[1] - 0.008, z + skidthickness, x + 0.055, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007)) + print('#cylinder: {} {} {} {} {} {} {} free_space'.format(x + 0.055, y + 0.008, z + skidthickness, x + 0.055, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007)) + print('#cylinder: {} {} {} {} {} {} {} free_space'.format(x + 0.147, y + casesize[1] - 0.008, z + skidthickness, x + 0.147, y + casesize[1] - 0.008, z + skidthickness + casesize[2] - casethickness, 0.007)) + print('#cylinder: {} {} {} {} {} {} {} free_space'.format(x + 0.147, y + 0.008, z + skidthickness, x + 0.147, y + 0.008, z + skidthickness + casesize[2] - casethickness, 0.007)) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.054, y + casesize[1] - 0.016, z + skidthickness, x + 0.056, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness)) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.054, y + 0.014, z + skidthickness, x + 0.056, y + 0.016, z + skidthickness + casesize[2] - casethickness)) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.146, y + casesize[1] - 0.016, z + skidthickness, x + 0.148, y + casesize[1] - 0.014, z + skidthickness + casesize[2] - casethickness)) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.146, y + 0.014, z + skidthickness, x + 0.148, y + 0.016, z + skidthickness + casesize[2] - casethickness)) + + # PCB + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.020, y + 0.018, z + skidthickness, x + casesize[0] - casethickness, y + casesize[1] - 0.018, z + skidthickness + pcbthickness)) + + # Shield - Tx & Rx cavities + print('#box: {} {} {} {} {} {} pec'.format(x + 0.032, y + 0.022, z + skidthickness, x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2])) + print('#box: {} {} {} {} {} {} absorber'.format(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2])) + print('#box: {} {} {} {} {} {} pec'.format(x + 0.108, y + 0.022, z + skidthickness, x + 0.108 + cavitysize[0], y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2])) + print('#box: {} {} {} {} {} {} free_space'.format(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + cavitysize[2])) + + # Shield - Tx & Rx cavities - joining strips + print('#box: {} {} {} {} {} {} pec'.format(x + 0.032 + cavitysize[0], y + 0.022 + cavitysize[1] - 0.006, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + cavitysize[1], z + skidthickness + cavitysize[2])) + print('#box: {} {} {} {} {} {} pec'.format(x + 0.032 + cavitysize[0], y + 0.022, z + skidthickness + cavitysize[2] - casethickness, x + 0.108, y + 0.022 + 0.006, z + skidthickness + cavitysize[2])) + + # PCB - replace bits chopped by TX & Rx cavities + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.032 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.032 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness)) + print('#box: {} {} {} {} {} {} pcb'.format(x + 0.108 + cavitythickness, y + 0.022 + cavitythickness, z + skidthickness, x + 0.108 + cavitysize[0] - cavitythickness, y + 0.022 + cavitysize[1] - cavitythickness, z + skidthickness + pcbthickness)) + + # PCB components + # Tx bowtie + print('#triangle: {} {} {} {} {} {} {} {} {} 0 pec'.format(tx[0], tx[1] - 0.001, tx[2], tx[0] - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.026, tx[1] - bowtieheight - 0.001, tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0], tx[1] - 0.001, tx[2], tx[0], tx[1], tx[2])) + print('#triangle: {} {} {} {} {} {} {} {} {} 0 pec'.format(tx[0], tx[1] + 0.002, tx[2], tx[0] - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.026, tx[1] + bowtieheight + 0.002, tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0], tx[1] + 0.001, tx[2], tx[0], tx[1] + 0.002, tx[2])) + + # Rx bowtie + print('#triangle: {} {} {} {} {} {} {} {} {} 0 pec'.format(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076 - 0.026, tx[1] - bowtieheight - 0.001, tx[2], tx[0] + 0.076 + 0.026, tx[1] - bowtieheight - 0.001, tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0] + 0.076, tx[1] - 0.001, tx[2], tx[0] + 0.076, tx[1], tx[2])) + print('#triangle: {} {} {} {} {} {} {} {} {} 0 pec'.format(tx[0] + 0.076, tx[1] + 0.002, tx[2], tx[0] + 0.076 - 0.026, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076 + 0.026, tx[1] + bowtieheight + 0.002, tx[2])) + print('#edge: {} {} {} {} {} {} pec'.format(tx[0] + 0.076, tx[1] + 0.001, tx[2], tx[0] + 0.076, tx[1] + 0.002, tx[2])) + + # Tx surface mount resistors (lower y coordinate) + if resolution == 0.001: + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + 0.022, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + 0.022 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx, tx[1] - bowtieheight - dy, tx[2])) + elif resolution == 0.002: + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] - 0.023, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] - 0.023 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0], tx[1] - bowtieheight - 0.004, tx[2], tx[0], tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + 0.020, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} txreslower'.format(tx[0] + 0.020 + dx, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx, tx[1] - bowtieheight, tx[2])) + + # Tx surface mount resistors (upper y coordinate) + if resolution == 0.001: + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + 0.022, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx, tx[1] + bowtieheight + 0.006, tx[2])) + elif resolution == 0.002: + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] - 0.023, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0], tx[1] + bowtieheight + 0.002, tx[2], tx[0], tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + 0.020, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} txresupper'.format(tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx, tx[1] + bowtieheight + 0.006, tx[2])) + + # Rx surface mount resistors (lower y coordinate) + if resolution == 0.001: + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + 0.076, tx[1] - bowtieheight - dy, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] - bowtieheight - dy, tx[2])) + elif resolution == 0.002: + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] - 0.023 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + 0.076, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.076, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + dx + 0.076, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.020 + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + 0.076, tx[1] - bowtieheight, tx[2])) + print('#edge: {} {} {} {} {} {} rxreslower'.format(tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight - 0.004, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] - bowtieheight, tx[2])) + + # Rx surface mount resistors (upper y coordinate) + if resolution == 0.001: + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.022 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + elif resolution == 0.002: + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] - 0.023 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + print('#edge: {} {} {} {} {} {} rxresupper'.format(tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.002, tx[2], tx[0] + 0.020 + dx + 0.076, tx[1] + bowtieheight + 0.006, tx[2])) + + # Skid + print('#box: {} {} {} {} {} {} polypropylene'.format(x, y, z, x + casesize[0], y + casesize[1], z + polypropylenethickness)) + print('#box: {} {} {} {} {} {} hdpe'.format(x, y, z + polypropylenethickness, x + casesize[0], y + casesize[1], z + polypropylenethickness + hdpethickness)) + + # Geometry views + #print('#geometry_view: {} {} {} {} {} {} {} {} {} antenna_like_MALA_1200 n'.format(x - dx, y - dy, z - dz, x + casesize[0] + dx, y + casesize[1] + dy, z + casesize[2] + skidthickness + dz, dx, dy, dz)) + #print('#geometry_view: {} {} {} {} {} {} {} {} {} antenna_like_MALA_1200_pcb f'.format(x, y, z, x + casesize[0], y + casesize[1], z + 0.010, dx, dy, dz)) + + # Excitation + print('#waveform: gaussian 1.0 {} myGaussian'.format(excitationfreq)) + print('#voltage_source: y {} {} {} {} myGaussian'.format(tx[0], tx[1], tx[2], sourceresistance)) + + # Output point - transmitter bowtie + #print('#rx: {} {} {}'.format(tx[0], tx[1], tx[2])) + # Output point - receiver bowtie + print('#rx: {} {} {}'.format(tx[0] + 0.076, tx[1], tx[2])) + diff --git a/user_models/antenna_MALA_1200_fs.in b/user_models/antenna_MALA_1200_fs.in new file mode 100755 index 00000000..0dba570f --- /dev/null +++ b/user_models/antenna_MALA_1200_fs.in @@ -0,0 +1,10 @@ +#title: MALA 1.2GHz 'like' antenna in free-space +#domain: 0.264 0.189 0.220 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 + +#python: +from user_libs.antennas import antenna_like_MALA_1200 +antenna_like_MALA_1200(0.132, 0.095, 0.100) +#end_python: + diff --git a/user_models/false_alarm_can.in b/user_models/false_alarm_can.in new file mode 100755 index 00000000..4c600936 --- /dev/null +++ b/user_models/false_alarm_can.in @@ -0,0 +1,12 @@ +#title: Metal can false alarm target in free-space +#domain: 0.076 0.076 0.108 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 + +#python: +from user_libs.landmines import false_alarm_can +false_alarm_can(0.038, 0.038, 0.054) +#end_python: + +#geometry_view: 0 0 0 0.076 0.076 0.108 0.001 0.001 0.001 false_alarm_can n + diff --git a/user_models/hertzian_dipole_2D.in b/user_models/hertzian_dipole_2D.in new file mode 100755 index 00000000..84af9a38 --- /dev/null +++ b/user_models/hertzian_dipole_2D.in @@ -0,0 +1,25 @@ +#title: 2D +#domain: 0.1 0.1 0.001 +#dx_dy_dz: 0.001 0.001 0.001 +#time_window: 6e-9 +#time_step_limit_type: 2d +#pml_cells: 10 10 0 10 10 0 + +#material: 8 0 1 0 half_space + +#waveform: ricker 1.0 1e9 myRicker +#box: 0 0 0 0.100 0.050 0.001 half_space +#sphere: 0.050 0.020 0 0.005 pec +#hertzian_dipole: z 0.040 0.050 0 myRicker +#rx: 0.060 0.050 0 +hertzian_dipole: z 0.015 0.050 0 myRicker +rx: 0.020 0.050 0 +src_steps: 0.002 0 0 +rx_steps: 0.002 0 0 + +geometry_view: 0 0 0 0.1 0.1 0.001 0.001 0.001 0.001 hertzian_dipole_2D n + +python: +for x in range (1, 20): + print('#snapshot: 0 0 0 0.1 0.1 0.001 0.001 0.001 0.001 {} hertzian_dipole_2D_snap{}'.format((x/5) * 1e-9, x)) +end_python: diff --git a/user_models/heterogeneous_soil.in b/user_models/heterogeneous_soil.in new file mode 100755 index 00000000..033424e0 --- /dev/null +++ b/user_models/heterogeneous_soil.in @@ -0,0 +1,44 @@ +#title: Soil fractals +#domain: 0.1 0.1 0.2 +#time_window: 10e-9 +#dx_dy_dz: 0.001 0.001 0.001 + +#soil_peplinski: 0.5 0.5 2.0 2.66 0.1 0.4 mySoil +#fractal_box: 0.030 0.030 0.030 0.070 0.070 0.070 1.5 1 1 1 10 mySoil mySoilBox + +xminus +add_surface_roughness: 0.030 0.030 0.030 0.030 0.070 0.070 1 1 1 0.025 0.035 mySoilBox +add_surface_water: 0.030 0.030 0.030 0.030 0.070 0.070 0.027 mySoilBox + +xplus +add_surface_roughness: 0.070 0.030 0.030 0.070 0.070 0.070 1 1 1 0.065 0.075 mySoilBox +add_surface_water: 0.070 0.030 0.030 0.070 0.070 0.070 0.070 mySoilBox +add_grass: 0.070 0.030 0.030 0.070 0.070 0.070 1.0 0.065 0.180 50 mySoilBox + +yminus +add_surface_roughness: 0.030 0.030 0.030 0.070 0.030 0.070 1 1 1 0.025 0.035 mySoilBox +add_surface_water: 0.030 0.030 0.030 0.070 0.030 0.070 0.027 mySoilBox + +yplus +add_surface_roughness: 0.030 0.070 0.030 0.070 0.070 0.070 1 1 1 0.065 0.075 mySoilBox +add_surface_water: 0.030 0.070 0.030 0.070 0.070 0.070 0.070 mySoilBox +add_grass: 0.030 0.070 0.030 0.070 0.070 0.070 1.0 0.065 0.180 50 mySoilBox + +zminus +add_surface_roughness: 0.030 0.030 0.030 0.070 0.070 0.030 1 1 1 0.025 0.035 mySoilBox +add_surface_water: 0.030 0.030 0.030 0.070 0.070 0.030 0.027 mySoilBox + +zplus +#add_surface_roughness: 0.030 0.030 0.070 0.070 0.070 0.070 1 1 1 0.065 0.075 mySoilBox +add_surface_water: 0.030 0.030 0.070 0.070 0.070 0.070 0.070 mySoilBox +add_grass: 0.050 0.050 0.070 0.055 0.055 0.070 1.0 0.070 0.180 5 mySoilBox +#add_grass: 0.030 0.030 0.070 0.070 0.070 0.070 1.0 0.065 0.180 50 mySoilBox + +box: 0.080 0.000 0.070 0.120 0.200 0.110 free_space + +python: +from gprMax.lib_antennas import antenna_like_GSSI_1500 +antenna_like_GSSI_1500(0.100, 0.100, 0.110) +end_python: + +#geometry_view: 0 0 0 0.1 0.1 0.2 0.001 0.001 0.001 soil_fractals n \ No newline at end of file