diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..894a44cc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,104 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..94a9ed02
--- /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.
+
+
+ Copyright (C)
+
+ 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:
+
+ Copyright (C)
+ 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.md b/README.md
new file mode 100644
index 00000000..96b23269
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+
+# AsFem
+
+
+# Download
+```
+git clone https://github.com/yangbai90/AsFem.git
+```
+
+# Demos
+https://space.bilibili.com/100272198/channel/detail?cid=90241
+
+# Usage
+[AsFem wiki](https://github.com/yangbai90/AsFem/wiki)
+
+# Contact
+[walkandthinker](mailto:walkandthinker@gmail.com)
+
+
+QQ group: 879908352
diff --git a/deprecated/CMakeLists.txt b/deprecated/CMakeLists.txt
new file mode 100644
index 00000000..af7d6b53
--- /dev/null
+++ b/deprecated/CMakeLists.txt
@@ -0,0 +1,490 @@
+cmake_minimum_required(VERSION 3.8)
+project(AsFem)
+
+set(CMAKE_CXX_STANDARD 14)
+
+###############################################
+### Set your Eigen path here ###
+###############################################
+set(Eigen "/home/by/Programs/Eigen-dev")
+
+#set(SuiteSparse "/home/by/Programs/SuiteSparse")
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+include_directories(${Eigen})
+
+#include_directories("${SuiteSparse}/include")
+#link_libraries("${SuiteSparse}/lib/libumfpack.so")
+
+###############################################
+### For debug mode ###
+###############################################
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -fopenmp -O2 -DUSE_SUITESPARSE")
+
+###############################################
+### For release mode ###
+###############################################
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fopenmp -O3 -march=native -DNDEBUG")
+
+###############################################
+### For windows release ###
+###############################################
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /W1 /favor:INTEL64 /arch:AVX")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL /Qpar /openmp")
+###################################################
+
+###############################################
+### For intel compiler ###
+###############################################
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -qopenmp -mkl:parallel -inline-forceinline")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost -DUSE_PARDISO")
+
+# the following line takes too long time for compiling
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xAVX -axCORE-AVX2 -DUSE_PARDISO")
+
+#############################################################
+#############################################################
+### For beginners, please don't edit the following line! ###
+### Do not edit the following lines, please!!! ###
+### Do not edit the following lines, please!!! ###
+### Do not edit the following lines, please!!! ###
+#############################################################
+#############################################################
+# For Welcome header file and main.cpp
+set(inc include/Welcome.h)
+set(src src/main.cpp)
+
+
+#############################################################
+### For message print system ###
+#############################################################
+set(inc ${inc} include/MessagePrint/MessagePrint.h)
+set(src ${src} src/MessagePrint/Program/Msg_AsFem_Exit.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_InvalidArgs.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFileName_Invalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LineError.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoMeshBlock.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_InvalidMeshType.cpp)
+### for [dofs] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_DofNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_DofNameDuplicate.cpp)
+### for [projection] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ProjectionNameNotFound.cpp)
+### for [bcs] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoDofsBlock.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BlockBracketNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCSubBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCUserNumNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCUserNumNotValid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NoDofNameFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCBoundaryNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCValueNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCBlockInfoNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NoBCBlockWarning.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_BCBlockUnsupportedType.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_BCBlockBlockNameInvalid.cpp)
+### for [qpoint] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_QpBlockTypeNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_QpBlockOrderNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_QpBlockOrderInvalid.cpp)
+### for [linearsolver] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LinearSolverBlock_InvalidSolverOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LinearSolverBlock_MaxIterNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LinearSolverBlock_MaxIterInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LinearSolverBlock_TolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_LinearSolverBlock_TolInvalid.cpp)
+### For [nonlinearsolver] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_InvalidSolverOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_MaxIterNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_MaxIterInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_RrelTolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_RrelTolInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_RabsTolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_RabsTolInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_ErelTolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_ErelTolInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_EabsTolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_EabsTolInvalid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_STolNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_NonLinearSolverBlock_STolInvalid.cpp)
+
+
+
+### for [elmts] block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtUserNumNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtUserNumNotValid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtBlockUnsupportedType.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtBlockMateNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtBlockBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtBlockInfoNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtSubBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ElmtBlockDuplicateDofsName.cpp)
+
+set(src ${src} src/MessagePrint/InputSystem/Msg_ElmtBlockBlockNameInvalid.cpp)
+
+
+
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoElmtBlockFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICSubBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICUserNumNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICUserNumNotValid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICValueNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICBlockInfoNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICBlockUnsupportedType.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoICBlockFoundWarning.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_ICBlockNoValueWarning.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_ICBlockBlockNameInvalid.cpp)
+
+### for input check
+set(src ${src} src/MessagePrint/Program/Msg_InputCheck_DofInvalidInElmtBlock.cpp)
+set(src ${src} src/MessagePrint/Program/Msg_InputCheck_DofInvalidInBCBlock.cpp)
+set(src ${src} src/MessagePrint/Program/Msg_InputCheck_DofInvalidInICBlock.cpp)
+set(src ${src} src/MessagePrint/Program/Msg_InputCheck_ElmtBlockDuplicateDomain.cpp)
+set(src ${src} src/MessagePrint/Program/Msg_InputCheck_DofIsNotAssignedToElmt.cpp)
+
+
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateSubBlockNameNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateUserNumNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateUserNumNotValid.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateParamsNotFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateBlockInfoNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateBlockUnsupportType.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_MateBlockNoParamsWarning.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoMateBlockFoundWarning.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputCheck_MateNotFoundForElmtBlock.cpp)
+
+### For job block
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidJobType.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidDebugOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidSolverOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidNonLinearSolverOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidTimeSteppingOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_InputFile_NoJobBlockFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_NoTimeFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidTimeValue.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_NoDtFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidDtValue.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBblock_TransientInfoNotComplete.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_NoIntervalFound.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidIntervalValue.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidProjectionOption.cpp)
+set(src ${src} src/MessagePrint/InputSystem/Msg_Input_JobBlock_InvalidAdaptiveOption.cpp)
+
+
+### For gauss point generation
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid1DLintNum.cpp)
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid1DLobbotLintNum.cpp)
+
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid2DGaussOrder.cpp)
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid2DMeshType.cpp)
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid2DLobattoMeshType.cpp)
+
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid3DGaussOrder.cpp)
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid3DMeshType.cpp)
+set(src ${src} src/MessagePrint/GaussPoint/Msg_GaussPoint_Invalid3DLobattoMeshType.cpp)
+
+set(src ${src} src/MessagePrint/ShapeFun/Msg_ShapeFun_InformationNotComlete.cpp)
+set(src ${src} src/MessagePrint/ShapeFun/Msg_ShapeFun_UnsupportedMeshType.cpp)
+
+set(src ${src} src/MessagePrint/ShapeFun/Msg_ShapeFun_Lagrange1DElmtSingular.cpp)
+set(src ${src} src/MessagePrint/ShapeFun/Msg_ShapeFun_Lagrange2DElmtSingular.cpp)
+set(src ${src} src/MessagePrint/ShapeFun/Msg_ShapeFun_Lagrange3DElmtSingular.cpp)
+
+#### for linear solver
+set(src ${src} src/MessagePrint/LinearSolver/Msg_LinearSolver_AnalyzeFailed.cpp)
+set(src ${src} src/MessagePrint/LinearSolver/Msg_LinearSolver_FactorizeFailed.cpp)
+set(src ${src} src/MessagePrint/LinearSolver/Msg_LinearSolver_SolveFailed.cpp)
+
+#### for nonlinear solver
+set(src ${src} src/MessagePrint/NonLinearSolver/Msg_NonLinearSolver_UnsupportSolver.cpp)
+
+
+#### for equation system
+set(src ${src} src/MessagePrint/EquationSystem/Msg_EquationSystem_NotInitialized.cpp)
+
+#### for Material System
+set(src ${src} src/MessagePrint/MaterialSystem/Msg_MaterialSystem_UnsupportUmat.cpp)
+
+#############################################################
+### For string utils ###
+#############################################################
+set(inc ${inc} include/Utils/StringUtils.h)
+set(src ${src} src/Utils/StringUtils/RemoveStrSpace.cpp)
+set(src ${src} src/Utils/StringUtils/RemoveSymbolFromStr.cpp)
+set(src ${src} src/Utils/StringUtils/SplitStrNum.cpp)
+set(src ${src} src/Utils/StringUtils/SplitStrNumAfter.cpp)
+set(src ${src} src/Utils/StringUtils/SplitStr.cpp)
+set(src ${src} src/Utils/StringUtils/IsCommentLine.cpp)
+set(src ${src} src/Utils/StringUtils/IsBracketMatch.cpp)
+set(src ${src} src/Utils/StringUtils/GoToLine.cpp)
+set(src ${src} src/Utils/StringUtils/IsUniqueStrVec.cpp)
+set(src ${src} src/Utils/StringUtils/IsValidExpression.cpp)
+
+#############################################################
+### For input system ###
+#############################################################
+set(inc ${inc} include/InputSystem/InputSystem.h)
+set(src ${src} src/InputSystem/InputSystem.cpp src/InputSystem/InitInputSystem.cpp)
+set(src ${src} src/InputSystem/ReadInputFile.cpp)
+set(src ${src} src/InputSystem/ReadMeshBlock.cpp)
+set(src ${src} src/InputSystem/ReadDofsBlock.cpp)
+set(src ${src} src/InputSystem/ReadBCBlock.cpp)
+set(src ${src} src/InputSystem/ReadElmtBlock.cpp)
+set(src ${src} src/InputSystem/ReadICBlock.cpp)
+set(src ${src} src/InputSystem/ReadMateBlock.cpp)
+set(src ${src} src/InputSystem/ReadJobBlock.cpp)
+set(src ${src} src/InputSystem/ReadQpBlock.cpp)
+set(src ${src} src/InputSystem/ReadLinearSolverBlock.cpp)
+set(src ${src} src/InputSystem/ReadNonLinearSolverBlock.cpp)
+set(src ${src} src/InputSystem/ReadProjectionBlock.cpp)
+
+
+
+#############################################################
+### For mesh system ###
+#############################################################
+set(inc ${inc} include/Mesh/Mesh.h include/Mesh/MeshTypeDefine.h)
+set(inc ${inc} include/Mesh/Point.h include/Mesh/Nodes.h)
+set(src ${src} src/Mesh/Mesh.cpp src/Mesh/CreateMesh.cpp src/Mesh/PrintMeshInfo.cpp)
+set(src ${src} src/Mesh/Create1DMesh.cpp src/Mesh/Create2DMesh.cpp src/Mesh/Create3DMesh.cpp)
+set(src ${src} src/Mesh/SetMeshElmtInfo.cpp)
+set(src ${src} src/Mesh/ReadMeshFromGmsh.cpp)
+set(src ${src} src/Mesh/SaveMesh.cpp)
+set(src ${src} src/Mesh/GetGmshInfo.cpp)
+
+#############################################################
+### For dof handler system ###
+#############################################################
+set(inc ${inc} include/DofHandler/DofHandler.h)
+set(src ${src} src/DofHandler/DofHandler.cpp src/DofHandler/DofHandlerSettings.cpp)
+set(src ${src} src/DofHandler/CreateDofMap.cpp src/DofHandler/Init.cpp)
+set(src ${src} src/DofHandler/DofHandlerPrinter.cpp)
+set(src ${src} src/DofHandler/ModifyDofActiveMapViaBC.cpp)
+
+
+#############################################################
+### For boundary condition system ###
+#############################################################
+set(inc ${inc} include/BCs/BCSystem.h include/BCs/BCBlock.h)
+set(src ${src} src/BCs/BCSystem.cpp src/BCs/AddBCBlock.cpp)
+set(src ${src} src/BCs/Init.cpp)
+set(src ${src} src/BCs/PrintBCBlockInfo.cpp)
+set(src ${src} src/BCs/ApplyBC.cpp)
+set(src ${src} src/BCs/ApplyPresetBC.cpp)
+set(src ${src} src/BCs/ApplyDirichletBC.cpp)
+set(src ${src} src/BCs/ApplyNeumannBC.cpp)
+set(src ${src} src/BCs/ApplyPreSetDirichletBC.cpp)
+
+
+#############################################################
+### For initial condition system ###
+#############################################################
+set(inc ${inc} include/ICs/ICBlock.h include/ICs/ICType.h)
+set(inc ${inc} include/ICs/ICSystem.h)
+set(src ${src} src/ICs/ICSystem.cpp src/ICs/AddICBlock.cpp)
+set(src ${src} src/ICs/PrintICBlockInfo.cpp)
+set(src ${src} src/ICs/ApplyIC.cpp)
+set(src ${src} src/ICs/ApplyConstIC.cpp)
+set(src ${src} src/ICs/ApplyRandIC.cpp)
+set(src ${src} src/ICs/ApplyCircleIC.cpp)
+
+
+#############################################################
+### For element system ###
+#############################################################
+set(inc ${inc} include/ElmtSystem/ElmtBlock.h include/ElmtSystem/ElmtSystem.h)
+SET(inc ${inc} include/ElmtSystem/ElmtType.h)
+set(src ${src} src/ElmtSystem/ElmtSystem.cpp)
+set(src ${src} src/ElmtSystem/AddElmtBlock.cpp)
+set(src ${src} src/ElmtSystem/PrintElmtBlockInfo.cpp)
+set(src ${src} src/ElmtSystem/RunElmtLib.cpp)
+### for poisson equation
+set(src ${src} src/ElmtSystem/Poisson.cpp)
+### for diffusion equation
+set(src ${src} src/ElmtSystem/Diffusion.cpp)
+### for cahn hilliard equation
+set(src ${src} src/ElmtSystem/CahnHilliard.cpp)
+### for mechanics
+set(src ${src} src/ElmtSystem/Mechanics.cpp)
+### for wave equation
+set(src ${src} src/ElmtSystem/Wave.cpp)
+### for thermal mechanics
+set(src ${src} src/ElmtSystem/ThermalMechanics.cpp)
+### for linear elastic phase field fracture model
+set(src ${src} src/ElmtSystem/LinearElasticPhaseFieldFracture.cpp)
+### for user-defined element (UEL)
+set(src ${src} src/ElmtSystem/UserElmt1.cpp)
+
+
+#############################################################
+### For material system ###
+#############################################################
+set(inc ${inc} include/MaterialSystem/MaterialSystem.h include/MaterialSystem/MaterialBlock.h)
+set(inc ${inc} include/MaterialSystem/MaterialType.h)
+set(src ${src} src/MaterialSystem/MaterialSystem.cpp)
+set(src ${src} src/MaterialSystem/AddMaterialBlock.cpp)
+set(src ${src} src/MaterialSystem/PrintMateBlockInfo.cpp)
+set(src ${src} src/MaterialSystem/RunMateLib.cpp)
+set(src ${src} src/MaterialSystem/ConstPoissonMate.cpp)
+set(src ${src} src/MaterialSystem/NonlinearPoissonMate.cpp)
+set(src ${src} src/MaterialSystem/ConstDiffusionMate.cpp)
+set(src ${src} src/MaterialSystem/NonlinearDiffusionMate.cpp)
+### For CahnHilliard material
+set(src ${src} src/MaterialSystem/CahnHilliardMate.cpp)
+### For mechanics material
+set(src ${src} src/MaterialSystem/LinearElasticMate.cpp)
+### For SaintVenantMate
+set(src ${src} src/MaterialSystem/SaintVenantMate.cpp)
+### For finite strain material
+set(src ${src} src/MaterialSystem/FiniteStrainMate.cpp)
+### For NeoHookeanMate material
+set(src ${src} src/MaterialSystem/NeoHookeanMate.cpp)
+### For thermal elastic material
+set(src ${src} src/MaterialSystem/ThermalElasticMate.cpp)
+
+### For linear elastic phase field fracture model (From Miehe's model)
+set(src ${src} src/MaterialSystem/LinearElasticPhaseFieldFracMate.cpp)
+set(src ${src} src/MaterialSystem/ModifyElasticFracMate.cpp)
+
+
+### For general wave equation's material
+set(src ${src} src/MaterialSystem/GenralWaveMate.cpp)
+### UMAT
+set(src ${src} src/MaterialSystem/UserMate1.cpp)
+
+#############################################################
+### For finite element system ###
+#############################################################
+set(inc ${inc} include/FE/FE.h)
+set(src ${src} src/FE/FE.cpp src/FE/InitFE.cpp)
+
+
+### for qp points
+set(inc ${inc} include/FE/QPoint.h include/FE/QPBlockInfo.h)
+set(src ${src} src/FE/GaussPoint/QPoint.cpp)
+set(src ${src} src/FE/GaussPoint/CreateQPoints.cpp)
+set(src ${src} src/FE/GaussPoint/Create1DGaussPoint.cpp)
+set(src ${src} src/FE/GaussPoint/Create2DGaussPoint.cpp)
+set(src ${src} src/FE/GaussPoint/Create3DGaussPoint.cpp)
+
+### for shape funs
+set(inc ${inc} include/FE/ShapeFun.h)
+set(src ${src} src/FE/ShapeFun/ShapeFun.cpp src/FE/ShapeFun/ShapeFunCalc.cpp)
+set(src ${src} src/FE/ShapeFun/Compute1DLagrangeShapeFun.cpp)
+set(src ${src} src/FE/ShapeFun/Compute2DLagrangeShapeFun.cpp)
+set(src ${src} src/FE/ShapeFun/Compute3DLagrangeShapeFun.cpp)
+
+#############################################################
+### For equation system ###
+#############################################################
+set(inc ${inc} include/EquationSystem/EquationSystem.h)
+set(src ${src} src/EquationSystem/EquationSystem.cpp)
+set(src ${src} src/EquationSystem/InitEquationSystem.cpp)
+set(src ${src} src/EquationSystem/CreateSparsityPatterns.cpp)
+
+
+#############################################################
+### For solution system ###
+#############################################################
+set(inc ${inc} include/SolutionSystem/SolutionSystem.h)
+set(src ${src} src/SolutionSystem/SolutionSystem.cpp)
+set(src ${src} src/SolutionSystem/SolutionSystemInit.cpp)
+set(src ${src} src/SolutionSystem/UpdateSolution.cpp)
+
+
+#############################################################
+### For linear solver system ###
+#############################################################
+set(inc ${inc} include/LinearSolver/LinearSolver.h include/LinearSolver/LinearSolverType.h)
+set(inc ${inc} include/LinearSolver/LinearSolverBlockInfo.h)
+set(src ${src} src/LinearSolver/LinearSolver.cpp)
+set(src ${src} src/LinearSolver/LinearSolverGetInfo.cpp)
+set(src ${src} src/LinearSolver/Solve.cpp)
+set(src ${src} src/LinearSolver/InitLinearSolver.cpp)
+set(src ${src} src/LinearSolver/PrintSolverInfo.cpp)
+
+
+#############################################################
+### For nonlinear solver system ###
+#############################################################
+set(inc ${inc} include/NonLinearSolver/NonLinearSolver.h)
+set(inc ${inc} include/NonLinearSolver/NonLinearSolverType.h)
+set(inc ${inc} include/NonLinearSolver/NonLinearSolverBlockInfo.h)
+set(src ${src} src/NonLinearSolver/NonLinearSolver.cpp)
+set(src ${src} src/NonLinearSolver/PrintNonLinearSolverInfo.cpp)
+set(src ${src} src/NonLinearSolver/InitNonlinearSolver.cpp)
+set(src ${src} src/NonLinearSolver/NonLinearSolve.cpp)
+set(src ${src} src/NonLinearSolver/ConvergenceCheck.cpp)
+set(src ${src} src/NonLinearSolver/Linear.cpp)
+set(src ${src} src/NonLinearSolver/NewtonRaphson.cpp)
+set(src ${src} src/NonLinearSolver/NewtonRaphsonModify.cpp)
+set(src ${src} src/NonLinearSolver/NewtonRaphsonWithLineSearch.cpp)
+set(src ${src} src/NonLinearSolver/NewtonRaphsonWithBisectionLineSearch.cpp)
+set(src ${src} src/NonLinearSolver/NewtonRaphsonWithRegulaFalsiLineSearch.cpp)
+set(src ${src} src/NonLinearSolver/PrintIterationInfo.cpp)
+
+
+#############################################################
+### For time stepping method system ###
+#############################################################
+set(inc ${inc} include/TimeStepping/TimeStepping.h include/TimeStepping/TimeSteppingType.h)
+set(src ${src} src/TimeStepping/TimeStepping.cpp)
+set(src ${src} src/TimeStepping/InitTimeStepping.cpp)
+set(src ${src} src/TimeStepping/RunTimeStepping.cpp)
+set(src ${src} src/TimeStepping/BackwardEuler.cpp)
+set(src ${src} src/TimeStepping/CrankNicolson.cpp)
+set(src ${src} src/TimeStepping/BackwardEulerAD.cpp)
+set(src ${src} src/TimeStepping/CrankNicolsonAD.cpp)
+
+
+#############################################################
+### For math utils ###
+#############################################################
+set(inc ${inc} include/Utils/MathUtils.h)
+
+### For tensor calculation
+set(inc ${inc} include/Utils/RankTwoTensor.h include/Utils/RankFourTensor.h)
+set(src ${src} src/Utils/Tensor/RankTwoTensor.cpp)
+set(src ${src} src/Utils/Tensor/RankFourTensor.cpp)
+#############################################################
+### For output system ###
+#############################################################
+set(inc ${inc} include/OutputSystem/OutputSystem.h)
+set(src ${src} src/OutputSystem/OutputSystem.cpp)
+set(src ${src} src/OutputSystem/InitOutputStream.cpp)
+set(src ${src} src/OutputSystem/WriteResultToVTU.cpp)
+
+#############################################################
+### For system level subroutines ###
+#############################################################
+set(inc ${inc} include/FESystem/FESystem.h)
+set(src ${src} src/FESystem/InitFESystem.cpp)
+set(src ${src} src/FESystem/FESystem.cpp src/FESystem/PrintFESystemInfo.cpp)
+set(src ${src} src/FESystem/FormFE.cpp)
+set(src ${src} src/FESystem/AssembleLocalToGlobal.cpp)
+set(src ${src} src/FESystem/AssembleLocalHistToGlobal.cpp)
+set(src ${src} src/FESystem/Projection.cpp)
+
+
+#############################################################
+### For FEProblem(the highest level) subroutines ###
+#############################################################
+### Currently, this is the highest level of AsFem
+set(inc ${inc} include/FEProblem/FEProblem.h include/FEProblem/FECtrlInfo.h include/FEProblem/FEJobType.h)
+set(src ${src} src/FEProblem/RunFEProblem.cpp)
+set(src ${src} src/FEProblem/FEProblem.cpp src/FEProblem/ReadInputFile.cpp)
+set(src ${src} src/FEProblem/CheckInputFileInfo.cpp)
+set(src ${src} src/FEProblem/PreRunFEProblem.cpp)
+set(src ${src} src/FEProblem/InitFEProblem.cpp)
+set(src ${src} src/FEProblem/StartJob.cpp src/FEProblem/Finalize.cpp)
+set(src ${src} src/FEProblem/RunFEAnalysis.cpp)
+set(src ${src} src/FEProblem/RunStaticAnalysis.cpp)
+set(src ${src} src/FEProblem/RunTransientAnalysis.cpp)
+set(src ${src} src/FEProblem/PrintJobInfo.cpp)
+
+
+##################################################
+add_executable(asfem ${inc} ${src})
+
diff --git a/deprecated/include/BCs/BCBlock.h b/deprecated/include/BCs/BCBlock.h
new file mode 100644
index 00000000..4617f673
--- /dev/null
+++ b/deprecated/include/BCs/BCBlock.h
@@ -0,0 +1,42 @@
+#ifndef ASFEM_BCBLOCK_H
+#define ASFEM_BCBLOCK_H
+
+#include
+#include
+#include
+
+
+
+class BCBlock
+{
+public:
+ std::string _BCBlockName; // [bc1]
+ std::string _DofName; // dof=u1
+ std::string _BoundaryName; // boundary=left
+ std::string _BCElmtName; // type=dirichlet [user1]
+ double _value=0.0;
+ bool _IsTimeDependent=false;
+
+ inline void Clear()
+ {
+ _BCBlockName="";
+ _DofName="";
+ _BoundaryName="";
+ _BCElmtName="";
+ _value=0.0;
+ _IsTimeDependent=false;
+ }
+
+ void PrintBCBlockInfo() const{
+ std::printf("*** BC block name= %-34s ***\n",_BCBlockName.c_str());
+ std::printf("*** type name = %-34s ***\n",_BCElmtName.c_str());
+ std::printf("*** dof name = %-34s ***\n",_DofName.c_str());
+ std::printf("*** value = %-16.8e ***\n",_value);
+ std::printf("*** boundary = %-34s ***\n",_BoundaryName.c_str());
+ if(_IsTimeDependent){
+ std::printf("*** time dependent=true ***\n");
+ }
+ }
+};
+
+#endif //ASFEM_BCBLOCK_H
\ No newline at end of file
diff --git a/deprecated/include/BCs/BCSystem.h b/deprecated/include/BCs/BCSystem.h
new file mode 100644
index 00000000..ed611fcb
--- /dev/null
+++ b/deprecated/include/BCs/BCSystem.h
@@ -0,0 +1,89 @@
+#ifndef ASFEM_BCSYSTEM_H
+#define ASFEM_BCSYSTEM_H
+
+#include
+#include
+#include
+#include
+
+#include "BCBlock.h"
+
+#include "Mesh/Mesh.h"
+#include "Mesh/Nodes.h"
+#include "DofHandler/DofHandler.h"
+#include "FE/FE.h"
+
+
+
+using namespace std;
+
+
+class Mesh;
+class DofHandler;
+class FE;
+
+
+class BCSystem
+{
+public:
+ BCSystem();
+ void Init(Mesh &mesh);
+ void SetMaxKMatrixValue(const double &val){_MaxKMatrixValue=val;}
+
+ // setting functions
+ bool AddBCBlock(const BCBlock &bcblock);
+
+ // get information of BCSystem
+ inline int GetBCBlockNum() const {return _nBCBlocks;}
+ inline BCBlock GetIthBCBlock(int i) {return _BCBlockList[i-1];}
+
+
+ void PrintBCBlockInfo() const;
+
+
+public:
+ void ApplyBC(Mesh &mesh,DofHandler &dofHandler,FE &fe,const double &t,const double (&ctan)[2],
+ Eigen::SparseMatrix &K,
+ Eigen::VectorXd &RHS,
+ Eigen::VectorXd &U);
+
+ void ApplyPreSetDirichletBC(const double &t,Mesh &mesh,DofHandler &dofHander,Eigen::VectorXd &U);
+ // void PresetDirichletBC(Mesh &mesh,DofHandler &dofHander,Eigen::VectorXd &U);
+ // void ApplyBC(Mesh &mesh,DofHandler &dofHander,
+ // ShapeFun &shp,);
+
+private:
+ void ApplyNeumannBC(Mesh &mesh,DofHandler &dofHandler,FE &fe,
+ const int &DofIndex,const double &bcvalue,string bcname,
+ Eigen::VectorXd &RHS);
+
+ void ApplyDirichletBC(Mesh &mesh,DofHandler &dofHandler,
+ const int &DofIndex,const double &bcvalue,string bcname,
+ Eigen::SparseMatrix &K,
+ Eigen::VectorXd &RHS,
+ Eigen::VectorXd &U);
+ // void ApplyDynamicDirichletBC()
+ void ApplyPresetBC(Mesh &mesh,DofHandler &dofHandler,FE &fe,const double (&ctan)[2],
+ const int &DofIndex,const double &bcvalue,string bcname,
+ Eigen::SparseMatrix &K,
+ Eigen::VectorXd &RHS,
+ Eigen::VectorXd &U);
+
+private:
+ int _nBCBlocks;
+ vector _BCBlockList;
+
+ int _nNodesPerBCElmt=1,_nDim=1;
+ double _xi,_eta,_JxW;
+ double _Area,_ElArea;
+
+ int _DofIndex;
+ double _bcvalue;
+ string _bcname;
+ Nodes _elNodes;
+
+ double _MaxKMatrixValue=1.0;
+
+};
+
+#endif // ASFEM_BCSYSTEM_H
\ No newline at end of file
diff --git a/deprecated/include/DofHandler/DofHandler.h b/deprecated/include/DofHandler/DofHandler.h
new file mode 100644
index 00000000..7b1e14cc
--- /dev/null
+++ b/deprecated/include/DofHandler/DofHandler.h
@@ -0,0 +1,154 @@
+#ifndef ASFEM_DOFHANDLER_H
+#define ASFEM_DOFHANDLER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+//**********************************
+//*** AsFem's own header file ***
+//**********************************
+#include "Mesh/Mesh.h"
+#include "BCs/BCSystem.h"
+#include "ElmtSystem/ElmtSystem.h"
+
+using namespace std;
+
+
+class BCSystem;
+class DofHandler
+{
+public:
+ DofHandler();
+ void Init(Mesh &mesh);
+ void CreateDofMap(Mesh &mesh,BCSystem &bcSystem);
+ void ModifyDofActiveMapViaBC(Mesh &mesh,BCSystem &bcSystem);
+
+public:
+ // settings for dofhandler
+ void SetDofNameListFromVec(vector &vec);
+ void SetDofNum(int ndofs) {_nDofs=ndofs;}
+ void SetNodesNum(int nnodes) {_nNodes=nnodes;}
+ void SetNodesNumPerBulkElmt(int nnodes) {_nNodesPerBulkElmt=nnodes;}
+ void SetElmtsNum(int nelmts) {_nElmts=nelmts;}
+ void SetBulkElmtsNum(int nelmts) {_nBulkElmts=nelmts;}
+
+ inline void SetIthNodeJthDofFlag(const int &i,const int &j,const int &flag) {
+ _NodalDofFlag[i-1][j-1]=flag;
+ }
+ inline void SetIthElmtJthDofFlag(const int &e,const int &j,const int &flag){
+ _ElmtalDofIndex[e-1][j-1]=flag;
+ }
+
+
+ void PrintDofInfo() const;
+ void PrintDofMap() const;
+
+
+public:
+ // get dofhandler information
+ inline int GetDim() const {return _nDim;}
+ inline int GetDofsNum() const {return _nDofs;}
+ inline int GetActiveDofsNum() const {return _nActiveDofs;}
+ inline int GetDofsNumPerNode() const {return _nDofsPerNode;}
+ inline int GetMaxDofsNumPerElmt() const {return _nMaxDofsPerElmt;}
+ inline int GetBulkElmtsNum() const {return _nBulkElmts;}
+ inline int GetElmtsNum() const {return _nElmts;}
+ inline int GetNodesNum() const {return _nNodes;}
+ inline int GetNodesNumPerBulkElmt() const {return _nNodesPerBulkElmt;}
+ inline int GetIthNodeJthDofFlag(const int &i,const int &j) const {return _NodalDofFlag[i-1][j-1];}
+ inline int GetIthNodeJthDofIndex(const int &i,const int &j) const {return _NodalDofFlag[i-1][j-1];}
+
+ inline int GetIthElmtDofsNum(const int &e) const{
+ return int(_ElmtalDofIndex[e-1].size());
+ }
+ inline int GetIthElmtJthDofIndex(const int &e,const int &j) const{
+ return _ElmtalDofIndex[e-1][j-1];
+ }
+ inline vector GetIthElmtDofIndex(const int &e) const{
+ // must be bulk element
+ vector elDofs;
+ int nDofsPerElmt=int(_ElmtalDofIndex[e-1].size());
+ elDofs.resize(nDofsPerElmt,0);
+ for(int i=0;i &elDofs) const {
+ for(int i=0;i &elDofs,vector &elDofsActive) const {
+ for(int i=0;i GetDofsIndexFromNameVec(vector namevec) const{
+ vector temp;
+ temp.clear();
+ for(unsigned int j=0;j GetDofNameList() const
+ {
+ vector temp;
+ temp.clear();
+ for(unsigned int i=0;i<_DofNameList.size();i++)
+ {
+ temp.push_back(_DofNameList[i]);
+ }
+ return temp;
+ }
+
+
+ inline void GetIthElmtalDofIndex(const int &e,vector &ind) const{
+ ind.clear();
+ ind=_ElmtalDofIndex[e-1];
+ }
+
+
+ void PrintDofsInfo() const;
+
+private:
+ int _nDofs,_nNodes,_nElmts,_nBulkElmts,_nDofsPerNode,_nDim;
+ int _nNodesPerBulkElmt,_nMaxDofsPerElmt;
+ int _nActiveDofs;
+ vector _DofNameList;
+ vector _DofIndexList;// the same length as _DofNameList, related one by one!!!
+ vector _NodalDofIndex;
+ vector> _ElmtalDofIndex;
+ vector> _NodalDofActiveFlag,_ElmtalDofActiveFlags;
+ vector> _NodalDofFlag;
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/ElmtSystem/ElmtBlock.h b/deprecated/include/ElmtSystem/ElmtBlock.h
new file mode 100644
index 00000000..51a2d3fa
--- /dev/null
+++ b/deprecated/include/ElmtSystem/ElmtBlock.h
@@ -0,0 +1,62 @@
+#ifndef ASFEM_ELMTBLOCK_H
+#define ASFEM_ELMTBLOCK_H
+
+#include
+#include
+
+#include "ElmtType.h"
+#include "MaterialSystem/MaterialType.h"
+
+class ElmtBlock
+{
+public:
+ // [solid]
+ // type=solid2d
+ // dofs=u1 u2
+ // mate=mate1 [can be ignored]
+ // block=all [can be ignored]
+ // [end]
+ std::string _ElmtBlockName=""; // [solid]
+ std::string _ElmtTypeName=""; // type=solid2d
+ std::string _ElmtMateName=""; // mate=mate1 [can be ignored]
+ std::string _ElmtDomainBlockName="alldomain"; // block=all [can be ignored]
+ std::vector _ElmtDofNameList;
+ std::vector _ElmtDofIndexList;
+ ElmtType _ElmtTypeID=ElmtType::NULLELMT;
+ MaterialType _MateTypeID=MaterialType::NULLMATE;
+
+
+ inline void Clean()
+ {
+ _ElmtBlockName="";
+ _ElmtTypeName="";
+ _ElmtMateName="";
+ _ElmtDomainBlockName="alldomain";
+ _ElmtDofNameList.clear();
+ _ElmtDofIndexList.clear();
+ _ElmtTypeID=ElmtType::NULLELMT;
+ _MateTypeID=MaterialType::NULLMATE;
+ }
+
+ void PrintInfo() const
+ {
+ std::printf("*** Elmt block name= %-32s ***\n",_ElmtBlockName.c_str());
+ std::printf("*** type name = %-34s ***\n",_ElmtTypeName.c_str());
+ std::cout<<"*** dof name = ";
+ for(unsigned int i=0;i<_ElmtDofNameList.size();++i)
+ {
+ std::cout<<_ElmtDofNameList[i]<<" ";
+ }
+ std::cout<
+#include
+#include
+#include
+
+#include "ElmtBlock.h"
+
+#include "FE/ShapeFun.h"
+
+#include "Utils/MathUtils.h"
+#include "Utils/RankTwoTensor.h"
+#include "Utils/RankFourTensor.h"
+
+#include "ElmtType.h"
+
+using namespace std;
+
+class ElmtSystem
+{
+public:
+ ElmtSystem();
+
+ // setting functions
+ bool AddElmtBlock(const ElmtBlock &elmtBlock);
+
+ // get information of BCSystem
+ inline int GetElmtBlockNum() const {return _nElmtBlock;}
+ inline ElmtBlock GetIthElmtBlock(int i) {return _ElmtBlockList[i-1];}
+
+ void SetIthElmtBlockMateID(const int i,MaterialType mateid){_ElmtBlockList[i-1]._MateTypeID=mateid;}
+
+ void RunElmtLib(const int &isw,const ElmtType &elmttype,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+
+ void PrintElmtBlockInfo() const;
+
+private:
+
+ void Poisson(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ void Diffusion(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+
+ void CahnHilliard(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ void Wave(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ void Mechanics(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ void ThermalMechanics(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ //*********************************************************
+ //*** For Miehe's phase field fracture model
+ void LinearElasticPhaseFieldFracture(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+ //*********************************************************
+ //*** For user defined elements (UEL)
+ //*********************************************************
+ void UserElmt1(const int &isw,
+ const int &nDim,
+ const int &nNodes,
+ const double &JxW,
+ const double &t,const double &dt,const double (&ctan)[2],
+ const Eigen::Vector3d &gpCoord,
+ const vector &gpU,const vector &gpV,
+ const vector &gpGradU,const vector &gpGradV,
+ const ShapeFun &shp,
+ const vector &MaterialValues,
+ const vector &Rank2MaterialValues,
+ const vector &Rank4MaterialValues,
+ vector &Hist,const vector &HistOld,vector &Proj,
+ Eigen::MatrixXd &K,Eigen::VectorXd &rhs);
+
+
+private:
+ int _nElmtBlock;
+ vector _ElmtBlockList;
+
+ Eigen::Vector3d _grad_test,_grad_phi;
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/ElmtSystem/ElmtType.h b/deprecated/include/ElmtSystem/ElmtType.h
new file mode 100644
index 00000000..9dce2066
--- /dev/null
+++ b/deprecated/include/ElmtSystem/ElmtType.h
@@ -0,0 +1,37 @@
+#ifndef ASFEM_ELMTTYPE_H
+#define ASFEM_ELMTTYPE_H
+
+enum class ElmtType
+{
+ NULLELMT,
+ POISSON,
+ DIFFUSION,
+ WAVE,
+ CAHNHILLIARD,
+ MECHANICS,
+ THERMALMECHANICS,
+ CAHNHILLIARDMECHANICS,
+ LINEARELASTICPHASEFIELDFRACTURE,
+ USER1,
+ USER2,
+ USER3,
+ USER4,
+ USER5,
+ USER6,
+ USER7,
+ USER8,
+ USER9,
+ USER10,
+ USER11,
+ USER12,
+ USER13,
+ USER14,
+ USER15,
+ USER16,
+ USER17,
+ USER18,
+ USER19,
+ USER20
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/EquationSystem/EquationSystem.h b/deprecated/include/EquationSystem/EquationSystem.h
new file mode 100644
index 00000000..2e5cc01e
--- /dev/null
+++ b/deprecated/include/EquationSystem/EquationSystem.h
@@ -0,0 +1,56 @@
+#ifndef ASFEM_EQUATIONSYSTEM_H
+#define ASFEM_EQUATIONSYSTEM_H
+
+#include
+#include
+#include
+#include
+
+#include "MessagePrint/MessagePrint.h"
+
+#include "DofHandler/DofHandler.h"
+
+#include "Eigen/Eigen"
+#include "Eigen/Core"
+#include "Eigen/Sparse"
+
+using namespace std;
+
+typedef Eigen::Triplet T;
+
+class EquationSystem
+{
+public:
+ EquationSystem();
+
+ void Init();
+ void CreateSparsityPatterns(DofHandler &dofHandler);
+
+ void SetDofsNum(const int &ndofs) {_nDofs=ndofs;}
+ void AddRhsNorm(const double &normval) {_RhsNorms.push_back(normval);}
+ void AddDuNrom(const double &normval) {_dUNorms.push_back(normval);}
+
+ inline void FirstZeroAMATRIX() {_AMATRIX.setFromTriplets(_ZeroCoeffList.begin(),_ZeroCoeffList.end());}
+ inline void ZeroAMATRIX(){_AMATRIX.setFromTriplets(_ZeroCoeffList.begin(),_ZeroCoeffList.end());}
+
+ void SetNNZNum(int nnznum) {_NNZNum=nnznum;}
+
+public:
+ vector _ZeroCoeffList;
+ vector _CoeffList;
+
+
+public:
+ Eigen::VectorXd _RHS;
+ Eigen::VectorXd _dU;
+ Eigen::SparseMatrix _AMATRIX;
+
+private:
+ bool _IsInit=false;
+ int _nDofs;
+ int _NNZNum;
+ vector _RhsNorms;// associated with step
+ vector _dUNorms;
+};
+
+#endif // ASFEM_EQUATIONSYSTEM_H
\ No newline at end of file
diff --git a/deprecated/include/FE/FE.h b/deprecated/include/FE/FE.h
new file mode 100644
index 00000000..c514c7ea
--- /dev/null
+++ b/deprecated/include/FE/FE.h
@@ -0,0 +1,47 @@
+#ifndef ASFEM_FE_H
+#define ASFEM_FE_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+//**********************************
+//*** AsFem's own header file ***
+//**********************************
+#include "QPoint.h"
+#include "ShapeFun.h"
+#include "Mesh/Nodes.h"
+#include "Mesh/Mesh.h"
+
+#include "QPBlockInfo.h"
+
+class FE
+{
+public:
+ FE();
+ void SetDim(int dim) {this->_nDim=dim;}
+ void SetDimMin(int dim) {this->_nDimMin=dim;}
+ void SetOrder(int order) {this->_nOrder=order;}
+ void InitFE(Mesh &mesh,string qpointtype);// init the gauss point system and shape fun system
+ // before real calculcation
+ //
+
+ inline int GetDim() const {return this->_nDim;}
+ inline int GetDimMin() const {return this->_nDimMin;}
+ inline int GetOrder() const {return this->_nOrder;}
+
+
+
+public:
+ bool _IsInit=false;
+ int _nDim,_nDimMin,_nOrder;
+ QPoint _qp_bulk,_qp_surface,_qp_line;
+ ShapeFun _shp_bulk,_shp_surface,_shp_line;
+ Nodes _nodes,_surface_nodes,_line_nodes;
+
+};
+
+#endif // ASFEM_FE_H
\ No newline at end of file
diff --git a/deprecated/include/FE/QPBlockInfo.h b/deprecated/include/FE/QPBlockInfo.h
new file mode 100644
index 00000000..5dd27dff
--- /dev/null
+++ b/deprecated/include/FE/QPBlockInfo.h
@@ -0,0 +1,25 @@
+#ifndef ASFEM_QPBLOCKINFO_H
+#define ASFEM_QPBLOCKINFO_H
+
+#include
+#include
+#include
+
+using namespace std;
+
+class QPBlockInfo{
+public:
+ int _nQpOrder=1;
+ bool _SetFromInput=false;// if not qpblock is taken from input
+ // the default order=mesh's order+1
+ string _QpType="gauss";// gauss or gausslobatto
+
+ void Reset(){
+ _nQpOrder=1;
+ _SetFromInput=false;
+ _QpType="gauss";
+ }
+};
+
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/FE/QPoint.h b/deprecated/include/FE/QPoint.h
new file mode 100644
index 00000000..39711eae
--- /dev/null
+++ b/deprecated/include/FE/QPoint.h
@@ -0,0 +1,58 @@
+#ifndef ASFEM_QPOINT_H
+#define ASFEM_QPOINT_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+//******************************************
+#include "MessagePrint/MessagePrint.h"
+#include "Mesh/MeshTypeDefine.h"
+using namespace std;
+
+class QPoint
+{
+public:
+ QPoint();
+ QPoint(int dim,int order);
+
+
+ void SetDim(int dim) {this->_nDim=dim;}
+ void SetQPointOrder(int order) {this->_nOrder=order;}
+ void SetQPointType(string type="gauss") {this->_QPointType=type;}
+ void CreateQPoints(MeshType meshtype);
+
+ // get function
+ inline int GetDim() const {return this->_nDim;}
+ inline int GetQpOrder() const {return this->_nOrder;}
+ inline int GetQpPointsNum() const {return this->_nQpPoints;}
+
+ inline double operator()(int i,int j) const {return this->_qp_coords[(i-1)*(_nDim+1)+j];}
+ inline double& operator()(int i,int j) {return this->_qp_coords[(i-1)*(_nDim+1)+j];}
+
+ inline double GetIthQpPointJthCoord(int i,int j) const {return this->_qp_coords[(i-1)*(_nDim+1)+j];}
+
+private:
+ void Create1DGaussPoint();
+ void Create1DGaussLobattoPoint();
+
+ void Create2DGaussPoint(MeshType meshtype);
+ void Create2DGaussLobattoPoint(MeshType meshtype);
+
+ void Create3DGaussPoint(MeshType meshtype);
+ void Create3DGaussLobattoPoint(MeshType meshtype);
+
+private:
+ vector _qp_coords;
+ int _nQpPoints,_nOrder;
+ int _nDim;
+ string _QPointType;
+ bool _HasSettings=false;
+ bool _HasDim,_HasOrder;
+
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/FE/ShapeFun.h b/deprecated/include/FE/ShapeFun.h
new file mode 100644
index 00000000..cc564700
--- /dev/null
+++ b/deprecated/include/FE/ShapeFun.h
@@ -0,0 +1,90 @@
+#ifndef ASFEM_SHAPEFUN_H
+#define ASFEM_SHAPEFUN_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+//******************************************
+#include "MessagePrint/MessagePrint.h"
+#include "Mesh/MeshTypeDefine.h"
+#include "Mesh/Nodes.h"
+
+
+#include "Eigen/Eigen"
+
+using namespace std;
+
+
+
+class ShapeFun
+{
+public:
+ ShapeFun();
+ ShapeFun(int dim,MeshType meshtype);
+ void PreCalc();
+ void Calc(const double &xi,const Nodes &nodes);// for 1D case
+ void Calc(const double &xi,const double &eta,const Nodes &nodes);// for 2D case
+ void Calc(const double &xi,const double &eta,const double &zeta,const Nodes &nodes);
+
+
+ inline double shape_value(const int &i) const{
+ return this->_shape_value[i-1];
+ }
+ inline Eigen::Vector3d shape_grad(const int &i) const{
+ return this->_shape_grad[i-1];
+ }
+
+
+
+ // friend double operator*(const Eigen::Vector3d &a,const Eigen::Vector3d &b){
+ // return a(0)*b(0)+a(1)*b(1)+a(2)*b(2);
+ // }
+
+
+ // settings
+ void SetDim(int dim) {_nDim=dim;}
+ void SetShapeFunNum(int nnodes) {_nFuns=nnodes;}
+ void SetShapeFunType(MeshType meshtype);
+
+ // get information
+ inline int GetShapeFunNums() const {return _nFuns;}
+ inline int GetDim() const {return _nDim;}
+ inline int GetOrder() const {return _nOrder;}
+ inline double GetDetJac() const {return _DetJac;}
+ inline MeshType GetMeshType() const {return _MeshType;}
+
+ // operator overload
+ inline double operator()(const int &i,const int &j) const {return this->_values[(i-1)*(_nDim+1)+j];}
+ inline double& operator()(const int &i,const int &j) {return this->_values[(i-1)*(_nDim+1)+j];}
+
+
+private:
+ void Compute1DLagrangeShapeFun(const double &xi,const Nodes &nodes);
+ void Compute2DLagrangeShapeFun(const double &xi,const double &eta,const Nodes &nodes);
+ void Compute3DLagrangeShapeFun(const double &xi,const double &eta,const double &zeta,const Nodes &nodes);
+
+
+private:
+ int _nOrder,_nFuns;
+ int _nDim;
+ MeshType _MeshType;
+ bool _IsCartesianDeriv;
+ double _DetJac;
+ double _dxdxi,_dydxi,_dzdxi;
+ double _dxdeta,_dydeta,_dzdeta;
+ double _dxdzeta,_dydzeta,_dzdzeta;
+ double _XJac[3][3],_Jac[3][3];
+ vector _values;
+ int _nValues;
+ bool _HasDim,_HasOrder,_HasMeshType;
+
+ vector _shape_value;
+ vector _shape_grad;
+};
+
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/FEProblem/FECtrlInfo.h b/deprecated/include/FEProblem/FECtrlInfo.h
new file mode 100644
index 00000000..8cb6a817
--- /dev/null
+++ b/deprecated/include/FEProblem/FECtrlInfo.h
@@ -0,0 +1,38 @@
+#ifndef ASFEM_FECTRLINFO_H
+#define ASFEM_FECTRLINFO_H
+
+#include
+#include "FEJobType.h"
+#include "LinearSolver/LinearSolverType.h"
+#include "NonLinearSolver/NonLinearSolverType.h"
+#include "TimeStepping/TimeSteppingType.h"
+
+class FECtrlInfo
+{
+public:
+ bool _IsDebugOn=false;
+ bool _IsDebugDep=false;
+ double _CurrentT=0.0;
+ double _CurrentDt=0.0;
+ long int _CurrentStep=0;
+ bool _IsProjOn=false;
+ int _OutputInterval=1;
+ FEJobType _JobType=FEJobType::STATIC;
+
+ bool _IsPrintMesh=false;
+
+ TimeSteppingType _TimeSteppingMethod=TimeSteppingType::BACKWARDEULER;
+ int _ISW=6;
+ int _Interval=1;
+ bool _IsAdaptive=false;
+ double _dt0=1.0e-6;
+ double _dt=1.0e-6,dtold=1.0e-6;
+ double _EndTime=1.0e10;
+ double _DtMax=0.1;
+ double _DtMin=1.0e-10;
+ int _OptIters=3;
+ double _ctan[2]={1.0,1.0};
+
+};
+
+#endif // ASFEM_FECTRLINFO_H
\ No newline at end of file
diff --git a/deprecated/include/FEProblem/FEJobType.h b/deprecated/include/FEProblem/FEJobType.h
new file mode 100644
index 00000000..56fd4bbc
--- /dev/null
+++ b/deprecated/include/FEProblem/FEJobType.h
@@ -0,0 +1,10 @@
+#ifndef ASFEM_FEJOBTYPE_H
+#define ASFEM_FEJOBTYPE_H
+
+enum class FEJobType
+{
+ STATIC,
+ TRANSIENT
+};
+
+#endif // ASFEM_FEJOBTYPE_H
\ No newline at end of file
diff --git a/deprecated/include/FEProblem/FEProblem.h b/deprecated/include/FEProblem/FEProblem.h
new file mode 100644
index 00000000..30f581cf
--- /dev/null
+++ b/deprecated/include/FEProblem/FEProblem.h
@@ -0,0 +1,129 @@
+#ifndef ASFEM_FEPROBLEM_H
+#define ASFEM_FEPROBLEM_H
+
+#include
+#include
+#include
+#include
+#include
+
+// For AsFem's built-in classes
+#include "InputSystem/InputSystem.h"
+#include "Mesh/Mesh.h"
+#include "BCs/BCSystem.h"
+#include "ICs/ICSystem.h"
+#include "ElmtSystem/ElmtSystem.h"
+#include "MaterialSystem/MaterialSystem.h"
+#include "DofHandler/DofHandler.h"
+#include "EquationSystem/EquationSystem.h"
+#include "SolutionSystem/SolutionSystem.h"
+
+#include "LinearSolver/LinearSolverBlockInfo.h"
+#include "LinearSolver/LinearSolver.h"
+
+#include "NonLinearSolver/NonLinearSolverBlockInfo.h"
+#include "NonLinearSolver/NonLinearSolver.h"
+
+#include "FESystem/FESystem.h"
+#include "TimeStepping/TimeStepping.h"
+#include "OutputSystem/OutputSystem.h"
+#include "FEJobType.h"
+#include "FECtrlInfo.h"
+#include "FE/QPBlockInfo.h"
+
+
+using namespace std;
+
+
+class FEProblem
+{
+public:
+ FEProblem(int args,char *argv[]);
+
+ void RunFEProblem();
+
+private:
+ void StartJob();
+ void PreRunFEProblem();
+ void ReadInputFile();
+ void CheckInputFileInfo();
+ //******************************
+ //*** create dof maps and generate sparsity patterns
+ void InitFEProblem();
+ //******************************
+ void RunFEAnalysis();
+ void RunStaticAnalysis();
+ void RunTransientAnalysis();
+ void Finalize();
+
+ void PrintJobInfo();
+
+
+private:
+ chrono::system_clock::time_point _JobStartTime,_JobEndTime;
+ string _JobStartTimeContext,_JobEndTimeContext;
+ // timer count for each module
+ chrono::high_resolution_clock::time_point _TimerStartOfInput,_TimerEndOfInput;
+ double _DurationOfInput;
+ chrono::high_resolution_clock::time_point _TimerStartOfInputCheck,_TimerEndOfInputChekc;
+ double _DurationOfInputCheck;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfElmtInit,_TimerEndOfElmtInit;
+ double _DurationOfElmtInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfDofInit,_TimerEndOfDofInit;
+ double _DurationOfDofInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfFormFE,_TimerEndOfFormFE;
+ double _DurationOfFormFE;
+ chrono::high_resolution_clock::time_point _TimerStartOfOutput,_TimerEndOfOutput;
+ double _DurationOfOutput;
+ chrono::high_resolution_clock::time_point _TimerStartOfSparseInit,_TimerEndOfSparseInit;
+ double _DurationOfSparseInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfSolInit,_TimerEndOfSolInit;
+ double _DurationOfSolInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfFESysInit,_TimerEndOfFESysInit;
+ double _DurationOfFESysInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfSolverInit,_TimerEndOfSolverInit;
+ double _DurationOfSolverInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfFEProInit,_TimerEndOfFEProInit;
+ double _DurationOfFEProInit;
+
+ chrono::high_resolution_clock::time_point _TimerStartOfStaticJob,_TimerEndOfStaticJob;
+ double _DurationOfStaticJob;
+
+private:
+ InputSystem inputSystem;
+ Mesh mesh;
+ BCSystem bcSystem;
+ ICSystem icSystem;
+ DofHandler dofHandler;
+ ElmtSystem elmtSystem;
+ MaterialSystem materialSystem;
+ QPBlockInfo qpBlockInfo;
+
+ EquationSystem equationSystem;
+ SolutionSystem solutionSystem;
+
+ FESystem feSystem;
+
+ TimeStepping timeStepping;
+
+ LinearSolver linearSolver;
+ NonLinearSolver nonlinearSolver;
+
+ LinearSolverBlockInfo linearSolverBlock;
+ NonLinearSolverBlockInfo nonlinearSolverBlock;
+
+ FEJobType JobType=FEJobType::STATIC;
+
+ FECtrlInfo feCtrlInfo;
+ OutputSystem outputSystem;
+
+};
+
+#endif // ASFEM_FEPROBLEM_H
\ No newline at end of file
diff --git a/deprecated/include/FESystem/FESystem.h b/deprecated/include/FESystem/FESystem.h
new file mode 100644
index 00000000..5f3fbc4e
--- /dev/null
+++ b/deprecated/include/FESystem/FESystem.h
@@ -0,0 +1,99 @@
+#ifndef ASFEM_FESYSTEM_H
+#define ASFEM_FESYSTEM_H
+
+#include
+#include
+#include
+#include
+
+
+#include "Mesh/Mesh.h"
+#include "DofHandler/DofHandler.h"
+#include "BCs/BCSystem.h"
+
+#include "ElmtSystem/ElmtSystem.h"
+#include "MaterialSystem/MaterialSystem.h"
+#include "SolutionSystem/SolutionSystem.h"
+
+#include "FE/FE.h"
+#include "FE/QPoint.h"
+#include "FE/QPBlockInfo.h"
+
+
+
+
+#include "Eigen/Eigen"
+
+using namespace std;
+
+class FESystem
+{
+public:
+ FESystem();
+ void InitFESystem(Mesh &mesh,
+ DofHandler &dofHandler,
+ //SolutionSystem &solutionSystem,
+ QPBlockInfo &qpBlockInfo);
+
+ FE& GetFEPtr(){return fe;}
+
+ int GetBulkElmtGPointNums() const{return fe._qp_bulk.GetQpPointsNum();}
+
+public:
+ void SetHistNumPerGPoint(const int &n){_nHist=n;}
+ void SetProjNumPerNode(const int &n) {_nProj=n;}
+ void SetKMatrixFactor(const double &factor){_KMatrixFactor=factor;}
+ inline double GetKMatrixFactor() const{return _KMatrixFactor;}
+ void ResetMaxAMatrixValue(){_MaxKMatrixValue=1.0e3;}
+ void SetMaxAMatrixValue(const double &val) {_MaxKMatrixValue=val;}
+ inline double GetMaxAMatrixValue()const {return _MaxKMatrixValue;}
+ inline double GetVolume() const {return _Volumes;}
+ // for FEM simulation related functions
+ void FormFE(const int &isw,const double &t,const double &dt,const double (&ctan)[2],
+ Mesh &mesh,DofHandler &dofHandler,
+ ElmtSystem &elmtSystem,MaterialSystem &mateSystem,
+ const Eigen::VectorXd &U,const Eigen::VectorXd &V,
+ Eigen::MatrixXd &Hist,const Eigen::MatrixXd &HistOld,Eigen::MatrixXd &Proj,
+ Eigen::SparseMatrix &AMATRIX,Eigen::VectorXd &RHS);
+
+
+private:
+ void Projection(const int &nNodes,Eigen::MatrixXd &Proj,const vector &elProj,ShapeFun &shp,const double &DetJac);
+ void AssembleLocalHistToGlobal(const int &elmtid,const int &gpInd,const vector &gpHist,Eigen::MatrixXd &Hist);
+
+ void AssembleLocalToGlobal(const int &isw,const int &ndofs,const vector &elDofs,
+ const Eigen::MatrixXd &localK,const Eigen::VectorXd &localR,
+ Eigen::SparseMatrix &AMATRIX,Eigen::VectorXd &RHS);
+
+ void AssembleLocalToGlobal(const int &isw,const int &ndofs,
+ const vector &elDofs,const vector &elDofsActiveFlag,
+ const Eigen::MatrixXd &localK,const Eigen::VectorXd &localR,
+ Eigen::SparseMatrix &AMATRIX,Eigen::VectorXd &RHS);
+
+public:
+ void PrintFESystemInfo() const;
+
+
+private:
+ FE fe;
+
+
+private:
+ double _Volumes=0.0;
+ Eigen::MatrixXd _localK;
+ Eigen::VectorXd _localR;
+
+ Nodes _elNodes;
+ vector _elConn,_elDofs;
+ vector _elDofsActiveFlag;
+ vector _elU,_elV;
+ vector _gpU,_gpV;
+ vector _gpHist,_gpHistOld,_gpProj;
+ vector _gpGradU,_gpGradV;
+ vector _MaterialValues;
+ int _nHist,_nProj;
+ double _MaxKMatrixValue=1.0e3;
+ double _KMatrixFactor=1.0e16;
+};
+
+#endif // ASFEM_FESYSTEM_H
\ No newline at end of file
diff --git a/deprecated/include/ICs/ICBlock.h b/deprecated/include/ICs/ICBlock.h
new file mode 100644
index 00000000..1e584936
--- /dev/null
+++ b/deprecated/include/ICs/ICBlock.h
@@ -0,0 +1,50 @@
+#ifndef ASFEM_ICBLOCK_H
+#define ASFEM_ICBLOCK_H
+
+
+#include
+#include
+#include
+
+#include "ICType.h"
+
+class ICBlock
+{
+public:
+ std::string _ICBlockName; // [ic1]
+ std::string _DofName; // dof=u1
+ std::string _BlockName; // block=left
+ std::string _ICElmtName; // type=dirichlet [user1]
+ std::vector _value;
+ ICType _ICTypeID;
+
+ inline void Clear()
+ {
+ _ICBlockName="";
+ _DofName="";
+ _BlockName="";
+ _ICElmtName="";
+ _value.clear();
+ _ICTypeID=ICType::CONST;
+ }
+
+ void PrintICBlockInfo() const
+ {
+ std::printf("*** IC block name= %-34s ***\n",_ICBlockName.c_str());
+ std::printf("*** type name = %-34s ***\n",_ICElmtName.c_str());
+ std::printf("*** dof name = %-34s ***\n",_DofName.c_str());
+ if(_value.size()>0)
+ {
+ std::printf("*** value =");
+ for(unsigned int i=0;i<_value.size();i++)
+ {
+ std::cout<<_value[i]<<" ";
+ }
+ std::cout<
+#include
+#include
+#include
+
+#include "MessagePrint/MessagePrint.h"
+
+#include "ICBlock.h"
+
+#include "Mesh/Mesh.h"
+#include "DofHandler/DofHandler.h"
+
+#include "Eigen/Eigen"
+
+using namespace std;
+
+class ICSystem
+{
+public:
+ ICSystem();
+
+ void ApplyIC(Mesh &mesh,DofHandler &dofHandler,Eigen::VectorXd &U);
+
+ // setting functions
+ bool AddICBlock(const ICBlock &icblock);
+
+ // get information of BCSystem
+ inline int GetICBlockNum() const {return _nICBlocks;}
+ inline ICBlock GetIthICBlock(int i) {return _ICBlockList[i-1];}
+
+
+ void PrintICBlockInfo() const;
+
+private:
+ void ApplyConstIC(const vector &Params,const int &DofIndex,Mesh &mesh,DofHandler &dofHandler,Eigen::VectorXd &U);
+ void ApplyRandIC(const vector &Params,const int &DofIndex,Mesh &mesh,DofHandler &dofHandler,Eigen::VectorXd &U);
+ void ApplyCircleIC(const vector &Params,const int &DofIndex,Mesh &mesh,DofHandler &dofHandler,Eigen::VectorXd &U);
+
+private:
+ int _nICBlocks;
+ vector _ICBlockList;
+};
+
+#endif //
\ No newline at end of file
diff --git a/deprecated/include/ICs/ICType.h b/deprecated/include/ICs/ICType.h
new file mode 100644
index 00000000..b4abbb23
--- /dev/null
+++ b/deprecated/include/ICs/ICType.h
@@ -0,0 +1,16 @@
+#ifndef ICTYPE_H
+#define ICTYPE_H
+
+enum class ICType
+{
+ CONST,
+ RAND,
+ CIRCLE,
+ USER1,
+ USER2,
+ USER3,
+ USER4,
+ USER5
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/InputSystem/InputSystem.h b/deprecated/include/InputSystem/InputSystem.h
new file mode 100644
index 00000000..24f37234
--- /dev/null
+++ b/deprecated/include/InputSystem/InputSystem.h
@@ -0,0 +1,87 @@
+#ifndef ASFEM_INPUTSYSTEM_H
+#define ASFEM_INPUTSYSTEM_H
+
+#include
+#include
+#include
+#include
+
+
+// AsFem's own header file
+#include "MessagePrint/MessagePrint.h"
+#include "Utils/StringUtils.h"
+
+#include "Mesh/Mesh.h"
+#include "DofHandler/DofHandler.h"
+
+#include "BCs/BCSystem.h"
+#include "ICs/ICSystem.h"
+
+#include "ElmtSystem/ElmtSystem.h"
+#include "MaterialSystem/MaterialSystem.h"
+#include "FE/QPBlockInfo.h"
+#include "FEProblem/FECtrlInfo.h"
+
+#include "LinearSolver/LinearSolverBlockInfo.h"
+#include "NonLinearSolver/NonLinearSolverBlockInfo.h"
+
+#include "SolutionSystem/SolutionSystem.h"
+
+using namespace std;
+
+
+class InputSystem
+{
+public:
+ InputSystem(int args,char *argv[]);
+ InputSystem();
+ inline string GetInputFileName() const {return _InputFileName;}
+ void InitInputSystem(int args,char *argv[]);
+ bool ReadInputFile(Mesh &mesh,
+ DofHandler &dofHandler,
+ BCSystem &bcSystem,
+ ICSystem &icSystem,
+ ElmtSystem &elmtSystem,
+ MaterialSystem &mateSystem,
+ QPBlockInfo &qpBlockInfo,
+ LinearSolverBlockInfo &linearSolverBlockInfo,
+ NonLinearSolverBlockInfo &nonlinearSolverBlockInfo,
+ SolutionSystem &solutionSystem,
+ FECtrlInfo &feCtrlInfo);
+
+private:
+ bool ReadMeshBlock(ifstream &in,string str,int &linenum,Mesh &mesh);
+ bool ReadDofsBlock(ifstream &in,string str,int &linenum,DofHandler &dofHandler);
+
+ bool ReadBCBlock(ifstream &in,string str,const int &lastendlinenum,int &linenum,BCSystem &bcSystem);
+
+ bool ReadICBlock(ifstream &in,string str,const int &lastendlinenum,int &linenum,ICSystem &icSystem);
+
+ bool ReadElmtBlock(ifstream &in,string str,const int &lastendlinenum,int &linenum,ElmtSystem &elmtSystem,DofHandler &dofHandler);
+ bool ReadMateBlock(ifstream &in,string str,const int &lastendlinenum,int &linenum,MaterialSystem &mateSystem);
+
+ bool ReadQpBlock(ifstream &in,string str,int &linenum,QPBlockInfo &qpBlockInfo);
+
+ // For linear solver block
+ bool ReadLinearSolverBlock(ifstream &in,string str,int &linenum,LinearSolverBlockInfo &linearSolverBlockInfo);
+ // For nonlinear solver block
+ bool ReadNonLinearSolverBlock(ifstream &in,string str,int &linenum,NonLinearSolverBlockInfo &nonlinearSolverBlockInfo);
+
+
+ // For projection block
+ bool ReadProjectionBlock(ifstream &in,string str,int &linenum,SolutionSystem &solutionSystem);
+
+ bool ReadJobBlock(ifstream &in,string str,int &linenum,FECtrlInfo &feCtrlInfo);
+
+
+private:
+ string _InputFileName;
+ bool _HasInputFileName=false;
+
+ // information for mesh block
+ string _MeshFileName="";
+ bool _UseBultiInMesh=true;
+
+};
+
+#endif
\ No newline at end of file
diff --git a/deprecated/include/LinearSolver/LinearSolver.h b/deprecated/include/LinearSolver/LinearSolver.h
new file mode 100644
index 00000000..01971a11
--- /dev/null
+++ b/deprecated/include/LinearSolver/LinearSolver.h
@@ -0,0 +1,96 @@
+#ifndef ASFEM_LINEARSOLVER_H
+#define ASFEM_LINEARSOLVER_H
+
+#include
+#include
+#include
+
+#include "Eigen/Sparse"
+#include "Eigen/SparseCore"
+#include "Eigen/SparseLU"
+#include "Eigen/IterativeLinearSolvers"
+#include "unsupported/Eigen/IterativeSolvers"
+
+#ifdef USE_PARDISO
+#define EIGEN_USE_MKL_ALL
+#include "Eigen/PardisoSupport"
+#endif
+
+#ifdef USE_SUITESPARSE
+#include "umfpack.h"
+#endif
+
+
+
+
+#include "LinearSolverType.h"
+#include "LinearSolverBlockInfo.h"
+#include "MessagePrint/MessagePrint.h"
+
+using namespace std;
+
+
+class LinearSolver
+{
+public:
+ LinearSolver();
+
+ void InitLinearSolver(LinearSolverBlockInfo &linearSolverBlockInfo);
+ void SetSolverType(LinearSolverType type){_SolverType=type;}
+ void SetMaxIters(const int &maxiters) {_MaxIters=maxiters;}
+ void SetTolerance(const double &tol) {_Tolerance=tol;}
+
+ int GetIters() const;
+ double GetTolerance() const;
+ LinearSolverType GetSolverType() const {return _SolverType;}
+
+ bool Solve(Eigen::SparseMatrix &A,
+ Eigen::VectorXd &F,Eigen::VectorXd &x);
+
+ void PrintSolverInfo() const;
+
+private:
+ LinearSolverType _SolverType;
+ int _MaxIters,_Restarts;
+ double _Tolerance;
+
+private:
+ bool _IsInit=false;
+ // define all the solvers
+ //Eigen::SparseLU,Eigen::COLAMDOrdering> _SparseLUSolver;
+ //Eigen::SparseLU> _SparseLUSolver;
+ Eigen::SparseLU> _SparseLUSolver;
+ Eigen::SparseQR,Eigen::COLAMDOrdering> _SparseQRSolver;
+ // for iterative solver
+ Eigen::ConjugateGradient,
+ Eigen::Lower|Eigen::Upper> _CGSolver;
+
+ // it seems bicg can't be paralled when LUT preconditioner is used!
+ // Eigen::BiCGSTAB,
+ // Eigen::IncompleteLUT> _BICGSolver;
+ Eigen::BiCGSTAB> _BICGSolver;
+
+ Eigen::GMRES> _GMRESSolver;// don't use iLUT preconditioner
+
+ // when iLUT preconditionier is used, the openmp has not effect at all!!!
+ // Eigen::GMRES,
+ // Eigen::IncompleteLUT> _GMRESSolver;
+
+ // // for some solver tags from Viennacl
+ // viennacl::linalg::gmres_tag _gmres_tag{1.0e-8,500,20};
+ // // viennacl::linalg::gmres_tag _gmres_tag;
+ // viennacl::compressed_matrix _vl_spmat;
+ // viennacl::vector _vl_rhs,_vl_x;
+ // viennacl::linalg::chow_patel_tag _chow_patel_ilu_config;
+ // use solver from AMGCL
+
+
+ // for pardiso from intel!
+ // in order to use it, you must install intel's icc compiler!!!
+ #ifdef USE_PARDISO
+ Eigen::PardisoLU> _PardisoLUSolver;
+ #endif
+
+};
+
+#endif // ASFEM_LINEARSOLVER_H
\ No newline at end of file
diff --git a/deprecated/include/LinearSolver/LinearSolverBlockInfo.h b/deprecated/include/LinearSolver/LinearSolverBlockInfo.h
new file mode 100644
index 00000000..bcb84615
--- /dev/null
+++ b/deprecated/include/LinearSolver/LinearSolverBlockInfo.h
@@ -0,0 +1,30 @@
+#ifndef ASFEM_LINEARSOLVERBLOCKINFO_H
+#define ASFEM_LINEARSOLVERBLOCKINFO_H
+
+#include
+#include
+#include
+
+#include "LinearSolverType.h"
+
+using namespace std;
+
+
+class LinearSolverBlockInfo{
+public:
+ int _MaxIters=2000;// for iterative solver
+ double _Tol=1.0e-6; // for iterative solver
+ int _Restart=500;
+ string _SolverName="lu";
+ LinearSolverType _SolverType=LinearSolverType::SPARSELU;
+
+ void Reset(){
+ _MaxIters=2000;// for iterative solver
+ _Tol=1.0e-6; // for iterative solver
+ _Restart=500;
+ _SolverName="lu";
+ _SolverType=LinearSolverType::SPARSELU;
+ }
+};
+
+#endif //
\ No newline at end of file
diff --git a/deprecated/include/LinearSolver/LinearSolverType.h b/deprecated/include/LinearSolver/LinearSolverType.h
new file mode 100644
index 00000000..5266e985
--- /dev/null
+++ b/deprecated/include/LinearSolver/LinearSolverType.h
@@ -0,0 +1,15 @@
+#ifndef ASFEM_LINEARSOLVERTYPE_H
+#define ASFEM_LINEARSOLVERTYPE_H
+
+enum class LinearSolverType
+{
+ SPARSELU,
+ SPARSEQR,
+ CG,
+ BICG,
+ GMRES,
+ PARDISOLU,
+ UMFPACK
+};
+
+#endif // ASFEM_LINEARSOLVERTYPE_H
\ No newline at end of file
diff --git a/deprecated/include/MaterialSystem/MaterialBlock.h b/deprecated/include/MaterialSystem/MaterialBlock.h
new file mode 100644
index 00000000..f7235aee
--- /dev/null
+++ b/deprecated/include/MaterialSystem/MaterialBlock.h
@@ -0,0 +1,43 @@
+#ifndef ASFEM_MATERIALBLOCK_H
+#define ASFEM_MATERIALBLOCK_H
+
+#include
+#include
+#include
+#include
+
+#include "MaterialType.h"
+
+class MaterialBlock
+{
+public:
+ std::string _MateBlockName;
+ std::string _MateTypeName;
+ std::vector _MateParams;
+ MaterialType _MateTypeID=MaterialType::CONSTPOISSONMATE;
+
+ void Clean()
+ {
+ _MateBlockName="";
+ _MateTypeName="";
+ _MateParams.clear();
+ _MateTypeID=MaterialType::NULLMATE;
+ }
+
+ void PrintMateBlockInfo() const
+ {
+ std::printf("*** Mateblockname= %-34s ***\n",_MateBlockName.c_str());
+ std::printf("*** type name = %-34s ***\n",_MateTypeName.c_str());
+ if(_MateParams.size()>0)
+ {
+ std::printf("*** params =");
+ for(unsigned int i=0;i<_MateParams.size();i++)
+ {
+ std::cout<<_MateParams[i]<<" ";
+ }
+ std::cout<
+#include
+#include
+#include
+// #include