| 1 | # -*- coding: utf-8 -*- |
| 2 | "This module defines some basics for generating C++ code." |
| 3 | |
| 4 | # Copyright (C) 2009-2017 Anders Logg |
| 5 | # |
| 6 | # This file is part of FFC. |
| 7 | # |
| 8 | # FFC is free software: you can redistribute it and/or modify |
| 9 | # it under the terms of the GNU Lesser General Public License as published by |
| 10 | # the Free Software Foundation, either version 3 of the License, or |
| 11 | # (at your option) any later version. |
| 12 | # |
| 13 | # FFC is distributed in the hope that it will be useful, |
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | # GNU Lesser General Public License for more details. |
| 17 | # |
| 18 | # You should have received a copy of the GNU Lesser General Public License |
| 19 | # along with FFC. If not, see <http://www.gnu.org/licenses/>. |
| 20 | # |
| 21 | # Modified by Kristian B. Oelgaard 2011 |
| 22 | # Modified by Marie E. Rognes 2010 |
| 23 | # Modified by Martin Sandve Alnæs 2013-2017 |
| 24 | # Modified by Chris Richardson 2017 |
| 25 | |
| 26 | # ufc class names |
| 27 | |
| 28 | def make_classname(prefix, basename, signature): |
| 29 | pre = prefix.lower() + "_" if prefix else "" |
| 30 | sig = str(signature).lower() |
| 31 | return "%s%s_%s" % (pre, basename, sig) |
| 32 | |
| 33 | |
| 34 | def make_integral_classname(prefix, integral_type, form_id, subdomain_id): |
| 35 | basename = "%s_integral_%s" % (integral_type, str(form_id).lower()) |
| 36 | return make_classname(prefix, basename, subdomain_id) |