Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
a5313ec301
674
COPYING
Normal file
674
COPYING
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
2
Doxyfile
2
Doxyfile
@ -641,7 +641,7 @@ RECURSIVE = YES
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE =
|
||||
EXCLUDE = opm/core/utility/parameters/tinyxml
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
#ifdef HAVE_ERT
|
||||
#include <opm/core/utility/writeECLData.hpp>
|
||||
#include <util.h>
|
||||
#include <ecl_util.h>
|
||||
#include <ecl_kw.h>
|
||||
#include <ecl_endian_flip.h>
|
||||
#include <fortio.h>
|
||||
#include <ert/util/util.h>
|
||||
#include <ert/ecl/ecl_util.h>
|
||||
#include <ert/ecl/ecl_kw.h>
|
||||
#include <ert/ecl/ecl_endian_flip.h>
|
||||
#include <ert/ecl/fortio.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -3,7 +3,7 @@ AC_DEFUN([_ERT_SOURCE_TEXT],
|
||||
AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stddef.h>
|
||||
#include <ecl_util.h>
|
||||
#include <ert/ecl/ecl_util.h>
|
||||
]],dnl
|
||||
[[
|
||||
int sz;
|
||||
@ -30,7 +30,7 @@ AS_IF([test x"${with_ert}" != x"no"],
|
||||
|
||||
ERT_CPPFLAGS=
|
||||
ERT_LDFLAGS=
|
||||
ERT_LIBS="-lecl -lgeometry -lert_util -lpthread -lz -lgomp"
|
||||
ERT_LIBS="-lecl -lert_geometry -lert_util -lpthread -lz -lgomp"
|
||||
AS_IF([test x"${with_ert}" != x"yes"],
|
||||
[ERT_LDFLAGS="-L${with_ert}/lib"
|
||||
ERT_CPPFLAGS="-I${with_ert}/include"], [:])[]dnl
|
||||
|
@ -20,7 +20,7 @@
|
||||
# for my_slu_found=yes.
|
||||
# my_slu_found
|
||||
# Whether HEADER was found at all. Either "yes" or "no".
|
||||
AC_DEFUN([_slu_lib_path],
|
||||
AC_DEFUN([_opm_slu_lib_path],
|
||||
[
|
||||
my_include_path=include/superlu
|
||||
my_lib_path=lib
|
||||
@ -58,13 +58,13 @@ AC_DEFUN([_slu_lib_path],
|
||||
# for my_slu_found=yes.
|
||||
# my_slu_found
|
||||
# Whether any of the headers. Either "yes" or "no".
|
||||
AC_DEFUN([_slu_search_versions],
|
||||
AC_DEFUN([_opm_slu_search_versions],
|
||||
[
|
||||
my_slu_header=slu_ddefs.h
|
||||
_slu_lib_path($1, $my_slu_header)
|
||||
_opm_slu_lib_path($1, $my_slu_header)
|
||||
if test "$my_slu_found" != "yes"; then
|
||||
my_slu_header="dsp_defs.h"
|
||||
_slu_lib_path($1, $my_slu_header)
|
||||
_opm_slu_lib_path($1, $my_slu_header)
|
||||
fi
|
||||
]
|
||||
)
|
||||
@ -79,14 +79,14 @@ AC_DEFUN([_slu_search_versions],
|
||||
# Root of the SuperLU installation: first of "/usr" and "/usr/local".
|
||||
# Contents is only meaningful for my_slu_found=yes.
|
||||
# For other output variables see documentation of _slu_search_versions().
|
||||
AC_DEFUN([_slu_search_default],
|
||||
AC_DEFUN([_opm_slu_search_default],
|
||||
[
|
||||
with_superlu=/usr
|
||||
_slu_search_versions($with_superlu)
|
||||
opm_with_superlu=/usr
|
||||
_opm_slu_search_versions($opm_with_superlu)
|
||||
|
||||
if test "$my_slu_found" = "no"; then
|
||||
with_superlu=/usr/local
|
||||
_slu_search_versions($with_superlu)
|
||||
opm_with_superlu=/usr/local
|
||||
_opm_slu_search_versions($opm_with_superlu)
|
||||
fi
|
||||
]
|
||||
)
|
||||
@ -156,18 +156,18 @@ AC_DEFUN([OPM_PATH_SUPERLU],[
|
||||
[dnl
|
||||
if test x"$withval" != xno ; then
|
||||
# get absolute path
|
||||
with_superlu=`eval cd $withval > /dev/null 2>&1 && pwd`
|
||||
if test x"$withval" = xyes; then
|
||||
# Search in default locations
|
||||
_slu_search_default
|
||||
_opm_slu_search_default
|
||||
else
|
||||
opm_with_superlu=`eval cd $withval > /dev/null 2>&1 && pwd`
|
||||
# Search for the headers in the specified location
|
||||
_slu_search_versions(["$with_superlu"])
|
||||
_opm_slu_search_versions(["$opm_with_superlu"])
|
||||
fi
|
||||
fi
|
||||
], [dnl
|
||||
# Search in default locations
|
||||
_slu_search_default
|
||||
_opm_slu_search_default
|
||||
])
|
||||
|
||||
AC_ARG_WITH([superlu-lib],
|
||||
@ -200,10 +200,10 @@ AC_DEFUN([OPM_PATH_SUPERLU],[
|
||||
ac_save_LIBS="$LIBS"
|
||||
|
||||
# do nothing if --without-superlu is used
|
||||
if test x"$with_superlu" != x"no" ; then
|
||||
if test x"$opm_with_superlu" != x"no" ; then
|
||||
# defaultpath
|
||||
SUPERLU_LIB_PATH="$with_superlu/$my_lib_path"
|
||||
SUPERLU_INCLUDE_PATH="$with_superlu/$my_include_path"
|
||||
SUPERLU_LIB_PATH="$opm_with_superlu/$my_lib_path"
|
||||
SUPERLU_INCLUDE_PATH="$opm_with_superlu/$my_include_path"
|
||||
|
||||
# set variables so that tests can use them
|
||||
direct_SUPERLU_CPPFLAGS="-I$SUPERLU_INCLUDE_PATH -DENABLE_SUPERLU"
|
||||
@ -274,7 +274,7 @@ AC_DEFUN([OPM_PATH_SUPERLU],[
|
||||
fi
|
||||
fi
|
||||
|
||||
else # $with_superlu = no
|
||||
else # $opm_with_superlu = no
|
||||
HAVE_SUPERLU=0
|
||||
fi
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2012, 2013 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@ -24,10 +24,66 @@
|
||||
/** \mainpage Documentation for the opm-core library.
|
||||
|
||||
The following are the main library features:
|
||||
|
||||
<h3>Grid handling</h3>
|
||||
|
||||
The library defines a simple grid interface through the struct
|
||||
UnstructuredGrid. This can be used both from C and C++ code, and has a
|
||||
structure that is similar to MRST grids.
|
||||
|
||||
Cells can have arbitrary shapes, and arbitrary numbers of neighbours.
|
||||
This flexibility allows us to handle complex grids such as faulted
|
||||
corner-point grids or PEBI grids. The structure is suited for
|
||||
computation with (for example) finite volume methods or mimetic finite
|
||||
differences. It is less ideal for finite element computations, as it
|
||||
does not provide any reference element mappings.
|
||||
|
||||
There are multiple construction functions for UnstructuredGrid, for
|
||||
example create_grid_cart2d(), create_grid_hexa3d(), read_grid() and
|
||||
create_grid_cornerpoint(). The function destroy_grid() frees the
|
||||
resources used by a grid.
|
||||
|
||||
For C++ users, the Opm::GridManager class can be used to encapsulate
|
||||
creation and destruction of an UnstructuredGrid. The method
|
||||
Opm::GridManager::c_grid() provides access to the underlying
|
||||
UnstructuredGrid structure. This class also provides an easy way
|
||||
to initialize a grid from an ECLIPSE-format input deck, via the
|
||||
constructor taking an Opm::EclipseGridParser.
|
||||
|
||||
|
||||
<h3>Well handling</h3>
|
||||
|
||||
A well in opm-core can have an arbitrary number of perforations
|
||||
connecting it to the reservoir. Wells can be open or closed, and they
|
||||
can be controlled by bottom hole pressure (BHP), volumetric
|
||||
(reservoir) rates or surface rates. Multiple controls can be
|
||||
specified, then one control will be the active control and the others
|
||||
will be interpreted as constraints.
|
||||
|
||||
A small collection of structs is used to communicate well information,
|
||||
the most important ones being the Wells struct and its contained
|
||||
WellControls structs. A set of C functions to manipulate these are
|
||||
provided, the most important ones are create_wells(),
|
||||
add_well(), append_well_controls() and destroy_wells().
|
||||
|
||||
The C++ class Opm::WellsManager encapsulates creation and management
|
||||
of well objects, making the underlying Wells struct available in the
|
||||
method Opm::WellsManager::c_wells(). It goes beyond this, however, and
|
||||
also provides methods such as Opm::WellsManager::conditionsMet() that
|
||||
checks if all well constraints are met, and switches controls if not.
|
||||
|
||||
|
||||
<h3>Pressure solvers</h3>
|
||||
|
||||
The currently recommended pressure solvers available in opm-core are
|
||||
the C++ classes
|
||||
- Opm::IncompTpfa (incompressible TPFA discretization)
|
||||
- Opm::CompressibleTpfa (compressible TPFA discretization)
|
||||
Both solvers (also Opm::IncompTpfa) support rock compaction, while
|
||||
only Opm::CompressibleTpfa supports fluid compressibility.
|
||||
|
||||
<h3>Transport solvers</h3>
|
||||
|
||||
<h3>Various utilities</h3>
|
||||
|
||||
*/
|
||||
|
@ -18,20 +18,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -13,27 +13,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
#define SINTEF_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
#ifndef OPM_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
#define OPM_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
|
||||
#include <vector>
|
||||
#include <tr1/array>
|
||||
@ -101,5 +101,5 @@ private:
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // SINTEF_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
#endif // OPM_ECLIPSEGRIDINSPECTOR_HEADER
|
||||
|
||||
|
@ -18,20 +18,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
@ -52,13 +52,13 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#ifdef HAVE_ERT
|
||||
#include <fortio.h>
|
||||
#include <ecl_grid.h>
|
||||
#include <ecl_kw_magic.h>
|
||||
#include <ecl_kw.h>
|
||||
#include <ecl_util.h>
|
||||
#include <ecl_init_file.h>
|
||||
#include <ecl_file.h>
|
||||
#include <ert/ecl/fortio.h>
|
||||
#include <ert/ecl/ecl_grid.h>
|
||||
#include <ert/ecl/ecl_kw_magic.h>
|
||||
#include <ert/ecl/ecl_kw.h>
|
||||
#include <ert/ecl/ecl_util.h>
|
||||
#include <ert/ecl/ecl_init_file.h>
|
||||
#include <ert/ecl/ecl_file.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
@ -13,27 +13,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SINTEF_ECLIPSEGRIDPARSER_HEADER
|
||||
#define SINTEF_ECLIPSEGRIDPARSER_HEADER
|
||||
#ifndef OPM_ECLIPSEGRIDPARSER_HEADER
|
||||
#define OPM_ECLIPSEGRIDPARSER_HEADER
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
@ -47,8 +47,8 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <opm/core/grid/cornerpoint_grid.h>
|
||||
#ifdef HAVE_ERT
|
||||
#include <ecl_kw.h>
|
||||
#include <ecl_grid.h>
|
||||
#include <ert/ecl/ecl_kw.h>
|
||||
#include <ert/ecl/ecl_grid.h>
|
||||
#endif
|
||||
|
||||
|
||||
@ -270,4 +270,4 @@ private:
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // SINTEF_ECLIPSEGRIDPARSER_HEADER
|
||||
#endif // OPM_ECLIPSEGRIDPARSER_HEADER
|
||||
|
@ -17,24 +17,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
#define OPENRS_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
#ifndef OPM_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
#define OPM_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
|
||||
#include <limits>
|
||||
#include <string>
|
||||
@ -460,4 +460,4 @@ namespace
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
#endif // OPENRS_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
#endif // OPM_ECLIPSEGRIDPARSERHELPERS_HEADER
|
||||
|
@ -18,24 +18,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_SPECIALECLIPSEFIELDS_HEADER
|
||||
#define OPENRS_SPECIALECLIPSEFIELDS_HEADER
|
||||
#ifndef OPM_SPECIALECLIPSEFIELDS_HEADER
|
||||
#define OPM_SPECIALECLIPSEFIELDS_HEADER
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
@ -2487,5 +2487,5 @@ struct TUNING : public MultRec {};
|
||||
|
||||
} // End of namespace Opm
|
||||
|
||||
#endif // OPENRS_SPECIALECLIPSEFIELDS_HEADER
|
||||
#endif // OPM_SPECIALECLIPSEFIELDS_HEADER
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <opm/core/fluid/RockBasic.hpp>
|
||||
#include <opm/core/fluid/PvtPropertiesBasic.hpp>
|
||||
#include <opm/core/fluid/SaturationPropsBasic.hpp>
|
||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
@ -81,6 +81,12 @@ allocate_grid(size_t ndims ,
|
||||
G = create_grid_empty();
|
||||
|
||||
if (G != NULL) {
|
||||
/* Grid fields ---------------------------------------- */
|
||||
G->dimensions = ndims;
|
||||
G->number_of_cells = ncells;
|
||||
G->number_of_faces = nfaces;
|
||||
G->number_of_nodes = nnodes;
|
||||
|
||||
/* Node fields ---------------------------------------- */
|
||||
nel = nnodes * ndims;
|
||||
G->node_coordinates = malloc(nel * sizeof *G->node_coordinates);
|
||||
|
@ -138,8 +138,6 @@ void compute_geometry(struct UnstructuredGrid *g)
|
||||
assert (g != NULL);
|
||||
if (g!=NULL)
|
||||
{
|
||||
assert (g->dimensions == 3);
|
||||
|
||||
assert (g->face_centroids != NULL);
|
||||
assert (g->face_normals != NULL);
|
||||
assert (g->face_areas != NULL);
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_FACETOPOLOGY_HEADER
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "geometry.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static void
|
||||
@ -25,16 +26,16 @@ norm(const double w[3])
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
void
|
||||
compute_face_geometry(int ndims, double *coords, int nfaces,
|
||||
int *nodepos, int *facenodes, double *fnormals,
|
||||
double *fcentroids, double *fareas)
|
||||
static void
|
||||
compute_face_geometry_3d(double *coords, int nfaces,
|
||||
int *nodepos, int *facenodes, double *fnormals,
|
||||
double *fcentroids, double *fareas)
|
||||
/* ------------------------------------------------------------------ */
|
||||
{
|
||||
|
||||
/* Assume 3D for now */
|
||||
const int ndims = 3;
|
||||
int f;
|
||||
double x[3];
|
||||
double u[3];
|
||||
@ -109,18 +110,108 @@ compute_face_geometry(int ndims, double *coords, int nfaces,
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static void
|
||||
compute_edge_geometry_2d(
|
||||
/* in */ double *node_coords,
|
||||
/* in */ int num_edges,
|
||||
/* in */ int *edge_node_pos,
|
||||
/* in */ int *edge_nodes,
|
||||
/* out */ double *edge_normals,
|
||||
/* out */ double *edge_midpoints,
|
||||
/* out */ double *edge_lengths)
|
||||
{
|
||||
const int num_dims = 2;
|
||||
|
||||
/* offsets to each of the nodes in a compacted edge */
|
||||
const int a_ofs = 0;
|
||||
const int b_ofs = 1;
|
||||
|
||||
/* offsets to each dimension is a compacted point */
|
||||
const int x_ofs = 0;
|
||||
const int y_ofs = 1;
|
||||
|
||||
int edge; /* edge index */
|
||||
int a_nod, b_nod; /* node indices */
|
||||
double a_x, a_y, b_x, b_y; /* node coordinates */
|
||||
double v_x, v_y; /* vector elements */
|
||||
|
||||
/* decompose each edge into a tuple (a,b) between two points and
|
||||
* compute properties for that face. hopefully the host has enough
|
||||
* cache pages to keep both input and output at the same time, and
|
||||
* registers for all the local variables */
|
||||
for (edge = 0; edge < num_edges; ++edge)
|
||||
{
|
||||
/* an edge in 2D can only have starting and ending point
|
||||
* check that there are exactly two nodes till the next edge */
|
||||
assert (edge_node_pos[edge + 1] - edge_node_pos[edge] == num_dims);
|
||||
|
||||
/* get the first and last point on the edge */
|
||||
a_nod = edge_nodes[edge_node_pos[edge] + a_ofs];
|
||||
b_nod = edge_nodes[edge_node_pos[edge] + b_ofs];
|
||||
|
||||
/* extract individual coordinates for the points */
|
||||
a_x = node_coords[a_nod * num_dims + x_ofs];
|
||||
a_y = node_coords[a_nod * num_dims + y_ofs];
|
||||
b_x = node_coords[b_nod * num_dims + x_ofs];
|
||||
b_y = node_coords[b_nod * num_dims + y_ofs];
|
||||
|
||||
/* compute edge center -- average of node coordinates */
|
||||
edge_midpoints[edge * num_dims + x_ofs] = (a_x + b_x) * 0.5;
|
||||
edge_midpoints[edge * num_dims + y_ofs] = (a_y + b_y) * 0.5;
|
||||
|
||||
/* vector from first to last point */
|
||||
v_x = b_x - a_x;
|
||||
v_y = b_y - a_y;
|
||||
|
||||
/* two-dimensional (unary) cross product analog that makes the
|
||||
* "triple" (dot-cross) product zero, i.e. it's a normal; the
|
||||
* direction of this vector is such that it will be pointing
|
||||
* inwards when enumerating nodes clock-wise */
|
||||
edge_normals[edge * num_dims + x_ofs] = +v_y;
|
||||
edge_normals[edge * num_dims + y_ofs] = -v_x;
|
||||
|
||||
/* Euclidian norm in two dimensions is magnitude of edge */
|
||||
edge_lengths[edge] = sqrt(v_x*v_x + v_y*v_y);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
void
|
||||
compute_cell_geometry(int ndims, double *coords,
|
||||
int *nodepos, int *facenodes, int *neighbors,
|
||||
double *fnormals,
|
||||
double *fcentroids,
|
||||
int ncells, int *facepos, int *cellfaces,
|
||||
double *ccentroids, double *cvolumes)
|
||||
compute_face_geometry(int ndims, double *coords, int nfaces,
|
||||
int *nodepos, int *facenodes, double *fnormals,
|
||||
double *fcentroids, double *fareas)
|
||||
/* ------------------------------------------------------------------ */
|
||||
{
|
||||
if (ndims == 3)
|
||||
{
|
||||
compute_face_geometry_3d(coords, nfaces, nodepos, facenodes,
|
||||
fnormals, fcentroids, fareas);
|
||||
}
|
||||
else if (ndims == 2)
|
||||
{
|
||||
/* two-dimensional interfaces are called 'edges' */
|
||||
compute_edge_geometry_2d(coords, nfaces, nodepos, facenodes,
|
||||
fnormals, fcentroids, fareas);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static void
|
||||
compute_cell_geometry_3d(double *coords,
|
||||
int *nodepos, int *facenodes, int *neighbors,
|
||||
double *fnormals,
|
||||
double *fcentroids,
|
||||
int ncells, int *facepos, int *cellfaces,
|
||||
double *ccentroids, double *cvolumes)
|
||||
/* ------------------------------------------------------------------ */
|
||||
{
|
||||
const int ndims = 3;
|
||||
int i,k, f,c;
|
||||
int face,node;
|
||||
double x[3];
|
||||
@ -240,3 +331,125 @@ compute_cell_geometry(int ndims, double *coords,
|
||||
cvolumes[c] = volume;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static void
|
||||
compute_cell_geometry_2d(
|
||||
/* in */ double *node_coords,
|
||||
/* in */ int *edge_node_pos,
|
||||
/* in */ int *edge_nodes,
|
||||
/* in */ double *edge_midpoints,
|
||||
/* in */ int num_cells,
|
||||
/* in */ int *cell_edge_pos,
|
||||
/* in */ int *cell_edges,
|
||||
/* out */ double *cell_centers,
|
||||
/* out */ double *cell_areas)
|
||||
{
|
||||
const int num_dims = 2;
|
||||
|
||||
/* offsets to each of the nodes in a compacted edge */
|
||||
const int a_ofs = 0;
|
||||
const int b_ofs = 1;
|
||||
|
||||
/* offsets to each dimension is a compacted point */
|
||||
const int x_ofs = 0;
|
||||
const int y_ofs = 1;
|
||||
|
||||
int cell; /* cell index */
|
||||
int num_nodes; /* number of vertices in current cell */
|
||||
int edge_ndx; /* relative edge index within cell */
|
||||
int edge; /* absolute cell index */
|
||||
double center_x; /* x-coordinate for cell barycenter */
|
||||
double center_y; /* y-coordinate for cell barycenter */
|
||||
double area; /* (accumulated) cell area */
|
||||
int a_nod, b_nod; /* node indices for edge start and end points */
|
||||
double a_x, a_y,
|
||||
b_x, b_y; /* vectors from center to edge points */
|
||||
|
||||
for (cell = 0; cell < num_cells; ++cell)
|
||||
{
|
||||
/* since the cell is a closed polygon, each point serves as the starting
|
||||
* point of one edge and the ending point of another; thus there is as
|
||||
* many vertices as there are edges */
|
||||
num_nodes = cell_edge_pos[cell + 1] - cell_edge_pos[cell];
|
||||
|
||||
/* to enumerate all vertices of a cell, we would have to expand the
|
||||
* edges and then remove duplicates. however, the centroid of each
|
||||
* edge contains half of the two vertices that are incident on it. if
|
||||
* we instead sum all the face centroids, we get the sum of all the
|
||||
* vertices */
|
||||
center_x = 0.;
|
||||
center_y = 0.;
|
||||
for (edge_ndx = cell_edge_pos[cell];
|
||||
edge_ndx < cell_edge_pos[cell + 1]; ++edge_ndx)
|
||||
{
|
||||
edge = cell_edges[edge_ndx];
|
||||
center_x += edge_midpoints[edge * num_dims + x_ofs];
|
||||
center_y += edge_midpoints[edge * num_dims + y_ofs];
|
||||
}
|
||||
center_x /= (double) num_nodes;
|
||||
center_y /= (double) num_nodes;
|
||||
cell_centers[cell * num_dims + x_ofs] = center_x;
|
||||
cell_centers[cell * num_dims + y_ofs] = center_y;
|
||||
|
||||
/* triangulate the polygon by introducing the cell center and then new
|
||||
* internal edges from this center to the vertices. the total area of
|
||||
* the cell is the sum of area of these sub-triangles */
|
||||
area = 0.;
|
||||
for (edge_ndx = cell_edge_pos[cell];
|
||||
edge_ndx < cell_edge_pos[cell + 1]; ++edge_ndx)
|
||||
{
|
||||
/* indirect lookup of edge index (from array that contains all the
|
||||
* edge indices for a certain cell) */
|
||||
edge = cell_edges[edge_ndx];
|
||||
|
||||
/* get the first and last point on the edge */
|
||||
a_nod = edge_nodes[edge_node_pos[edge] + a_ofs];
|
||||
b_nod = edge_nodes[edge_node_pos[edge] + b_ofs];
|
||||
|
||||
/* vector from center to each of the nodes */
|
||||
a_x = node_coords[a_nod * num_dims + x_ofs] - center_x;
|
||||
a_y = node_coords[a_nod * num_dims + y_ofs] - center_y;
|
||||
b_x = node_coords[b_nod * num_dims + x_ofs] - center_x;
|
||||
b_y = node_coords[b_nod * num_dims + y_ofs] - center_y;
|
||||
|
||||
/* two-dimensional (binary) cross product analog that has length
|
||||
* equal to the parallelogram spanned by the two vectors (but which
|
||||
* is a scalar). the sign tells us the orientation between the nodes
|
||||
* a and b, but we are not interested in that, just the area */
|
||||
area += fabs(a_x * b_y - a_y * b_x);
|
||||
}
|
||||
/* we summed parallelograms which are twice the size of the triangles
|
||||
* that make up the cell; divide out the half for all terms here */
|
||||
area *= 0.5;
|
||||
cell_areas[cell] = area;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
void
|
||||
compute_cell_geometry(int ndims, double *coords,
|
||||
int *nodepos, int *facenodes, int *neighbors,
|
||||
double *fnormals,
|
||||
double *fcentroids,
|
||||
int ncells, int *facepos, int *cellfaces,
|
||||
double *ccentroids, double *cvolumes)
|
||||
/* ------------------------------------------------------------------ */
|
||||
{
|
||||
if (ndims == 3)
|
||||
{
|
||||
compute_cell_geometry_3d(coords, nodepos, facenodes,
|
||||
neighbors, fnormals, fcentroids, ncells,
|
||||
facepos, cellfaces, ccentroids, cvolumes);
|
||||
}
|
||||
else if (ndims == 2)
|
||||
{
|
||||
compute_cell_geometry_2d(coords, nodepos, facenodes, fcentroids,
|
||||
ncells, facepos, cellfaces, ccentroids,
|
||||
cvolumes);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_MXGRDECL_HEADER
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010, 2011, 2012 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PREPROCESS_HEADER
|
||||
#define OPENRS_PREPROCESS_HEADER
|
||||
#ifndef OPM_PREPROCESS_HEADER
|
||||
#define OPM_PREPROCESS_HEADER
|
||||
|
||||
/**
|
||||
* \file
|
||||
@ -146,7 +146,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* OPENRS_PREPROCESS_HEADER */
|
||||
#endif /* OPM_PREPROCESS_HEADER */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010, 2011, 2012 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Copyright 2009, 2010 SINTEF ICT, Applied Mathematics. */
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_UNIQUEPOINTS_HEADER
|
||||
|
@ -42,12 +42,15 @@ namespace Opm
|
||||
// to pressure in first perforation cell.
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
const WellControls* ctrl = wells->ctrls[w];
|
||||
if (ctrl->type[ctrl->current] == BHP) {
|
||||
bhp_[w] = ctrl->target[ctrl->current];
|
||||
} else {
|
||||
|
||||
if ((ctrl->current < 0) || // SHUT
|
||||
(ctrl->type[ctrl->current] != BHP)) {
|
||||
const int cell = wells->well_cells[wells->well_connpos[w]];
|
||||
bhp_[w] = state.pressure()[cell];
|
||||
}
|
||||
else {
|
||||
bhp_[w] = ctrl->target[ctrl->current];
|
||||
}
|
||||
}
|
||||
perfrates_.resize(wells->well_connpos[nw], 0.0);
|
||||
perfpress_.resize(wells->well_connpos[nw], -1e100);
|
||||
|
@ -25,12 +25,30 @@
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
// ---------------- Methods for class DGBasisInterface ----------------
|
||||
|
||||
|
||||
/// Virtual destructor.
|
||||
DGBasisInterface::~DGBasisInterface()
|
||||
{
|
||||
}
|
||||
|
||||
/// Evaluate function f = sum_i c_i b_i at the point x.
|
||||
/// Note that this function is not virtual, but implemented in
|
||||
/// terms of the virtual functions of the class.
|
||||
/// \param[in] cell Cell index
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
/// \param[in] x Point at which to compute f(x).
|
||||
double DGBasisInterface::evalFunc(const int cell,
|
||||
const double* coefficients,
|
||||
const double* x) const
|
||||
{
|
||||
bvals_.resize(numBasisFunc());
|
||||
eval(cell, x, &bvals_[0]);
|
||||
return std::inner_product(bvals_.begin(), bvals_.end(), coefficients, 0.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------- Methods for class DGBasisBoundedTotalDegree ----------------
|
||||
|
||||
@ -154,6 +172,12 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
/// Compute the average of the function f = sum_i c_i b_i.
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
double DGBasisBoundedTotalDegree::functionAverage(const double* coefficients) const
|
||||
{
|
||||
return coefficients[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -300,11 +324,18 @@ namespace Opm
|
||||
double* coefficients) const
|
||||
{
|
||||
const int nb = numBasisFunc();
|
||||
const double average = std::accumulate(coefficients, coefficients + nb, 0.0)/double(nb);
|
||||
const double aver = functionAverage(coefficients);
|
||||
for (int ix = 0; ix < nb; ++ix) {
|
||||
coefficients[ix] = factor*(coefficients[ix] - average) + average;
|
||||
coefficients[ix] = factor*(coefficients[ix] - aver) + aver;
|
||||
}
|
||||
}
|
||||
|
||||
/// Compute the average of the function f = sum_i c_i b_i.
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
double DGBasisMultilin::functionAverage(const double* coefficients) const
|
||||
{
|
||||
const int nb = numBasisFunc();
|
||||
return std::accumulate(coefficients, coefficients + nb, 0.0)/double(nb);
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef OPM_DGBASIS_HEADER_INCLUDED
|
||||
#define OPM_DGBASIS_HEADER_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct UnstructuredGrid;
|
||||
|
||||
namespace Opm
|
||||
@ -75,6 +77,23 @@ namespace Opm
|
||||
/// \param[out] coefficients Coefficients {c_i} for a single cell.
|
||||
virtual void multiplyGradient(const double factor,
|
||||
double* coefficients) const = 0;
|
||||
|
||||
/// Evaluate function f = sum_i c_i b_i at the point x.
|
||||
/// Note that this function is not virtual, but implemented in
|
||||
/// terms of the virtual functions of the class.
|
||||
/// \param[in] cell Cell index
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
/// \param[in] x Point at which to compute f(x).
|
||||
double evalFunc(const int cell,
|
||||
const double* coefficients,
|
||||
const double* x) const;
|
||||
|
||||
/// Compute the average of the function f = sum_i c_i b_i.
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
virtual double functionAverage(const double* coefficients) const = 0;
|
||||
|
||||
private:
|
||||
mutable std::vector<double> bvals_; // For evalFunc().
|
||||
};
|
||||
|
||||
|
||||
@ -144,6 +163,10 @@ namespace Opm
|
||||
virtual void multiplyGradient(const double factor,
|
||||
double* coefficients) const;
|
||||
|
||||
/// Compute the average of the function f = sum_i c_i b_i.
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
virtual double functionAverage(const double* coefficients) const;
|
||||
|
||||
private:
|
||||
const UnstructuredGrid& grid_;
|
||||
const int degree_;
|
||||
@ -217,6 +240,10 @@ namespace Opm
|
||||
virtual void multiplyGradient(const double factor,
|
||||
double* coefficients) const;
|
||||
|
||||
/// Compute the average of the function f = sum_i c_i b_i.
|
||||
/// \param[in] coefficients Coefficients {c_i} for a single cell.
|
||||
virtual double functionAverage(const double* coefficients) const;
|
||||
|
||||
private:
|
||||
const UnstructuredGrid& grid_;
|
||||
const int degree_;
|
||||
|
@ -411,10 +411,10 @@ namespace Opm
|
||||
{
|
||||
switch (limiter_method_) {
|
||||
case MinUpwindFace:
|
||||
applyMinUpwindFaceLimiter(cell, tof);
|
||||
applyMinUpwindLimiter(cell, true, tof);
|
||||
break;
|
||||
case MinUpwindAverage:
|
||||
applyMinUpwindAverageLimiter(cell, tof);
|
||||
applyMinUpwindLimiter(cell, false, tof);
|
||||
break;
|
||||
default:
|
||||
THROW("Limiter type not implemented: " << limiter_method_);
|
||||
@ -424,48 +424,32 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTofDiscGal::applyMinUpwindFaceLimiter(const int cell, double* tof)
|
||||
void TransportModelTracerTofDiscGal::applyMinUpwindLimiter(const int cell, const bool face_min, double* tof)
|
||||
{
|
||||
if (basis_func_->degree() != 1) {
|
||||
THROW("This limiter only makes sense for our DG1 implementation.");
|
||||
}
|
||||
|
||||
// Limiter principles:
|
||||
// 1. Let M be the minimum TOF value on the upstream faces,
|
||||
// evaluated in the upstream cells. Then the value at all
|
||||
// points in this cell shall be at least M.
|
||||
// Upstream faces whose flux does not exceed the relative
|
||||
// flux threshold are not considered for this minimum.
|
||||
// 1. Let M be either:
|
||||
// - the minimum TOF value of all upstream faces,
|
||||
// evaluated in the upstream cells
|
||||
// (chosen if face_min is true).
|
||||
// or:
|
||||
// - the minimum average TOF value of all upstream cells
|
||||
// (chosen if face_min is false).
|
||||
// Then the value at all points in this cell shall be at
|
||||
// least M. Upstream faces whose flux does not exceed the
|
||||
// relative flux threshold are not considered for this
|
||||
// minimum.
|
||||
// 2. The TOF shall not be below zero in any point.
|
||||
|
||||
// Find total upstream/downstream fluxes.
|
||||
double upstream_flux = 0.0;
|
||||
double downstream_flux = 0.0;
|
||||
for (int hface = grid_.cell_facepos[cell]; hface < grid_.cell_facepos[cell+1]; ++hface) {
|
||||
const int face = grid_.cell_faces[hface];
|
||||
double flux = 0.0;
|
||||
if (cell == grid_.face_cells[2*face]) {
|
||||
flux = darcyflux_[face];
|
||||
} else {
|
||||
flux = -darcyflux_[face];
|
||||
}
|
||||
if (flux < 0.0) {
|
||||
upstream_flux += flux;
|
||||
} else {
|
||||
downstream_flux += flux;
|
||||
}
|
||||
}
|
||||
// In the presence of sources, significant fluxes may be missing from the computed fluxes,
|
||||
// setting the total flux to the (positive) maximum avoids this: since source is either
|
||||
// inflow or outflow, not both, either upstream_flux or downstream_flux must be correct.
|
||||
const double total_flux = std::max(-upstream_flux, downstream_flux);
|
||||
|
||||
// Find minimum tof on upstream faces and for this cell.
|
||||
const int dim = grid_.dimensions;
|
||||
// Find minimum tof on upstream faces/cells and for this cell.
|
||||
const int num_basis = basis_func_->numBasisFunc();
|
||||
double min_upstream_tof = 1e100;
|
||||
double min_here_tof = 1e100;
|
||||
int num_upstream_faces = 0;
|
||||
const double total_flux = totalFlux(cell);
|
||||
for (int hface = grid_.cell_facepos[cell]; hface < grid_.cell_facepos[cell+1]; ++hface) {
|
||||
const int face = grid_.cell_faces[hface];
|
||||
double flux = 0.0;
|
||||
@ -478,30 +462,22 @@ namespace Opm
|
||||
upstream_cell = grid_.face_cells[2*face];
|
||||
}
|
||||
const bool upstream = (flux < -total_flux*limiter_relative_flux_threshold_);
|
||||
const bool interior = (upstream_cell >= 0);
|
||||
|
||||
// Find minimum tof in this cell and upstream.
|
||||
// The meaning of minimum upstream tof depends on method.
|
||||
min_here_tof = std::min(min_here_tof, minCornerVal(cell, face));
|
||||
if (upstream) {
|
||||
++num_upstream_faces;
|
||||
}
|
||||
bool interior = (upstream_cell >= 0);
|
||||
|
||||
// Evaluate the solution in all corners.
|
||||
for (int fnode = grid_.face_nodepos[face]; fnode < grid_.face_nodepos[face+1]; ++fnode) {
|
||||
const double* nc = grid_.node_coordinates + dim*grid_.face_nodes[fnode];
|
||||
basis_func_->eval(cell, nc, &basis_[0]);
|
||||
const double tof_here = std::inner_product(basis_.begin(), basis_.end(),
|
||||
tof_coeff_ + num_basis*cell, 0.0);
|
||||
min_here_tof = std::min(min_here_tof, tof_here);
|
||||
if (upstream) {
|
||||
if (interior) {
|
||||
basis_func_->eval(upstream_cell, nc, &basis_nb_[0]);
|
||||
const double tof_upstream
|
||||
= std::inner_product(basis_nb_.begin(), basis_nb_.end(),
|
||||
tof_coeff_ + num_basis*upstream_cell, 0.0);
|
||||
min_upstream_tof = std::min(min_upstream_tof, tof_upstream);
|
||||
double upstream_tof = 0.0;
|
||||
if (interior) {
|
||||
if (face_min) {
|
||||
upstream_tof = minCornerVal(upstream_cell, face);
|
||||
} else {
|
||||
// Allow tof down to 0 on inflow boundaries.
|
||||
min_upstream_tof = std::min(min_upstream_tof, 0.0);
|
||||
upstream_tof = basis_func_->functionAverage(tof_coeff_ + num_basis*upstream_cell);
|
||||
}
|
||||
}
|
||||
min_upstream_tof = std::min(min_upstream_tof, upstream_tof);
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,7 +489,7 @@ namespace Opm
|
||||
if (min_upstream_tof < 0.0) {
|
||||
min_upstream_tof = 0.0;
|
||||
}
|
||||
const double tof_c = tof_coeff_[num_basis*cell];
|
||||
const double tof_c = basis_func_->functionAverage(tof_coeff_ + num_basis*cell);
|
||||
double limiter = (tof_c - min_upstream_tof)/(tof_c - min_here_tof);
|
||||
if (tof_c < min_upstream_tof) {
|
||||
// Handle by setting a flat solution.
|
||||
@ -535,110 +511,6 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTofDiscGal::applyMinUpwindAverageLimiter(const int cell, double* tof)
|
||||
{
|
||||
if (basis_func_->degree() != 1) {
|
||||
THROW("This limiter only makes sense for our DG1 implementation.");
|
||||
}
|
||||
|
||||
// Limiter principles:
|
||||
// 1. Let M be the average TOF value of the upstream cells.
|
||||
/// Then the value at all points in this cell shall be at least M.
|
||||
// Upstream faces whose flux does not exceed the relative
|
||||
// flux threshold are not considered for this minimum.
|
||||
// 2. The TOF shall not be below zero in any point.
|
||||
|
||||
// Find total upstream/downstream fluxes.
|
||||
double upstream_flux = 0.0;
|
||||
double downstream_flux = 0.0;
|
||||
for (int hface = grid_.cell_facepos[cell]; hface < grid_.cell_facepos[cell+1]; ++hface) {
|
||||
const int face = grid_.cell_faces[hface];
|
||||
double flux = 0.0;
|
||||
if (cell == grid_.face_cells[2*face]) {
|
||||
flux = darcyflux_[face];
|
||||
} else {
|
||||
flux = -darcyflux_[face];
|
||||
}
|
||||
if (flux < 0.0) {
|
||||
upstream_flux += flux;
|
||||
} else {
|
||||
downstream_flux += flux;
|
||||
}
|
||||
}
|
||||
// In the presence of sources, significant fluxes may be missing from the computed fluxes,
|
||||
// setting the total flux to the (positive) maximum avoids this: since source is either
|
||||
// inflow or outflow, not both, either upstream_flux or downstream_flux must be correct.
|
||||
const double total_flux = std::max(-upstream_flux, downstream_flux);
|
||||
|
||||
// Find minimum tof on upstream faces and for this cell.
|
||||
const int dim = grid_.dimensions;
|
||||
const int num_basis = basis_func_->numBasisFunc();
|
||||
double min_upstream_tof = 1e100;
|
||||
double min_here_tof = 1e100;
|
||||
int num_upstream_faces = 0;
|
||||
for (int hface = grid_.cell_facepos[cell]; hface < grid_.cell_facepos[cell+1]; ++hface) {
|
||||
const int face = grid_.cell_faces[hface];
|
||||
double flux = 0.0;
|
||||
int upstream_cell = -1;
|
||||
if (cell == grid_.face_cells[2*face]) {
|
||||
flux = darcyflux_[face];
|
||||
upstream_cell = grid_.face_cells[2*face+1];
|
||||
} else {
|
||||
flux = -darcyflux_[face];
|
||||
upstream_cell = grid_.face_cells[2*face];
|
||||
}
|
||||
const bool upstream = (flux < -total_flux*limiter_relative_flux_threshold_);
|
||||
if (upstream) {
|
||||
++num_upstream_faces;
|
||||
}
|
||||
bool interior = (upstream_cell >= 0);
|
||||
|
||||
// Evaluate the solution in all corners.
|
||||
for (int fnode = grid_.face_nodepos[face]; fnode < grid_.face_nodepos[face+1]; ++fnode) {
|
||||
const double* nc = grid_.node_coordinates + dim*grid_.face_nodes[fnode];
|
||||
basis_func_->eval(cell, nc, &basis_[0]);
|
||||
const double tof_here = std::inner_product(basis_.begin(), basis_.end(),
|
||||
tof_coeff_ + num_basis*cell, 0.0);
|
||||
min_here_tof = std::min(min_here_tof, tof_here);
|
||||
if (upstream) {
|
||||
if (interior) {
|
||||
min_upstream_tof = std::min(min_upstream_tof, tof_coeff_[num_basis*upstream_cell]);
|
||||
} else {
|
||||
// Allow tof down to 0 on inflow boundaries.
|
||||
min_upstream_tof = std::min(min_upstream_tof, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compute slope multiplier (limiter).
|
||||
if (num_upstream_faces == 0) {
|
||||
min_upstream_tof = 0.0;
|
||||
min_here_tof = 0.0;
|
||||
}
|
||||
if (min_upstream_tof < 0.0) {
|
||||
min_upstream_tof = 0.0;
|
||||
}
|
||||
const double tof_c = tof_coeff_[num_basis*cell];
|
||||
double limiter = (tof_c - min_upstream_tof)/(tof_c - min_here_tof);
|
||||
if (tof_c < min_upstream_tof) {
|
||||
// Handle by setting a flat solution.
|
||||
std::cout << "Trouble in cell " << cell << std::endl;
|
||||
limiter = 0.0;
|
||||
basis_func_->addConstant(min_upstream_tof - tof_c, tof + num_basis*cell);
|
||||
}
|
||||
ASSERT(limiter >= 0.0);
|
||||
|
||||
// Actually do the limiting (if applicable).
|
||||
if (limiter < 1.0) {
|
||||
// std::cout << "Applying limiter in cell " << cell << ", limiter = " << limiter << std::endl;
|
||||
basis_func_->multiplyGradient(limiter, tof + num_basis*cell);
|
||||
} else {
|
||||
// std::cout << "Not applying limiter in cell " << cell << "!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTofDiscGal::applyLimiterAsPostProcess()
|
||||
@ -675,4 +547,51 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
double TransportModelTracerTofDiscGal::totalFlux(const int cell) const
|
||||
{
|
||||
// Find total upstream/downstream fluxes.
|
||||
double upstream_flux = 0.0;
|
||||
double downstream_flux = 0.0;
|
||||
for (int hface = grid_.cell_facepos[cell]; hface < grid_.cell_facepos[cell+1]; ++hface) {
|
||||
const int face = grid_.cell_faces[hface];
|
||||
double flux = 0.0;
|
||||
if (cell == grid_.face_cells[2*face]) {
|
||||
flux = darcyflux_[face];
|
||||
} else {
|
||||
flux = -darcyflux_[face];
|
||||
}
|
||||
if (flux < 0.0) {
|
||||
upstream_flux += flux;
|
||||
} else {
|
||||
downstream_flux += flux;
|
||||
}
|
||||
}
|
||||
// In the presence of sources, significant fluxes may be missing from the computed fluxes,
|
||||
// setting the total flux to the (positive) maximum avoids this: since source is either
|
||||
// inflow or outflow, not both, either upstream_flux or downstream_flux must be correct.
|
||||
return std::max(-upstream_flux, downstream_flux);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
double TransportModelTracerTofDiscGal::minCornerVal(const int cell, const int face) const
|
||||
{
|
||||
// Evaluate the solution in all corners.
|
||||
const int dim = grid_.dimensions;
|
||||
const int num_basis = basis_func_->numBasisFunc();
|
||||
double min_cornerval = 1e100;
|
||||
for (int fnode = grid_.face_nodepos[face]; fnode < grid_.face_nodepos[face+1]; ++fnode) {
|
||||
const double* nc = grid_.node_coordinates + dim*grid_.face_nodes[fnode];
|
||||
basis_func_->eval(cell, nc, &basis_[0]);
|
||||
const double tof_corner = std::inner_product(basis_.begin(), basis_.end(),
|
||||
tof_coeff_ + num_basis*cell, 0.0);
|
||||
min_cornerval = std::min(min_cornerval, tof_corner);
|
||||
}
|
||||
return min_cornerval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -119,8 +119,8 @@ namespace Opm
|
||||
std::vector<double> orig_jac_; // single-cell jacobian (copy)
|
||||
// Below: storage for quantities needed by solveSingleCell().
|
||||
std::vector<double> coord_;
|
||||
std::vector<double> basis_;
|
||||
std::vector<double> basis_nb_;
|
||||
mutable std::vector<double> basis_;
|
||||
mutable std::vector<double> basis_nb_;
|
||||
std::vector<double> grad_basis_;
|
||||
std::vector<double> velocity_;
|
||||
|
||||
@ -130,10 +130,11 @@ namespace Opm
|
||||
// (will read data from tof_coeff_, it is ok to call
|
||||
// with tof_coeff as tof argument.
|
||||
void applyLimiter(const int cell, double* tof);
|
||||
void applyMinUpwindFaceLimiter(const int cell, double* tof);
|
||||
void applyMinUpwindAverageLimiter(const int cell, double* tof);
|
||||
void applyMinUpwindLimiter(const int cell, const bool face_min, double* tof);
|
||||
void applyLimiterAsPostProcess();
|
||||
void applyLimiterAsSimultaneousPostProcess();
|
||||
double totalFlux(const int cell) const;
|
||||
double minCornerVal(const int cell, const int face) const;
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#include "tarjan.h"
|
||||
@ -30,7 +30,13 @@ SOFTWARE.
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
clear_vector(size_t n, int *v)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) { v[i] = 0; }
|
||||
}
|
||||
|
||||
static int min(int a, int b){ return a < b? a : b;}
|
||||
|
||||
@ -73,19 +79,21 @@ tarjan (int nv, const int *ia, const int *ja, int *vert, int *comp,
|
||||
int *stack = comp + nv;
|
||||
int *bottom = stack;
|
||||
int *cstack = vert + nv-1;
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
int *cbottom = cstack;
|
||||
#endif
|
||||
|
||||
int t = 0;
|
||||
int pos = 0;
|
||||
|
||||
int *time = work;
|
||||
int *link = (int *) time + nv;
|
||||
int *status = (int *) link + nv; /* dual usage... */
|
||||
int *link = time + nv;
|
||||
int *status = link + nv; /* dual usage... */
|
||||
|
||||
(void) cbottom;
|
||||
|
||||
memset(work, 0, 3*nv * sizeof *work);
|
||||
memset(vert, 0, nv * sizeof *vert );
|
||||
memset(comp, 0, (nv+1) * sizeof *comp );
|
||||
clear_vector(3 * ((size_t) nv), work);
|
||||
clear_vector(1 * ((size_t) nv), vert);
|
||||
clear_vector(1 + ((size_t) nv), comp);
|
||||
|
||||
/* Init status all vertices */
|
||||
for (i=0; i<nv; ++i)
|
||||
@ -188,7 +196,7 @@ tarjan (int nv, const int *ia, const int *ja, int *vert, int *comp,
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(status[child] = DONE);
|
||||
assert(status[child] == DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,24 +17,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_AVERAGE_HEADER
|
||||
#define OPENRS_AVERAGE_HEADER
|
||||
#ifndef OPM_AVERAGE_HEADER
|
||||
#define OPM_AVERAGE_HEADER
|
||||
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
@ -95,4 +95,4 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
#endif // OPENRS_AVERAGE_HEADER
|
||||
#endif // OPM_AVERAGE_HEADER
|
||||
|
@ -13,27 +13,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_ERRORMACROS_HEADER
|
||||
#define OPENRS_ERRORMACROS_HEADER
|
||||
#ifndef OPM_ERRORMACROS_HEADER
|
||||
#define OPM_ERRORMACROS_HEADER
|
||||
|
||||
|
||||
/// Error macros. In order to use some of them, you must also
|
||||
@ -104,4 +104,4 @@ along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endif
|
||||
|
||||
|
||||
#endif // OPENRS_ERRORMACROS_HEADER
|
||||
#endif // OPM_ERRORMACROS_HEADER
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_FACTORY_HEADER
|
||||
#define OPENRS_FACTORY_HEADER
|
||||
#ifndef OPM_FACTORY_HEADER
|
||||
#define OPM_FACTORY_HEADER
|
||||
|
||||
#include <map>
|
||||
#include <tr1/memory>
|
||||
@ -169,4 +169,4 @@ namespace Opm
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_FACTORY_HEADER
|
||||
#endif // OPM_FACTORY_HEADER
|
||||
|
@ -17,24 +17,24 @@
|
||||
Copyright 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_ROOTFINDERS_HEADER
|
||||
#define OPENRS_ROOTFINDERS_HEADER
|
||||
#ifndef OPM_ROOTFINDERS_HEADER
|
||||
#define OPM_ROOTFINDERS_HEADER
|
||||
|
||||
|
||||
|
||||
@ -335,4 +335,4 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
#endif // OPENRS_ROOTFINDERS_HEADER
|
||||
#endif // OPM_ROOTFINDERS_HEADER
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_SPARSETABLE_HEADER
|
||||
#define OPENRS_SPARSETABLE_HEADER
|
||||
#ifndef OPM_SPARSETABLE_HEADER
|
||||
#define OPM_SPARSETABLE_HEADER
|
||||
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
@ -239,4 +239,4 @@ namespace Opm
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
#endif // OPENRS_SPARSETABLE_HEADER
|
||||
#endif // OPM_SPARSETABLE_HEADER
|
||||
|
@ -17,25 +17,25 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OPENRS_SPARSEVECTOR_HEADER
|
||||
#define OPENRS_SPARSEVECTOR_HEADER
|
||||
#ifndef OPM_SPARSEVECTOR_HEADER
|
||||
#define OPM_SPARSEVECTOR_HEADER
|
||||
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
@ -192,4 +192,4 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
#endif // OPENRS_SPARSEVECTOR_HEADER
|
||||
#endif // OPM_SPARSEVECTOR_HEADER
|
||||
|
@ -16,20 +16,20 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_STOPWATCH_HEADER
|
||||
#define OPENRS_STOPWATCH_HEADER
|
||||
#ifndef OPM_STOPWATCH_HEADER
|
||||
#define OPM_STOPWATCH_HEADER
|
||||
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
@ -78,4 +78,4 @@ namespace Opm
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_STOPWATCH_HEADER
|
||||
#endif // OPM_STOPWATCH_HEADER
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010, 2011, 2012 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010, 2011, 2012 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_UNITS_HEADER
|
||||
#define OPENRS_UNITS_HEADER
|
||||
#ifndef OPM_UNITS_HEADER
|
||||
#define OPM_UNITS_HEADER
|
||||
|
||||
/**
|
||||
* \file
|
||||
@ -229,4 +229,4 @@ namespace Opm
|
||||
const double WELL_INDEX_UNIT = VISCOSITY_UNIT/(DAYS2SECONDS*1e5);
|
||||
} // namespace units
|
||||
} // namespace Opm
|
||||
#endif // OPENRS_UNITS_HEADER
|
||||
#endif // OPM_UNITS_HEADER
|
||||
|
@ -18,24 +18,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_LININT_HEADER
|
||||
#define OPENRS_LININT_HEADER
|
||||
#ifndef OPM_LININT_HEADER
|
||||
#define OPM_LININT_HEADER
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
@ -114,4 +114,4 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
#endif // OPENRS_LININT_HEADER
|
||||
#endif // OPM_LININT_HEADER
|
||||
|
@ -16,24 +16,24 @@
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS is free software: you can redistribute it and/or modify
|
||||
OPM 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.
|
||||
|
||||
OpenRS is distributed in the hope that it will be useful,
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_LINEARINTERPOLATION_HEADER
|
||||
#define OPENRS_LINEARINTERPOLATION_HEADER
|
||||
#ifndef OPM_LINEARINTERPOLATION_HEADER
|
||||
#define OPM_LINEARINTERPOLATION_HEADER
|
||||
|
||||
|
||||
#include <vector>
|
||||
@ -124,4 +124,4 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
#endif // OPENRS_LINEARINTERPOLATION_HEADER
|
||||
#endif // OPM_LINEARINTERPOLATION_HEADER
|
||||
|
@ -14,23 +14,23 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETER_HEADER
|
||||
#define OPENRS_PARAMETER_HEADER
|
||||
#ifndef OPM_PARAMETER_HEADER
|
||||
#define OPM_PARAMETER_HEADER
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
@ -211,4 +211,4 @@ namespace Opm {
|
||||
};
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
#endif // OPENRS_PARAMETER_HPP
|
||||
#endif // OPM_PARAMETER_HPP
|
||||
|
@ -14,23 +14,23 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERGROUP_HEADER
|
||||
#define OPENRS_PARAMETERGROUP_HEADER
|
||||
#ifndef OPM_PARAMETERGROUP_HEADER
|
||||
#define OPM_PARAMETERGROUP_HEADER
|
||||
|
||||
#include <exception>
|
||||
#include <map>
|
||||
@ -289,4 +289,4 @@ namespace Opm {
|
||||
|
||||
#include <opm/core/utility/parameters/ParameterGroup_impl.hpp>
|
||||
|
||||
#endif // OPENRS_PARAMETERGROUP_HEADER
|
||||
#endif // OPM_PARAMETERGROUP_HEADER
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERGROUP_IMPL_HEADER
|
||||
#define OPENRS_PARAMETERGROUP_IMPL_HEADER
|
||||
#ifndef OPM_PARAMETERGROUP_IMPL_HEADER
|
||||
#define OPM_PARAMETERGROUP_IMPL_HEADER
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -325,4 +325,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERGROUP_IMPL_HEADER
|
||||
#endif // OPM_PARAMETERGROUP_IMPL_HEADER
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERMAPITEM_HEADER
|
||||
#define OPENRS_PARAMETERMAPITEM_HEADER
|
||||
#ifndef OPM_PARAMETERMAPITEM_HEADER
|
||||
#define OPM_PARAMETERMAPITEM_HEADER
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -70,4 +70,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERMAPITEM_HEADER
|
||||
#endif // OPM_PARAMETERMAPITEM_HEADER
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERREQUIREMENT_HEADER
|
||||
#define OPENRS_PARAMETERREQUIREMENT_HEADER
|
||||
#ifndef OPM_PARAMETERREQUIREMENT_HEADER
|
||||
#define OPM_PARAMETERREQUIREMENT_HEADER
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@ -240,4 +240,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERREQUIREMENT_HEADER
|
||||
#endif // OPM_PARAMETERREQUIREMENT_HEADER
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERSTRINGS_HEADER
|
||||
#define OPENRS_PARAMETERSTRINGS_HEADER
|
||||
#ifndef OPM_PARAMETERSTRINGS_HEADER
|
||||
#define OPM_PARAMETERSTRINGS_HEADER
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -68,4 +68,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERSTRINGS_HEADER
|
||||
#endif // OPM_PARAMETERSTRINGS_HEADER
|
||||
|
@ -14,23 +14,23 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERTOOLS_HEADER
|
||||
#define OPENRS_PARAMETERTOOLS_HEADER
|
||||
#ifndef OPM_PARAMETERTOOLS_HEADER
|
||||
#define OPM_PARAMETERTOOLS_HEADER
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -45,4 +45,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERTOOLS_HEADER
|
||||
#endif // OPM_PARAMETERTOOLS_HEADER
|
||||
|
@ -14,23 +14,23 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
|
@ -14,27 +14,27 @@
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2009, 2010 Statoil ASA.
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPENRS_PARAMETERXML_HEADER
|
||||
#define OPENRS_PARAMETERXML_HEADER
|
||||
#ifndef OPM_PARAMETERXML_HEADER
|
||||
#define OPM_PARAMETERXML_HEADER
|
||||
|
||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||
|
||||
@ -51,4 +51,4 @@ namespace Opm {
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPENRS_PARAMETERXML_HEADER
|
||||
#endif // OPM_PARAMETERXML_HEADER
|
||||
|
@ -31,9 +31,9 @@
|
||||
|
||||
#ifdef HAVE_ERT // This one goes almost to the bottom of the file
|
||||
|
||||
#include <ecl_grid.h>
|
||||
#include <ecl_util.h>
|
||||
#include <ecl_rst_file.h>
|
||||
#include <ert/ecl/ecl_grid.h>
|
||||
#include <ert/ecl/ecl_util.h>
|
||||
#include <ert/ecl/ecl_rst_file.h>
|
||||
|
||||
|
||||
namespace Opm
|
||||
|
@ -1,22 +1,21 @@
|
||||
/*
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/wells/WellCollection.hpp>
|
||||
|
||||
|
@ -1,22 +1,22 @@
|
||||
/*
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
This file is part of The Open Reservoir Simulator Project (OpenRS).
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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.
|
||||
OPM 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.
|
||||
|
||||
OpenRS 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 OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef OPM_WELLCOLLECTION_HPP
|
||||
|
@ -19,6 +19,7 @@ sparsetable_test \
|
||||
sparsevector_test \
|
||||
test_cartgrid \
|
||||
test_column_extract \
|
||||
test_dgbasis \
|
||||
test_lapack \
|
||||
test_quadratures \
|
||||
test_read_grid \
|
||||
@ -54,6 +55,9 @@ test_cartgrid_SOURCES = test_cartgrid.cpp
|
||||
test_column_extract_SOURCES = test_column_extract.cpp
|
||||
test_column_extract_LDADD = $(LDADD) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
|
||||
|
||||
test_dgbasis_SOURCES = test_dgbasis.cpp
|
||||
test_dgbasis_LDADD = $(LDADD) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
|
||||
|
||||
test_lapack_SOURCES = test_lapack.cpp
|
||||
test_lapack_LDADD = $(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS)
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include <opm/core/GridManager.hpp>
|
||||
#include <opm/core/eclipse/EclipseGridParser.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SingleColumnTest)
|
||||
{
|
||||
using namespace Opm;
|
||||
@ -29,7 +31,6 @@ BOOST_AUTO_TEST_CASE(SingleColumnTest)
|
||||
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(correct_answer.begin(), correct_answer.end(),
|
||||
columns[0].begin(), columns[0].end());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +55,6 @@ BOOST_AUTO_TEST_CASE(FourByFourColumnTest)
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(correct_answer[i].begin(), correct_answer[i].end(),
|
||||
columns[i].begin(), columns[i].end());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -101,47 +101,58 @@ BOOST_AUTO_TEST_CASE(DisjointColumn)
|
||||
"13*1 \n"
|
||||
"/ \n"
|
||||
"\n";
|
||||
using namespace Opm;
|
||||
std::istringstream is(grdecl);
|
||||
EclipseGridParser deck;
|
||||
deck.read(is);
|
||||
GridManager manager(deck);
|
||||
|
||||
std::vector<std::vector<int> > columns;
|
||||
extractColumn(*manager.c_grid(), columns);
|
||||
// for (size_t i = 0; i < columns.size(); ++i) {
|
||||
// for (size_t j = 0; j < columns[i].size(); ++j) {
|
||||
// std::cout << columns[i][j] << ' ';
|
||||
// }
|
||||
// std::cout << '\n';
|
||||
// }
|
||||
// std::cout << std::endl;
|
||||
typedef std::vector< std::vector<int> > VVI;
|
||||
|
||||
const int correct[10][3] = { { 0, 1, 2 },
|
||||
{ 3, 4, 5 },
|
||||
{ 6, 7, 8 },
|
||||
{ 9, 10, 11 },
|
||||
{ 13, -1, -1 },
|
||||
{ 14, 15, 16 },
|
||||
{ 17, 18, 19 },
|
||||
{ 20, 21, 22 },
|
||||
{ 23, 24, 25 },
|
||||
{ 12, -1, -1 } };
|
||||
std::vector<std::vector<int> > correct_answer;
|
||||
correct_answer.resize(10);
|
||||
for(int i = 0; i < 10; i++) {
|
||||
for(int j = 0; j < 3; j++) {
|
||||
const int correct[][3] = { { 0, 9, 17 } , // 0
|
||||
{ 1, 10, 18 } , // 1
|
||||
{ 2, 11, 19 } , // 2
|
||||
{ 3, 12, 20 } , // 3
|
||||
{ 21, - 1, - 1 } , // 4
|
||||
{ 5, 13, 22 } , // 5
|
||||
{ 6, 14, 23 } , // 6
|
||||
{ 7, 15, 24 } , // 7
|
||||
{ 8, 16, 25 } , // 8
|
||||
{ 4, - 1, - 1 } }; // 9
|
||||
|
||||
const std::size_t ncol = (sizeof correct) / (sizeof correct[0]);
|
||||
|
||||
VVI correct_answer(ncol);
|
||||
|
||||
for (std::size_t i = 0; i < ncol; ++i) {
|
||||
for (std::size_t j = 0; j < 3; ++j) {
|
||||
correct_answer[i].push_back(correct[i][j]);
|
||||
}
|
||||
}
|
||||
correct_answer[4].resize(1);
|
||||
correct_answer[9].resize(1);
|
||||
|
||||
BOOST_CHECK_EQUAL(columns.size(), 10);
|
||||
std::istringstream is(grdecl);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(correct_answer[i].begin(), correct_answer[i].end(),
|
||||
columns[i].begin(), columns[i].end());
|
||||
Opm::EclipseGridParser deck;
|
||||
deck.read(is);
|
||||
Opm::GridManager manager(deck);
|
||||
|
||||
VVI columns;
|
||||
Opm::extractColumn(*manager.c_grid(), columns);
|
||||
|
||||
#if 0
|
||||
for (size_t i = 0; i < columns.size(); ++i) {
|
||||
for (size_t j = 0; j < columns[i].size(); ++j) {
|
||||
std::cout << columns[i][j] << ' ';
|
||||
}
|
||||
std::cout << '\n';
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_EQUAL(columns.size(), correct_answer.size());
|
||||
|
||||
for (VVI::iterator
|
||||
xb = correct_answer.begin(), xe = correct_answer.end(),
|
||||
cb = columns .begin(), ce = columns .end();
|
||||
xb != xe; ++xb, ++cb) {
|
||||
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS((*xb).begin(), (*xb).end(),
|
||||
(*cb).begin(), (*cb).end());
|
||||
}
|
||||
}
|
||||
|
160
tests/test_dgbasis.cpp
Normal file
160
tests/test_dgbasis.cpp
Normal file
@ -0,0 +1,160 @@
|
||||
/*
|
||||
Copyright 2013 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM 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.
|
||||
|
||||
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_DYNAMIC_BOOST_TEST
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#endif
|
||||
#define NVERBOSE // to suppress our messages when throwing
|
||||
|
||||
#define BOOST_TEST_MODULE DGBasisTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <opm/core/transport/reorder/DGBasis.hpp>
|
||||
#include <opm/core/GridManager.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <cmath>
|
||||
|
||||
using namespace Opm;
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
||||
bool aequal(double a, double b)
|
||||
{
|
||||
const double eps = 1e-15;
|
||||
return std::fabs(a - b) < eps;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
namespace cart2d
|
||||
{
|
||||
|
||||
static void test()
|
||||
{
|
||||
// Set up 2d 1-cell cartesian case.
|
||||
GridManager g(1, 1);
|
||||
const UnstructuredGrid& grid = *g.c_grid();
|
||||
|
||||
// Test DGBasisBoundedTotalDegree, degree 0.
|
||||
{
|
||||
DGBasisBoundedTotalDegree b(grid, 0);
|
||||
BOOST_CHECK_EQUAL(b.numBasisFunc(), 1);
|
||||
std::vector<double> bx(b.numBasisFunc(), 0.0);
|
||||
b.eval(0, grid.cell_centroids, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
double x[2] = { 0.123, 0.456 };
|
||||
b.eval(0, x, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
std::vector<double> c(b.numBasisFunc(), 0.0);
|
||||
b.addConstant(0.789, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 0.789));
|
||||
b.multiplyGradient(1.234, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 0.789));
|
||||
}
|
||||
// Test DGBasisBoundedTotalDegree, degree 1.
|
||||
{
|
||||
DGBasisBoundedTotalDegree b(grid, 1);
|
||||
BOOST_CHECK_EQUAL(b.numBasisFunc(), 3);
|
||||
std::vector<double> bx(b.numBasisFunc(), 0.0);
|
||||
b.eval(0, grid.cell_centroids, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
BOOST_CHECK(aequal(bx[1], 0.0));
|
||||
BOOST_CHECK(aequal(bx[2], 0.0));
|
||||
double x[2] = { 0.123, 0.456 };
|
||||
b.eval(0, x, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
BOOST_CHECK(aequal(bx[1], 0.123 - 0.5));
|
||||
BOOST_CHECK(aequal(bx[2], 0.456 - 0.5));
|
||||
std::vector<double> c(b.numBasisFunc(), 0.0);
|
||||
c[0] = 1.0; c[1] = 2.0; c[2] = 3.0;
|
||||
b.addConstant(0.789, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 1.789));
|
||||
BOOST_CHECK(aequal(c[1], 2.0));
|
||||
BOOST_CHECK(aequal(c[2], 3.0));
|
||||
const double fx = c[0]*bx[0] + c[1]*bx[1] + c[2]*bx[2];
|
||||
b.multiplyGradient(1.234, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 1.789));
|
||||
BOOST_CHECK(aequal(c[1], 2.0*1.234));
|
||||
BOOST_CHECK(aequal(c[2], 3.0*1.234));
|
||||
const double fx2 = c[0]*bx[0] + c[1]*bx[1] + c[2]*bx[2];
|
||||
BOOST_CHECK(aequal(fx2 - c[0], 1.234*(fx - c[0])));
|
||||
}
|
||||
// Test DGBasisMultilin, degree 0.
|
||||
{
|
||||
DGBasisMultilin b(grid, 0);
|
||||
BOOST_CHECK_EQUAL(b.numBasisFunc(), 1);
|
||||
std::vector<double> bx(b.numBasisFunc(), 0.0);
|
||||
b.eval(0, grid.cell_centroids, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
double x[2] = { 0.123, 0.456 };
|
||||
b.eval(0, x, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 1.0));
|
||||
std::vector<double> c(b.numBasisFunc(), 0.0);
|
||||
b.addConstant(0.789, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 0.789));
|
||||
b.multiplyGradient(1.234, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], 0.789));
|
||||
}
|
||||
// Test DGBasisMultilin, degree 1.
|
||||
{
|
||||
DGBasisMultilin b(grid, 1);
|
||||
BOOST_CHECK_EQUAL(b.numBasisFunc(), 4);
|
||||
std::vector<double> bx(b.numBasisFunc(), 0.0);
|
||||
b.eval(0, grid.cell_centroids, &bx[0]);
|
||||
BOOST_CHECK(aequal(bx[0], 0.25));
|
||||
BOOST_CHECK(aequal(bx[1], 0.25));
|
||||
BOOST_CHECK(aequal(bx[2], 0.25));
|
||||
BOOST_CHECK(aequal(bx[3], 0.25));
|
||||
double x[2] = { 0.123, 0.456 };
|
||||
b.eval(0, x, &bx[0]);
|
||||
const double xm[2] = { 1.0 - x[0], x[0] };
|
||||
const double ym[2] = { 1.0 - x[1], x[1] };
|
||||
BOOST_CHECK(aequal(bx[0], xm[0]*ym[0]));
|
||||
BOOST_CHECK(aequal(bx[1], xm[0]*ym[1]));
|
||||
BOOST_CHECK(aequal(bx[2], xm[1]*ym[0]));
|
||||
BOOST_CHECK(aequal(bx[3], xm[1]*ym[1]));
|
||||
std::vector<double> c(b.numBasisFunc(), 0.0);
|
||||
c[0] = -1.567; c[1] = 1.42; c[2] = 0.59; c[3] = 3.225;
|
||||
std::vector<double> corig = c;
|
||||
b.addConstant(0.789, &c[0]);
|
||||
BOOST_CHECK(aequal(c[0], corig[0] + 0.25*0.789));
|
||||
BOOST_CHECK(aequal(c[1], corig[1] + 0.25*0.789));
|
||||
BOOST_CHECK(aequal(c[2], corig[2] + 0.25*0.789));
|
||||
BOOST_CHECK(aequal(c[3], corig[3] + 0.25*0.789));
|
||||
const double fx = c[0]*bx[0] + c[1]*bx[1] + c[2]*bx[2] + c[3]*bx[3];
|
||||
const double fc = 0.25*(c[0] + c[1] + c[2] + c[3]);
|
||||
b.multiplyGradient(1.234, &c[0]);
|
||||
const double fx2 = c[0]*bx[0] + c[1]*bx[1] + c[2]*bx[2] + c[3]*bx[3];
|
||||
BOOST_CHECK(aequal(fx2 - fc, 1.234*(fx - fc)));
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace cart2d
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_dgbasis)
|
||||
{
|
||||
cart2d::test();
|
||||
}
|
@ -29,7 +29,7 @@
|
||||
#include <opm/core/fluid/IncompPropertiesFromDeck.hpp>
|
||||
|
||||
|
||||
#include <ecl_grid.h>
|
||||
#include <ert/ecl/ecl_grid.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
195
tests/test_geom2d.cpp
Normal file
195
tests/test_geom2d.cpp
Normal file
@ -0,0 +1,195 @@
|
||||
/* Copyright 2013 Uni Research AS
|
||||
* This file is licensed under GPL3, see http://www.opm-project.org/
|
||||
*/
|
||||
#include <config.h>
|
||||
|
||||
/* --- Boost.Test boilerplate --- */
|
||||
#if HAVE_DYNAMIC_BOOST_TEST
|
||||
#define BOOST_TEST_DYN_LINK
|
||||
#endif
|
||||
|
||||
#define NVERBOSE // Suppress own messages when throw()ing
|
||||
|
||||
#define BOOST_TEST_MODULE CompGeo2DTest
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/floating_point_comparison.hpp>
|
||||
|
||||
/* --- our own headers --- */
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/grid/cornerpoint_grid.h> /* compute_geometry */
|
||||
|
||||
using namespace std;
|
||||
|
||||
/* Test properties on a grid that looks like this:
|
||||
*
|
||||
* /------
|
||||
* / | |
|
||||
* < | |
|
||||
* \ | |
|
||||
* \------
|
||||
*
|
||||
*/
|
||||
struct BackspaceGrid {
|
||||
UnstructuredGrid* g;
|
||||
|
||||
BackspaceGrid()
|
||||
{
|
||||
g = allocate_grid(
|
||||
2, /* ndims */
|
||||
2, /* number of cells */
|
||||
6, /* number of edges */
|
||||
6*2, /* six edges with two nodes each */
|
||||
3+4, /* one triangle and one quadrilateral */
|
||||
5); /* five nodes total */
|
||||
/* nodes */
|
||||
double nodes[] = {
|
||||
-1., 0., /* node 0 */
|
||||
0., 1., /* node 1 */
|
||||
1., 1., /* node 2 */
|
||||
1., -1., /* node 3 */
|
||||
0., -1., /* node 4 */
|
||||
};
|
||||
copy(nodes, nodes+sizeof(nodes)/sizeof(nodes[0]), g->node_coordinates);
|
||||
/* edges */
|
||||
int edges[] = {
|
||||
0, 1, /* edge 0 */
|
||||
1, 2, /* edge 1 */
|
||||
2, 3, /* edge 2 */
|
||||
3, 4, /* edge 3 */
|
||||
4, 0, /* edge 4 */
|
||||
4, 1, /* edge 5 */
|
||||
};
|
||||
copy(edges, edges+sizeof(edges)/sizeof(edges[0]), g->face_nodes);
|
||||
/* starting index in map for each edge */
|
||||
int edge_pos[] = {
|
||||
0, 2, 4, 6, 8, 10, 12,
|
||||
};
|
||||
copy(edge_pos, edge_pos+sizeof(edge_pos)/sizeof(edge_pos[0]), g->face_nodepos);
|
||||
/* topology, clock-wise ordering */
|
||||
int neighbours[] = {
|
||||
-1, 0, /* edge 0, between boundary and cell 0 */
|
||||
-1, 1, /* edge 1, between boundary and cell 1 */
|
||||
-1, 1, /* edge 2, between boundary and cell 1 */
|
||||
-1, 1, /* edge 3, between boundary and cell 1 */
|
||||
-1, 0, /* edge 4, between boundary and cell 0 */
|
||||
0, 1, /* edge 5, between cell 0 and cell 1 */
|
||||
};
|
||||
copy(neighbours, neighbours+sizeof(neighbours)/sizeof(neighbours[0]), g->face_cells);
|
||||
/* cells */
|
||||
int cells[] = {
|
||||
0, 5, 4, /* cell 0, clockwise */
|
||||
1, 2, 3, 5, /* cell 1, clockwise */
|
||||
};
|
||||
copy(cells, cells+sizeof(cells)/sizeof(cells[0]), g->cell_faces);
|
||||
/* starting index in map for each cell */
|
||||
int cell_pos[] = {
|
||||
0, 3, 7,
|
||||
};
|
||||
copy(cell_pos, cell_pos+sizeof(cell_pos)/sizeof(cell_pos[0]), g->cell_facepos);
|
||||
/* everything interesting actually happens here, for all tests */
|
||||
compute_geometry(g);
|
||||
}
|
||||
|
||||
~BackspaceGrid()
|
||||
{
|
||||
destroy_grid(g);
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(CompGeo2D, BackspaceGrid)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(edgeMidpoints)
|
||||
{
|
||||
double midpoints[] = {
|
||||
-0.5, 0.5, /* edge 0 */
|
||||
0.5, 1., /* edge 1 */
|
||||
1., 0., /* edge 2 */
|
||||
0.5, -1., /* edge 3 */
|
||||
-0.5, -0.5, /* edge 4 */
|
||||
0., 0., /* edge 5 */
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(midpoints)/sizeof(midpoints[0]) ==
|
||||
g->number_of_faces * g->dimensions);
|
||||
for (int edge = 0; edge < g->number_of_faces; ++edge)
|
||||
{
|
||||
for (int dim = 0; dim < g->dimensions; ++dim)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->face_centroids[edge*g->dimensions+dim],
|
||||
midpoints[edge*g->dimensions+dim], 0.001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(edgeNormals)
|
||||
{
|
||||
/* inward normal when doing clockwise enumeration */
|
||||
double normals[] = {
|
||||
1., -1., /* edge 0 */
|
||||
0., -1., /* edge 1 */
|
||||
-2., 0., /* edge 2 */
|
||||
0., 1., /* edge 3 */
|
||||
1., 1., /* edge 4 */
|
||||
2., 0., /* edge 5 */
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(normals)/sizeof(normals[0]) ==
|
||||
g->number_of_faces * g->dimensions);
|
||||
for (int edge = 0; edge < g->number_of_faces; ++edge)
|
||||
{
|
||||
for (int dim = 0; dim < g->dimensions; ++dim)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->face_normals[edge*g->dimensions+dim],
|
||||
normals[edge*g->dimensions+dim], 0.001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(edgeLengths)
|
||||
{
|
||||
double lengths[] = {
|
||||
1.4142, /* edge 0 */
|
||||
1., /* edge 1 */
|
||||
2., /* edge 2 */
|
||||
1., /* edge 3 */
|
||||
1.4142, /* edge 4 */
|
||||
2., /* edge 5 */
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(lengths)/sizeof(lengths[0]) == g->number_of_faces);
|
||||
for (int edge = 0; edge < g->number_of_faces; ++edge)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->face_areas[edge], lengths[edge], 0.001);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cellAreas)
|
||||
{
|
||||
double areas[] = {
|
||||
1., 2.,
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(areas)/sizeof(areas[0]) == g->number_of_cells);
|
||||
for (int cell = 0; cell < g->number_of_cells; ++cell)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->cell_volumes[cell], areas[cell], 0.001);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cellCenters)
|
||||
{
|
||||
double cellCenters[] = {
|
||||
-1./3., 0.0, /* cell 0 */
|
||||
1./2., 0.0, /* cell 1 */
|
||||
};
|
||||
BOOST_REQUIRE (sizeof(cellCenters)/sizeof(cellCenters[0]) ==
|
||||
g->number_of_cells * g->dimensions);
|
||||
for (int cell = 0; cell < g->number_of_cells; ++cell)
|
||||
{
|
||||
for (int dim = 0; dim < g->dimensions; ++dim)
|
||||
{
|
||||
BOOST_REQUIRE_CLOSE (g->cell_centroids[cell*g->dimensions+dim],
|
||||
cellCenters[cell*g->dimensions+dim], 0.001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
Loading…
Reference in New Issue
Block a user