• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FEniCS / ffcx / 19800646711

30 Nov 2025 02:58PM UTC coverage: 73.811% (-4.1%) from 77.933%
19800646711

Pull #803

github

schnellerhase
Add cpp package
Pull Request #803: Add `C++` backend

0 of 268 new or added lines in 10 files covered. (0.0%)

3740 of 5067 relevant lines covered (73.81%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/ffcx/codegeneration/cpp/form_template.py
1
# Code generation format strings for UFC (Unified Form-assembly Code)
2
# This code is released into the public domain.
3
#
4
# The FEniCS Project (http://www.fenicsproject.org/) 2020.
5
"""Templates for C++ form output."""
6

NEW
7
declaration = """
×
8
extern ufcx_form {factory_name};
9

10
// Helper used to create form using name which was given to the
11
// form in the UFL file.
12
// This helper is called in user c++ code.
13
//
14
extern ufcx_form* {name_from_uflfile};
15

16
// Helper used to create function space using function name
17
// i.e. name of the Python variable.
18
//
19
ufcx_function_space* functionspace_{name_from_uflfile}(const char* function_name);
20
"""
21

NEW
22
factory = """
×
23
// Code for form {factory_name}
24

25
{dofmaps_init}
26
{finite_elements_init}
27

28
{name_from_uflfile}::constant_name = {constant_name_map};
29
{name_from_uflfile}::coefficient_name = {coefficient_name_map};
30
{name_from_uflfile}::signature ={signature};
31
{name_from_uflfile}::rank = {rank};
32
{name_from_uflfile}::num_coefficients = {num_coefficients};
33
{name_from_uflfile}::num_constants = {num_constants};
34
{name_from_uflfile}::original_coefficient_position = {original_coefficient_position};
35
{name_from_uflfile}::coefficient_name_map = coefficient_name_{factory_name};
36
{name_from_uflfile}::constant_name_map = constant_name_{factory_name};
37
{name_from_uflfile}::finite_elements = {finite_elements};
38
{name_from_uflfile}::dofmaps = {dofmaps};
39
{name_from_uflfile}::form_integrals = {form_integrals};
40
{name_from_uflfile}::form_integral_ids = {form_integral_ids};
41
{name_from_uflfile}::form_integral_offsets = {form_integral_offsets};
42

43
ufcx_function_space* functionspace_{name_from_uflfile}(const char* function_name)
44
{{
45
{functionspace}
46
}}
47

48
// End of code for form {factory_name}
49
"""
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc