LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
lehrfem_info.cc
1
11#include <lf/base/lehrfem_info.h>
12
13#include <regex>
14#include <sstream>
15
16namespace /*anonymous*/ {}
17
18namespace lf::base {
19std::string LehrFemInfo::getVersionSha() { return "@version_sha@"; }
20
21std::string LehrFemInfo::getVersionDateTime() { return "@version_datetime@"; }
22
23std::string LehrFemInfo::getVersionTag() { return "@version_tag@"; }
24
25void LehrFemInfo::PrintInfo(std::ostream &stream) {
26 std::string version;
27 if (!getVersionTag().empty()) {
28 version = getVersionTag();
29 } else if (!getVersionSha().empty()) {
30 version = getVersionSha();
31 } else {
32 version = "unknown";
33 }
34 version.insert(version.size(), 56 - version.size(), ' ');
35 version += "|\n";
36
37 std::string version_datetime;
38 if (!getVersionDateTime().empty()) {
39 version_datetime = "(" + getVersionDateTime() + ")";
40 }
41
42 version_datetime.insert(version_datetime.size(), 56 - version_datetime.size(),
43 ' ');
44 version_datetime += "|\n";
45
46 // clang-format off
47 stream << "\n";
48 stream << R"foo(+------------------------------------------------------------------+)foo" << "\n";
49 stream << R"foo(| __ __ ______________ ___ |)foo" << "\n";
50 stream << R"foo(| / / ___ / /_ _____/ ____/ ____/ |/ / __ __ |)foo" << "\n";
51 stream << R"foo(| / / / _ \/ __ \/ ___/ /_ / __/ / /|_/ /_/ /___/ /_ |)foo" << "\n";
52 stream << R"foo(| / /___/ __/ / / / / / __/ / /___/ / / /_ __/_ __/ |)foo" << "\n";
53 stream << R"foo(| /_____/\___/_/ /_/_/ /_/ /_____/_/ /_/ /_/ /_/ |)foo" << "\n";
54 stream << R"foo(| |)foo" << "\n";
55 stream << R"foo(| |)foo" << "\n";
56 stream << R"foo(| Maintained by Raffael Casagrande and Ralf Hiptmair with |)foo" << "\n";
57 stream << R"foo(| contributions from many other people. |)foo" << "\n";
58 stream << R"foo(| |)foo" << "\n";
59 stream << R"foo(| Version: )foo" << version;
60 stream << R"foo(| )foo" << version_datetime;
61 stream << R"foo(| Source: https://github.com/craffael/lehrfempp |)foo" << "\n";
62 stream << R"foo(| License: MIT License |)foo" << "\n";
63 stream << R"foo(+------------------------------------------------------------------+)foo" << "\n";
64 stream << "\n";
65 // clang-format on
66}
67
68void LehrFemInfo::PrintLicense(std::ostream &stream) {
69 stream << R"foo(MIT License
70
71Copyright (c) 2018 Raffael Casagrande, Ralf Hiptmair
73Permission is hereby granted, free of charge, to any person obtaining a copy
74of this software and associated documentation files (the "Software"), to deal
75in the Software without restriction, including without limitation the rights
76to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77copies of the Software, and to permit persons to whom the Software is
78furnished to do so, subject to the following conditions:
79
80The above copyright notice and this permission notice shall be included in all
81copies or substantial portions of the Software.
82
83THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
86AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
88OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
89SOFTWARE.
90
91)foo";
92}
93
94void LehrFemInfo::Print3rdPartyLicenses(std::ostream &stream) {
95 stream << R"foo(
96LehrFEM++ makes use of the following 3rd Party software with their respective License Terms:
97
98Hunter Package Manager (https://github.com/cpp-pm/hunter)
99 BSD 2-Clause "Simplified License"
100---------------------------------------------------------
101Copyright (c) 2013-2018, Ruslan Baratov
102All rights reserved.
103
104Redistribution and use in source and binary forms, with or without modification,
105are permitted provided that the following conditions are met:
106
107* Redistributions of source code must retain the above copyright notice, this
108 list of conditions and the following disclaimer.
109
110* Redistributions in binary form must reproduce the above copyright notice, this
111 list of conditions and the following disclaimer in the documentation and/or
112 other materials provided with the distribution.
113
114THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
115ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
116WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
117DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
118ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
119(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
120LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
121ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
122(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
123SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
124
125
126Boost (https://boost.org)
127---------------------------------------------------------
128Boost Software License - Version 1.0 - August 17th, 2003
129
130Permission is hereby granted, free of charge, to any person or organization
131obtaining a copy of the software and accompanying documentation covered by
132this license (the "Software") to use, reproduce, display, distribute,
133execute, and transmit the Software, and to prepare derivative works of the
134Software, and to permit third-parties to whom the Software is furnished to
135do so, all subject to the following:
136
137The copyright notices in the Software and this entire statement, including
138the above license grant, this restriction and the following disclaimer,
139must be included in all copies of the Software, in whole or in part, and
140all derivative works of the Software, unless such copies or derivative
141works are solely in the form of machine-executable object code generated by
142a source language processor.
143
144THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
145IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
146FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
147SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
148FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
149ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
150DEALINGS IN THE SOFTWARE.
151
152Eigen (http://eigen.tuxfamily.org/)
153---------------------------------------------------------
154Eigen uses the Mozilla Public License Version 2.0
155(http://mozilla.org/MPL/2.0/)
156
157Eigens source code is available at https://gitlab.com/libeigen/eigen
158
159fmt (https://github.com/fmtlib/fmt)
160---------------------------------------------------------
161Copyright (c) 2012 - present, Victor Zverovich
162
163Permission is hereby granted, free of charge, to any person obtaining
164a copy of this software and associated documentation files (the
165"Software"), to deal in the Software without restriction, including
166without limitation the rights to use, copy, modify, merge, publish,
167distribute, sublicense, and/or sell copies of the Software, and to
168permit persons to whom the Software is furnished to do so, subject to
169the following conditions:
170
171The above copyright notice and this permission notice shall be
172included in all copies or substantial portions of the Software.
173
174THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
175EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
176MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
177NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
178LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
179OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
180WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
181
182--- Optional exception to the license ---
183
184As an exception, if, as a result of your compiling your source code, portions
185of this Software are embedded into a machine-executable object form of such
186source code, you may redistribute such embedded portions in such object form
187without including the above copyright and permission notices.
188
189
190spdlog (https://github.com/gabime/spdlog)
191---------------------------------------------------------
192The MIT License (MIT)
193
194Copyright (c) 2016 Gabi Melman.
195
196Permission is hereby granted, free of charge, to any person obtaining a copy
197of this software and associated documentation files (the "Software"), to deal
198in the Software without restriction, including without limitation the rights
199to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
200copies of the Software, and to permit persons to whom the Software is
201furnished to do so, subject to the following conditions:
202
203The above copyright notice and this permission notice shall be included in
204all copies or substantial portions of the Software.
205
206THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
207IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
208FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
209AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
210LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
211OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
212THE SOFTWARE.
213
214Google Test (https://github.com/google/googletest)
215---------------------------------------------------------
216Copyright 2008, Google Inc.
217All rights reserved.
218
219Redistribution and use in source and binary forms, with or without
220modification, are permitted provided that the following conditions are
221met:
222
223 * Redistributions of source code must retain the above copyright
224notice, this list of conditions and the following disclaimer.
225 * Redistributions in binary form must reproduce the above
226copyright notice, this list of conditions and the following disclaimer
227in the documentation and/or other materials provided with the
228distribution.
229 * Neither the name of Google Inc. nor the names of its
230contributors may be used to endorse or promote products derived from
231this software without specific prior written permission.
232
233THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
234"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
235LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
236A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
237OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
238SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
239LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
240DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
243OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
244
245)foo";
246}
247
248} // namespace lf::base
static void Print3rdPartyLicenses(std::ostream &stream)
Print information about third-party libraries used by LehrFEM++ to the given stream.
static void PrintLicense(std::ostream &stream)
Print the MIT License which applies to the LehrFEM++ code.
static std::string getVersionSha()
Get the git sha1 of this commit of LehrFEM++ (agrees with the sha1 of the respective commit on github...
static std::string getVersionTag()
Get the name of a git Tag attached to this commit. (Mostly the empty string)
static std::string getVersionDateTime()
Get the date and time of this commit of LehrFEM++.
static void PrintInfo(std::ostream &stream)
Prints the LehrFEM++ banner to the given stream including version information.
Contains basic functionality that is used by other parts of LehrFEM++.
Definition base.h:15