pax_global_header 0000666 0000000 0000000 00000000064 12263013201 0014500 g ustar 00root root 0000000 0000000 52 comment=86e6ad88c88ac8dd7c6470eac88f66e479d47711
ffc-1.3.0/ 0000775 0000000 0000000 00000000000 12263013201 0012237 5 ustar 00root root 0000000 0000000 ffc-1.3.0/.bzrignore 0000664 0000000 0000000 00000000130 12263013201 0014233 0 ustar 00root root 0000000 0000000 syntax: glob
(^|/)CVS($|/)
(^|/)\.hg($|/)
./*~
./*.pyc
./build/*
./demo/*.py
./demo/*.h
ffc-1.3.0/.gitignore 0000664 0000000 0000000 00000000043 12263013201 0014224 0 ustar 00root root 0000000 0000000 *~
*.pyc
build/
demo/*.py
demo/*.h
ffc-1.3.0/AUTHORS 0000664 0000000 0000000 00000001757 12263013201 0013321 0 ustar 00root root 0000000 0000000 Main authors:
Anders Logg
email: logg@simula.no
www: http://home.simula.no/~logg/
Kristian B. Ølgaard
email: k.b.oelgaard@gmail.com
Marie Rognes
email: meg@simula.no
Main contributors:
Garth N. Wells
email: gnw20@cam.ac.uk
www: http://www.eng.cam.ac.uk/~gnw20/
Contributors:
Joachim B Haga
email: jobh@broadpark.no
Johan Jansson
email: johanjan@math.chalmers.se
www: http://www.math.chalmers.se/~johanjan/
Robert C. Kirby
email: kirby@cs.uchicago.edu
www: http://people.cs.uchicago.edu/~kirby/
Matthew G. Knepley
email: knepley@mcs.anl.gov
www: http://www-unix.mcs.anl.gov/~knepley/
Dag Lindbo
email: dag@f.kth.se
www: http://www.f.kth.se/~dag/
Ola Skavhaug
email: skavhaug@simula.no
www: http://home.simula.no/~skavhaug/
Andy R. Terrel
email: aterrel@uchicago.edu
www: http://people.cs.uchicago.edu/~aterrel/
Peter Brune
email: brune@uchicago.edu
ffc-1.3.0/COPYING 0000664 0000000 0000000 00000104513 12263013201 0013276 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
.
ffc-1.3.0/COPYING.LESSER 0000664 0000000 0000000 00000016727 12263013201 0014303 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser 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
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
ffc-1.3.0/ChangeLog 0000664 0000000 0000000 00000041545 12263013201 0014022 0 ustar 00root root 0000000 0000000 1.3.0 [2014-01-07]
- Fix bug with runtime check of SWIG version
- Move DOLFIN wrappers here from DOLFIN
- Add support for new UFL operators cell_avg and facet_avg
- Add new reference data handling system, now data is kept in an external repository
- Fix bugs with ignoring quadrature rule arguments
- Use cpp optimization by default in jit compiler
1.2.0 [2013-03-24]
- New feature: Add basic support for point integrals on vertices
- New feature: Add general support for m-dimensional cells in n-dimensional space (n >= m, n, m = 1, 2, 3)
1.1.0 [2013-01-07]
- Fix bug for Conditionals related to DG constant Coefficients. Bug #1082048.
- Fix bug for Conditionals, precedence rules for And and Or. Bug #1075149.
- Changed data structure from list to deque when pop(0) operation is needed, speeding up split_expression operation considerable
- Other minor fixes
1.0.0 [2011-12-07]
- Issue warning when form integration requires more than 100 points
1.0-rc1 [2011-11-28]
- Fix bug with coordinates on facet integrals (intervals). Bug #888682.
- Add support for FacetArea, new geometric quantity in UFL.
- Fix bug in optimised quadrature code, AlgebraOperators demo. Bug #890859.
- Fix bug with undeclared variables in optimised quadrature code. Bug #883202.
1.0-beta2 [2011-10-11]
- Added support for bessel functions, bessel_* (I,J,K,Y), in UFL.
- Added support for error function, erf(), new math function in UFL.
- Fix dof map 'need_entities' for Real spaces
- Improve performance for basis function computation
1.0-beta [2011-08-11]
- Improve formatting of floats with up to one non-zero decimal place.
- Fix bug involving zeros in products and sums. Bug #804160.
- Fix bug for new conditions '&&', '||' and '!' in UFL. Bug #802560.
- Fix bug involving VectorElement with dim=1. Bug #798578.
- Fix bug with mixed element of symmetric tensor elements. Bug #745646.
- Fix bug when using geometric coordinates with one quadrature point
0.9.10 [2011-05-16]
- Change license from GPL v3 or later to LGPL v3 or later
- Add some schemes for low-order simplices
- Request quadrature schemes by polynomial degree (not longer by number
of points in each direction)
- Get quadrature schemes via ffc.quadrature_schemes
- Improved lock handling in JIT compiler
- Include common_cell in form signature
- Add possibility to set swig binary and swig path
0.9.9 [2011-02-23]
- Add support for generating error control forms with option -e
- Updates for UFC 2.0
- Set minimal degree to 1 in automatic degree selection for expressions
- Add command-line option -f no_ferari
- Add support for plotting of elements
- Add utility function compute_tensor_representation
0.9.4 [2010-09-01]
- Added memory cache in jit(), for preprocessed forms
- Added support for Conditional and added demo/Conditional.ufl.
- Added support for new geometric quantity Circumradius in UFL.
- Added support for new geometric quantity CellVolume in UFL.
0.9.3 [2010-07-01]
- Make global_dimension for Real return an int instead of double, bug # 592088
- Add support for facet normal in 1D.
- Expose -feliminate_zeros for quadrature optimisations to give user more
control
- Remove return of form in compile_form
- Remove object_names argument to compile_element
- Rename ElementUnion -> EnrichedElement
- Add support for tan() and inverse trigonometric functions
- Added support for ElementUnion (i.e. span of combinations of elements)
- Added support for Bubble elements
- Added support for UFL.SpatialCoordinate.
0.9.2 [2010-02-17]
- Bug fix in removal of unused variables in Piola-mapped terms for tensor
representation
0.9.1 [2010-02-15]
- Add back support for FErari optimizations
- Bug fixes in JIT compiler
0.9.0 [2010-02-02]
- Updates for FIAT 0.9.0
- Updates for UFC 1.4.0 (now supporting the full interface)
- Automatic selection of representation
- Change quadrature_order --> quadrature_degree
- Split compile() --> compile_form(), compile_element()
- Major cleanup and reorganization of code (flatter directories)
- Updates for changes in UFL: Argument, Coefficient, FormData
0.7.1
- Handle setting quadrature degree when it is set to None in UFL form
- Added demo: HyperElasticity.ufl
0.7.0
- Move contents of TODO to: https://blueprints.launchpad.net/ffc
- Support for restriction of finite elements to only consider facet dofs
- Use quadrature_order from metadata when integrating terms using tensor representation
- Use loop to reset the entries of the local element tensor
- Added new symbolic classes for quadrature optimisation (speed up compilation)
- Added demos: Biharmonic.ufl, div(grad(v)) term;
ReactionDiffusion.ufl, tuple notation;
MetaData.ufl, how to attach metadata to the measure;
ElementRestriction.ufl, restriction of elements to facets
- Tabulate the coordinates of the integration points in the tabulate_tensor() function
- Change command line option '-f split_implementation' -> '-f split'
- Renaming of files and restructuring of the compiler directory
- Added option -q rule (--quadrature-rule rule) to specify which rule to use
for integration of a given integral. (Can also bet set through the metadata
through "quadrature_rule"). No rules have yet been implemented, so default
is the FIAT rule.
- Remove support for old style .form files/format
0.6.2 [2009-04-07]
- Experimental support for UFL, supporting both .form and .ufl
- Moved configuration and construction of python extension module to ufc_module
0.6.1 [2009-02-18]
- Initial work on UFL transition
- Minor bug fixes
- The version of ufc and swig is included in the form signature
- Better system configuration for JIT compiled forms
- The JIT compiled python extension module use shared_ptr for all classes
0.6.0 [2009-01-05]
- Update DOLFIN output format (-l dolfin) for DOLFIN 0.9.0
- Cross-platform fixes for test scripts
- Minor bug fix for quadrature code generation (forms affected by this bug would not be able to compile
- Fix bug with output of *.py.
- Permit dot product bewteen rectangular matrices (Frobenius norm)
0.5.1 [2008-10-20]
- New operator skew()
- Allow JIT compilation of elements and dof maps
- Rewrite JIT compiler to rely on Instant for caching
- Display flop count for evaluating the element tensor during compilation
- Add arguments language and representation to options dictionary
- Fix installation on Windows
- Add option -f split_implementation for separate .h and .cpp files
0.5.0 [2008-06-23]
- Remove default restriction +/- for Constant
- Make JIT optimization (-O0 / -O2) optional
- Add in-memory cache to speed up JIT compiler for repeated assembly
- Allow subdomain integrals without needing full range of integrals
- Allow simple subdomain integral specification dx(0), dx(1), ds(0) etc
0.4.5 [2008-04-30]
- Optimizations in generated quadrature code
- Change formatting of floats from %g to %e, fixes problem with too long integers
- Bug fix for order of values in interpolate_vertex_values, now according to UFC
- Speed up JIT compiler
- Add index ranges to form printing
- Throw runtime error in functions not generated
- Update DOLFIN format for new location of include files
0.4.4 [2008-02-18]
- RT, BDM, BDFM and Nedelec now working in 2D and 3D
- New element type QuadratureElement
- Add support for 1D elements
- Add experimental support for new Darcy-Stokes element
- Use FIAT transformed spaces instead of mapping in FFC
- Updates for UFC 1.1
- Implement caching of forms/modules in ~/.ffc/cache for JIT compiler
- Add script ffc-clean
- New operators lhs() and rhs()
- Bug fixes in simplify
- Bug fixes for Nedelec and BDFM
- Fix bug in mult()
- Fix bug with restrictions on exterior facet integrals
- Fix bug in grad() for vectors
- Add divergence operator for matrices
0.4.3 [2007-10-23]
- Require FIAT to use UFC reference cells
- Fix bug in form simplification
- Rename abs --> modulus to avoid conflict with builtin abs
- Fix bug in operators invert, abs, sqrt
- Fix bug in integral tabulation
- Add BDFM and Nedelec elements (nonworking)
- Fix bug in JIT compiler
0.4.2 [2007-08-31]
- Change license from GPL v2 to GPL v3 or later
- Add JIT (just-in-time) compiler
- Fix bug for constants on interior facets
0.4.1 [2007-06-22]
- Fix bug in simplification of forms
- Optimize removal of unused terms in code formattting
0.4.0 [2007-06-20]
- Move to UFC interface for code generation
- Major rewrite, restructure, cleanup
- Add support for Brezzi-Douglas-Marini (BDM) elements
- Add support for Raviart-Thomas (RT) elements
- Add support for Discontinuous Galerkin (DG) methods
- Operators jump() and avg()
- Add quadrature compilation mode (experimental)
- Simplification of forms
- Operators sqrt(), abs() and inverse
- Improved Python interface
- Add flag -f precision=n
- Generate code for basis functions and derivatives
- Use Set from set module for Python2.3 compatibility
0.3.5 [2006-12-01]
- Bug fixes
- Move from Numeric to numpy
0.3.4 [2006-10-27]
- Updates for new DOLFIN mesh library
- Add support for evaluation of functionals
- Add operator outer() for outer product of vector-valued functions
- Enable optimization of linear forms (in addition to bilinear forms)
- Remove DOLFIN SWIG format
- Fix bug in ffc -v/--version (thanks to Ola Skavhaug)
- Consolidate DOLFIN and DOLFIN SWIG formats (patch from Johan Jansson)
- Fix bug in optimized compilation (-O) for some forms ("too many values to unpack")
0.3.3 [2006-09-05]
- Fix bug in operator div()
- Add operation count (number of multiplications) with -d0
- Add hint for printing more informative error messages (flag -d1)
- Modify implementation of vertexeval()
- Add support for boundary integrals (Garth N. Wells)
0.3.2 [2006-04-01]
- Add support for FErari optimizations, new flag -O
0.3.1 [2006-03-28]
- Remove verbose output: silence means success
- Generate empty boundary integral eval() to please Intel C++ compiler
- New classes TestFunction and TrialFunction
0.3.0 [2006-03-01]
- Work on manual, document command-line and user-interfaces
- Name change: u --> U
- Add compilation of elements without form
- Add generation of FiniteElementSpec in DOLFIN formats
- Fix bugs in raw and XML formats
- Fix bug in LaTeX format
- Fix path and predefine tokens to enable import in .form file
- Report number of entries in reference tensor during compilation
0.2.5 [2005-12-28]
- Add demo Stabilization.form
- Further speedup computation of reference tensor (use ufunc Numeric.add)
0.2.4 [2005-12-05]
- Report time taken to compute reference tensor
- Restructure computation of reference tensor to use less memory.
As a side effect, the speed has also been improved.
- Update for DOLFIN name change node --> vertex
- Update finite element interface for DOLFIN
- Check for FIAT bug in discontinuous vector Lagrange elements
- Fix signatures for vector-valued elements
0.2.3 [2005-11-28]
- New fast Numeric/BLAS based algorithm for computing reference tensor
- Bug fix: reassign indices for complete subexpressions
- Bug fix: operator Function * Integral
- Check tensor notation for completeness
- Bug fix: mixed elements with more than two function spaces
- Don't declare unused coefficients (or gcc will complain)
0.2.2 [2005-11-14]
- Add command-line argument -v / --version
- Add new operator mean() for projection onto piecewise constants
- Add support for projections
- Bug fix for higher order mixed elements: declaration of edge/face_ordering
- Generate code for sub elements of mixed elements
- Add new test form: TensorWeighteLaplacian
- Add new test form: EnergyNorm
- Fix bugs in mult() and vec() (skavhaug)
- Reset correct entries of G for interior in BLAS mode
- Only assign to entries of G that meet nonzero entries of A in BLAS mode
0.2.1 [2005-10-11]
- Only generate declarations that are needed according to format
- Check for missing options and add missing default options
- Simplify usage of FFC as Python module: from ffc import *
- Fix bug in division with constants
- Generate output for BLAS (with option -f blas)
- Add new XML output format
- Remove command-line option --license (collect in compiler options -f)
- Modify demo Mass.form to use 3:rd order Lagrange on tets
- Fix bug in dofmap() for equal order mixed elements
- Add compiler option -d debuglevel
- Fix Python Numeric bug: vdot --> dot
0.2.0 [2005-09-23]
- Generate function vertexeval() for evaluation at vertices
- Add support for arbitrary mixed elements
- Add man page
- Work on manual, chapters on form language, quickstart and installation
- Handle exceptions gracefully in command-line interface
- Use new template fenicsmanual.cls for manual
- Add new operators grad, div, rot (curl), D, rank, trace, dot, cross
- Factorize common reference tensors from terms with equal signatures
- Collect small building blocks for form algebra in common module tokens.py
0.1.9 [2005-07-05]
- Complete support for general order Lagrange elements on triangles and tetrahedra
- Compute reordering of dofs on tets correctly
- Update manual with ordering of dofs
- Break compilation into two phases: build() and write()
- Add new output format ASE (Matt Knepley)
- Improve python interface to FFC
- Remove excessive logging at compilation
- Fix bug in raw output format
0.1.8 [2005-05-17]
- Access data through map in DOLFIN format
- Experimental support for computation of coordinate maps
- Add first draft of manual
- Experimental support for computation of dof maps
- Allow specification of the number of components for vector Lagrange
- Count the number of zeros dropped
- Fix bug in handling command-line arguments
- Use module sets instead of built-in set (fix for Python 2.3)
- Handle constant indices correctly (bug reported by Garth N. Wells)
0.1.7 [2005-05-02]
- Write version number to output
- Add command-line option for choosing license
- Display usage if no input is given
- Bug fix for finding correct prefix of file name
- Automatically choose name of output file (if not supplied)
- Use FIAT tabulation mode for vector-valued elements (speedup a factor 5)
- Use FIAT tabulation mode for scalar elements (speedup a factor 1000)
- Fig bug in demo elasticity.form (change order of u and v)
- Make references to constants const in DOLFIN format
- Don't generate code for unused entries of geometry tensor
- Update formats to write numeric constants with full precision
0.1.6 [2005-03-17]
- Add support for mixing multiple different finite elements
- Add support for division with constants
- Fix index bug (reverse order of multi-indices)
0.1.5 [2005-03-14]
- Automatically choose the correct quadrature rule for precomputation
- Add test program for verification of FIAT quadrature rules
- Fix bug for derivative of sum
- Improve common interface for debugging: add indentation
- Add support for constants
- Fix bug for sums of more than one term (make copies of references in lists)
- Add '_' in naming of geometry tensor (needed for large dimensions)
- Add example elasticity.form
- Cleanup build_indices()
0.1.4-1 [2005-02-07]
- Fix version number and remove build directory from tarball
0.1.4 [2005-02-04]
- Fix bug for systems, seems to work now
- Add common interface for debugging
- Modify DOLFIN output to initialize functions
- Create unique numbers for each function
- Use namespaces for DOLFIN output instead of class names
- Temporary implementation of dof mapping for vector-valued elements
- Make DOLFIN output format put entries into PETSc block
- Change name of coefficient data: c%d[%d] -> c[%d][%d]
- Change ordering of basis functions (one component at a time)
- Add example poissonsystem.form
- Modifications for new version of FIAT (FIAT-L)
FIAT version 0.1 a factor 5 slower (no memoization)
FIAT version 0.1.1 a little faster, only a factor 2 slower
- Add setup.py script
0.1.3 [2004-12-06]
- Fix bug in DOLFIN format (missing value when zero)
- Add output of reference tensor to LaTeX format
- Make raw output format print data with full precision
- Add component diagram
- Change order of declaration of basis functions
- Add new output format raw
0.1.2 [2004-11-17]
- Add command-line interface ffc
- Add support for functions (coefficients)
- Add support for constants
- Allow multiple forms (left- and right-hand side) in same file
- Add test examples: poisson.form, mass.form, navierstokes.form
- Wrap FIAT to create vector-valued finite element spaces
- Check ranks of operands
- Clean up algebra, add base class Element
- Add some documentation (class diagram)
- Add support for LaTeX output
0.1.1-1 [2004-11-10]
- Add missing file declaration.py
0.1.1 [2004-11-10]
- Make output variable names configurable
- Clean up DOLFIN code generation
- Post-process form to create reference, geometry, and element tensors
- Experimental support for general tensor-valued elements
- Clean up and improve index reassignment
- Use string formatting for generation of output
- Change index ordering to access row-wise
0.1.0 [2004-10-22]
- First iteration of the FEniCS Form Compiler
ffc-1.3.0/INSTALL 0000664 0000000 0000000 00000001012 12263013201 0013262 0 ustar 00root root 0000000 0000000 To install FFC, type
sudo python setup.py install
This will install FFC in the default Python path of your system,
something like /usr/lib/python2.6/site-packages/.
The installation script requires the Python module distutils, which
for Debian users is available with the python-dev package. Other
dependencies are listed in the file README.
For detailed installation instructions, see the FFC user manual which
is available on http://www.fenics.org/ and also in the subdirectory
doc/manual/ of this source tree.
ffc-1.3.0/README.rst 0000664 0000000 0000000 00000003370 12263013201 0013731 0 ustar 00root root 0000000 0000000 -----------------------------
FFC: The FEniCS Form Compiler
-----------------------------
FFC is a compiler for finite element variational forms. From a
high-level description of the form, it generates efficient low-level
C++ code that can be used to assemble the corresponding discrete
operator (tensor). In particular, a bilinear form may be assembled
into a matrix and a linear form may be assembled into a vector.
FFC may be used either from the command line (by invoking the ``ffc``
command) or as a Python module (``import ffc``).
FFC is part of the FEniCS project (http://www.fenicsproject.org) and
functions as a just-in-time (JIT) compiler for DOLFIN.
For further introduction to FFC, open the FFC user manual available in
the subdirectory ``doc/manual/`` of this source tree, or try out the
demos available in the subdirectory ``src/demo/`` of this source tree.
License
-------
This program 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.
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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
.
Dependencies
------------
#. Python, version 2.6
#. The latest version of FIAT, UFC and UFL
You need to have FIAT, UFC and UFL installed. They are available from the
web page: https://bitbucket.org/fenics-project/.
#. The Python NumPy module
ffc-1.3.0/bench/ 0000775 0000000 0000000 00000000000 12263013201 0013316 5 ustar 00root root 0000000 0000000 ffc-1.3.0/bench/HyperElasticity.ufl 0000664 0000000 0000000 00000004010 12263013201 0017143 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Harish Narayanan
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2009-09-29
# Last changed: 2011-07-01
#
# The bilinear form a(u, v) and linear form L(v) for
# a hyperelastic model. (Copied from dolfin/demo/pde/hyperelasticity/cpp)
#
# Compile this form with FFC: ffc HyperElasticity.ufl.
# Coefficient spaces
element = VectorElement("Lagrange", tetrahedron, 1)
# Coefficients
v = TestFunction(element) # Test function
du = TrialFunction(element) # Incremental displacement
u = Coefficient(element) # Displacement from previous iteration
B = Coefficient(element) # Body force per unit mass
T = Coefficient(element) # Traction force on the boundary
# Kinematics
I = Identity(v.cell().d) # Identity tensor
F = I + grad(u) # Deformation gradient
C = F.T*F # Right Cauchy-Green tensor
E = (C - I)/2 # Euler-Lagrange strain tensor
E = variable(E)
# Material constants
mu = Constant(tetrahedron) # Lame's constants
lmbda = Constant(tetrahedron)
# Strain energy function (material model)
psi = lmbda/2*(tr(E)**2) + mu*tr(E*E)
S = diff(psi, E) # Second Piola-Kirchhoff stress tensor
P = F*S # First Piola-Kirchoff stress tensor
# The variational problem corresponding to hyperelasticity
L = inner(P, grad(v))*dx - inner(B, v)*dx - inner(T, v)*ds
a = derivative(L, u, du)
ffc-1.3.0/bench/MassH1_2D_1.ufl 0000664 0000000 0000000 00000001447 12263013201 0015675 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
a = v*u*dx
ffc-1.3.0/bench/MassH1_2D_2.ufl 0000664 0000000 0000000 00000001447 12263013201 0015676 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 2)
v = TestFunction(element)
u = TrialFunction(element)
a = v*u*dx
ffc-1.3.0/bench/MassH1_2D_3.ufl 0000664 0000000 0000000 00000001447 12263013201 0015677 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 3)
v = TestFunction(element)
u = TrialFunction(element)
a = v*u*dx
ffc-1.3.0/bench/MassH1_2D_4.ufl 0000664 0000000 0000000 00000001447 12263013201 0015700 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 4)
v = TestFunction(element)
u = TrialFunction(element)
a = v*u*dx
ffc-1.3.0/bench/MassH1_2D_5.ufl 0000664 0000000 0000000 00000001447 12263013201 0015701 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 5)
v = TestFunction(element)
u = TrialFunction(element)
a = v*u*dx
ffc-1.3.0/bench/MassHcurl_2D_1.ufl 0000664 0000000 0000000 00000001462 12263013201 0016477 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("N1curl", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHcurl_2D_2.ufl 0000664 0000000 0000000 00000001462 12263013201 0016500 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("N1curl", triangle, 2)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHcurl_2D_3.ufl 0000664 0000000 0000000 00000001462 12263013201 0016501 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("N1curl", triangle, 3)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHcurl_2D_4.ufl 0000664 0000000 0000000 00000001462 12263013201 0016502 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("N1curl", triangle, 4)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHcurl_2D_5.ufl 0000664 0000000 0000000 00000001462 12263013201 0016503 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("N1curl", triangle, 5)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHdiv_2D_1.ufl 0000664 0000000 0000000 00000001452 12263013201 0016313 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("BDM", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHdiv_2D_2.ufl 0000664 0000000 0000000 00000001452 12263013201 0016314 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("BDM", triangle, 2)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHdiv_2D_3.ufl 0000664 0000000 0000000 00000001452 12263013201 0016315 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("BDM", triangle, 3)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHdiv_2D_4.ufl 0000664 0000000 0000000 00000001452 12263013201 0016316 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("BDM", triangle, 4)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/MassHdiv_2D_5.ufl 0000664 0000000 0000000 00000001452 12263013201 0016317 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("BDM", triangle, 5)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(v, u)*dx
ffc-1.3.0/bench/NavierStokes_2D_1.ufl 0000664 0000000 0000000 00000001632 12263013201 0017212 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
scalar = FiniteElement("Lagrange", triangle, 1)
vector = VectorElement("Lagrange", triangle, 1)
v = TestFunction(vector)
u = TrialFunction(vector)
w = Coefficient(vector)
rho = Coefficient(scalar)
a = rho*inner(v, grad(w)*u)*dx
ffc-1.3.0/bench/NavierStokes_2D_2.ufl 0000664 0000000 0000000 00000001632 12263013201 0017213 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
scalar = FiniteElement("Lagrange", triangle, 2)
vector = VectorElement("Lagrange", triangle, 2)
v = TestFunction(vector)
u = TrialFunction(vector)
w = Coefficient(vector)
rho = Coefficient(scalar)
a = rho*inner(v, grad(w)*u)*dx
ffc-1.3.0/bench/NavierStokes_2D_3.ufl 0000664 0000000 0000000 00000001632 12263013201 0017214 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
scalar = FiniteElement("Lagrange", triangle, 3)
vector = VectorElement("Lagrange", triangle, 3)
v = TestFunction(vector)
u = TrialFunction(vector)
w = Coefficient(vector)
rho = Coefficient(scalar)
a = rho*inner(v, grad(w)*u)*dx
ffc-1.3.0/bench/Poisson_2D_1.ufl 0000664 0000000 0000000 00000001500 12263013201 0016221 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/Poisson_2D_2.ufl 0000664 0000000 0000000 00000001500 12263013201 0016222 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 2)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/Poisson_2D_3.ufl 0000664 0000000 0000000 00000001500 12263013201 0016223 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 3)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/Poisson_2D_4.ufl 0000664 0000000 0000000 00000001500 12263013201 0016224 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 4)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/Poisson_2D_5.ufl 0000664 0000000 0000000 00000001500 12263013201 0016225 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 5)
v = TestFunction(element)
u = TrialFunction(element)
a = inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/WeightedPoisson_2D_1.ufl 0000664 0000000 0000000 00000001526 12263013201 0017712 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
c = Coefficient(element)
a = c*inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/WeightedPoisson_2D_2.ufl 0000664 0000000 0000000 00000001526 12263013201 0017713 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 2)
v = TestFunction(element)
u = TrialFunction(element)
c = Coefficient(element)
a = c*inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/WeightedPoisson_2D_3.ufl 0000664 0000000 0000000 00000001526 12263013201 0017714 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 3)
v = TestFunction(element)
u = TrialFunction(element)
c = Coefficient(element)
a = c*inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/WeightedPoisson_2D_4.ufl 0000664 0000000 0000000 00000001526 12263013201 0017715 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 4)
v = TestFunction(element)
u = TrialFunction(element)
c = Coefficient(element)
a = c*inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/WeightedPoisson_2D_5.ufl 0000664 0000000 0000000 00000001526 12263013201 0017716 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
element = FiniteElement("Lagrange", triangle, 5)
v = TestFunction(element)
u = TrialFunction(element)
c = Coefficient(element)
a = c*inner(grad(v), grad(u))*dx
ffc-1.3.0/bench/bench.py 0000664 0000000 0000000 00000003732 12263013201 0014754 0 ustar 00root root 0000000 0000000 """This script runs a benchmark study on the form files found in the
current directory. It relies on the regression test script for
timings."""
# Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2010-05-11
# Last changed: 2010-05-11
import os, glob
from utils import print_table
# Test options
test_options = ["-r tensor", "-r tensor -O", "-r quadrature", "-r quadrature -O"]
# Get list of test cases
test_cases = sorted([f.split(".")[0] for f in glob.glob("*.ufl")])
# Open logfile
logfile = open("bench.log", "w")
# Iterate over options
os.chdir("../test/regression")
table = {}
for (j, test_option) in enumerate(test_options):
# Run benchmark
print "\nUsing options %s\n" % test_option
os.system("python test.py --bench %s" % test_option)
# Collect results
for (i, test_case) in enumerate(test_cases):
output = open("output/%s.out" % test_case).read()
lines = [line for line in output.split("\n") if "bench" in line]
if not len(lines) == 1:
raise RuntimeError, "Unable to extract benchmark data for test case %s" % test_case
timing = float(lines[0].split(":")[-1])
table[(i, j)] = (test_case, test_option, timing)
logfile.write("%s, %s, %g\n" % (test_case, test_option, timing))
# Close logfile
logfile.close()
# Print results
print_table(table, "FFC bench")
ffc-1.3.0/bench/plot.py 0000664 0000000 0000000 00000004733 12263013201 0014655 0 ustar 00root root 0000000 0000000 "This script plots the results found in bench.log."
# Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2010-05-13
# Last changed: 2010-05-13
from pylab import *
# Read logfile
results = {}
try:
output = open("bench.log").read()
except:
output = open("results/bench.log").read()
for line in output.split("\n"):
if not "," in line: continue
test_case, test_option, timing = [w.strip() for w in line.split(",")]
try:
form, degree = test_case.split("_")
except:
form, dim, degree = test_case.split("_")
form = form + "_" + dim
if not form in results:
results[form] = {}
if not test_option in results[form]:
results[form][test_option] = ([], [])
results[form][test_option][0].append(int(degree))
results[form][test_option][1].append(float(timing))
# Plot results
forms = sorted([form for form in results])
test_options = ["-r quadrature", "-r quadrature -O", "-r tensor", "-r tensor -O"]
bullets = ["x-", "o-", "*-", "s-"]
for (i, form) in enumerate(forms):
figure(i)
# Plot timings
subplot(121)
for (j, test_option) in enumerate(test_options):
q, t = results[form][test_option]
semilogy(q, t, bullets[j])
hold(True)
a = list(axis()); a[-1] = 50.0*a[-1]; axis(a);
legend(test_options, loc="upper left")
grid(True)
xlabel('degree')
ylabel(form)
title('CPU time')
# Plot speedups
subplot(122)
q0, t0 = results[form]["-r quadrature"]
for (j, test_option) in enumerate(test_options):
q, t = results[form][test_option]
t = [t0[k] / t[k] for k in range(len(t))]
semilogy(q, t, bullets[j])
hold(True)
a = list(axis()); a[-1] = 50.0*a[-1]; axis(a);
legend(test_options, loc="upper left")
grid(True)
xlabel('degree')
title("Speedup vs '-r quadrature'")
show()
ffc-1.3.0/bench/results/ 0000775 0000000 0000000 00000000000 12263013201 0015017 5 ustar 00root root 0000000 0000000 ffc-1.3.0/bench/results/bench.log 0000664 0000000 0000000 00000010534 12263013201 0016604 0 ustar 00root root 0000000 0000000 MassH1_1, -r tensor, 4.55379e-08
MassH1_2, -r tensor, 5.8651e-08
MassH1_3, -r tensor, 1.62125e-07
MassH1_4, -r tensor, 3.8147e-07
MassH1_5, -r tensor, 5.6076e-07
MassHcurl_1, -r tensor, 9.01222e-08
MassHcurl_2, -r tensor, 2.46048e-07
MassHcurl_3, -r tensor, 7.93457e-07
MassHcurl_4, -r tensor, 5.58472e-06
MassHcurl_5, -r tensor, 1.17188e-05
MassHdiv_1, -r tensor, 1.65939e-07
MassHdiv_2, -r tensor, 5.26428e-07
MassHdiv_3, -r tensor, 3.75366e-06
MassHdiv_4, -r tensor, 8.48389e-06
MassHdiv_5, -r tensor, 1.61133e-05
NavierStokes_1, -r tensor, 5.37872e-07
NavierStokes_2, -r tensor, 2.02637e-05
NavierStokes_3, -r tensor, 0.000178711
Poisson_1, -r tensor, 8.2016e-08
Poisson_2, -r tensor, 1.19209e-07
Poisson_3, -r tensor, 2.82288e-07
Poisson_4, -r tensor, 6.48499e-07
Poisson_5, -r tensor, 3.72314e-06
WeightedPoisson_1, -r tensor, 1.23978e-07
WeightedPoisson_2, -r tensor, 5.45502e-07
WeightedPoisson_3, -r tensor, 7.50732e-06
WeightedPoisson_4, -r tensor, 2.80762e-05
WeightedPoisson_5, -r tensor, 8.05664e-05
MassH1_1, -r tensor -O, 3.71933e-08
MassH1_2, -r tensor -O, 5.57899e-08
MassH1_3, -r tensor -O, 1.24931e-07
MassH1_4, -r tensor -O, 2.82288e-07
MassH1_5, -r tensor -O, 5.34058e-07
MassHcurl_1, -r tensor -O, 8.91685e-08
MassHcurl_2, -r tensor -O, 2.46048e-07
MassHcurl_3, -r tensor -O, 7.47681e-07
MassHcurl_4, -r tensor -O, 5.00488e-06
MassHcurl_5, -r tensor -O, 1.01929e-05
MassHdiv_1, -r tensor -O, 1.57356e-07
MassHdiv_2, -r tensor -O, 4.50134e-07
MassHdiv_3, -r tensor -O, 1.31226e-06
MassHdiv_4, -r tensor -O, 7.20215e-06
MassHdiv_5, -r tensor -O, 1.36719e-05
NavierStokes_1, -r tensor -O, 3.43323e-07
NavierStokes_2, -r tensor -O, 1.16577e-05
NavierStokes_3, -r tensor -O, 8.93555e-05
Poisson_1, -r tensor -O, 8.4877e-08
Poisson_2, -r tensor -O, 1.13487e-07
Poisson_3, -r tensor -O, 2.32697e-07
Poisson_4, -r tensor -O, 4.80652e-07
Poisson_5, -r tensor -O, 9.38416e-07
WeightedPoisson_1, -r tensor -O, 1.13487e-07
WeightedPoisson_2, -r tensor -O, 4.27246e-07
WeightedPoisson_3, -r tensor -O, 5.31006e-06
WeightedPoisson_4, -r tensor -O, 1.96533e-05
WeightedPoisson_5, -r tensor -O, 5.51758e-05
MassH1_1, -r quadrature, 3.7384e-07
MassH1_2, -r quadrature, 2.94495e-06
MassH1_3, -r quadrature, 1.42822e-05
MassH1_4, -r quadrature, 5.07812e-05
MassH1_5, -r quadrature, 0.000148437
MassHcurl_1, -r quadrature, 8.39233e-07
MassHcurl_2, -r quadrature, 1.14136e-05
MassHcurl_3, -r quadrature, 7.8125e-05
MassHcurl_4, -r quadrature, 0.000316406
MassHcurl_5, -r quadrature, 0.000992188
MassHdiv_1, -r quadrature, 8.54492e-06
MassHdiv_2, -r quadrature, 7.51953e-05
MassHdiv_3, -r quadrature, 0.000367188
MassHdiv_4, -r quadrature, 0.00128125
MassHdiv_5, -r quadrature, 0.00378125
NavierStokes_1, -r quadrature, 4.02832e-06
NavierStokes_2, -r quadrature, 5.9082e-05
NavierStokes_3, -r quadrature, 0.000355469
Poisson_1, -r quadrature, 2.07901e-07
Poisson_2, -r quadrature, 3.38745e-06
Poisson_3, -r quadrature, 2.03857e-05
Poisson_4, -r quadrature, 7.91016e-05
Poisson_5, -r quadrature, 0.000255859
WeightedPoisson_1, -r quadrature, 2.57492e-07
WeightedPoisson_2, -r quadrature, 8.11768e-06
WeightedPoisson_3, -r quadrature, 4.05273e-05
WeightedPoisson_4, -r quadrature, 0.000183594
WeightedPoisson_5, -r quadrature, 0.000535156
MassH1_1, -r quadrature -O, 3.64304e-07
MassH1_2, -r quadrature -O, 3.17383e-06
MassH1_3, -r quadrature -O, 1.3916e-05
MassH1_4, -r quadrature -O, 4.8584e-05
MassH1_5, -r quadrature -O, 0.000136719
MassHcurl_1, -r quadrature -O, 6.79016e-07
MassHcurl_2, -r quadrature -O, 8.42285e-06
MassHcurl_3, -r quadrature -O, 6.00586e-05
MassHcurl_4, -r quadrature -O, 0.000248047
MassHcurl_5, -r quadrature -O, 0.000777344
MassHdiv_1, -r quadrature -O, 2.62451e-06
MassHdiv_2, -r quadrature -O, 2.28271e-05
MassHdiv_3, -r quadrature -O, 0.000111328
MassHdiv_4, -r quadrature -O, 0.00040625
MassHdiv_5, -r quadrature -O, 0.00122656
NavierStokes_1, -r quadrature -O, 1.60217e-06
NavierStokes_2, -r quadrature -O, 2.19727e-05
NavierStokes_3, -r quadrature -O, 0.000132813
Poisson_1, -r quadrature -O, 2.02179e-07
Poisson_2, -r quadrature -O, 3.479e-06
Poisson_3, -r quadrature -O, 2.49023e-05
Poisson_4, -r quadrature -O, 0.000107422
Poisson_5, -r quadrature -O, 0.000349609
WeightedPoisson_1, -r quadrature -O, 2.26974e-07
WeightedPoisson_2, -r quadrature -O, 7.93457e-06
WeightedPoisson_3, -r quadrature -O, 4.41895e-05
WeightedPoisson_4, -r quadrature -O, 0.000224609
WeightedPoisson_5, -r quadrature -O, 0.000703125
ffc-1.3.0/bench/results/results.log 0000664 0000000 0000000 00000011511 12263013201 0017222 0 ustar 00root root 0000000 0000000 Linux aule 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:09:38 UTC 2010 x86_64 GNU/Linux
Thu May 13 21:39:15 CEST 2010
----------------------------------------------------------------------------------
| FFC bench | -r tensor | -r tensor -O | -r quadrature | -r quadrature -O |
----------------------------------------------------------------------------------
| MassH1_1 | 4.5538e-08 | 3.7193e-08 | 3.7384e-07 | 3.643e-07 |
----------------------------------------------------------------------------------
| MassH1_2 | 5.8651e-08 | 5.579e-08 | 2.9449e-06 | 3.1738e-06 |
----------------------------------------------------------------------------------
| MassH1_3 | 1.6212e-07 | 1.2493e-07 | 1.4282e-05 | 1.3916e-05 |
----------------------------------------------------------------------------------
| MassH1_4 | 3.8147e-07 | 2.8229e-07 | 5.0781e-05 | 4.8584e-05 |
----------------------------------------------------------------------------------
| MassH1_5 | 5.6076e-07 | 5.3406e-07 | 0.00014844 | 0.00013672 |
----------------------------------------------------------------------------------
| MassHcurl_1 | 9.0122e-08 | 8.9169e-08 | 8.3923e-07 | 6.7902e-07 |
----------------------------------------------------------------------------------
| MassHcurl_2 | 2.4605e-07 | 2.4605e-07 | 1.1414e-05 | 8.4229e-06 |
----------------------------------------------------------------------------------
| MassHcurl_3 | 7.9346e-07 | 7.4768e-07 | 7.8125e-05 | 6.0059e-05 |
----------------------------------------------------------------------------------
| MassHcurl_4 | 5.5847e-06 | 5.0049e-06 | 0.00031641 | 0.00024805 |
----------------------------------------------------------------------------------
| MassHcurl_5 | 1.1719e-05 | 1.0193e-05 | 0.00099219 | 0.00077734 |
----------------------------------------------------------------------------------
| MassHdiv_1 | 1.6594e-07 | 1.5736e-07 | 8.5449e-06 | 2.6245e-06 |
----------------------------------------------------------------------------------
| MassHdiv_2 | 5.2643e-07 | 4.5013e-07 | 7.5195e-05 | 2.2827e-05 |
----------------------------------------------------------------------------------
| MassHdiv_3 | 3.7537e-06 | 1.3123e-06 | 0.00036719 | 0.00011133 |
----------------------------------------------------------------------------------
| MassHdiv_4 | 8.4839e-06 | 7.2021e-06 | 0.0012813 | 0.00040625 |
----------------------------------------------------------------------------------
| MassHdiv_5 | 1.6113e-05 | 1.3672e-05 | 0.0037812 | 0.0012266 |
----------------------------------------------------------------------------------
| NavierStokes_1 | 5.3787e-07 | 3.4332e-07 | 4.0283e-06 | 1.6022e-06 |
----------------------------------------------------------------------------------
| NavierStokes_2 | 2.0264e-05 | 1.1658e-05 | 5.9082e-05 | 2.1973e-05 |
----------------------------------------------------------------------------------
| NavierStokes_3 | 0.00017871 | 8.9355e-05 | 0.00035547 | 0.00013281 |
----------------------------------------------------------------------------------
| Poisson_1 | 8.2016e-08 | 8.4877e-08 | 2.079e-07 | 2.0218e-07 |
----------------------------------------------------------------------------------
| Poisson_2 | 1.1921e-07 | 1.1349e-07 | 3.3875e-06 | 3.479e-06 |
----------------------------------------------------------------------------------
| Poisson_3 | 2.8229e-07 | 2.327e-07 | 2.0386e-05 | 2.4902e-05 |
----------------------------------------------------------------------------------
| Poisson_4 | 6.485e-07 | 4.8065e-07 | 7.9102e-05 | 0.00010742 |
----------------------------------------------------------------------------------
| Poisson_5 | 3.7231e-06 | 9.3842e-07 | 0.00025586 | 0.00034961 |
----------------------------------------------------------------------------------
| WeightedPoisson_1 | 1.2398e-07 | 1.1349e-07 | 2.5749e-07 | 2.2697e-07 |
----------------------------------------------------------------------------------
| WeightedPoisson_2 | 5.455e-07 | 4.2725e-07 | 8.1177e-06 | 7.9346e-06 |
----------------------------------------------------------------------------------
| WeightedPoisson_3 | 7.5073e-06 | 5.3101e-06 | 4.0527e-05 | 4.4189e-05 |
----------------------------------------------------------------------------------
| WeightedPoisson_4 | 2.8076e-05 | 1.9653e-05 | 0.00018359 | 0.00022461 |
----------------------------------------------------------------------------------
ffc-1.3.0/bench/utils.py 0000664 0000000 0000000 00000003414 12263013201 0015032 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2010-05-11
# Last changed: 2010-05-11
def print_table(values, title):
"Print nicely formatted table."
m = max([key[0] for key in values]) + 2
n = max([key[1] for key in values]) + 2
table = []
for i in range(m):
table.append(["" for j in range(n)])
for i in range(m - 1):
table[i + 1][0] = str(values[(i, 0)][0])
for j in range(n - 1):
table[0][j + 1] = str(values[(0, j)][1])
for i in range(m - 1):
for j in range(n - 1):
value = values[(i, j)][2]
if isinstance(value, float):
value = "%.5g" % value
table[i + 1][j + 1] = value
table[0][0] = title
column_sizes = [max([len(table[i][j]) for i in range(m)]) for j in range(n)]
row_size = sum(column_sizes) + 3*(len(column_sizes) - 1) + 2
print ""
for i in range(m):
print " " + "-"*row_size
print "|",
for j in range(n):
print table[i][j] + " "*(column_sizes[j] - len(table[i][j])),
print "|",
print ""
print " " + "-"*row_size
print ""
ffc-1.3.0/demo/ 0000775 0000000 0000000 00000000000 12263013201 0013163 5 ustar 00root root 0000000 0000000 ffc-1.3.0/demo/AdaptivePoisson.ufl 0000664 0000000 0000000 00000000422 12263013201 0017001 0 ustar 00root root 0000000 0000000 element = FiniteElement("Lagrange", triangle, 1)
element2 = FiniteElement("Lagrange", triangle, 3)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element2)
g = Coefficient(element)
a = inner(grad(u), grad(v))*dx()
L = f*v*dx() + g*v*ds()
M = u*dx()
ffc-1.3.0/demo/AlgebraOperators.ufl 0000664 0000000 0000000 00000002532 12263013201 0017131 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Test all algebra operators on Coefficients.
#
# Compile this form with FFC: ffc AlgebraOperators.ufl
element = FiniteElement("Lagrange", triangle, 1)
c0 = Coefficient(element)
c1 = Coefficient(element)
s0 = 3*c0 - c1
p0 = c0*c1
f0 = c0/c1
integrand = 5*c0 + 5*p0 + 5*f0\
+ s0*c0 + s0*p0 + s0*f0\
+ 5/c0 + 5/p0 + 5/f0\
+ s0/c0 + s0/p0 + s0/f0\
+ s0/5 + s0/5 + s0/5\
+ c0**2 + s0**2 + p0**2 + f0**2\
+ c1**2.2 + s0**2.2 + p0**2.2 + f0**2.2\
+ c0**c1 + s0**c0 + p0**c0 + f0**c0\
+ c0**s0 + s0**p0 + p0**f0 + f0**p0\
+ abs(c0) + abs(s0) + abs(p0) + abs(f0)
a = integrand*dx
ffc-1.3.0/demo/Biharmonic.ufl 0000664 0000000 0000000 00000003023 12263013201 0015744 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# Copyright (C) 2009 Kristian B. Oelgaard, Garth N. Wells and Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2009-06-26
# Last changed: 2011-03-08
#
# The bilinear form a(u, v) and linear form L(v) for
# Biharmonic equation in a discontinuous Galerkin (DG)
# formulation.
#
# Compile this form with FFC: ffc -l dolfin Biharmonic.ufl
# Elements
element = FiniteElement("Lagrange", triangle, 2)
# Trial and test functions
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
# Normal component, mesh size and right-hand side
n = element.cell().n
h = Constant(triangle)
# Parameters
alpha = Constant(triangle)
# Bilinear form
a = inner(div(grad(u)), div(grad(v)))*dx \
- inner(jump(grad(u), n), avg(div(grad(v))))*dS \
- inner(avg(div(grad(u))), jump(grad(v), n))*dS \
+ alpha('+')/h('+')*inner(jump(grad(u),n), jump(grad(v),n))*dS
# Linear form
L = f*v*dx
ffc-1.3.0/demo/CellGeometry.ufl 0000664 0000000 0000000 00000002225 12263013201 0016267 0 ustar 00root root 0000000 0000000 # Copyright (C) 2013 Martin S. Alnaes
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# A functional M involving a bunch of cell geometry quantities in ufl.
#
# Compile this form with FFC: ffc CellGeometry.ufl
cell = tetrahedron
V = FiniteElement("CG", cell, 1)
u = Coefficient(V)
# TODO: Add all geometry for all cell types to this and other demo files, need for regression test.
x = cell.x
n = cell.n
vol = cell.volume
rad = cell.circumradius
area = cell.facet_area
M = u*(x[0]*vol*rad)*dx + u*(x[0]*vol*rad*area)*ds # + u*area*avg(n[0]*x[0]*vol*rad)*dS
ffc-1.3.0/demo/CoefficientOperators.ufl 0000664 0000000 0000000 00000002006 12263013201 0020006 0 ustar 00root root 0000000 0000000 # Copyright (C) 2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Test form for operators on Coefficients.
#
# Compile this form with FFC: ffc CoefficientOperators.ufl
element = FiniteElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
g = Coefficient(element)
a = sqrt(1/abs(1/f))*sqrt(g)*inner(grad(u), grad(v))*dx + sqrt(f*g)*g*u*v*dx
ffc-1.3.0/demo/Components.ufl 0000664 0000000 0000000 00000002000 12263013201 0016010 0 ustar 00root root 0000000 0000000 # Copyright (C) 2011 Garth N. Wells
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This example demonstrates how to create vectors component-wise
#
# Compile this form with FFC: ffc Component.ufl
element = VectorElement("Lagrange", tetrahedron, 1)
v = TestFunction(element)
f = Coefficient(element)
# Create vector
v0 = as_vector([v[0], v[1], 0.0])
# Use created vector in linear form
L = dot(f, v0)*dx
ffc-1.3.0/demo/Conditional.ufl 0000664 0000000 0000000 00000002462 12263013201 0016142 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010-2011 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Illustration on how to use Conditional to define a source term
#
# Compile this form with FFC: ffc Conditional.ufl
element = FiniteElement("Lagrange", triangle, 2)
v = TestFunction(element)
g = Constant(triangle)
x = triangle.x
c0 = conditional(le( (x[0]-0.33)**2 + (x[1]-0.67)**2, 0.015), -1.0, 5.0)
c = conditional( le( (x[0]-0.33)**2 + (x[1]-0.67)**2, 0.025), c0, 0.0 )
t0 = And(ge( x[0], 0.55), le(x[0], 0.95))
t1 = Or( lt( x[1], 0.05), gt(x[1], 0.45))
t2 = And(t0, Not(t1))
t = conditional(And(ge( x[1] - x[0] - 0.05 + 0.55, 0.0), t2), -1.0, 0.0)
k = conditional(gt(1,0),g,g+1)
f = c + t + k
L = v*f*dx
ffc-1.3.0/demo/Constant.ufl 0000664 0000000 0000000 00000002004 12263013201 0015460 0 ustar 00root root 0000000 0000000 # Copyright (C) 2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Test form for scalar and vector constants.
#
# Compile this form with FFC: ffc Constant.ufl
element = FiniteElement("Lagrange", triangle, 1)
v = TestFunction(element)
u = TrialFunction(element)
f = Coefficient(element)
c = Constant(triangle)
d = VectorConstant(triangle)
a = c*inner(grad(u), grad(v))*dx
L = inner(d, grad(v))*dx
ffc-1.3.0/demo/Elasticity.ufl 0000664 0000000 0000000 00000002077 12263013201 0016013 0 ustar 00root root 0000000 0000000 # Copyright (C) 2005 Johan Jansson
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Modified by Anders Logg 2005-2007
# Modified by Marie E. Rognes 2012
#
# The bilinear form e(v) : e(u) for linear
# elasticity with e(v) = 1/2 (grad(v) + grad(v)^T)
#
# Compile this form with FFC: ffc Elasticity.ufl
element = VectorElement("Lagrange", tetrahedron, 1)
u = TrialFunction(element)
v = TestFunction(element)
def eps(v):
return sym(grad(v))
a = inner(eps(u), eps(v))*dx
ffc-1.3.0/demo/EnergyNorm.ufl 0000664 0000000 0000000 00000001736 12263013201 0015767 0 ustar 00root root 0000000 0000000 # Copyright (C) 2005-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This example demonstrates how to define a functional, here
# the energy norm (squared) for a reaction-diffusion problem.
#
# Compile this form with FFC: ffc EnergyNorm.ufl
element = FiniteElement("Lagrange", tetrahedron, 1)
v = Coefficient(element)
a = (v*v + inner(grad(v), grad(v)))*dx
ffc-1.3.0/demo/Equation.ufl 0000664 0000000 0000000 00000003136 12263013201 0015463 0 ustar 00root root 0000000 0000000 # Copyright (C) 2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Specification of a system F(u, v) = 0 and extraction of
# the bilinear and linear forms a and L for the left- and
# right-hand sides:
#
# F(u, v) = a(u, v) - L(v) = 0
#
# The example below demonstrates the specification of the
# linear system for a cG(1)/Crank-Nicholson time step for
# the heat equation.
#
# The below formulation is equivalent to writing
#
# a = u*v*dx + 0.5*k*inner(grad(u), grad(v))*dx
# L = u0*v*dx - 0.5*k*inner(grad(u0), grad(v))*dx
#
# but instead of manually shuffling terms not including
# the unknown u to the right-hand side, all terms may
# be listed on one line and left- and right-hand sides
# extracted by lhs() and rhs().
#
# Compile this form with FFC: ffc Equation.ufl
element = FiniteElement("Lagrange", triangle, 1)
k = 0.1
u = TrialFunction(element)
v = TestFunction(element)
u0 = Coefficient(element)
eq = (u - u0)*v*dx + k*inner(grad(0.5*(u0 + u)), grad(v))*dx
a = lhs(eq)
L = rhs(eq)
ffc-1.3.0/demo/FacetIntegrals.ufl 0000664 0000000 0000000 00000002217 12263013201 0016570 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009-2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2009-03-20
# Last changed: 2011-03-08
#
# Simple example of a form defined over exterior and interior facets.
#
# Compile this form with FFC: ffc FacetIntegrals.ufl
element = FiniteElement("Discontinuous Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
h = Constant(triangle)
n = VectorConstant(triangle)
a = u*v*ds \
+ u('+')*v('-')*dS \
+ inner(jump(u, n), avg(grad(v)))*dS \
+ inner(avg(grad(u)), jump(v, n))*dS
ffc-1.3.0/demo/FacetRestrictionAD.ufl 0000664 0000000 0000000 00000001734 12263013201 0017355 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Garth N. Wells
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2010-06-07
# Last changed: 2011-07-01
#
element = FiniteElement("Discontinuous Lagrange", triangle, 1)
v = TestFunction(element)
w = Coefficient(element)
L = inner(grad(w), grad(v))*dx - dot(avg(grad(w)), avg(grad(v)))*dS
u = TrialFunction(element)
a = derivative(L, w, u)
ffc-1.3.0/demo/Heat.ufl 0000664 0000000 0000000 00000002340 12263013201 0014553 0 ustar 00root root 0000000 0000000 # Copyright (C) 2005-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(v, u1) and linear form L(v) for
# one backward Euler step with the heat equation.
#
# Compile this form with FFC: ffc Heat.ufl
element = FiniteElement("Lagrange", triangle, 1)
u1 = TrialFunction(element) # Value at t_n
u0 = Coefficient(element) # Value at t_n-1
v = TestFunction(element) # Test function
c = Coefficient(element) # Heat conductivity
f = Coefficient(element) # Heat source
k = Constant(triangle) # Time step
a = u1*v*dx + k*c*inner(grad(u1), grad(v))*dx
L = u0*v*dx + k*f*v*dx
ffc-1.3.0/demo/HyperElasticity.ufl 0000664 0000000 0000000 00000004010 12263013201 0017010 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Harish Narayanan
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2009-09-29
# Last changed: 2011-07-01
#
# The bilinear form a(u, v) and linear form L(v) for
# a hyperelastic model. (Copied from dolfin/demo/pde/hyperelasticity/cpp)
#
# Compile this form with FFC: ffc HyperElasticity.ufl.
# Coefficient spaces
element = VectorElement("Lagrange", tetrahedron, 1)
# Coefficients
v = TestFunction(element) # Test function
du = TrialFunction(element) # Incremental displacement
u = Coefficient(element) # Displacement from previous iteration
B = Coefficient(element) # Body force per unit mass
T = Coefficient(element) # Traction force on the boundary
# Kinematics
I = Identity(v.cell().d) # Identity tensor
F = I + grad(u) # Deformation gradient
C = F.T*F # Right Cauchy-Green tensor
E = (C - I)/2 # Euler-Lagrange strain tensor
E = variable(E)
# Material constants
mu = Constant(tetrahedron) # Lame's constants
lmbda = Constant(tetrahedron)
# Strain energy function (material model)
psi = lmbda/2*(tr(E)**2) + mu*tr(E*E)
S = diff(psi, E) # Second Piola-Kirchhoff stress tensor
P = F*S # First Piola-Kirchoff stress tensor
# The variational problem corresponding to hyperelasticity
L = inner(P, grad(v))*dx - inner(B, v)*dx - inner(T, v)*ds
a = derivative(L, u, du)
ffc-1.3.0/demo/Mass.ufl 0000664 0000000 0000000 00000001605 12263013201 0014600 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form for a mass matrix.
#
# Compile this form with FFC: ffc Mass.ufl
element = FiniteElement("Lagrange", tetrahedron, 3)
v = TestFunction(element)
u = TrialFunction(element)
a = u*v*dx
ffc-1.3.0/demo/MathFunctions.ufl 0000664 0000000 0000000 00000003430 12263013201 0016455 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Test all algebra operators on Coefficients.
#
# Compile this form with FFC: ffc MathFunctions.ufl
element = FiniteElement("Lagrange", triangle, 1)
c0 = Coefficient(element)
c1 = Coefficient(element)
s0 = 3*c0 - c1
p0 = c0*c1
f0 = c0/c1
integrand = sqrt(c0) + sqrt(s0) + sqrt(p0) + sqrt(f0)\
+ exp(c0) + exp(s0) + exp(p0) + exp(f0)\
+ ln(c0) + ln(s0) + ln(p0) + ln(f0)\
+ cos(c0) + cos(s0) + cos(p0) + cos(f0)\
+ sin(c0) + sin(s0) + sin(p0) + sin(f0)\
+ tan(c0) + tan(s0) + tan(p0) + tan(f0)\
+ acos(c0) + acos(s0) + acos(p0) + acos(f0)\
+ asin(c0) + asin(s0) + asin(p0) + asin(f0)\
+ atan(c0) + atan(s0) + atan(p0) + atan(f0)\
+ erf(c0) + erf(s0) + erf(p0) + erf(f0)\
+ bessel_I(1, c0) + bessel_I(1, s0) + bessel_I(0, p0) + bessel_I(0, f0)\
+ bessel_J(1, c0) + bessel_J(1, s0) + bessel_J(0, p0) + bessel_J(0, f0)\
+ bessel_K(1, c0) + bessel_K(1, s0) + bessel_K(0, p0) + bessel_K(0, f0)\
+ bessel_Y(1, c0) + bessel_Y(1, s0) + bessel_Y(0, p0) + bessel_Y(0, f0)
a = integrand*dx
ffc-1.3.0/demo/MetaData.ufl 0000664 0000000 0000000 00000002733 12263013201 0015360 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Test form for metadata
#
# Compile this form with FFC: ffc MetaData.ufl
element = FiniteElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
# Three terms on the same subdomain using different representations
a_0 = u*v*dx(0, {"representation":"tensor"})\
+ inner(grad(u), grad(v))*dx(0, {"representation": "quadrature"})\
+ inner(grad(u), grad(v))*dx(0, {"representation": "auto"})
# Three terms on different subdomains using different representations and order
a_1 = inner(grad(u), grad(v))*dx(0, {"representation":"tensor", "quadrature_degree":8})\
+ inner(grad(u), grad(v))*dx(1, {"representation":"quadrature", "quadrature_degree":4})\
+ inner(grad(u), grad(v))*dx(1, {"representation":"auto", "quadrature_degree":"auto"})
a = a_0 + a_1
ffc-1.3.0/demo/Mini.ufl 0000664 0000000 0000000 00000002353 12263013201 0014572 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Marie E. Rognes
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Illustration of vector sum of elements (EnrichedElement): The
# bilinear form a(u, v) for the Stokes equations using a mixed
# formulation involving the Mini element. The velocity element is
# composed of a P1 element augmented by the cubic bubble function.
# Compile this form with FFC: ffc Mini.ufl
P1 = VectorElement("Lagrange", triangle, 1)
B = VectorElement("Bubble", triangle, 3)
Q = FiniteElement("CG", triangle, 1)
Mini = (P1 + B)*Q
(u, p) = TrialFunctions(Mini)
(v, q) = TestFunctions(Mini)
a = (inner(grad(u), grad(v)) - div(v)*p + div(u)*q)*dx
ffc-1.3.0/demo/MixedMixedElement.ufl 0000664 0000000 0000000 00000001720 12263013201 0017242 0 ustar 00root root 0000000 0000000 # Copyright (C) 2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# A mixed element of mixed elements
#
# Compile this form with FFC: ffc MixedMixedElement.ufl
cell = triangle
DG = VectorElement("DG", cell, 0)
CG = FiniteElement("Lagrange", cell, 2)
RT = FiniteElement("RT", cell, 3)
element = DG * CG * RT
v = TestFunction(element)
a = v[0]*dx
ffc-1.3.0/demo/MixedPoisson.ufl 0000664 0000000 0000000 00000002314 12263013201 0016314 0 ustar 00root root 0000000 0000000 # Copyright (C) 2006-2007 Anders Logg and Marie E. Rognes
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a and linear form L for a mixed formulation of
# Poisson's equation with BDM (Brezzi-Douglas-Marini) elements.
# Compile this form with FFC: ffc MixedPoisson.ufl
q = 1
BDM = FiniteElement("Brezzi-Douglas-Marini", triangle, q)
DG = FiniteElement("Discontinuous Lagrange", triangle, q - 1)
mixed_element = BDM * DG
(sigma, u) = TrialFunctions(mixed_element)
(tau, w) = TestFunctions(mixed_element)
f = Coefficient(DG)
a = (inner(sigma, tau) - div(tau)*u + div(sigma)*w)*dx
L = f*w*dx
ffc-1.3.0/demo/NavierStokes.ufl 0000664 0000000 0000000 00000001776 12263013201 0016323 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form for the nonlinear term in the
# Navier-Stokes equations with fixed convective velocity.
#
# Compile this form with FFC: ffc NavierStokes.ufl
element = VectorElement("Lagrange", tetrahedron, 1)
u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
a = w[j]*Dx(u[i], j)*v[i]*dx
ffc-1.3.0/demo/NeumannProblem.ufl 0000664 0000000 0000000 00000002073 12263013201 0016617 0 ustar 00root root 0000000 0000000 # Copyright (C) 2006-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation with Neumann boundary conditions.
#
# Compile this form with FFC: ffc NeumannProblem.ufl
element = VectorElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
g = Coefficient(element)
a = inner(grad(u), grad(v))*dx
L = inner(f, v)*dx + inner(g, v)*ds
ffc-1.3.0/demo/Normals.ufl 0000664 0000000 0000000 00000001764 12263013201 0015316 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Peter Brune
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This example demonstrates how to use the facet normals
# Merely project the normal onto a vector section
#
# Compile this form with FFC: ffc Normals.ufl
cell = triangle
element = VectorElement("Lagrange", cell, 1)
n = cell.n
v = TrialFunction(element)
u = TestFunction(element)
a = dot(v, u)*ds
L = dot(n, u)*ds
ffc-1.3.0/demo/Optimization.ufl 0000664 0000000 0000000 00000001751 12263013201 0016365 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation.
#
# Compile this form with FFC: ffc -O Optimization.ufl
element = FiniteElement("Lagrange", triangle, 3)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = inner(grad(u), grad(v))*dx
L = f*v*dx
ffc-1.3.0/demo/P5tet.ufl 0000664 0000000 0000000 00000001527 12263013201 0014701 0 ustar 00root root 0000000 0000000 # Copyright (C) 2006-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# A fifth degree Lagrange finite element on a tetrahedron
#
# Compile this form with FFC: ffc P5tet.ufl
element = FiniteElement("Lagrange", tetrahedron, 5)
ffc-1.3.0/demo/P5tri.ufl 0000664 0000000 0000000 00000001521 12263013201 0014675 0 ustar 00root root 0000000 0000000 # Copyright (C) 2006-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# A fifth degree Lagrange finite element on a triangle
#
# Compile this form with FFC: ffc P5tri.ufl
element = FiniteElement("Lagrange", triangle, 5)
ffc-1.3.0/demo/PointMeasure.ufl 0000664 0000000 0000000 00000002213 12263013201 0016304 0 ustar 00root root 0000000 0000000 # Copyright (C) 2013 Marie E. Rognes
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This demo illustrates how to use a point measure: dP
#
# Compile this form with FFC: ffc PointMeasure.ufl
element = FiniteElement("CG", triangle, 1)
V = FiniteElement("CG", triangle, 2)
u = TrialFunction(element)
v = TestFunction(element)
g = Coefficient(element)
f = Coefficient(V)
a = u*v*dP + g*g*u*v*dP(1) + u*v*dx
element = FiniteElement("DG", tetrahedron, 1)
V = FiniteElement("DG", tetrahedron, 2)
v = TestFunction(element)
f = Coefficient(V)
L = v*f*dP
ffc-1.3.0/demo/Poisson.ufl 0000664 0000000 0000000 00000001741 12263013201 0015330 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation.
#
# Compile this form with FFC: ffc Poisson.ufl
element = FiniteElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = inner(grad(u), grad(v))*dx
L = f*v*dx
ffc-1.3.0/demo/Poisson1D.ufl 0000664 0000000 0000000 00000001741 12263013201 0015515 0 ustar 00root root 0000000 0000000 # Copyright (C) 2004-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation.
#
# Compile this form with FFC: ffc Poisson.ufl
element = FiniteElement("Lagrange", interval, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = inner(grad(u), grad(v))*dx
L = f*v*dx
ffc-1.3.0/demo/PoissonDG.ufl 0000664 0000000 0000000 00000003226 12263013201 0015543 0 ustar 00root root 0000000 0000000 # Copyright (C) 2006-2007 Kristian B. Oelgaard and Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2006-12-05
# Last changed: 2011-03-08
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation in a discontinuous Galerkin (DG)
# formulation.
#
# Compile this form with FFC: ffc PoissonDG.ufl
# Elements
element = FiniteElement("Discontinuous Lagrange", triangle, 1)
# Trial and test functions
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
# Normal component, mesh size and right-hand side
n = element.cell().n
h = Constant(triangle)
# Compute average of mesh size
h_avg = (h('+') + h('-'))/2.0
# Neumann boundary conditions
gN = Coefficient(element)
# Parameters
alpha = 4.0
gamma = 8.0
# Bilinear form
a = inner(grad(u), grad(v))*dx \
- inner(jump(u, n), avg(grad(v)))*dS \
- inner(avg(grad(u)), jump(v, n))*dS \
+ alpha/h_avg*inner(jump(u, n), jump(v, n))*dS \
- inner(u*n, grad(v))*ds \
- inner(grad(u), v*n)*ds \
+ gamma/h*u*v*ds
# Linear form
L = f*v*dx + gN*v*ds
ffc-1.3.0/demo/ProjectionManifold.ufl 0000664 0000000 0000000 00000002250 12263013201 0017460 0 ustar 00root root 0000000 0000000 # Copyright (C) 2012 Marie E. Rognes and David Ham
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This demo illustrates use of finite element spaces defined over
# simplicies embedded in higher dimensions
#
# Compile this form with FFC: ffc ProjectionManifold.ufl
# Define interval embedded in 3D:
domain = Cell("triangle", geometric_dimension=3)
# Define element over this domain
V = FiniteElement("RT", domain, 1)
Q = FiniteElement("DG", domain, 0)
element = V*Q
(u, p) = TrialFunctions(element)
(v, q) = TestFunctions(element)
a = (inner(u, v) + div(u)*q + div(v)*p)*dx
ffc-1.3.0/demo/QuadratureElement.ufl 0000664 0000000 0000000 00000002513 12263013201 0017323 0 ustar 00root root 0000000 0000000 # Copyright (C) 2008 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2008-03-31
# Last changed: 2011-03-08
#
# The linearised bilinear form a(u,v) and linear form L(v) for
# the nonlinear equation - div (1+u) grad u = f (non-linear Poisson)
#
# Compile this form with FFC: ffc QuadratureElement.ufl
element = FiniteElement("Lagrange", triangle, 2)
QE = FiniteElement("Quadrature", triangle, 3)
sig = VectorElement("Quadrature", triangle, 3)
u = TrialFunction(element)
v = TestFunction(element)
u0 = Coefficient(element)
C = Coefficient(QE)
sig0 = Coefficient(sig)
f = Coefficient(element)
a = C*u.dx(i)*v.dx(i)*dx + 2*u0*u0.dx(i)*u*v.dx(i)*dx
L = f*v*dx - inner(sig0, grad(v))*dx
ffc-1.3.0/demo/README 0000664 0000000 0000000 00000000446 12263013201 0014047 0 ustar 00root root 0000000 0000000 To compile a form in this directory, just type
ffc .ufl
for example
ffc Poisson.ufl
To run these demos from within the source tree without needing to
install FFC system-wide, update your paths according to
export PATH="../scripts:$PATH"
export PYTHONPATH="..:$PYTHONPATH"
ffc-1.3.0/demo/ReactionDiffusion.ufl 0000664 0000000 0000000 00000002040 12263013201 0017302 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for a simple
# reaction-diffusion equation using simplified tuple notation.
#
# Compile this form with FFC: ffc ReactionDiffusion.ufl
element = FiniteElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = (inner(grad(u), grad(v)) + u*v)*dx
L = f*v*dx
ffc-1.3.0/demo/RestrictedElement.ufl 0000664 0000000 0000000 00000002757 12263013201 0017330 0 ustar 00root root 0000000 0000000 # Copyright (C) 2009 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# Restriction of a finite element.
# The below syntax show how one can restrict a higher order Lagrange element
# to only take into account those DOFs that live on the facets.
#
# Compile this form with FFC: ffc RestrictedElement.ufl
# Restricted element
CG_R = FiniteElement("Lagrange", triangle, 4)["facet"]
u_r = TrialFunction(CG_R)
v_r = TestFunction(CG_R)
a = avg(v_r)*avg(u_r)*dS + v_r*u_r*ds
#CG = FiniteElement("Lagrange", triangle, 4)
#CG_R = CG["facet"]
#u_r = TrialFunction(CG_R)
#v_r = TestFunction(CG_R)
#a = v_r('+')*u_r('+')*dS + v_r('-')*u_r('-')*dS + v_r*u_r*ds
# Mixed element
#CG = FiniteElement("Lagrange", triangle, 4)
#CG_R = CG["facet"]
#ME = CG * CG_R
#u, u_r = TrialFunctions(ME)
#v, v_r = TestFunctions(ME)
#a = v*u*dx + v_r('+')*u_r('+')*dS + v_r('+')*u_r('+')*dS + v_r*u_r*ds
ffc-1.3.0/demo/SpatialCoordinates.ufl 0000664 0000000 0000000 00000002262 12263013201 0017465 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# Poisson's equation where spatial coordinates are used to define the source
# and boundary flux terms.
#
# Compile this form with FFC: ffc SpatialCoordinates.ufl
element = FiniteElement("Lagrange", triangle, 2)
u = TrialFunction(element)
v = TestFunction(element)
x = triangle.x[0]
d_x = triangle.x[0] - 0.5
d_y = triangle.x[1] - 0.5
f = 10.0*exp(-(d_x*d_x + d_y*d_y) / 0.02)
g = sin(5.0*x)
a = inner(grad(u), grad(v))*dx
L = f*v*dx + g*v*ds
ffc-1.3.0/demo/StabilisedStokes.ufl 0000664 0000000 0000000 00000002351 12263013201 0017150 0 ustar 00root root 0000000 0000000 # Copyright (c) 2005-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and Linear form L(v) for the Stokes
# equations using a mixed formulation (equal-order stabilized).
#
# Compile this form with FFC: ffc Stokes.ufl
vector = VectorElement("Lagrange", triangle, 1)
scalar = FiniteElement("Lagrange", triangle, 1)
system = vector * scalar
(u, p) = TrialFunctions(system)
(v, q) = TestFunctions(system)
f = Coefficient(vector)
h = Coefficient(scalar)
beta = 0.2
delta = beta*h*h
a = (inner(grad(u), grad(v)) - div(v)*p + div(u)*q + delta*dot(grad(p), grad(q)))*dx
L = dot(f, v + delta*grad(q))*dx
ffc-1.3.0/demo/Stokes.ufl 0000664 0000000 0000000 00000002144 12263013201 0015144 0 ustar 00root root 0000000 0000000 # Copyright (C) 2005-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and Linear form L(v) for the Stokes
# equations using a mixed formulation (Taylor-Hood elements).
# Compile this form with FFC: ffc Stokes.ufl
P2 = VectorElement("Lagrange", triangle, 2)
P1 = FiniteElement("Lagrange", triangle, 1)
TH = P2 * P1
(u, p) = TrialFunctions(TH)
(v, q) = TestFunctions(TH)
f = Coefficient(P2)
a = (inner(grad(u), grad(v)) - div(v)*p + div(u)*q)*dx
L = inner(f, v)*dx
ffc-1.3.0/demo/SubDomain.ufl 0000664 0000000 0000000 00000001753 12263013201 0015562 0 ustar 00root root 0000000 0000000 # Copyright (C) 2008 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This example illustrates how to define a form over a
# given subdomain of a mesh, in this case a functional.
#
# Compile this form with FFC: ffc SubDomain.ufl
element = FiniteElement("CG", tetrahedron, 1)
v = TestFunction(element)
u = TrialFunction(element)
f = Coefficient(element)
M = f*dx(2) + f*ds(5)
ffc-1.3.0/demo/SubDomains.ufl 0000664 0000000 0000000 00000002132 12263013201 0015735 0 ustar 00root root 0000000 0000000 # Copyright (C) 2008 Anders Logg and Kristian B. Oelgaard
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# This simple example illustrates how forms can be defined on
# different sub domains. It is supported for all three integral
# types.
#
# Compile this form with FFC: ffc SubDomains.ufl
element = FiniteElement("CG", tetrahedron, 1)
u = TrialFunction(element)
v = TestFunction(element)
a = u*v*dx(0) + 10.0*u*v*dx(1) + u*v*ds(0) + 2.0*u*v*ds(1) + u('+')*v('+')*dS(0) + 4.3*u('+')*v('+')*dS(1)
ffc-1.3.0/demo/TensorWeightedPoisson.ufl 0000664 0000000 0000000 00000002042 12263013201 0020177 0 ustar 00root root 0000000 0000000 # Copyright (C) 2005-2007 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) for tensor-weighted Poisson's equation.
#
# Compile this form with FFC: ffc TensorWeightedPoisson.ufl
P1 = FiniteElement("Lagrange", triangle, 1)
P0 = TensorElement("Discontinuous Lagrange", triangle, 0, (2, 2))
u = TrialFunction(P1)
v = TestFunction(P1)
f = Coefficient(P1)
C = Coefficient(P0)
a = inner(C*grad(u), grad(v))*dx
ffc-1.3.0/demo/VectorLaplaceGradCurl.ufl 0000664 0000000 0000000 00000003253 12263013201 0020046 0 ustar 00root root 0000000 0000000 # Copyright (C) 2007 Marie Rognes
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for the Hodge Laplace
# problem using 0- and 1-forms. Intended to demonstrate use of N1curl
# elements.
# Compile this form with FFC: ffc VectorLaplaceGradCurl.ufl
def HodgeLaplaceGradCurl(element, felement):
"""This is a formulation of the Hodge Laplacian using k=1 and n=3,
i.e 0-forms and 1-forms in 3D.
Appropriate elements are
GRAD \times CURL =
Lagrange_r \ times Ned^1_{r}
Lagrange_{r+1} \ times Ned^2_{r}
"""
(sigma, u) = TrialFunctions(element)
(tau, v) = TestFunctions(element)
f = Coefficient(felement)
a = (inner(sigma, tau) - inner(grad(tau), u) +
inner(grad(sigma), v) + inner(curl(u), curl(v)))*dx
L = inner(f, v)*dx
return [a, L]
shape = tetrahedron
order = 1
GRAD = FiniteElement("Lagrange", shape, order)
CURL = FiniteElement("N1curl", shape, order)
VectorLagrange = VectorElement("Lagrange", shape, order+1)
[a, L] = HodgeLaplaceGradCurl(GRAD * CURL, VectorLagrange)
ffc-1.3.0/demo/VectorPoisson.ufl 0000664 0000000 0000000 00000001774 12263013201 0016521 0 ustar 00root root 0000000 0000000 # Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# The bilinear form a(u, v) and linear form L(v) for
# the vector-valued Poisson's equation.
#
# Compile this form with FFC: ffc VectorPoisson.ufl
element = VectorElement("Lagrange", triangle, 1)
u = TrialFunction(element)
v = TestFunction(element)
f = Coefficient(element)
a = inner(grad(u), grad(v))*dx
L = inner(f, v)*dx
ffc-1.3.0/demo/plotelements.py 0000664 0000000 0000000 00000004052 12263013201 0016251 0 ustar 00root root 0000000 0000000 "This program demonstrates how to plot finite elements with FFC."
# Copyright (C) 2010 Anders Logg
#
# This file is part of FFC.
#
# FFC 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.
#
# FFC 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 FFC. If not, see .
#
# First added: 2010-12-07
# Last changed: 2010-12-10
from ufl import *
from ffc import *
#element = FiniteElement("Argyris", triangle, 5)
#element = FiniteElement("Arnold-Winther", triangle)
#element = FiniteElement("Brezzi-Douglas-Marini", triangle, 3)
element = FiniteElement("Brezzi-Douglas-Marini", tetrahedron, 3)
#element = FiniteElement("Crouzeix-Raviart", triangle, 1)
#element = FiniteElement("Crouzeix-Raviart", tetrahedron, 1)
#element = FiniteElement("Discontinuous Lagrange", triangle, 3)
#element = FiniteElement("Discontinuous Lagrange", tetrahedron, 3)
#element = FiniteElement("Hermite", triangle)
#element = FiniteElement("Hermite", tetrahedron)
#element = FiniteElement("Lagrange", triangle, 3)
#element = FiniteElement("Lagrange", tetrahedron, 3)
#element = FiniteElement("Mardal-Tai-Winther", triangle)
#element = FiniteElement("Morley", triangle)
#element = FiniteElement("Nedelec 1st kind H(curl)", triangle, 3)
#element = FiniteElement("Nedelec 1st kind H(curl)", tetrahedron, 3)
#element = FiniteElement("Nedelec 2nd kind H(curl)", triangle, 3)
#element = FiniteElement("Nedelec 2nd kind H(curl)", tetrahedron, 1)
#element = FiniteElement("Raviart-Thomas", triangle, 3)
#element = FiniteElement("Raviart-Thomas", tetrahedron, 3)
plot(element)
#plot(element, rotate=False)
#plot("notation")
ffc-1.3.0/doc/ 0000775 0000000 0000000 00000000000 12263013201 0013004 5 ustar 00root root 0000000 0000000 ffc-1.3.0/doc/man/ 0000775 0000000 0000000 00000000000 12263013201 0013557 5 ustar 00root root 0000000 0000000 ffc-1.3.0/doc/man/man1/ 0000775 0000000 0000000 00000000000 12263013201 0014413 5 ustar 00root root 0000000 0000000 ffc-1.3.0/doc/man/man1/ffc.1.gz 0000664 0000000 0000000 00000005562 12263013201 0015662 0 ustar 00root root 0000000 0000000 AN ffc.1 Yn#7+,esK x3uƃ'bnDElʗ"jrfXzZ=\__}#buNqk;yviO/݇{z%YnßϞO+[e77/F+WWzV&W4oZx͇"{(w}MkV^6p=`btR7֕{\z[YZ{
UUAj9e
Ԫڊ4c7G
jcɾ{
gSn]9,VEY)+ZAr?7yx9[鴠zue6hxAX};)-b^'8DI_qhkr~XqkBUlmaj}(YўH) =G29';p8ZZ8hGD 7(2dj:rAIaz@t1Ë=Rʴ\ <5߿Tw\`կE&t:H?E~2q5y:3g|:,g.hs&p} }ulӚ
hV.rZ6=vU=w~AIЃҼ# 3vSa#3Ʃv<>2JSF'nʃ頸OU3EF.Zȳ\Dڵ)RSPvS-ino/g,|'G/~?ŤϏR@S9l(|r#ǰpSokMT燓BumdAÄpFPuDdJM>-uuƹ;EP`rx
&|B<9n`0?';ٞ[3n20s7^kvRSjn3%]#<"tQCI`8Rj |u{y/7rϦY(J+71)hLfcA83kxWZCǭNDk& )zǕ툦j.P"kz[NV\`