/usr/lib/python3/dist-packages/FIAT/lagrange.py is in python3-fiat 2017.2.0.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | # Copyright (C) 2008 Robert C. Kirby (Texas Tech University)
# Modified by Andrew T. T. McRae (Imperial College London)
#
# This file is part of FIAT.
#
# FIAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FIAT 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with FIAT. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import, print_function, division
from FIAT import finite_element, polynomial_set, dual_set, functional
class LagrangeDualSet(dual_set.DualSet):
"""The dual basis for Lagrange elements. This class works for
simplices of any dimension. Nodes are point evaluation at
equispaced points."""
def __init__(self, ref_el, degree):
entity_ids = {}
nodes = []
# make nodes by getting points
# need to do this dimension-by-dimension, facet-by-facet
top = ref_el.get_topology()
cur = 0
for dim in sorted(top):
entity_ids[dim] = {}
for entity in sorted(top[dim]):
pts_cur = ref_el.make_points(dim, entity, degree)
nodes_cur = [functional.PointEvaluation(ref_el, x)
for x in pts_cur]
nnodes_cur = len(nodes_cur)
nodes += nodes_cur
entity_ids[dim][entity] = list(range(cur, cur + nnodes_cur))
cur += nnodes_cur
super(LagrangeDualSet, self).__init__(nodes, ref_el, entity_ids)
class Lagrange(finite_element.CiarletElement):
"""The Lagrange finite element. It is what it is."""
def __init__(self, ref_el, degree):
poly_set = polynomial_set.ONPolynomialSet(ref_el, degree)
dual = LagrangeDualSet(ref_el, degree)
formdegree = 0 # 0-form
super(Lagrange, self).__init__(poly_set, dual, degree, formdegree)
|