| @@ -0,0 +1,4 @@ | |||
| build | |||
| sparselizard | |||
| nbproject | |||
| src | |||
| @@ -0,0 +1,5 @@ | |||
| If you like this library do not hesitate to cite the following reference: | |||
| "Sparselizard - the user friendly finite element c++ library", Alexandre Halbach, University of Liege, Belgium | |||
| available at "http://hdl.handle.net/2268/216780". | |||
| @@ -0,0 +1,2 @@ | |||
| Copyright (C) 2017 A. Halbach and C. Geuzaine, University of Liege | |||
| Copyright (C) 2018-2019 A. Halbach, IMEC | |||
| @@ -0,0 +1,7 @@ | |||
| Alexandre Halbach <alexandre.halbach at gmail.com> | |||
| Sincere thanks | |||
| to Maxime Spirlet for all his technical help, | |||
| to Christophe Geuzaine for his very broad knowledge of numerical methods, | |||
| to Rachid Haouari for his valuable user feedback and code input, | |||
| and to the PETSc team for PETSc and for the unlimited support they provide. | |||
| @@ -0,0 +1,344 @@ | |||
| Sparselizard is provided under the terms of the GNU General Public License | |||
| (GPL), Version 2 or later. | |||
| GNU GENERAL PUBLIC LICENSE | |||
| Version 2 | |||
| Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |||
| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |||
| Everyone is permitted to copy and distribute verbatim copies | |||
| of this license document, but changing it is not allowed. | |||
| Preamble | |||
| The licenses for most software are designed to take away your | |||
| freedom to share and change it. By contrast, the GNU General Public | |||
| License is intended to guarantee your freedom to share and change free | |||
| software--to make sure the software is free for all its users. This | |||
| General Public License applies to most of the Free Software | |||
| Foundation's software and to any other program whose authors commit to | |||
| using it. (Some other Free Software Foundation software is covered by | |||
| the GNU Library General Public License instead.) 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 | |||
| this service 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 make restrictions that forbid | |||
| anyone to deny you these rights or to ask you to surrender the rights. | |||
| These restrictions translate to certain responsibilities for you if you | |||
| distribute copies of the software, or if you modify it. | |||
| For example, if you distribute copies of such a program, whether | |||
| gratis or for a fee, you must give the recipients all the rights that | |||
| you have. 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. | |||
| We protect your rights with two steps: (1) copyright the software, and | |||
| (2) offer you this license which gives you legal permission to copy, | |||
| distribute and/or modify the software. | |||
| Also, for each author's protection and ours, we want to make certain | |||
| that everyone understands that there is no warranty for this free | |||
| software. If the software is modified by someone else and passed on, we | |||
| want its recipients to know that what they have is not the original, so | |||
| that any problems introduced by others will not reflect on the original | |||
| authors' reputations. | |||
| Finally, any free program is threatened constantly by software | |||
| patents. We wish to avoid the danger that redistributors of a free | |||
| program will individually obtain patent licenses, in effect making the | |||
| program proprietary. To prevent this, we have made it clear that any | |||
| patent must be licensed for everyone's free use or not licensed at all. | |||
| The precise terms and conditions for copying, distribution and | |||
| modification follow. | |||
| GNU GENERAL PUBLIC LICENSE | |||
| TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |||
| 0. This License applies to any program or other work which contains | |||
| a notice placed by the copyright holder saying it may be distributed | |||
| under the terms of this General Public License. The "Program", below, | |||
| refers to any such program or work, and a "work based on the Program" | |||
| means either the Program or any derivative work under copyright law: | |||
| that is to say, a work containing the Program or a portion of it, | |||
| either verbatim or with modifications and/or translated into another | |||
| language. (Hereinafter, translation is included without limitation in | |||
| the term "modification".) Each licensee is addressed as "you". | |||
| Activities other than copying, distribution and modification are not | |||
| covered by this License; they are outside its scope. The act of | |||
| running the Program is not restricted, and the output from the Program | |||
| is covered only if its contents constitute a work based on the | |||
| Program (independent of having been made by running the Program). | |||
| Whether that is true depends on what the Program does. | |||
| 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the | |||
| notices that refer to this License and to the absence of any warranty; | |||
| and give any other recipients of the Program a copy of this License | |||
| along with the Program. | |||
| You may charge a fee for the physical act of transferring a copy, and | |||
| you may at your option offer warranty protection in exchange for a fee. | |||
| 2. You may modify your copy or copies of the Program or any portion | |||
| of it, thus forming a work based on the Program, and copy and | |||
| distribute such modifications or work under the terms of Section 1 | |||
| above, provided that you also meet all of these conditions: | |||
| a) You must cause the modified files to carry prominent notices | |||
| stating that you changed the files and the date of any change. | |||
| b) You must cause any work that you distribute or publish, that in | |||
| whole or in part contains or is derived from the Program or any | |||
| part thereof, to be licensed as a whole at no charge to all third | |||
| parties under the terms of this License. | |||
| c) If the modified program normally reads commands interactively | |||
| when run, you must cause it, when started running for such | |||
| interactive use in the most ordinary way, to print or display an | |||
| announcement including an appropriate copyright notice and a | |||
| notice that there is no warranty (or else, saying that you provide | |||
| a warranty) and that users may redistribute the program under | |||
| these conditions, and telling the user how to view a copy of this | |||
| License. (Exception: if the Program itself is interactive but | |||
| does not normally print such an announcement, your work based on | |||
| the Program is not required to print an announcement.) | |||
| These requirements apply to the modified work as a whole. If | |||
| identifiable sections of that work are not derived from the Program, | |||
| and can be reasonably considered independent and separate works in | |||
| themselves, then this License, and its terms, do not apply to those | |||
| sections when you distribute them as separate works. But when you | |||
| distribute the same sections as part of a whole which is a work based | |||
| on the Program, the distribution of the whole must be on the terms of | |||
| this License, whose permissions for other licensees extend to the | |||
| entire whole, and thus to each and every part regardless of who wrote it. | |||
| Thus, it is not the intent of this section to claim rights or contest | |||
| your rights to work written entirely by you; rather, the intent is to | |||
| exercise the right to control the distribution of derivative or | |||
| collective works based on the Program. | |||
| In addition, mere aggregation of another work not based on the Program | |||
| with the Program (or with a work based on the Program) on a volume of | |||
| a storage or distribution medium does not bring the other work under | |||
| the scope of this License. | |||
| 3. You may copy and distribute the Program (or a work based on it, | |||
| under Section 2) in object code or executable form under the terms of | |||
| Sections 1 and 2 above provided that you also do one of the following: | |||
| a) Accompany it with the complete corresponding machine-readable | |||
| source code, which must be distributed under the terms of Sections | |||
| 1 and 2 above on a medium customarily used for software interchange; or, | |||
| b) Accompany it with a written offer, valid for at least three | |||
| years, to give any third party, for a charge no more than your | |||
| cost of physically performing source distribution, a complete | |||
| machine-readable copy of the corresponding source code, to be | |||
| distributed under the terms of Sections 1 and 2 above on a medium | |||
| customarily used for software interchange; or, | |||
| c) Accompany it with the information you received as to the offer | |||
| to distribute corresponding source code. (This alternative is | |||
| allowed only for noncommercial distribution and only if you | |||
| received the program in object code or executable form with such | |||
| an offer, in accord with Subsection b above.) | |||
| The source code for a work means the preferred form of the work for | |||
| making modifications to it. For an executable work, complete source | |||
| code means all the source code for all modules it contains, plus any | |||
| associated interface definition files, plus the scripts used to | |||
| control compilation and installation of the executable. However, as a | |||
| special exception, the source code distributed need not include | |||
| anything that is normally distributed (in either source or binary | |||
| form) with the major components (compiler, kernel, and so on) of the | |||
| operating system on which the executable runs, unless that component | |||
| itself accompanies the executable. | |||
| If distribution of executable or object code is made by offering | |||
| access to copy from a designated place, then offering equivalent | |||
| access to copy the source code from the same place counts as | |||
| distribution of the source code, even though third parties are not | |||
| compelled to copy the source along with the object code. | |||
| 4. You may not copy, modify, sublicense, or distribute the Program | |||
| except as expressly provided under this License. Any attempt | |||
| otherwise to copy, modify, sublicense or distribute the Program is | |||
| void, and will automatically terminate your rights under this License. | |||
| However, parties who have received copies, or rights, from you under | |||
| this License will not have their licenses terminated so long as such | |||
| parties remain in full compliance. | |||
| 5. You are not required to accept this License, since you have not | |||
| signed it. However, nothing else grants you permission to modify or | |||
| distribute the Program or its derivative works. These actions are | |||
| prohibited by law if you do not accept this License. Therefore, by | |||
| modifying or distributing the Program (or any work based on the | |||
| Program), you indicate your acceptance of this License to do so, and | |||
| all its terms and conditions for copying, distributing or modifying | |||
| the Program or works based on it. | |||
| 6. Each time you redistribute the Program (or any work based on the | |||
| Program), the recipient automatically receives a license from the | |||
| original licensor to copy, distribute or modify the Program subject to | |||
| these terms and conditions. You may not impose any further | |||
| restrictions on the recipients' exercise of the rights granted herein. | |||
| You are not responsible for enforcing compliance by third parties to | |||
| this License. | |||
| 7. If, as a consequence of a court judgment or allegation of patent | |||
| infringement or for any other reason (not limited to patent issues), | |||
| 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 | |||
| distribute so as to satisfy simultaneously your obligations under this | |||
| License and any other pertinent obligations, then as a consequence you | |||
| may not distribute the Program at all. For example, if a patent | |||
| license would not permit royalty-free redistribution of the Program by | |||
| all those who receive copies directly or indirectly through you, then | |||
| the only way you could satisfy both it and this License would be to | |||
| refrain entirely from distribution of the Program. | |||
| If any portion of this section is held invalid or unenforceable under | |||
| any particular circumstance, the balance of the section is intended to | |||
| apply and the section as a whole is intended to apply in other | |||
| circumstances. | |||
| It is not the purpose of this section to induce you to infringe any | |||
| patents or other property right claims or to contest validity of any | |||
| such claims; this section has the sole purpose of protecting the | |||
| integrity of the free software distribution system, which is | |||
| implemented by public license practices. Many people have made | |||
| generous contributions to the wide range of software distributed | |||
| through that system in reliance on consistent application of that | |||
| system; it is up to the author/donor to decide if he or she is willing | |||
| to distribute software through any other system and a licensee cannot | |||
| impose that choice. | |||
| This section is intended to make thoroughly clear what is believed to | |||
| be a consequence of the rest of this License. | |||
| 8. If the distribution and/or use of the Program is restricted in | |||
| certain countries either by patents or by copyrighted interfaces, the | |||
| original copyright holder who places the Program under this License | |||
| may add an explicit geographical distribution limitation excluding | |||
| those countries, so that distribution is permitted only in or among | |||
| countries not thus excluded. In such case, this License incorporates | |||
| the limitation as if written in the body of this License. | |||
| 9. The Free Software Foundation may publish revised and/or new versions | |||
| of the 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 a version number of this License which applies to it and "any | |||
| later version", you have the option of following the terms and conditions | |||
| either of that version or of any later version published by the Free | |||
| Software Foundation. If the Program does not specify a version number of | |||
| this License, you may choose any version ever published by the Free Software | |||
| Foundation. | |||
| 10. If you wish to incorporate parts of the Program into other free | |||
| programs whose distribution conditions are different, write to the author | |||
| to ask for permission. For software which is copyrighted by the Free | |||
| Software Foundation, write to the Free Software Foundation; we sometimes | |||
| make exceptions for this. Our decision will be guided by the two goals | |||
| of preserving the free status of all derivatives of our free software and | |||
| of promoting the sharing and reuse of software generally. | |||
| NO WARRANTY | |||
| 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. | |||
| 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |||
| WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |||
| REDISTRIBUTE 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. | |||
| 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 | |||
| convey the exclusion of warranty; and each file should have at least | |||
| the "copyright" line and a pointer to where the full notice is found. | |||
| <one line to give the program's name and a brief idea of what it does.> | |||
| Copyright (C) <year> <name of author> | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 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, write to the Free Software | |||
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
| Also add information on how to contact you by electronic and paper mail. | |||
| If the program is interactive, make it output a short notice like this | |||
| when it starts in an interactive mode: | |||
| Gnomovision version 69, Copyright (C) year name of author | |||
| Gnomovision 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, the commands you use may | |||
| be called something other than `show w' and `show c'; they could even be | |||
| mouse-clicks or menu items--whatever suits your program. | |||
| You should also get your employer (if you work as a programmer) or your | |||
| school, if any, to sign a "copyright disclaimer" for the program, if | |||
| necessary. Here is a sample; alter the names: | |||
| Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |||
| `Gnomovision' (which makes passes at compilers) written by James Hacker. | |||
| <signature of Ty Coon>, 1 April 1989 | |||
| Ty Coon, President of Vice | |||
| This 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 Library General | |||
| Public License instead of this License. | |||
| @@ -0,0 +1,58 @@ | |||
| ##### THESE ARE THE REQUIRED LIBRARIES: | |||
| UNAME := $(shell uname) | |||
| ifeq ($(UNAME), Linux) | |||
| LIBS = -L ~/SLlibs/petsc/arch-linux2-c-opt/lib -l openblas -l petsc -l slepc | |||
| INCL = -I ~/SLlibs/petsc/include/petsc/mpiuni -I ~/SLlibs/petsc/arch-linux2-c-opt/externalpackages/git.openblas -I ~/SLlibs/petsc/include/ -I ~/SLlibs/petsc/arch-linux2-c-opt/include/ | |||
| endif | |||
| ifeq ($(UNAME), Darwin) | |||
| LIBS = -L ~/SLlibs/petsc/arch-darwin-c-opt/lib -l openblas -l petsc -l slepc | |||
| INCL = -I ~/SLlibs/petsc/include/petsc/mpiuni -I ~/SLlibs/petsc/arch-darwin-c-opt/externalpackages/git.openblas -I ~/SLlibs/petsc/include/ -I ~/SLlibs/petsc/arch-darwin-c-opt/include/ | |||
| endif | |||
| # $@ is the filename representing the target. | |||
| # $< is the filename of the first prerequisite. | |||
| # $^ the filenames of all the prerequisites. | |||
| # $(@D) is the file path of the target file. | |||
| # D can be added to all of the above. | |||
| CXX = g++ -fopenmp # openmp is used for parallel sorting on Linux | |||
| CXX_FLAGS= -std=c++11 -O0 -g -Wno-return-type # Do not warn when not returning anything (e.g. in virtual functions) | |||
| # List of all directories containing the headers: | |||
| INCLUDES = -I src -I src/field -I src/expression -I src/expression/operation -I src/shapefunction -I src/formulation -I src/shapefunction/hierarchical -I src/shapefunction/hierarchical/h1 -I src/shapefunction/hierarchical/hcurl -I src/shapefunction/hierarchical/meca -I src/gausspoint -I src/shapefunction/lagrange -I src/mesh -I src/io -I src/io/gmsh -I src/io/paraview -I src/io/nastran -I src/resolution -I src/geometry | |||
| # List of all .cpp source files: | |||
| CPPS= $(wildcard src/*.cpp) $(wildcard src/field/*.cpp) $(wildcard src/expression/*.cpp) $(wildcard src/expression/operation/*.cpp) $(wildcard src/shapefunction/*.cpp) $(wildcard src/formulation/*.cpp) $(wildcard src/shapefunction/hierarchical/*.cpp) $(wildcard src/shapefunction/hierarchical/h1/*.cpp) $(wildcard src/shapefunction/hierarchical/meca/*.cpp) $(wildcard src/shapefunction/hierarchical/hcurl/*.cpp) $(wildcard src/gausspoint/*.cpp) $(wildcard src/shapefunction/lagrange/*.cpp) $(wildcard src/mesh/*.cpp) $(wildcard src/io/*.cpp) $(wildcard src/io/gmsh/*.cpp) $(wildcard src/io/paraview/*.cpp) $(wildcard src/io/nastran/*.cpp) $(wildcard src/resolution/*.cpp) $(wildcard src/geometry/*.cpp) | |||
| # Final binary name: | |||
| BIN = sparselizard | |||
| # Put all generated stuff to this build directory: | |||
| BUILD_DIR = ./build | |||
| # Same list as CPP but with the .o object extension: | |||
| OBJECTS=$(CPPS:%.cpp=$(BUILD_DIR)/%.o) | |||
| # Gcc/Clang will create these .d files containing dependencies. | |||
| DEP = $(OBJECTS:%.o=%.d) | |||
| all: $(OBJECTS) | |||
| # The main is always recompiled (it could have been replaced): | |||
| $(CXX) $(CXX_FLAGS) $(LIBS) $(INCL) $(INCLUDES) -c main.cpp -o $(BUILD_DIR)/main.o | |||
| # Linking objects: | |||
| $(CXX) $(BUILD_DIR)/main.o $(OBJECTS) $(LIBS) -o $(BIN) | |||
| # Include all .d files | |||
| -include $(DEP) | |||
| $(BUILD_DIR)/%.o: %.cpp | |||
| # Create the folder of the current target in the build directory: | |||
| mkdir -p $(@D) | |||
| # Compile .cpp file. MMD creates the dependencies. | |||
| $(CXX) $(CXX_FLAGS) $(LIBS) $(INCL) $(INCLUDES) -MMD -c $< -o $@ | |||
| clean : | |||
| # Removes all files created. | |||
| rm -rf $(BUILD_DIR) | |||
| rm -f $(BIN) | |||
| @@ -0,0 +1,6 @@ | |||
| The `src` directory should be a symlink to the base sparselizard distribution. | |||
| Note that the positive check for `universe::isaxisymmetric` in `src/io/paraview/pvinterface.cpp:175` has been commented out to get results in $x$-$y$. | |||
| The input mesh is the same as in Fino (axi-100.geo) but written in v2.2 | |||
| The result axi-fino-100.dat is the horizontal displacement (in the x direction) along evaluated at x=0.95*0.05 along y \in [0,2]. | |||
| Full 2D vtk is axi-fino-100.vtk | |||
| @@ -0,0 +1,17 @@ | |||
| // an structured rectangle which creates an axi-symmetric | |||
| // solid cylinder of radius 0.5 and length (height) 2 | |||
| SetFactory("OpenCASCADE"); | |||
| Rectangle(1) = {0, 0, 0, 0.5, 2}; | |||
| // entities for BCs and volume | |||
| Physical Curve("bottom", 1) = {1}; | |||
| Physical Curve("top", 2) = {3}; | |||
| Physical Surface("bulk", 3) = {1}; | |||
| // structured grid | |||
| Transfinite Line {1,3} = 1+0.5/0.01; | |||
| Transfinite Line {2,4} = 1+2/0.01; | |||
| Transfinite Surface "*"; | |||
| Recombine Surface {1}; // quads instead of triangs | |||
| Mesh.ElementOrder = 2; // second-order quads | |||
| Mesh.SecondOrderIncomplete = 0; // force quads9 (if set to true, quad8 are created) | |||
| @@ -0,0 +1,201 @@ | |||
| 0.000000e+00 0.000000e+00 | |||
| 1.000000e-02 1.055176e-05 | |||
| 2.000000e-02 2.173914e-05 | |||
| 3.000000e-02 3.231060e-05 | |||
| 4.000000e-02 4.187692e-05 | |||
| 5.000000e-02 5.046932e-05 | |||
| 6.000000e-02 5.821022e-05 | |||
| 7.000000e-02 6.521901e-05 | |||
| 8.000000e-02 7.159544e-05 | |||
| 9.000000e-02 7.741982e-05 | |||
| 1.000000e-01 8.275715e-05 | |||
| 1.100000e-01 8.766089e-05 | |||
| 1.200000e-01 9.217560e-05 | |||
| 1.300000e-01 9.633892e-05 | |||
| 1.400000e-01 1.001829e-04 | |||
| 1.500000e-01 1.037355e-04 | |||
| 1.600000e-01 1.070210e-04 | |||
| 1.700000e-01 1.100609e-04 | |||
| 1.800000e-01 1.128748e-04 | |||
| 1.900000e-01 1.154798e-04 | |||
| 2.000000e-01 1.178915e-04 | |||
| 2.100000e-01 1.201243e-04 | |||
| 2.200000e-01 1.221910e-04 | |||
| 2.300000e-01 1.241032e-04 | |||
| 2.400000e-01 1.258722e-04 | |||
| 2.500000e-01 1.275078e-04 | |||
| 2.600000e-01 1.290193e-04 | |||
| 2.700000e-01 1.304149e-04 | |||
| 2.800000e-01 1.317031e-04 | |||
| 2.900000e-01 1.328909e-04 | |||
| 3.000000e-01 1.339854e-04 | |||
| 3.100000e-01 1.349930e-04 | |||
| 3.200000e-01 1.359194e-04 | |||
| 3.300000e-01 1.367703e-04 | |||
| 3.400000e-01 1.375508e-04 | |||
| 3.500000e-01 1.382659e-04 | |||
| 3.600000e-01 1.389201e-04 | |||
| 3.700000e-01 1.395175e-04 | |||
| 3.800000e-01 1.400623e-04 | |||
| 3.900000e-01 1.405580e-04 | |||
| 4.000000e-01 1.410083e-04 | |||
| 4.100000e-01 1.414164e-04 | |||
| 4.200000e-01 1.417853e-04 | |||
| 4.300000e-01 1.421178e-04 | |||
| 4.400000e-01 1.424169e-04 | |||
| 4.500000e-01 1.426847e-04 | |||
| 4.600000e-01 1.429238e-04 | |||
| 4.700000e-01 1.431362e-04 | |||
| 4.800000e-01 1.433242e-04 | |||
| 4.900000e-01 1.434896e-04 | |||
| 5.000000e-01 1.436342e-04 | |||
| 5.100000e-01 1.437596e-04 | |||
| 5.200000e-01 1.438674e-04 | |||
| 5.300000e-01 1.439591e-04 | |||
| 5.400000e-01 1.440362e-04 | |||
| 5.500000e-01 1.440998e-04 | |||
| 5.600000e-01 1.441510e-04 | |||
| 5.700000e-01 1.441911e-04 | |||
| 5.800000e-01 1.442210e-04 | |||
| 5.900000e-01 1.442417e-04 | |||
| 6.000000e-01 1.442541e-04 | |||
| 6.100000e-01 1.442590e-04 | |||
| 6.200000e-01 1.442571e-04 | |||
| 6.300000e-01 1.442493e-04 | |||
| 6.400000e-01 1.442362e-04 | |||
| 6.500000e-01 1.442183e-04 | |||
| 6.600000e-01 1.441961e-04 | |||
| 6.700000e-01 1.441704e-04 | |||
| 6.800000e-01 1.441414e-04 | |||
| 6.900000e-01 1.441097e-04 | |||
| 7.000000e-01 1.440755e-04 | |||
| 7.100000e-01 1.440392e-04 | |||
| 7.200000e-01 1.440013e-04 | |||
| 7.300000e-01 1.439620e-04 | |||
| 7.400000e-01 1.439217e-04 | |||
| 7.500000e-01 1.438805e-04 | |||
| 7.600000e-01 1.438387e-04 | |||
| 7.700000e-01 1.437965e-04 | |||
| 7.800000e-01 1.437542e-04 | |||
| 7.900000e-01 1.437119e-04 | |||
| 8.000000e-01 1.436697e-04 | |||
| 8.100000e-01 1.436277e-04 | |||
| 8.200000e-01 1.435860e-04 | |||
| 8.300000e-01 1.435448e-04 | |||
| 8.400000e-01 1.435043e-04 | |||
| 8.500000e-01 1.434644e-04 | |||
| 8.600000e-01 1.434252e-04 | |||
| 8.700000e-01 1.433870e-04 | |||
| 8.800000e-01 1.433494e-04 | |||
| 8.900000e-01 1.433127e-04 | |||
| 9.000000e-01 1.432770e-04 | |||
| 9.100000e-01 1.432422e-04 | |||
| 9.200000e-01 1.432084e-04 | |||
| 9.300000e-01 1.431756e-04 | |||
| 9.400000e-01 1.431439e-04 | |||
| 9.500000e-01 1.431131e-04 | |||
| 9.600000e-01 1.430834e-04 | |||
| 9.700000e-01 1.430545e-04 | |||
| 9.800000e-01 1.430267e-04 | |||
| 9.900000e-01 1.430000e-04 | |||
| 1.000000e+00 1.429744e-04 | |||
| 1.010000e+00 1.429497e-04 | |||
| 1.020000e+00 1.429260e-04 | |||
| 1.030000e+00 1.429032e-04 | |||
| 1.040000e+00 1.428814e-04 | |||
| 1.050000e+00 1.428604e-04 | |||
| 1.060000e+00 1.428403e-04 | |||
| 1.070000e+00 1.428212e-04 | |||
| 1.080000e+00 1.428029e-04 | |||
| 1.090000e+00 1.427854e-04 | |||
| 1.100000e+00 1.427687e-04 | |||
| 1.110000e+00 1.427528e-04 | |||
| 1.120000e+00 1.427378e-04 | |||
| 1.130000e+00 1.427234e-04 | |||
| 1.140000e+00 1.427097e-04 | |||
| 1.150000e+00 1.426966e-04 | |||
| 1.160000e+00 1.426843e-04 | |||
| 1.170000e+00 1.426725e-04 | |||
| 1.180000e+00 1.426613e-04 | |||
| 1.190000e+00 1.426507e-04 | |||
| 1.200000e+00 1.426407e-04 | |||
| 1.210000e+00 1.426313e-04 | |||
| 1.220000e+00 1.426223e-04 | |||
| 1.230000e+00 1.426138e-04 | |||
| 1.240000e+00 1.426058e-04 | |||
| 1.250000e+00 1.425983e-04 | |||
| 1.260000e+00 1.425912e-04 | |||
| 1.270000e+00 1.425845e-04 | |||
| 1.280000e+00 1.425783e-04 | |||
| 1.290000e+00 1.425724e-04 | |||
| 1.300000e+00 1.425670e-04 | |||
| 1.310000e+00 1.425618e-04 | |||
| 1.320000e+00 1.425569e-04 | |||
| 1.330000e+00 1.425524e-04 | |||
| 1.340000e+00 1.425481e-04 | |||
| 1.350000e+00 1.425441e-04 | |||
| 1.360000e+00 1.425403e-04 | |||
| 1.370000e+00 1.425369e-04 | |||
| 1.380000e+00 1.425337e-04 | |||
| 1.390000e+00 1.425306e-04 | |||
| 1.400000e+00 1.425278e-04 | |||
| 1.410000e+00 1.425252e-04 | |||
| 1.420000e+00 1.425227e-04 | |||
| 1.430000e+00 1.425204e-04 | |||
| 1.440000e+00 1.425183e-04 | |||
| 1.450000e+00 1.425163e-04 | |||
| 1.460000e+00 1.425145e-04 | |||
| 1.470000e+00 1.425128e-04 | |||
| 1.480000e+00 1.425113e-04 | |||
| 1.490000e+00 1.425099e-04 | |||
| 1.500000e+00 1.425086e-04 | |||
| 1.510000e+00 1.425074e-04 | |||
| 1.520000e+00 1.425063e-04 | |||
| 1.530000e+00 1.425053e-04 | |||
| 1.540000e+00 1.425043e-04 | |||
| 1.550000e+00 1.425034e-04 | |||
| 1.560000e+00 1.425026e-04 | |||
| 1.570000e+00 1.425019e-04 | |||
| 1.580000e+00 1.425012e-04 | |||
| 1.590000e+00 1.425007e-04 | |||
| 1.600000e+00 1.425002e-04 | |||
| 1.610000e+00 1.424999e-04 | |||
| 1.620000e+00 1.424995e-04 | |||
| 1.630000e+00 1.424992e-04 | |||
| 1.640000e+00 1.424988e-04 | |||
| 1.650000e+00 1.424985e-04 | |||
| 1.660000e+00 1.424984e-04 | |||
| 1.670000e+00 1.424983e-04 | |||
| 1.680000e+00 1.424982e-04 | |||
| 1.690000e+00 1.424980e-04 | |||
| 1.700000e+00 1.424978e-04 | |||
| 1.710000e+00 1.424976e-04 | |||
| 1.720000e+00 1.424974e-04 | |||
| 1.730000e+00 1.424973e-04 | |||
| 1.740000e+00 1.424971e-04 | |||
| 1.750000e+00 1.424970e-04 | |||
| 1.760000e+00 1.424969e-04 | |||
| 1.770000e+00 1.424967e-04 | |||
| 1.780000e+00 1.424966e-04 | |||
| 1.790000e+00 1.424966e-04 | |||
| 1.800000e+00 1.424967e-04 | |||
| 1.810000e+00 1.424965e-04 | |||
| 1.820000e+00 1.424963e-04 | |||
| 1.830000e+00 1.424961e-04 | |||
| 1.840000e+00 1.424958e-04 | |||
| 1.850000e+00 1.424958e-04 | |||
| 1.860000e+00 1.424958e-04 | |||
| 1.870000e+00 1.424957e-04 | |||
| 1.880000e+00 1.424954e-04 | |||
| 1.890000e+00 1.424952e-04 | |||
| 1.900000e+00 1.424949e-04 | |||
| 1.910000e+00 1.424948e-04 | |||
| 1.920000e+00 1.424948e-04 | |||
| 1.930000e+00 1.424949e-04 | |||
| 1.940000e+00 1.424948e-04 | |||
| 1.950000e+00 1.424948e-04 | |||
| 1.960000e+00 1.424949e-04 | |||
| 1.970000e+00 1.424949e-04 | |||
| 1.980000e+00 1.424949e-04 | |||
| 1.990000e+00 1.424949e-04 | |||
| 2.000000e+00 1.424948e-04 | |||
| @@ -0,0 +1,2 @@ | |||
| Merge "axi-100.geo"; | |||
| Mesh.MshFileVersion = 2.2; | |||
| @@ -0,0 +1,100 @@ | |||
| 2.000000e-02 2.173914e-05 2.043216e-05 -1.306978e-06 -6.396668e-02 | |||
| 3.980000e-02 4.168559e-05 4.005148e-05 -1.634118e-06 -4.080044e-02 | |||
| 5.960000e-02 5.790058e-05 5.636475e-05 -1.535834e-06 -2.724813e-02 | |||
| 7.940000e-02 7.121285e-05 7.336344e-05 2.150582e-06 2.931409e-02 | |||
| 9.920000e-02 8.233016e-05 8.107759e-05 -1.252576e-06 -1.544911e-02 | |||
| 1.190000e-01 9.172413e-05 9.056949e-05 -1.154642e-06 -1.274869e-02 | |||
| 1.388000e-01 9.972162e-05 1.017142e-04 1.992612e-06 1.959029e-02 | |||
| 1.586000e-01 1.065610e-04 1.055181e-04 -1.042946e-06 -9.884055e-03 | |||
| 1.784000e-01 1.124246e-04 1.143273e-04 1.902717e-06 1.664272e-02 | |||
| 1.982000e-01 1.174574e-04 1.164491e-04 -1.008311e-06 -8.658816e-03 | |||
| 2.180000e-01 1.217777e-04 1.207674e-04 -1.010214e-06 -8.364952e-03 | |||
| 2.378000e-01 1.254830e-04 1.244622e-04 -1.020771e-06 -8.201451e-03 | |||
| 2.576000e-01 1.286565e-04 1.276183e-04 -1.038207e-06 -8.135248e-03 | |||
| 2.774000e-01 1.313682e-04 1.303080e-04 -1.060211e-06 -8.136197e-03 | |||
| 2.972000e-01 1.336789e-04 1.325932e-04 -1.085753e-06 -8.188603e-03 | |||
| 3.170000e-01 1.356415e-04 1.336012e-04 -2.040268e-06 -1.527133e-02 | |||
| 3.368000e-01 1.373010e-04 1.353782e-04 -1.922823e-06 -1.420334e-02 | |||
| 3.566000e-01 1.386977e-04 1.368721e-04 -1.825562e-06 -1.333772e-02 | |||
| 3.764000e-01 1.398662e-04 1.381209e-04 -1.745301e-06 -1.263604e-02 | |||
| 3.962000e-01 1.408372e-04 1.391577e-04 -1.679466e-06 -1.206880e-02 | |||
| 4.160000e-01 1.416377e-04 1.428179e-04 1.180157e-06 8.263370e-03 | |||
| 4.358000e-01 1.422913e-04 1.438265e-04 1.535254e-06 1.067435e-02 | |||
| 4.556000e-01 1.428186e-04 1.412702e-04 -1.548411e-06 -1.096064e-02 | |||
| 4.754000e-01 1.432377e-04 1.417165e-04 -1.521223e-06 -1.073427e-02 | |||
| 4.952000e-01 1.435648e-04 1.420645e-04 -1.500273e-06 -1.056050e-02 | |||
| 5.150000e-01 1.438135e-04 1.423292e-04 -1.484284e-06 -1.042852e-02 | |||
| 5.348000e-01 1.439961e-04 1.425236e-04 -1.472462e-06 -1.033135e-02 | |||
| 5.546000e-01 1.441234e-04 1.427080e-04 -1.415355e-06 -9.917838e-03 | |||
| 5.744000e-01 1.442043e-04 1.427457e-04 -1.458567e-06 -1.021794e-02 | |||
| 5.942000e-01 1.442469e-04 1.427917e-04 -1.455170e-06 -1.019086e-02 | |||
| 6.140000e-01 1.442582e-04 1.428047e-04 -1.453525e-06 -1.017841e-02 | |||
| 6.338000e-01 1.442443e-04 1.427910e-04 -1.453338e-06 -1.017808e-02 | |||
| 6.536000e-01 1.442103e-04 1.427560e-04 -1.454307e-06 -1.018736e-02 | |||
| 6.734000e-01 1.441605e-04 1.427044e-04 -1.456115e-06 -1.020371e-02 | |||
| 6.932000e-01 1.440988e-04 1.426402e-04 -1.458543e-06 -1.022533e-02 | |||
| 7.130000e-01 1.440278e-04 1.425667e-04 -1.461120e-06 -1.024867e-02 | |||
| 7.328000e-01 1.439507e-04 1.424867e-04 -1.463990e-06 -1.027457e-02 | |||
| 7.526000e-01 1.438696e-04 1.424026e-04 -1.467031e-06 -1.030200e-02 | |||
| 7.724000e-01 1.437863e-04 1.423163e-04 -1.470077e-06 -1.032965e-02 | |||
| 7.922000e-01 1.437026e-04 1.422293e-04 -1.473296e-06 -1.035860e-02 | |||
| 8.120000e-01 1.436194e-04 1.421430e-04 -1.476331e-06 -1.038623e-02 | |||
| 8.318000e-01 1.435375e-04 1.420584e-04 -1.479091e-06 -1.041185e-02 | |||
| 8.516000e-01 1.434581e-04 1.419763e-04 -1.481841e-06 -1.043724e-02 | |||
| 8.714000e-01 1.433817e-04 1.418972e-04 -1.484494e-06 -1.046175e-02 | |||
| 8.912000e-01 1.433084e-04 1.418217e-04 -1.486684e-06 -1.048277e-02 | |||
| 9.110000e-01 1.432388e-04 1.417501e-04 -1.488751e-06 -1.050265e-02 | |||
| 9.308000e-01 1.431731e-04 1.416825e-04 -1.490611e-06 -1.052078e-02 | |||
| 9.506000e-01 1.431113e-04 1.416190e-04 -1.492324e-06 -1.053760e-02 | |||
| 9.704000e-01 1.430534e-04 1.415597e-04 -1.493668e-06 -1.055150e-02 | |||
| 9.902000e-01 1.429995e-04 1.415046e-04 -1.494886e-06 -1.056422e-02 | |||
| 1.010000e+00 1.429497e-04 1.414536e-04 -1.496140e-06 -1.057690e-02 | |||
| 1.029800e+00 1.429037e-04 1.414065e-04 -1.497181e-06 -1.058778e-02 | |||
| 1.049600e+00 1.428612e-04 1.413632e-04 -1.498040e-06 -1.059710e-02 | |||
| 1.069400e+00 1.428223e-04 1.413236e-04 -1.498783e-06 -1.060533e-02 | |||
| 1.089200e+00 1.427868e-04 1.412874e-04 -1.499418e-06 -1.061254e-02 | |||
| 1.109000e+00 1.427544e-04 1.412545e-04 -1.499929e-06 -1.061863e-02 | |||
| 1.128800e+00 1.427251e-04 1.412246e-04 -1.500527e-06 -1.062511e-02 | |||
| 1.148600e+00 1.426984e-04 1.441957e-04 1.497301e-06 1.038381e-02 | |||
| 1.168400e+00 1.426744e-04 1.411733e-04 -1.501131e-06 -1.063325e-02 | |||
| 1.188200e+00 1.426526e-04 1.411514e-04 -1.501230e-06 -1.063560e-02 | |||
| 1.208000e+00 1.426332e-04 1.411318e-04 -1.501409e-06 -1.063835e-02 | |||
| 1.227800e+00 1.426157e-04 1.411143e-04 -1.501417e-06 -1.063973e-02 | |||
| 1.247600e+00 1.426001e-04 1.410986e-04 -1.501452e-06 -1.064115e-02 | |||
| 1.267400e+00 1.425862e-04 1.410848e-04 -1.501452e-06 -1.064219e-02 | |||
| 1.287200e+00 1.425741e-04 1.410725e-04 -1.501529e-06 -1.064367e-02 | |||
| 1.307000e+00 1.425634e-04 1.410669e-04 -1.496421e-06 -1.060788e-02 | |||
| 1.326800e+00 1.425538e-04 1.410568e-04 -1.497058e-06 -1.061316e-02 | |||
| 1.346600e+00 1.425455e-04 1.410479e-04 -1.497595e-06 -1.061764e-02 | |||
| 1.366400e+00 1.425381e-04 1.410401e-04 -1.498061e-06 -1.062153e-02 | |||
| 1.386200e+00 1.425318e-04 1.410333e-04 -1.498515e-06 -1.062526e-02 | |||
| 1.406000e+00 1.425262e-04 1.410274e-04 -1.498881e-06 -1.062830e-02 | |||
| 1.425800e+00 1.425214e-04 1.410223e-04 -1.499112e-06 -1.063032e-02 | |||
| 1.445600e+00 1.425172e-04 1.410179e-04 -1.499320e-06 -1.063213e-02 | |||
| 1.465400e+00 1.425136e-04 1.410141e-04 -1.499486e-06 -1.063359e-02 | |||
| 1.485200e+00 1.425106e-04 1.410109e-04 -1.499683e-06 -1.063523e-02 | |||
| 1.505000e+00 1.425080e-04 1.410082e-04 -1.499829e-06 -1.063647e-02 | |||
| 1.524800e+00 1.425058e-04 1.410059e-04 -1.499937e-06 -1.063740e-02 | |||
| 1.544600e+00 1.425039e-04 1.410040e-04 -1.499916e-06 -1.063740e-02 | |||
| 1.564400e+00 1.425023e-04 1.410024e-04 -1.499909e-06 -1.063747e-02 | |||
| 1.584200e+00 1.425010e-04 1.410011e-04 -1.499913e-06 -1.063760e-02 | |||
| 1.604000e+00 1.425001e-04 1.410000e-04 -1.500068e-06 -1.063878e-02 | |||
| 1.623800e+00 1.424994e-04 1.409992e-04 -1.500233e-06 -1.064001e-02 | |||
| 1.643600e+00 1.424987e-04 1.409985e-04 -1.500224e-06 -1.064000e-02 | |||
| 1.663400e+00 1.424984e-04 1.409979e-04 -1.500439e-06 -1.064157e-02 | |||
| 1.683200e+00 1.424981e-04 1.409975e-04 -1.500631e-06 -1.064296e-02 | |||
| 1.703000e+00 1.424977e-04 1.409972e-04 -1.500561e-06 -1.064249e-02 | |||
| 1.722800e+00 1.424974e-04 1.409969e-04 -1.500445e-06 -1.064169e-02 | |||
| 1.742600e+00 1.424971e-04 1.409967e-04 -1.500344e-06 -1.064099e-02 | |||
| 1.762400e+00 1.424969e-04 1.409966e-04 -1.500281e-06 -1.064055e-02 | |||
| 1.782200e+00 1.424966e-04 1.409964e-04 -1.500165e-06 -1.063974e-02 | |||
| 1.802000e+00 1.424967e-04 1.409963e-04 -1.500354e-06 -1.064109e-02 | |||
| 1.821800e+00 1.424963e-04 1.409962e-04 -1.500092e-06 -1.063924e-02 | |||
| 1.841600e+00 1.424958e-04 1.409960e-04 -1.499779e-06 -1.063703e-02 | |||
| 1.861400e+00 1.424958e-04 1.409958e-04 -1.499943e-06 -1.063821e-02 | |||
| 1.881200e+00 1.424954e-04 1.409956e-04 -1.499749e-06 -1.063685e-02 | |||
| 1.901000e+00 1.424949e-04 1.409954e-04 -1.499524e-06 -1.063527e-02 | |||
| 1.920800e+00 1.424948e-04 1.409951e-04 -1.499752e-06 -1.063691e-02 | |||
| 1.940600e+00 1.424948e-04 1.409947e-04 -1.500107e-06 -1.063946e-02 | |||
| 1.960400e+00 1.424949e-04 1.409943e-04 -1.500620e-06 -1.064313e-02 | |||
| 1.980200e+00 1.424949e-04 1.409938e-04 -1.501072e-06 -1.064637e-02 | |||
| @@ -0,0 +1,10 @@ | |||
| FUNCTION u_fino(y) FILE_PATH axi-fino-100.dat | |||
| MESH FILE_PATH u.vtk DIMENSIONS 2 READ_SCALAR u1 AS u_lizard_vtk | |||
| # extract the profile at 95% of the radius | |||
| u_lizard(y) := u_lizard_vtk(0.95*0.5, y) | |||
| # write the two profiles and their differences | |||
| PRINT_FUNCTION FORMAT %e FILE_PATH diff-fino-lizard.dat \ | |||
| u_fino u_lizard u_lizard(y)-u_fino(y) (u_lizard(y)-u_fino(y))/u_lizard(y) \ | |||
| MIN 2e-2 MAX 2 NSTEPS 100 | |||
| @@ -0,0 +1,40 @@ | |||
| #include "sparselizardbase.h" | |||
| using namespace mathop; | |||
| void sparselizard(void) | |||
| { | |||
| formulation elasticity; | |||
| int bottom = 1, top = 2, bulk = 3; | |||
| double lambda, mu; | |||
| setaxisymmetry(); | |||
| mesh mymesh("axi-lizard.msh"); | |||
| field u("h1xyz"); | |||
| u.setorder(bulk, 2); | |||
| u.setconstraint(bottom); | |||
| parameter E, nu; | |||
| E|bulk = 100e3; nu|bulk = 0.3; | |||
| elasticity += integral(bulk, predefinedelasticity(dof(u), tf(u), E, nu)); | |||
| elasticity += integral(top, array1x3(0,-100,0)*tf(u)); | |||
| elasticity.generate(); | |||
| solve(elasticity); | |||
| u.write(bulk, "u.vtk"); | |||
| } | |||
| int main(void) | |||
| { | |||
| SlepcInitialize(0,{},0,0); | |||
| sparselizard(); | |||
| SlepcFinalize(); | |||
| return 0; | |||
| } | |||
| @@ -0,0 +1,15 @@ | |||
| #!/bin/bash | |||
| # THIS SCRIPT RUNS THE SPARSELIZARD EXECUTABLE | |||
| if [ "$(uname)" == "Linux" ]; then | |||
| LD_LIBRARY_PATH="$HOME/SLlibs/petsc/arch-linux2-c-opt/lib":$LD_LIBRARY_PATH | |||
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH | |||
| elif [ "$(uname)" == "Darwin" ]; then | |||
| DYLD_LIBRARY_PATH="$HOME/SLlibs/petsc/arch-darwin-c-opt/lib":$DYLD_LIBRARY_PATH | |||
| export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH | |||
| fi | |||
| ./sparselizard; | |||