Compare commits

...
819 Commits
Author SHA1 Message Date
Tucker Hartland 0e5f41221f including an obstacle problem variant wherein the essential dofs are not given to the optimizer as free variables that it must choose the values for. 2024-03-01 14:58:16 -08:00
Tucker Hartland d2794dd0da removing bug in the evaluation of the optimality measures wherein all processors now see the same value of the optimality error 2023-11-10 10:43:20 -08:00
Tucker Hartland 88372c99ee clean up... using a GeneralOptimizationProblem class and an OptimizationProblem class and no longer using the specific ContactProblem class as the generality of the Parent class does not have anything per say to do with contact 2023-10-10 11:33:29 -07:00
Tucker Hartland 52bfc8618d Merge branch 'contactIPM-dev' of https://github.com/mfem/mfem into contactIPM-dev 2023-08-07 10:07:55 -07:00
Tucker Hartland 977cb839b4 adding the ability to use the Hessian of the constraints in the optimizer, for the two sided Dirichlet obstacle problem it is observed that the number of outer Newton iterations is relatively constant only when the Hessian of the constraints are included in the Newton linear system 2023-08-07 10:06:35 -07:00
Socratis Petrides a52c7f036a bug fix 2023-07-25 19:20:04 -07:00
Socratis Petrides 39c32b9454 removing leftover print 2023-07-25 17:01:44 -07:00
Socratis Petrides 49041b062b simplifying dirichlet dofs handling 2023-07-25 16:26:21 -07:00
Socratis Petrides ed2d0846f6 small edits fixing compiler warnings 2023-07-24 14:34:22 -07:00
Tucker Hartland a1f6b3cf42 renaming descriptions of Optimization Problems... the general optimization problem which is more useful for PDE- and bound-constrained optimization is now described just as that GeneralOptProblem... the problem format min E(u) s.t. g(u) >= 0 and where (as the interior-point solver sees) the bound-constrained variable is a slack variable is now the less general but fairly descriptive OptProblem... the QPOptProblem (formerly QPContactProblem) now is more aptly described as there is nothing specific to contact that the class invokes 2023-07-21 12:40:04 -07:00
Tucker Hartland b8f4fbc84f updating a problem description 2023-07-21 10:11:17 -07:00
Tucker Hartland a2fef97289 removing the distinction between DirichletObstacle and ObstacleProblems 2023-07-21 10:06:58 -07:00
Tucker Hartland 07f22f98d3 removing DirichletObstacleProblem in favor of the ObstacleProblem class which has the ability to utilize Dirichlet boundary conditions 2023-07-20 18:44:34 -07:00
Tucker Hartland 9d5f4fd4ea removed all usages of typedef Number and all unnecessary ipopt stuff... moving meshes to the example/contact subdirectory and out of data directory... makefile now copies the meshes to the out of source directory when appropriate... problems now have more functionality for the inclusion of the Hessian of the constraint functions 2023-07-20 16:40:48 -07:00
tuckerh 17139c5fe8 fixing issue of a null Jacobian that shows up with certain builds/compilers/systems... the order of the gap function evaluation and gap function Jacobian in exQPContact was out of order and the Jacobian that is owned by the problem and passed to main was being deleted after a subsequent call of the gap function. Strange that this issue did not show up with all compilers 2023-07-20 09:51:05 -07:00
Tucker Hartland 3d201cd4ef removing comment about how function is leaking memory, since it is no longer leaking memory 2023-07-19 16:42:07 -07:00
Tucker Hartland 272f816245 fixing a memory leak via a FreeData call on the FindPointsGSLIB finder object in FindPointsInMesh 2023-07-19 16:29:54 -07:00
Tucker Hartland d18539aae2 fixing bug when not compiled with SUITESPARSE 2023-07-19 14:13:25 -07:00
Tucker Hartland 03aa2308d1 using more utility functions... ownership of blocks of IP-Newton system now owned by the problem and not the optimizer/solver... less copying in QPcontact and removing more of the functionality for ipopt 2023-07-17 17:36:44 -07:00
Tucker Hartland 27bcb49294 removing unnecessary copy when using dyanmic_cast, as well as removing unnecessary delete of the dynamic_cast variable to avoid dangling pointers 2023-07-17 15:27:23 -07:00
Tucker Hartland 90ca8bd551 including the QP contact block problem example... the infastructure in problems, additional meshes in data 2023-07-17 11:09:18 -07:00
Tucker Hartland 762fbedb42 more descriptions in Parallel Spherical example problem, as well as outputting the error of the numerical solution and that of the analytic solution 2023-07-06 12:09:32 -07:00
Tucker Hartland 028bbfbc20 Spherical obstacle problem in parallel... more consistent/descriptive variables for the parallel interior-point solver...including a parallel Dirichlet obstacle problem description 2023-07-05 17:35:17 -07:00
Tucker Hartland c2f85de2f9 added a new example wherein the Dirichlet condition and the obstacle coincide 2023-07-03 18:26:04 -07:00
Tucker Hartland c4c9962a0b small modification of the DirichletObstacleProblem that fixes a memory leak 2023-07-03 13:08:27 -07:00
tuckerh 5d15f6c2eb removing an unnecessary item 2023-06-29 13:38:48 -07:00
tuckerh 64e3cf5a52 making the ParIPSolver consistent with the IPsolver.... in particular the reduced print messages and also what the linSolver i.d.s correspond to 2023-06-29 13:18:43 -07:00
Tucker Hartland 81c0094f96 Spherical obstacle problem -- solving an obstacle problem with Dirichlet boundary conditions, able to check numerical solution against analytic to see convergence of the optimizer under mesh refinement to the analytic solution. problems.*pp contains new functionality for being able to describe an obstacle problem with Dirichlet boundary conditions. There has been a minor change to the IPsolver, so that there are fewer statements about the intermediate status of the optimizer 2023-06-29 12:35:21 -07:00
Tucker Hartland 91d8d5da29 removing unnecessary iterative solve option with the Schur-complement approximation Huu + D of the true Schur-complement Huu + Ju^T D Ju 2023-06-06 13:37:57 -07:00
tuckerh e4dd3399ac adding direct and iterative method options to solve IP-Newton-contact system via the Schur complement/stiffness by contact system matrix... including option to set the linear solve tolerance used by the iterative solver from the application code 2023-05-25 08:41:24 -07:00
Tucker Hartland aeff128c42 altering the logic of how the linear solver is chosen in the interior-point method, specifically to expose the newly available iterative method to builds that do not use SUITESPARSE 2023-05-25 07:14:05 -07:00
Tucker Hartland 617c9e2f21 adding new linear solver options and reducing the optimization tolerance so as to avoid conflicts with tolerances for Krylov-subspace solvers 2023-05-24 18:28:39 -07:00
Tucker Hartland 9fd2ae2229 using more descriptive language to describe various member functions 2023-05-24 10:57:18 -07:00
tuckerh bec6766ddb having sorted out the issue with the HypreMatrix from blocks function, we now remove unnecessary print statements and also include the fix 2023-05-15 17:07:02 -07:00
tuckerh 81fa2ca541 updating so that things are current even though there are failures with cpardiso on quartz 2023-05-15 14:12:35 -07:00
tuckerh dadfad3321 updated makefile so we can use either MUMPS or CPARDISO for the parallel sparse direct solver... using NULL instead of nullptr in order to try to be more consistent with the use of HypreParMatrixFromBlocks 2023-05-15 10:00:39 -07:00
tuckerh 18d3d7182c adding ability to use CPardiso sparse direct solvers 2023-05-12 13:23:47 -07:00
Socratis Petrides 994310c49e bug fix 2023-05-10 18:27:10 -07:00
Socratis Petrides 6396772300 first iteration of obstacle problem in parallel 2023-05-09 16:30:50 -07:00
Socratis Petrides a2b5fca7d4 minor changes to fix compiler warnings 2023-05-09 16:30:00 -07:00
Tucker Hartland 891a1aa72d new Mult function included in IPSolver so that the user does not need to be aware of the variable for which the bound-constraints are applied m >= ml, this is useful for contact mechanics problems wherein the bound-constraint variable is actually a slack variable and will not be especially important to the user. obstacleProblem.cpp is now cleaned up a bit, there is no longer a need to create a BlockVector and use this as input to the Mult IPM solution call and so it has been removed in favor of just working with a Vector representation of the primal variable 2023-05-05 15:21:50 -07:00
Tucker Hartland 332cc0e9da including another argument in the constructor of the abstract ContactProblem class, so that we pass the number of inequality constraints, this removes the need to copy the so-called boiler plate code into each of the child ContractProblem classes 2023-05-05 14:13:09 -07:00
Tucker Hartland 82c14b7544 altering various optimization problem member functions so that they no longer are of void type and take a reference to a SparseMatrix pointer but rather they just return a SparseMatrix pointer. the obstacleProblem now expects a function pointer to be passed when initialized, so that the right hand side forcing term is specified from the application side 2023-05-04 13:25:34 -07:00
Tucker Hartland c4cc5b600b adding initial serial features for contact... optimizer and the obstacleProblem. 2023-04-18 11:24:44 -07:00
Veselin Dobrev d84944d9af Merge pull request #3579 from mfem/array-makeref
Change Array::MakeRef to use MakeAlias
2023-04-15 21:06:40 -07:00
Tzanio Kolev 46dd1b779f Merge pull request #3137 from mfem/tmop-bif
Updates to TMOP-based interface and boundary fitting method
2023-04-15 17:27:43 -07:00
Tzanio Kolev ca5b285c44 Merge pull request #3529 from mfem/1D-NURBS-dev
Add 1D NURBS [1D-NURBS-dev]
2023-04-14 07:01:23 -07:00
Tzanio Kolev e7e2850b5c Merge pull request #3202 from mfem/dof-doc-dev
Expanding documentation related to DoFs [dof-doc-dev]
2023-04-14 07:00:05 -07:00
Tzanio Kolev 3705df79bc Merge pull request #3552 from mfem/hiop-new-x
Access to HiOp's new_x
2023-04-14 06:59:34 -07:00
Veselin Dobrev 1f4cc7c9ae In MemoryManager::Register_, check for alias after checking for
nullptr -- it is okay to try to register an alias to nullptr.
2023-04-12 23:39:43 -07:00
Veselin Dobrev 3ec5edbfb1 Add the new miniapp 'pmesh-fitting' to 'config/sample-runs.sh' 2023-04-11 17:33:39 -07:00
Ketan Mittal a1d643ef77 update paper title 2023-04-11 11:20:57 -07:00
Ketan Mittal 041c9362e1 Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2023-04-11 11:07:44 -07:00
Veselin Dobrev fc0602cf16 In the memory manager, when creating an alias memory to nullptr,
do not set the flag OWNS_INTERNAL of the alias.
2023-04-10 20:20:08 -07:00
Will Pazner 18330cc31c Merge pull request #3578 from mfem/fix-warnings-2023-04
Fix warnings from non-debug build with new Apple-clang
2023-04-10 16:55:42 -07:00
Will Pazner fa1f8cf075 Merge pull request #3571 from adam-sim-dev/gmres
Init j and resid for GMRES
2023-04-10 16:55:09 -07:00
Tzanio Kolev 0061c55699 Merge branch 'master' into tmop-bif 2023-04-09 17:55:56 -07:00
Tzanio Kolev 72fd6dcb62 Merge pull request #3393 from mfem/rt-face-restriction
RT FaceRestriction and VectorFEBoundaryFluxLFIntegrator kernels
2023-04-09 17:48:17 -07:00
Tzanio Kolev 23565af525 Merge pull request #3444 from mfem/vectorfe-linearform-ext
Support RT VectorFEDomainLFIntegrator on device
2023-04-09 17:47:26 -07:00
Tzanio Kolev 7dc0b2a541 Merge branch 'master' into tmop-bif 2023-04-09 13:45:05 -07:00
Tzanio Kolev c7780a3085 Merge branch 'master' into rt-face-restriction 2023-04-09 13:33:13 -07:00
Tzanio Kolev 01772b0ad6 Merge branch 'master' into 1D-NURBS-dev 2023-04-09 13:32:16 -07:00
Tzanio Kolev 80bc91f811 Merge branch 'master' into hiop-new-x 2023-04-09 13:20:07 -07:00
Tzanio Kolev 2dc923a624 Merge branch 'master' into dof-doc-dev 2023-04-09 13:09:45 -07:00
Tzanio Kolev 782e69270b Merge branch 'master' into vectorfe-linearform-ext 2023-04-09 13:05:27 -07:00
Veselin Dobrev e9eddf8205 Merge pull request #3409 from mfem/ex20p-determinism-dev
Quest for ex20p deterministic output [ex20p-determinism-dev]
2023-04-07 19:02:34 -07:00
Will Pazner 11ec97fe5f Revert inadvertent comment change 2023-04-06 09:09:56 -07:00
Will Pazner 2d3b216c95 Fix bug in ConformingFaceRestriction
When constructing ConformingFaceRestriction from the derived class
ParNCH1FaceRestriction, vol_dof_map was not initialized because of an early
return.
2023-04-05 22:07:06 -07:00
Will Pazner f9e69ad1df Move SpaceType enum to namespace in unit test 2023-04-05 22:06:50 -07:00
Veselin Dobrev 3c64ca0841 Remove GitLab test using old gcc v4.9.3 on Quartz.
There is no need to add the same test with newer gcc version
because we already have it -- with gcc v6.1.0.
2023-04-05 20:29:17 -07:00
Veselin DobrevandWill Pazner 700208c3db Apply reviewer suggestion: update fem/tmop_tools.cpp
Co-authored-by: Will Pazner <11493037+pazner@users.noreply.github.com>
2023-04-05 16:44:18 -07:00
Will Pazner f6df4a9c09 Make LinearFormIntegrator::SupportsDevice const
Required for compatibility with PR #3393
2023-04-04 14:18:43 -07:00
Will Pazner 468f49e29c Define main on Windows in test_debug_device.cpp 2023-04-04 09:17:01 -07:00
Will Pazner 3cd8f8a328 Add REQUIRE_NOTHROW to Array::MakeRef test 2023-04-04 09:16:42 -07:00
Will Pazner 3045411a09 Allow multiple test cases in debug device tests 2023-04-04 08:06:31 -07:00
Will Pazner 6a09aab038 Change Array::MakeRef to use MakeAlias 2023-04-04 08:06:13 -07:00
Ido Akkerman 3033b32339 Make macos compiler happy 3 2023-04-04 12:36:14 +02:00
Ido Akkerman 6ba52de1af Make macos compiler happy 2 2023-04-04 12:20:18 +02:00
Ido Akkerman 936fd0b24a Make macos compiler happy 2023-04-04 12:02:44 +02:00
Ido Akkerman 054b543e8a Sort and clean 1D data array 2023-04-04 11:26:36 +02:00
Ido Akkerman d5ef001b45 instance in lowercase 2023-04-04 10:59:27 +02:00
Ido Akkerman ea084b06dd Fix typo 2023-04-04 10:58:58 +02:00
Veselin Dobrev 2cb8f5d764 Fix a few comments 2023-04-03 23:29:47 -07:00
Will Pazner d05ae0be96 Add namespace internal to face_map_utils.cpp 2023-04-03 20:42:19 -07:00
Will Pazner 5bb11cfde0 Rename H1_ND_RT_FaceRestriction to ConformingFaceRestriction 2023-04-03 20:40:12 -07:00
Will Pazner 8ddbd51116 Add note about return in a MFEM_FORALL lambda 2023-04-03 20:37:51 -07:00
Will Pazner cdfb022714 Improve GetFaceMap Doxygen comment 2023-04-03 20:34:47 -07:00
Will Pazner da2bd5e422 Move face map utils to mfem::internal namespace 2023-04-03 20:30:25 -07:00
Will Pazner 436163bd75 Rename GetNodalTensorFaceMap to GetTensorFaceMap 2023-04-03 20:28:27 -07:00
Will Pazner 0a676e66cc Pass offsets by reference in FillFaceMap 2023-04-03 20:27:28 -07:00
Will Pazner 3e944fd215 Verify H1 space in ParNCH1FaceRestriction 2023-04-03 20:27:28 -07:00
Will Pazner 128a3cef7e Delete out-of-date comment 2023-04-03 20:25:03 -07:00
Veselin Dobrev 3fb16431b3 Fix a shadow variable warning 2023-04-03 14:17:19 -07:00
Veselin Dobrev d52b81fcf2 Update copyright to 2023 2023-04-03 13:59:35 -07:00
Veselin Dobrev d1ef99f4cf Merge branch 'master' into rt-face-restriction
Resolved conflicts:
   CHANGELOG
2023-04-03 12:35:18 -07:00
Veselin Dobrev 393c0104e0 Drop 'virtual' from some methods marked with both 'virtual' and
'override'

In methods related to face restriction, rename 'e_ordering' or
'ordering' to 'f_ordering' to emphasize that this is reordering
for the face dofs. Also, clarified that doxygen comments.

In class H1_ND_RT_FaceRestriction, rename some variables for better
clarity; do not use 'f_ordering' to make decisions about element
dofs.

Remove the declaration of GetFaceDofs() whose definition was
removed earlier in this branch.
2023-04-03 12:18:15 -07:00
Veselin Dobrev 16df54d667 Fix warnings from non-debug build with new Apple-clang 2023-04-03 11:32:41 -07:00
Tzanio Kolev 70083ae9d9 Merge branch 'master' into hiop-new-x 2023-04-03 09:04:28 -07:00
Ketan Mittal da0062988b update changelog 2023-03-31 09:26:48 -07:00
Ketan Mittal fca4583833 Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2023-03-31 09:22:32 -07:00
Adam bc1b23bf8c Init j and resid
This PR sets j and resid. They are not initialized if beta <= final_norm, while they are printed later.
2023-03-31 08:49:43 +08:00
Tzanio Kolev 1349c34886 Merge branch 'master' into vectorfe-linearform-ext 2023-03-30 11:55:14 -07:00
Tzanio Kolev d4bc14a48a Merge pull request #3466 from mfem/ab-am-fix
Small fix in Adams Moulton and Adams Bashforth integrators [ab-am-fix]
2023-03-30 11:50:35 -07:00
Tzanio Kolev 34ad9fca15 Merge pull request #3316 from mfem/nurbs-attr
NURBS patch attributes
2023-03-30 11:50:06 -07:00
Tzanio Kolev c1a1c0ba16 Merge pull request #3550 from mfem/tmop-fit-bug
Corrections in TMOP_Integrator::GetSurfaceFittingErrors
2023-03-30 11:48:48 -07:00
Ido Akkerman ff5bce20e3 Fix init order 2023-03-30 14:23:22 +02:00
Ido Akkerman b2cbb1ed92 Fix compile error?? 2023-03-30 14:13:56 +02:00
Ido Akkerman 18f28e0fbf Added checks and comments 2023-03-30 10:08:07 +02:00
Vladimir Z Tomov c4ccb28184 added some deletes and minor edits 2023-03-29 16:17:24 -07:00
Ketan Mittal db5bfb536e Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2023-03-29 09:13:47 -07:00
Ketan Mittal 7d6ad1639d fix default metric id for test 2023-03-29 09:13:19 -07:00
Ketan Mittal f1344306e1 typo 2023-03-28 20:21:27 -07:00
Tzanio Kolev bcea3019b4 Merge pull request #3131 from mfem/mesh-ptr-doc-dev
Adding Doxygen comments for returned pointers in mesh classes [mesh-ptr-doc-dev]
2023-03-28 17:02:33 -07:00
Ketan Mittal 2bdecef57a update gitignore 2023-03-28 16:23:59 -07:00
Ketan Mittal 8f93f66541 add common namespace to shifted miniapps 2023-03-28 14:49:59 -07:00
Ketan Mittal 55228baed8 rename file and fix header 2023-03-28 14:35:02 -07:00
Ketan Mittal ea1403a9da rename files and edit makefile 2023-03-28 14:31:53 -07:00
Ketan Mittal eed32e52db resolve conflicts 2023-03-28 14:21:54 -07:00
Ketan Mittal e222c576e7 refactor gradient and hessian for fitting term 2023-03-28 13:45:00 -07:00
Ketan Mittal ec3d524b9a reviewer comments 2023-03-28 11:25:18 -07:00
Dylan Copeland fc279d85ca CHANGELOG 2023-03-27 10:27:30 -07:00
Vladimir Z Tomov 7d6d7249b4 cosmetic edits in tmop-fitting.cpp, no changes in execution. 2023-03-26 17:55:31 -07:00
Vladimir Z Tomov 0d0c4a3b79 improved comments and spacing in tmop.hpp/cpp. 2023-03-26 16:32:27 -07:00
Vladimir Z Tomov 6477552732 edits related to min-detJ_threshold. 2023-03-26 12:50:55 -07:00
Vladimir Z Tomov e10a991272 CountZones - made it virtual, changed the name.
other minor edits.
2023-03-26 12:28:13 -07:00
Tzanio Kolev 7d2be1e37c Merge branch 'master' into nurbs-attr 2023-03-25 18:12:25 -07:00
Tzanio Kolev fa603e6793 Merge branch 'master' into ex20p-determinism-dev 2023-03-25 17:57:55 -07:00
Tzanio Kolev 664bb278ef Merge branch 'master' into 1D-NURBS-dev 2023-03-25 17:49:04 -07:00
Will Pazner 75b88ab5c8 Update copyright to 2023 in lininteg_vectorfe_domain.cpp 2023-03-25 14:28:07 -07:00
Will Pazner d2f15700a3 Merge remote-tracking branch 'origin/master' into vectorfe-linearform-ext 2023-03-25 14:26:27 -07:00
Tzanio Kolev 92bf531fab Merge pull request #3556 from mfem/new-dev-version-4.5.3
Update version numbers to 4.5.3 -- a new development version
2023-03-24 17:10:58 -07:00
Stowell, Mark L 84f65c049d Typo caught by @hughcars 2023-03-24 13:56:17 -07:00
Stowell, Mark L bb70eb3657 Reverting an unintended change in error.hpp 2023-03-24 10:42:50 -07:00
Veselin Dobrev d054509853 Update version numbers to 4.5.3 -- a new development version 2023-03-24 09:43:38 -07:00
Stowell, Mark L 8fce609951 Improvements suggested by @jamiebramwell 2023-03-23 15:49:14 -07:00
Tzanio Kolev 00b2a0705f Merge pull request #3384 from mfem/mfem-4.5.2-dev
Final changes for mfem-4.5.2
2023-03-23 15:33:44 -07:00
Tzanio Kolev 98d4b369ba Final edits in the CHANGELOG for mfem-4.5.2 2023-03-23 15:30:22 -07:00
Stowell, Mark L 12fcd41115 Typos and other improvements suggested by @acfisher 2023-03-23 15:10:54 -07:00
Stowell, Mark L 5a2b434c2c Typo found by @v-dobrev 2023-03-23 15:10:03 -07:00
Stowell, Mark L 9b3c7e7211 Merge remote-tracking branch 'origin/master' into mesh-ptr-doc-dev
# Conflicts:
#	mesh/mesh.hpp
#	mesh/pmesh.hpp
2023-03-23 09:46:31 -07:00
Stowell, Mark L dada0326ef Changes suggested by @acfisher 2023-03-23 09:21:14 -07:00
Vladimir Z Tomov 1f53683c64 style 2023-03-22 13:03:33 -07:00
Vladimir Z Tomov a8f0bfbafe forgot to return it. 2023-03-22 13:00:23 -07:00
Vladimir Z Tomov f73f677b00 Added access to hiop's new_x field. 2023-03-22 12:59:04 -07:00
Veselin Dobrev af6e5e7b21 Merge branch 'master' into mfem-4.5.2-dev 2023-03-21 13:13:59 -07:00
Veselin DobrevandTzanio Kolev 0f6cd97b1a Update CHANGELOG with v4.5.2 release date
Co-authored-by: Tzanio Kolev <tzanio@llnl.gov>
2023-03-21 13:13:39 -07:00
Veselin Dobrev 2106ea4039 Merge pull request #3532 from mfem/2023-copyright
Updated COPYRIGHT to 2010-2023
2023-03-21 13:11:37 -07:00
Veselin Dobrev a152e48fd3 Update config/githooks/pre-push 2023-03-21 11:16:17 -07:00
Vladimir Z Tomov 3c4e67dbe1 unused variable in serial 2023-03-21 10:54:13 -07:00
Vladimir Z Tomov b0614c26d0 corrections in TMOP_Integrator::GetSurfaceFittingErrors() 2023-03-21 10:42:02 -07:00
Ido Akkerman 9105a3aa22 Merge branch '1D-NURBS-dev' of https://github.com/mfem/mfem into 1D-NURBS-dev 2023-03-16 11:42:18 +01:00
Ido Akkerman ada6d009cf Add 1D periodicity to NURBS 2023-03-16 09:41:16 +01:00
Will Pazner 701870a7da Merge pull request #3438 from mfem/sjg/pyr-ref-leak
Fix memory leak in pyramid mesh refinement for MFEM_USE_MEMALLOC
2023-03-15 13:27:07 -07:00
Ido Akkerman c866f52b69 Merge branch 'master' into 1D-NURBS-dev 2023-03-15 09:11:50 +01:00
Ido Akkerman f68365a0a0 Merge branch 'master' into ab-am-fix 2023-03-15 09:10:55 +01:00
Will Pazner 25d6fbc4ea Fix grammar in face map comments 2023-03-14 22:15:38 -07:00
Will Pazner cd9e718ea9 Fix GetFaceNormal3D Doxygen comment 2023-03-14 21:52:26 -07:00
Will Pazner 3beb66b7cc Fix comment grammar 2023-03-14 21:50:12 -07:00
Will Pazner 8869ad64a0 Improve Doxygen comment for H1_ND_RT_FaceRestriction 2023-03-14 21:49:22 -07:00
Will Pazner 9b0c3f7d13 Add comment to RT face restriction unit test 2023-03-14 21:48:13 -07:00
Will Pazner a78c2fee04 Implement PositiveTensorFiniteElement::GetFaceMap
Factor out logic in NodalTensorFiniteElement::GetFaceMap to
GetNodalTensorFaceMap, reuse for the case of Bernstein basis.
2023-03-14 14:04:42 -07:00
Will Pazner 6b7d72147f Add comment to FiniteElement::GetFaceMap 2023-03-14 14:02:41 -07:00
Will Pazner c3acad6dbd Merge remote-tracking branch 'origin/master' into rt-face-restriction
# Conflicts:
#	fem/fe/fe_base.hpp
#	fem/restriction.cpp
2023-03-14 11:23:26 -07:00
Veselin Dobrev a46650042b Fix some warnings 2023-03-14 09:11:41 -07:00
Veselin Dobrev b4bece1e0f Small tweak in the HiOp header to avoid recursive header
inclusion: 'linalg.hpp' and 'hiop.hpp' were including each
other (harmless due to header guards).
2023-03-13 06:10:57 -07:00
Veselin Dobrev e3e413bdae Fix warnings when building with Ginkgo 1.5.0 2023-03-13 06:09:50 -07:00
Veselin Dobrev 1792b1a90c In fem/picojson.h, use 'serialize_' instead of '_serialize' to
avoid a clash with a macro defined in GCC 11.2.
2023-03-13 06:05:40 -07:00
Tzanio Kolev 96e00dc815 Updated COPYRIGHT to 2010-2023 2023-03-11 16:58:18 -08:00
Veselin Dobrev 4f0a7d4773 Small updates:
* Bugfix in SparseMatrix::SortColumnIndices()
* More general definition of AsConst()
* Fix nvcc warning in miniapps/meshing/reflector.cpp
2023-03-10 23:48:14 -08:00
Ido Akkerman e3fb8fd88d Make style 2023-03-10 11:54:43 +01:00
Ido Akkerman d368e96e14 together with previous commit -- adding 1D weak BCs 2023-03-10 11:49:18 +01:00
Ido Akkerman d2a9fd1efa mesh/mesh.cpp 2023-03-10 11:48:07 +01:00
Ido Akkerman cffa32e98a Add Point to NURBS fe collection 2023-03-09 15:31:43 +01:00
Ido Akkerman 3fabd09cb9 Make pedantic compiler happy 2023-03-09 14:53:27 +01:00
Ido Akkerman 78a05c527a make style 2023-03-09 14:44:58 +01:00
Ido Akkerman 781d15969b Add parallel function def 2023-03-09 14:35:25 +01:00
Ido Akkerman 54b1ea497a Make pedantic test happy 2023-03-09 14:22:07 +01:00
Ido Akkerman e4d3533c9c Fix include 2 2023-03-09 14:16:07 +01:00
Ido Akkerman b87c6c5ba7 Fix include 2023-03-09 14:14:27 +01:00
Ido Akkerman 1f15ca161a Merge branch 'ab-am-fix' of https://github.com/mfem/mfem into ab-am-fix 2023-03-09 14:07:06 +01:00
Ido Akkerman f9998e6ca9 Memory errors 2023-03-09 14:04:33 +01:00
Ido Akkerman caab78bde3 Make style 2023-03-09 14:03:09 +01:00
Ido Akkerman 721ba15b38 Add test case and 1D output to nurbs miniapp 2023-03-09 13:15:47 +01:00
Ido Akkerman 16f107a79b make style 2023-03-09 10:45:20 +01:00
Ido Akkerman ec6990ce79 Change print mechanicsm and correct includes 2023-03-09 09:18:35 +01:00
Ido Akkerman dbfb30b9d4 Works? 2023-03-09 09:03:06 +01:00
Ido Akkerman 265ff5a817 More NURBS fixes 2023-03-09 08:48:48 +01:00
Veselin Dobrev 5335942a92 Merge branch 'master' into mfem-4.5.2-dev 2023-03-08 18:44:07 -08:00
Mark L. Stowell 888b8eca6d Merge pull request #3513 from mfem/shared-msvc-dev-v2
Add support for shared builds on Windows with MSVC using CMake
2023-03-08 17:39:58 -08:00
Mark L. Stowell 5c6000512d Merge branch 'master' into shared-msvc-dev-v2 2023-03-08 16:48:16 -08:00
Veselin Dobrev fe525828ab Merge pull request #3501 from mfem/task/2023_02_windows_macro_fixes
changes to enums to avoid windows macro conflicts
2023-03-08 11:22:57 -08:00
Ido Akkerman 43b770ac26 First fixes to get things running 2023-03-08 18:08:37 +01:00
Ido Akkerman 0f8c634181 Add 1D NURBS mesh 2023-03-08 17:47:20 +01:00
Ido Akkerman d111505b94 Change patch data access operators 2023-03-08 17:32:00 +01:00
Ido Akkerman 369a5e03a1 Add 1D functions to NURBS classes 2023-03-08 16:42:01 +01:00
Veselin Dobrev ddfb7d48e2 In CHANGELOG, move a bullet added after v4.5.0 from the
v4.5.0 section to the v4.5.2 section.
2023-03-07 22:18:14 -08:00
Veselin Dobrev 1d95c85a0d Merge branch 'master' into mfem-4.5.2-dev 2023-03-07 22:04:28 -08:00
Tzanio Kolev a275e75549 Merge pull request #3427 from mfem/FindPointsGSLIB-update
Fix logic for points near but outside domain boundary
2023-03-07 12:45:23 -08:00
Ido Akkerman 2238dadd06 Merge branch 'master' into ab-am-fix 2023-03-07 10:30:14 +01:00
Veselin Dobrev ea56d41dd3 Mention the shared MSVC build support in CHANGELOG and
document the MFEM_EXPORT macro in config.hpp.
2023-03-06 17:48:51 -08:00
Veselin Dobrev 119451df1a Rename NO_ERROR_ to No_Error and REGISTERED_ to Registered 2023-03-06 16:26:45 -08:00
Veselin Dobrev e941c8ba91 More tweaks in .gitignore and 'make clean' 2023-03-06 02:43:07 -08:00
Veselin Dobrev fa142c9b59 Small tweaks to .gitignore and 'make clean' 2023-03-06 01:14:53 -08:00
Veselin Dobrev 9d5f62de33 Merge branch 'master' into mfem-4.5.2-dev 2023-03-05 20:27:25 -08:00
Veselin Dobrev f250ee95bb Merge pull request #3520 from lcheng9/master
Initialize two pointers.
2023-03-05 20:24:53 -08:00
Veselin Dobrev 2daf9762a4 Merge branch 'master' into shared-msvc-dev-v2 2023-03-04 21:36:37 -08:00
Veselin Dobrev 8356dd015f In GitHub actions: replace the static build with a shared
build in the windows-par-opt job.
2023-03-04 21:32:41 -08:00
Veselin Dobrev c8801d0d27 Merge pull request #3515 from mfem/bugfix/generalize-addelemvec
Relax the assert requirement in AddElementVector
2023-03-04 20:24:48 -08:00
Liang 8c8deaed95 Initialize null pointers.
Some compilers may complain about these two uninitialized pointers, simply resolve it.
2023-03-03 23:24:40 -05:00
Veselin Dobrev 78467f4268 Fix the shared build on Windows with MinGW-w64 2023-03-03 06:36:22 -08:00
Veselin Dobrev e75ab127c8 Bugfix for GitHub issue #3516 2023-03-02 17:25:15 -08:00
Veselin Dobrev fff74aca98 Suppress Doxygen warnings in geom.hpp 2023-02-28 21:00:49 -08:00
Ben Chung Yee ff993ffb1b Loosen assert in SetSubVector as well 2023-02-28 18:05:58 -08:00
Ben Chung Yee 69d96008ae Relax the assert requirement in AddElementVector
The implementation is fine if we just want the dofs.Size() entries of
elemvect, so we only need <= rather than ==

This is currently causing an issue in
ParLinearForm::AssembleSharedFaces, where the integrator returns an
elemvect of size 2x dofs, but we are only appending the local portion of
that vector.
2023-02-28 17:52:26 -08:00
Sebastian Grimberg 0412f7f9ea Merge branch 'master' into sjg/pyr-ref-leak 2023-02-28 16:24:27 -08:00
Ketan Mittal 72b0bdbcef serial sample run 2023-02-28 11:50:12 -08:00
Veselin Dobrev ce505ceab2 In the Appveyor CI, test only the serial shared build since
both static and shared tests take too long.

Try to speed up the hypre build with -j 4.
2023-02-27 22:50:44 -08:00
Veselin DobrevandKenny Weiss c3dbd8041b Add support for shared builds on Windows with MSVC using CMake.
This commit based to a large extend on PR #1401.

Co-authored-by: Kenny Weiss <kennyweiss@users.noreply.github.com>
2023-02-27 19:31:21 -08:00
Veselin Dobrev bbd1b42bab Merge branch 'master' into mfem-4.5.2-dev 2023-02-24 16:49:21 -08:00
Mark L. Stowell ea5c466486 Merge pull request #3314 from mfem/sjg/dof-to-quad-dev
Non-tensor H(curl) and H(div) FiniteElement::GetDofToQuad
2023-02-24 16:27:35 -08:00
Mark L. Stowell 82bc4f058d Merge branch 'master' into sjg/dof-to-quad-dev 2023-02-24 14:34:18 -08:00
Tzanio Kolev c416dddeae Merge pull request #3253 from mfem/parGF-grad
GetGradient methods for face-neighbor elements.
2023-02-24 14:23:37 -08:00
Tzanio Kolev 7aa6e58d07 Merge branch 'master' into parGF-grad 2023-02-24 14:23:29 -08:00
Mark L. Stowell df01ea1554 Merge branch 'master' into sjg/dof-to-quad-dev 2023-02-24 13:43:25 -08:00
Mark L. Stowell 563b8d455a Merge pull request #3503 from mfem/fe-coll--fe-for-dim--fix
Fix an issue in `FiniteElementCollection::FiniteElementForDim`
2023-02-24 13:42:08 -08:00
Mark L. Stowell e28ed04f52 Merge branch 'master' into sjg/dof-to-quad-dev 2023-02-24 13:05:26 -08:00
Mark L. Stowell 1406569993 Merge branch 'master' into fe-coll--fe-for-dim--fix 2023-02-24 13:00:10 -08:00
Veselin Dobrev c5b77f1dca Merge pull request #3474 from mfem/mass-pa-geom
Use GeometricFactors::DETERMINANTS in PA mass integrator
2023-02-24 12:30:54 -08:00
Veselin Dobrev 546e96c2a2 Merge branch 'master' into mfem-4.5.2-dev 2023-02-23 09:42:52 -08:00
Veselin Dobrev 220b22f33b Merge pull request #3462 from mfem/cmake-global-flag-fix
Cmake global flag fix
2023-02-23 09:41:33 -08:00
Veselin Dobrev b9b17575fb Merge branch 'master' into mfem-4.5.2-dev 2023-02-23 09:27:28 -08:00
Tzanio Kolev 1789cb6d3f Merge pull request #3468 from mfem/origin/ms-fix
Bug fixes in GSLib and TMOP
2023-02-23 07:41:55 -08:00
Ido Akkerman da7ae3d7fe Merge branch 'master' into ab-am-fix 2023-02-23 10:50:34 +01:00
Ido Akkerman ae32fddc73 Merge branch 'ab-am-fix' of https://github.com/mfem/mfem into ab-am-fix 2023-02-23 10:48:08 +01:00
Ido Akkerman d21eb9f5b2 Remove guard and prevent warning output at first timestep 2023-02-23 10:43:01 +01:00
Veselin Dobrev 946ecc4623 Github actions: use v2.3 of the mfem-build action which solves the
slow linking on Ubuntu + CMake. Keep the ability to set additional
configuration options in the build matrix.
2023-02-22 23:41:53 -08:00
Veselin Dobrev 86786df48e Github actions: try another way to pass config-options to the
Ubuntu + CMake build.
2023-02-22 18:37:39 -08:00
Veselin Dobrev 15aae11753 Try to resolve the slow linking issue on Ubuntu + CMake. 2023-02-22 18:10:04 -08:00
Veselin Dobrev 7cda15237b Merge branch 'master' into mfem-4.5.2-dev
Resolved conflicts:
   CHANGELOG
2023-02-22 18:07:58 -08:00
Ketan Mittal d1689afc84 Merge branch 'master' of https://github.com/mfem/mfem into FindPointsGSLIB-update 2023-02-22 17:59:07 -08:00
Cyrus Harrison 023552d99f Merge branch 'master' into task/2023_02_windows_macro_fixes 2023-02-21 16:38:44 -08:00
Will Pazner 1f89a88844 Merge pull request #3363 from mfem/mesh-reflect
Mesh reflector miniapp
2023-02-21 14:38:00 -08:00
Will Pazner d3d3b6b1c5 Merge pull request #3452 from mfem/static_glvis_init
Avoid global initialization issues in (p)minimal-surface
2023-02-21 14:37:34 -08:00
Tzanio Kolev 5a0414146c Merge pull request #3275 from mfem/add_default_constructor
Add default constructor to ParFiniteElementSpaceHierarchy [add_default_constructor]
2023-02-21 13:51:11 -08:00
Tzanio Kolev e90514c51f Merge pull request #3458 from mfem/goto-dev
Change intersect algorithm to not use goto
2023-02-21 13:50:33 -08:00
Veselin Dobrev 94573fcaec Merge branch 'master' into mfem-4.5.2-dev 2023-02-21 12:51:03 -08:00
Veselin Dobrev 715175844d Merge pull request #3412 from mfem/tmop-auto-gamma
TMOP - balancing of compound metrics
2023-02-21 12:46:27 -08:00
Veselin Dobrev af73e58ffc Fix an issue in FiniteElementCollection::FiniteElementForDim for
sub-classes that raise errors instead of returning NULL from
calls to FiniteElementForGeometry.
2023-02-21 12:27:59 -08:00
Mathias Rainer Schmidt 534194bb74 - removed comm_free() call from this PR. Should be investigated in future PR to resolve the corresponding memory leak. 2023-02-21 12:07:48 -08:00
Tzanio Kolev 3f566ab46f Merge branch 'master' into dof-doc-dev 2023-02-21 11:48:37 -08:00
Cyrus Harrison 13cccd6c66 style 2023-02-21 11:19:12 -08:00
Cyrus Harrison 06beca6d83 changes to enums to avoid windows macro conflicts 2023-02-21 10:59:20 -08:00
Ben Southworth 6fa71acdd6 fix space in printout 2023-02-21 08:52:20 -07:00
Ben Southworth 1f1fc6e6e5 add missing space 2023-02-21 06:18:35 -07:00
Veselin Dobrev 764898e186 Suppress a warning from CMake about HDF5_ROOT.
In MfemCmakeUtilities.cmake, tweak mfem_find_package() and
mfem_get_target_options() to handle imported libraries better.
2023-02-20 15:22:42 -08:00
Ido Akkerman 61848a0627 Fix print if root statement 2023-02-20 16:33:28 +01:00
Ido Akkerman 4c59647387 Fixing compile error and warning message 2023-02-20 14:59:20 +01:00
Veselin DobrevandChris White 93cdcae163 Fix some CMake issues in FindNetCDF.cmake related to HDF5
Reported-by: Jamie Bramwell <jamiebramwell@users.noreply.github.com>
Co-authored-by: Chris White <white238@users.noreply.github.com>
2023-02-17 16:22:10 -08:00
Will Pazner fb2b2f0067 Use GeometricFactors::DETERMINANTS in PA mass integrator 2023-02-17 13:57:15 -08:00
Ido Akkerman ffbb844a22 Add timestep check to AM and AB solvers. FLush history if timestep changes 2023-02-17 17:34:45 +01:00
Mathias Rainer Schmidt 9484091bce - fixed memory corruption bug
- fixed parallel bug
- fixed memory leak
2023-02-16 11:19:41 -08:00
Hugh Carson 78706f96dc Further unwind the nested if branch 2023-02-15 13:25:19 -05:00
Ido Akkerman 3c8f827c8e Small improvement to ODE unit tester 2023-02-15 15:47:32 +01:00
Ido Akkerman 200f146a81 Correct time increment in AB & AM ode integrators 2023-02-15 15:47:20 +01:00
Dylan Copeland 92e11e48f8 Merge branch 'master' into mesh-reflect 2023-02-14 22:25:55 -08:00
Dylan Copeland 42102085ec Another attempt. 2023-02-14 21:30:51 -08:00
Dylan Copeland 4d95303bf3 Attempting to fix reflector serial test. 2023-02-14 21:01:04 -08:00
Tzanio Kolev 8053bc25e4 Updated CHANGELOG for the mfem-4.5.2 release 2023-02-14 15:02:48 -08:00
Ketan Mittal 1399f10675 change sample runs in miniapp 2023-02-14 13:13:30 -08:00
Frank Wang d4b6deeeb7 fix bugs 2023-02-14 12:26:03 -08:00
Ketan Mittal 93f7e778cd Merge branch 'FindPointsGSLIB-update' of https://github.com/mfem/mfem into FindPointsGSLIB-update 2023-02-14 11:54:24 -08:00
Ketan Mittal 8c62969dc7 disable FD+GSLIB+DiscreteAdaptivity 2023-02-14 11:53:09 -08:00
Vladimir Z Tomov 29ec82fcb9 changelog 2023-02-14 11:08:53 -08:00
Tzanio Kolev 1303b3e251 Merge branch 'master' into FindPointsGSLIB-update 2023-02-14 10:13:55 -08:00
Tzanio Kolev 93940754a3 Merge branch 'master' into add_default_constructor 2023-02-14 10:12:33 -08:00
Hugh Carson 69541be811 Change intersect algorithm to not use goto 2023-02-13 12:17:21 -05:00
Vladimir Z Tomov 5937a85546 small fix for sum=1. 2023-02-12 15:37:59 -08:00
Veselin Dobrev c8aa9544c3 Merge branch 'master' into mfem-4.5.2-dev 2023-02-11 23:33:39 -08:00
Veselin Dobrev 72596e45d4 In defaults.mk, replace the '--amdgpu-target' flag with
'--offload-arch' since new versions of hipcc generate warning
about it; older versions should still work fine with
'--offload-arch'.
2023-02-11 23:27:40 -08:00
Vladimir Z Tomov 5061dbd214 avoid possible div by zero 2023-02-10 17:55:26 -08:00
Dylan Copeland 7ded5aae7a FindFaceNeighbors now returns an Array instead of a set. 2023-02-10 10:21:14 -08:00
Tzanio Kolev e110cd4554 Merge branch 'master' into parGF-grad 2023-02-09 20:40:38 -08:00
Dylan Copeland e163306242 Documenting ownership of some tables. 2023-02-09 18:52:13 -08:00
Dylan Copeland 096c5f8db7 Fixed a memory leak. 2023-02-09 18:37:55 -08:00
Sebastian Grimberg 1b8e5e3717 Merge branch 'master' into sjg/dof-to-quad-dev 2023-02-09 14:32:44 -08:00
Tzanio Kolev 66de366701 Merge branch 'master' into vectorfe-linearform-ext 2023-02-09 10:19:26 -08:00
Tzanio Kolev 61b394409b Merge pull request #3440 from mfem/lor-space-fix
Support LOR transfer with smaller LOR spaces
2023-02-09 10:16:11 -08:00
Vladimir Z Tomov 1698c06900 gitignore 2023-02-08 09:25:43 -08:00
camierjs 48e3de797c Avoid global initialization issues in (p)minimal-surface 2023-02-08 08:58:20 -08:00
Dylan Copeland f7f20e8542 Add reflector to SEQ_MINIAPPS. 2023-02-07 20:59:47 -08:00
Dylan Copeland dd40e443c1 Merge branch 'master' of github.com:mfem/mfem into mesh-reflect 2023-02-07 20:59:09 -08:00
Sebastian Grimberg ae8ed6bb92 Merge branch 'master' into sjg/pyr-ref-leak 2023-02-07 20:25:56 -08:00
Vladimir Z Tomov 7ad3cd3509 autotest fix 2023-02-07 18:45:03 -08:00
Vladimir Z Tomov 371047e628 missing ifdef. 2023-02-07 18:21:37 -08:00
Vladimir Z Tomov fd4bf50a71 minor 2023-02-07 18:13:11 -08:00
Vladimir Z Tomov fa89fbfc71 minor 2023-02-07 18:09:57 -08:00
Vladimir Z Tomov 8805b1fd98 Removed the universal averaging stuff. 2023-02-07 17:42:10 -08:00
Vladimir Z Tomov 32d62a23a3 canceled 3d tmop-metric-magnitude for now. 2023-02-07 17:34:43 -08:00
Vladimir Z Tomov 35300fa1b6 Merge branch 'master' into tmop-auto-gamma 2023-02-07 17:14:28 -08:00
Veselin Dobrev d5f46a61bc Merge pull request #3411 from mfem/gitlab-ci-retry-push
Retry git push in autotest GitLab CI
2023-02-07 12:20:24 -08:00
Sebastian Grimberg 538ec0b33d Merge branch 'master' into sjg/dof-to-quad-dev 2023-02-07 12:06:22 -08:00
Will Pazner 2e8c7a1c07 Handle the case of empty local mesh 2023-02-07 10:02:02 -08:00
Veselin Dobrev b90350b234 Bugfix for issue #3433 2023-02-06 12:04:44 -08:00
Will Pazner 45c373a02c Use static constexpr for lambda capture constants
Otherwise Windows build complains about error:

error C2131: expression did not evaluate to a constant
2023-02-06 11:31:07 -08:00
Will Pazner dadd863539 Support VectorFEDomainLFIntegrator on device 2023-02-06 11:31:06 -08:00
Tzanio Kolev b8b3dc2f73 Merge branch 'master' into nurbs-attr 2023-02-06 11:02:17 -08:00
Frank Wang c33a8cebb4 using a simpler changwe 2023-02-06 10:19:04 -08:00
Veselin Dobrev 0a50fe2fde CMake fix for using (with the tests) and exporting the MPI variables
MPI_CXX_COMPILE_FLAGS and MPI_CXX_LINK_FLAGS when defined.
2023-02-05 21:26:41 -08:00
Veselin Dobrev ada669ff40 Merge branch 'master' into mfem-4.5.2-dev 2023-02-05 21:25:46 -08:00
Tzanio Kolev 52162982a8 Merge pull request #2980 from mfem/gmsh-pyr-dev
Add support for pyramid elements in Gmsh meshes
2023-02-03 15:28:09 -08:00
Tzanio Kolev 69c52e55bd Merge pull request #3430 from mfem/nodes-doxygen
Improve Doxygen comments for Mesh::GetNodes and related functions
2023-02-03 15:27:21 -08:00
Tzanio Kolev 23b0fa7e3c Merge branch 'master' into gmsh-pyr-dev 2023-02-03 15:26:57 -08:00
Dylan Copeland 13504d6116 Merge branch 'master' of github.com:mfem/mfem into mesh-reflect 2023-02-03 15:02:51 -08:00
Dylan Copeland 9aa6b00053 Removed unused variable. Fixed the boundary element orientation. Added some documentation. 2023-02-03 14:58:29 -08:00
Veselin Dobrev 3764f6e15c Merge branch 'master' into mfem-4.5.2-dev 2023-02-03 13:47:38 -08:00
Will Pazner a059294d02 Merge pull request #3441 from mfem/missing-inline
Add missing `inline`
2023-02-03 13:44:56 -08:00
Will Pazner 2e8750410e Merge pull request #3364 from mfem/fix-hypreparvec-double-free
Fix double-free of HypreParVector after move with hypre+GPU
2023-02-03 13:43:46 -08:00
Will Pazner 33635307cf Merge pull request #3405 from mfem/final-rel-norm
Initial and relative final norm for IterativeSolvers.
2023-02-03 13:42:50 -08:00
Will Pazner 75b1906749 Merge branch 'master' into fix-hypreparvec-double-free 2023-02-03 12:59:55 -08:00
Veselin Dobrev 271c63fbee Merge pull request #3445 from mfem/update-setup-mpi-action
Update version of mpi4py/setup-mpi action
2023-02-03 12:35:10 -08:00
Veselin Dobrev ad37c6af78 Merge pull request #3357 from mfem/docs-get-trans
Documentation improvements for `GetTransformation()`
2023-02-02 18:56:52 -08:00
Will Pazner 64e61fdc3e Update version of mpi4py/setup-mpi action 2023-02-01 10:27:46 -08:00
Vladimir Z Tomov ce74176355 CGSolver norm<0 fix. 2023-01-31 10:40:51 -08:00
Dylan Copeland 08b5a285be Merge branch 'master' of github.com:mfem/mfem into nurbs-attr 2023-01-30 16:30:40 -08:00
Dylan Copeland 9d62c10fbe Setting patch boundary elements on setup rather than on demand. 2023-01-30 16:28:04 -08:00
Tom Stitt 6acba0c1f0 add inline to avoid duplicate symbols (discovered with misconfigured compute-device spec) 2023-01-30 12:45:40 -08:00
Sebastian Grimberg caa1e2c7ae Update changelog 2023-01-30 08:59:29 -08:00
Tzanio Kolev e70e80da3f Merge pull request #3417 from mfem/pbilinearform-fix
Bugfix in `ParBilinearForm::TrueAddMult`
2023-01-30 08:30:00 -08:00
Tzanio Kolev 2c6d541745 Merge pull request #3285 from mfem/tmop-fix-301
Fix metric 301.
2023-01-30 08:29:20 -08:00
Vladimir Z Tomov a92e1600e3 3D perturbations. 2023-01-29 18:23:09 -08:00
Will Pazner f271e9d549 Allow construction of L2ProjectionGridTransfer::ForwardOperator even when the LOR space is small
Resolves issue #2429.
2023-01-28 16:28:11 -08:00
Tzanio Kolev 2f6eb8838f Merge pull request #3007 from mfem/bugfix/rwa/coarsen-L2-proj
Use local L2 projection for coarsening L2 spaces on non-conforming AMR meshes [bugfix/rwa/coarsen-L2-proj]
2023-01-27 14:30:06 -08:00
Sebastian Grimberg c7e701807a Fix memory leak in pyramid mesh refinement for MFEM_USE_MEMALLOC 2023-01-27 10:51:43 -08:00
Veselin Dobrev cbfbe68651 Update and sort the list of tests in tests/unit/CMakeLists.txt 2023-01-26 15:03:39 -08:00
Vladimir Z Tomov 8358ce040b minor 2023-01-25 10:16:23 -08:00
Vladimir Z Tomov b4934a836c Tool for checking magnitudes. 2023-01-24 19:58:27 -08:00
Sebastian Grimberg 446eda52c7 Minor style cleanup looking for bug in next 2023-01-24 18:13:03 -08:00
Vladimir Z Tomov 0a3f8bdea5 Reviewer suggestions. 2023-01-24 11:53:44 -08:00
Sebastian Grimberg b62e11cd34 Merge branch 'master' into sjg/dof-to-quad-dev 2023-01-24 11:47:32 -08:00
Vladimir Z Tomov 61613ae1a5 Merge branch 'master' into tmop-fix-301 2023-01-24 11:44:07 -08:00
Will Pazner 4c9157bd30 Improve Doxygen comments for Mesh::GetNodes and related functions 2023-01-23 15:53:09 -08:00
Will PaznerandAdrien Bernede 21c3272e3f Use short-circuit && instead of if statement
Co-authored-by: Adrien Bernede <51493078+adrienbernede@users.noreply.github.com>
2023-01-23 08:50:55 -08:00
Tzanio Kolev 62c65660c8 Merge branch 'master' into gmsh-pyr-dev 2023-01-21 14:56:14 -08:00
Vladimir Z Tomov 16d20ff17f balancing based on universal perturbed element. 2023-01-20 13:00:51 -08:00
Robert W. Anderson d3a98b2f01 fix for deprecated operator 2023-01-19 12:30:40 -08:00
Robert W. Anderson 83dfc2bb49 replace Set with SetRow for better performance 2023-01-19 10:47:28 -08:00
Ketan Mittal 058590bb39 fix logic for points near but outside domain boundary 2023-01-19 09:54:49 -08:00
Will Pazner 349ddfd954 Merge pull request #3410 from mfem/mesh-explorer-datacollection-dev
Adding DataCollection output to mesh-explorer [mesh-explorer-datacollection-dev]
2023-01-18 13:47:38 -08:00
Frank Wang 6ac4a86a15 update 2023-01-14 22:31:53 -08:00
Frank Wang d729b1b9bf cmake cuda using target 2023-01-14 22:20:24 -08:00
Mark L. Stowell 3bb1f7921b Merge branch 'master' into mesh-explorer-datacollection-dev 2023-01-14 09:14:44 -05:00
Will Pazner 715c242f44 Bug fix 2023-01-13 21:40:05 -08:00
Will Pazner 01fde3cecb Make behavior of ParaViewDataCollection::SetCompression consistent with its Doxygen comment 2023-01-13 18:41:34 -08:00
Veselin Dobrev 6992c1daac In the mesh-explorer miniapp, use high-order ParaView export when
the mesh is high-order.

Tweak doxygen comments in class ParaViewDataCollection.

Fix a bug in ParaViewDataCollection::SetCompression -- it still
needs work, I think, so I left a FIXME comment there too.
2023-01-13 15:55:12 -08:00
Vladimir Z Tomov 95c2b08358 Reports the final imbalance of the combinations. 2023-01-13 13:14:10 -08:00
Vladimir Z Tomov 8bce1ab633 Reviewer suggestions. 2023-01-13 10:54:29 -08:00
Veselin Dobrev 479c15a336 Merge branch 'master' into fix-hypreparvec-double-free 2023-01-13 09:13:14 -08:00
Veselin Dobrev f858ed978d Make some move-assignment operators safe for self-assignment
See: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c65-make-move-assignment-safe-for-self-assignment
2023-01-12 17:06:26 -08:00
Veselin Dobrev aa6b8c24bb Cleaner implementation of move assignment for HypreParVector using
the Vector move assignment.

Small simplification in the Vector move assignment operator.
2023-01-12 16:04:59 -08:00
Veselin Dobrev 0905576515 Merge pull request #3403 from mfem/algoim_fix
Algoim configuration fix
2023-01-12 11:45:55 -08:00
Veselin Dobrev e401a26051 In ParBilinearForm::TrueAddMult, handle correctly the case when
the pointer 'pfes' has not changed but the object it points to
has changed, e.g. due to mesh refinement.
2023-01-12 10:28:06 -08:00
Veselin Dobrev 253eac37d2 A few small tweaks and fixes 2023-01-12 07:08:04 -08:00
Vladimir Z Tomov f282c0c2c5 General balancing of N metrics, moved it into the combo metric class. 2023-01-11 13:46:46 -08:00
Will Pazner 1922df6fd2 Simplify 2023-01-11 12:57:55 -08:00
Mark L. Stowell 3538641b58 Merge branch 'master' into dof-doc-dev 2023-01-11 15:38:53 -05:00
Mark L. Stowell 22f4f06bae Merge branch 'master' into mesh-ptr-doc-dev 2023-01-11 15:37:40 -05:00
Stowell, Mark L 05cf37c8c1 Adding CHANGELOG entry 2023-01-11 15:24:27 -05:00
Stowell, Mark L b561b07712 Changing default ParaViewDataCollection cycle index to zero 2023-01-11 15:07:20 -05:00
Will Pazner a87373710d Use git_try_to_push in quartz-baseline 2023-01-11 11:14:52 -08:00
Will Pazner 4ea2860257 Move delay after unsuccessful git push 2023-01-11 11:10:22 -08:00
Will Pazner d8ccf16b87 Add delay between git push retries 2023-01-11 10:59:36 -08:00
Will Pazner 64ccaa8941 Bug fix 2023-01-11 10:56:33 -08:00
Will Pazner 3937340ec3 Bug fix 2023-01-11 10:52:35 -08:00
Will Pazner c87fdf7e8b Retry git push in autotest GitLab CI 2023-01-11 10:16:06 -08:00
Stowell, Mark L 11b1d2a597 Removing extraneous setting (thanks @pazner!) 2023-01-11 12:05:43 -05:00
Stowell, Mark L ff6fed8ee9 Increased error handling in DataCollection option 2023-01-11 12:05:09 -05:00
Stowell, Mark L 3b98856717 Adding DataCollection output to mesh-explorer 2023-01-11 11:48:39 -05:00
Tzanio Kolev a598682d68 Merge pull request #3271 from Biswa96/cmake-mingw-install
Fix DLL install directory in mingw
2023-01-11 08:01:45 -08:00
Stowell, Mark L 122061b0ed Switch to using MPI_Gather 2023-01-11 09:37:55 -05:00
Veselin Dobrev 3bc57ff6ba Merge pull request #3394 from mfem/coefficient-unneeded-using
Remove unneeded `using` statements in coefficient.hpp
2023-01-10 16:25:56 -08:00
Tzanio Kolev 5a6ef6e9e2 Merge branch 'master' into cmake-mingw-install 2023-01-10 14:26:28 -08:00
Veselin Dobrev a1849e45a3 Merge branch 'master' into coefficient-unneeded-using 2023-01-10 12:29:20 -08:00
Tzanio Kolev dec0dc4b4d Merge pull request #3402 from mfem/move-par-transfer-map
Add Array move constructor, make [Par]TransferMap movable
2023-01-10 12:12:07 -08:00
Sebastian Grimberg daa8b6b844 Add support for pyramid elements in Gmsh meshes 2023-01-10 10:43:23 -08:00
Sebastian Grimberg bc43f6fbf1 Merge branch 'master' into sjg/dof-to-quad-dev 2023-01-10 10:42:21 -08:00
Tzanio Kolev 2bf54066e9 Merge branch 'master' into move-par-transfer-map 2023-01-10 10:40:27 -08:00
Will Pazner 7aa756bebb Doxygen comments for IterativeSolver statistics 2023-01-10 10:28:54 -08:00
Mark L. Stowell 646715d66b Merge pull request #3075 from mfem/sjg/multigrid-mult-rhs
`Multigrid::Mult` with multiple RHS
2023-01-10 09:21:32 -05:00
Vladimir Z Tomov 84eb2bee18 minor 2023-01-09 22:47:37 -08:00
Boyan Lazarov 6c54854ddc Merge branch 'master' into algoim_fix 2023-01-09 21:48:53 -08:00
blaz c6922112d1 fix in findalgoim 2023-01-09 21:36:14 -08:00
Will Pazner 35cea24e21 Move face map logic from restriction.cpp into FiniteElement derived classes
Use inheritance instead of switch statement to dispatch
2023-01-09 20:46:51 -08:00
Will Pazner 9732e4dc6f Make SupportsDevice const
In both LinearFormIntegrator and LinearForm classes
2023-01-09 19:40:21 -08:00
Will Pazner 035301c212 Comment 2023-01-09 19:35:51 -08:00
Will Pazner f6efd6e56b Fix comment 2023-01-09 19:17:26 -08:00
Veselin Dobrev f64405b283 Merge branch 'master' into sjg/multigrid-mult-rhs 2023-01-09 12:16:28 -08:00
Vladimir Z Tomov d4eeee31b5 IterativeSolver::GetInitialNorm() and GetFinalRelNorm(). 2023-01-09 11:51:57 -08:00
Will Pazner 2ab6da3489 Remove unneeded static_cast 2023-01-08 20:07:36 -08:00
Will Pazner c5c7acd5cf Make TransferMap implicitly movable 2023-01-08 20:07:36 -08:00
Will Pazner eaaa541a16 Make ParTransferMap implicitly movable 2023-01-08 20:07:36 -08:00
Will Pazner 40a0fac667 Add move constructor to Array<T> 2023-01-08 20:07:34 -08:00
BL 4426e33e7e initial agloim fix 2023-01-08 17:50:34 -08:00
Will Pazner 8754571ef0 Infer root mesh type in GetRootParent 2023-01-08 17:25:39 -08:00
Will Pazner 896922fbe4 Update CHANGELOG 2023-01-08 17:14:57 -08:00
Tzanio Kolev f00eb000ed Merge pull request #3387 from mfem/submesh-surface-bdr-fix
Bugfix for surface submesh boundary elements from volume
2023-01-08 14:48:58 -08:00
Veselin Dobrev 4882231889 Merge branch 'master' into mfem-4.5.2-dev 2023-01-06 09:19:34 -08:00
Will Pazner cc79e6a1b9 Remove another using statement in coefficient.hpp 2023-01-05 14:59:53 -08:00
Tzanio Kolev 745504e4ab Merge pull request #3320 from mfem/FaceQuadratureSpace-bug-fix
Bug fix for non-conforming meshes.
2023-01-05 14:08:05 -08:00
Will Pazner f726606b96 Add GetFaceNormal3D to help manage 3D hexahedron face cases 2023-01-05 08:55:45 -08:00
Will Pazner 02fa406807 Refactor FillFaceMap and add explanatory comment 2023-01-05 08:55:20 -08:00
Will Pazner 1e34a98337 ND face restriction 2023-01-05 08:55:19 -08:00
Will Pazner bbd28f5f45 VectorFEBoundaryFluxLFIntegrator kernel in 3D 2023-01-04 18:49:04 -08:00
Will Pazner f413481bff RT face restriction in 3D 2023-01-04 18:49:04 -08:00
Will Pazner 61a922a812 Fix Mesh::FaceInformation output with operator<<
Newline was missing after face topology.

Also use '\n' instead of std::endl for all but last newline since there is no
reason to flush the buffer before then.
2023-01-04 18:48:46 -08:00
Will Pazner 25ba954475 Test device kernel for VectorFEBoundaryFluxLFIntegrator in 2D 2023-01-04 18:48:46 -08:00
Will Pazner a9829da2cb Add device kernel for VectorFEBoundaryFluxLFIntegrator 2023-01-04 18:48:46 -08:00
Will Pazner 1b2ab9253b Add test case for 2D RT face restriction 2023-01-04 18:48:44 -08:00
Will Pazner 4e5b88054d Remove unneeded using statements in coefficient.hpp 2023-01-04 18:44:41 -08:00
Will Pazner 067f571dc4 Support 2D RT elements in H1_ND_RT_FaceRestriction 2023-01-04 14:18:27 -08:00
Will Pazner 452cf127c6 Rename H1FaceRestriction to H1_ND_RT_FaceRestriction
The same class should be able to be used for H1, ND, and RT spaces
2023-01-04 14:18:27 -08:00
Will Pazner 328df07f5d Refactor GetFaceDofs to use offset and strides 2023-01-04 14:18:27 -08:00
Veselin Dobrev 576401f779 Merge pull request #3389 from mfem/fix-gnutls-shadow
Fix some shadow warnings
2023-01-03 19:43:45 -08:00
Vladimir Z Tomov bdb6e5a046 wip auto gamma in composite metrics 2023-01-03 14:06:21 -08:00
Veselin Dobrev 12dab69fe7 Merge branch 'master' into fix-gnutls-shadow 2023-01-03 12:42:21 -08:00
Will Pazner b210fb5398 Merge pull request #3362 from mfem/bugfix/kweiss/quad-face-ctor
Adds a QuadratureFunction constructor from external data
2023-01-03 12:33:22 -08:00
Veselin Dobrev f327a1f2fe Merge branch 'master' into fix-gnutls-shadow 2023-01-03 12:25:21 -08:00
Tzanio Kolev e81e3f7a55 Merge branch 'master' into bugfix/rwa/coarsen-L2-proj 2023-01-03 11:36:51 -08:00
Will Pazner 2d04785d2b Update CHANGELOG 2023-01-03 11:33:13 -08:00
Will Pazner 0364cab0f9 Merge remote-tracking branch 'origin/master' into FaceQuadratureSpace-bug-fix 2023-01-03 11:31:26 -08:00
Will Pazner b35eb5acd2 Merge remote-tracking branch 'origin/master' into bugfix/kweiss/quad-face-ctor 2023-01-03 11:17:25 -08:00
Tzanio Kolev eeece17619 Merge pull request #3293 from mfem/artv3/raja-launch-updates
RAJA launch API updates
2023-01-03 11:16:50 -08:00
Will Pazner 2905874bc0 Fix shadow warnings in ND and RT with MFEM_THREAD_SAFE 2022-12-29 14:53:35 -08:00
Will Pazner a8730f78fd Fix shadow warning when GNUTLS is enabled 2022-12-29 14:47:36 -08:00
Tzanio Kolev 70bcb774f2 Merge branch 'master' into bugfix/kweiss/quad-face-ctor 2022-12-28 11:06:34 -08:00
Tzanio Kolev 2b3b0ea1e7 Merge branch 'master' into FaceQuadratureSpace-bug-fix 2022-12-28 11:06:18 -08:00
Tzanio Kolev e53afac528 Merge branch 'master' into mesh-reflect 2022-12-28 11:05:15 -08:00
Tzanio Kolev fb21cca26e Merge branch 'master' into bugfix/rwa/coarsen-L2-proj 2022-12-28 11:03:05 -08:00
Veselin Dobrev f8f20ba147 Merge branch 'master' into mfem-4.5.2-dev 2022-12-28 10:41:48 -08:00
Tzanio Kolev f93da2f1b8 Merge branch 'master' into submesh-surface-bdr-fix 2022-12-28 10:17:41 -08:00
Tzanio Kolev e90e6e2b75 Merge pull request #3385 from mfem/gh-actions-homebrew-fix
Fix GitHub actions failure on MacOS
2022-12-28 10:17:17 -08:00
Veselin Dobrevand@tzanio fb3d72ce89 Add reviewer suggested comments
Co-authored-by: @tzanio
2022-12-28 10:08:50 -08:00
Will Pazner b9efa256b4 Add comment that QuadratureFunction constructor takes a host pointer 2022-12-27 15:08:03 -08:00
Tzanio Kolev 2e89831b1e Merge branch 'master' into gh-actions-homebrew-fix 2022-12-27 14:33:26 -08:00
Julian Andrej 3258e39120 bugfix for surface submesh boundary elements from volume 2022-12-27 13:49:31 -08:00
Veselin Dobrev ac1f88ee74 Merge pull request #3369 from mfem/feature/kweiss/caliper-dependencies
Adds support for optional caliper dependencies to build system
2022-12-25 19:21:05 -08:00
Veselin Dobrev 652e2ba386 GitHub actions: test MacOS fix 2022-12-24 16:15:52 -08:00
Veselin Dobrev 4756a9c405 Fix GitHub actions failure on MacOS 2022-12-24 15:39:40 -08:00
Veselin Dobrev b657fd4d74 Initial changes for the v4.5.2 release 2022-12-24 15:06:13 -08:00
Tzanio KolevandYohann 72f17709e3 Update mesh/mesh.hpp
Co-authored-by: Yohann <dudouit1@llnl.gov>
2022-12-22 13:28:11 -08:00
Tzanio KolevandYohann 0aeb9b49b0 Update mesh/mesh.hpp
Co-authored-by: Yohann <dudouit1@llnl.gov>
2022-12-22 13:28:03 -08:00
Tzanio Kolev adf7a40c0a Merge branch 'master' into FaceQuadratureSpace-bug-fix 2022-12-22 13:25:39 -08:00
Kenneth Weiss 46f64bf75f Merge branch 'master' into feature/kweiss/caliper-dependencies 2022-12-21 10:58:53 -08:00
Kenneth Weiss 326a4177b4 Adds lib64 library paths for caliper, adiak and gotcha
Per PR suggestion.
2022-12-21 10:58:25 -08:00
Kenneth Weiss fcb9f6b4c2 Use find_package for adiak and gotcha dependencies in CMake build system
Per PR suggestion from Veselin.
2022-12-21 10:29:46 -08:00
Tzanio Kolev e16e2a916f Merge pull request #3373 from mfem/delete_noret
Modify Delete_ to not return a value
2022-12-19 15:24:44 -08:00
Tzanio Kolev c4f16f478b Merge pull request #3372 from mfem/enzyme_alloc
Add Enzyme info for allocation mechanisms
2022-12-19 15:23:33 -08:00
Tzanio Kolev bf8ec1a218 Merge pull request #3334 from mfem/bugfix/submesh-bdr-l2
Adding SubMesh support for discontinuous fields with vdim > 1
2022-12-17 19:17:24 -08:00
William S. Moses 973b42c57a Simplify 2022-12-16 17:19:02 -05:00
Veselin Dobrev 0ee0e55a92 Fix the Caliper tests defined in CMake 2022-12-15 18:33:42 -08:00
Tzanio Kolev 1f16c7a309 make style 2022-12-15 16:39:10 -08:00
William S. Moses ef42d3994a Add Enzyme info for allocation mechanisms 2022-12-15 18:07:34 -05:00
William S. Moses 0f75a95372 Modifiy Delete_ to not return a value 2022-12-15 18:06:16 -05:00
Dylan Copeland 91946fa48c Formatting 2022-12-15 12:22:07 -08:00
Dylan Copeland eadf460df5 Revert SEQ_MINIAPPS. 2022-12-15 11:21:07 -08:00
Dylan Copeland 726ffb93b0 CHANGELOG and a bug fix. 2022-12-15 10:56:26 -08:00
Sebastian Grimberg 7548778722 Rename Mult -> ArrayMult and similar to avoid partially overridden warnings 2022-12-14 18:14:38 -08:00
Dylan Copeland cffcc25cf1 Made GridFunction::GetVectorGradientHat public. Updated gitignore. 2022-12-14 18:13:55 -08:00
Ketan Mittal cb9d36b293 fix dist_solver include 2022-12-14 14:45:26 -08:00
Ketan Mittal 23f45ab9df remove trimming option 2022-12-14 14:35:06 -08:00
Kenneth Weiss 09331236d2 Adds support for optional caliper dependencies in cmake build system
If a user's caliper is built against `adiak` or `gotcha`, they can supply
`ADIAK_DIR` and/or `GOTCHA_DIR` config variables.
2022-12-14 12:18:52 -08:00
Kenneth Weiss be9f6a0d07 Adds support for optional caliper dependencies in make build system
If a user's caliper is built against `adiak` or `gotcha`, they can supply
`ADIAK_DIR` and/or `GOTCHA_DIR` config variables.
2022-12-14 12:18:42 -08:00
Ketan Mittal e2e9bd0061 update fitting miniapp 2022-12-14 10:38:20 -08:00
Ketan Mittal 9fe24667c4 fit CMake for shifting dist_solver 2022-12-14 09:46:49 -08:00
Ketan Mittal 1525caaee9 minor clean up and make style 2022-12-14 09:43:45 -08:00
Ketan Mittal 445ffbe037 merge with master, resolve conflict, and make style 2022-12-14 09:27:02 -08:00
Dylan Copeland 2c1b05d448 Fixing default options. 2022-12-13 20:28:44 -08:00
Dylan Copeland 1d758dbc66 Fixing documentation. 2022-12-13 19:46:57 -08:00
Dylan Copeland 792184cf2c Fixing shadowed variable. 2022-12-13 19:33:14 -08:00
Dylan Copeland e4b71fde61 Moved FindFaceNeighbors to Mesh class. Added documentation. 2022-12-13 19:22:49 -08:00
Veselin Dobrev 4952b82c48 Restore CHANGELOG entries (deleted by mistake?)
Use C++14 when UMPIRE is enabled.

Fix and enhance FindUMPIRE.cmake.
2022-12-13 18:43:59 -08:00
Arturo Vargas e3b05bea8e update raja notes 2022-12-13 15:16:36 -08:00
Tzanio Kolev 831cd98243 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-12-13 11:15:25 -08:00
Tom Stitt a1e4b59ed9 fix double-free of HypreParVector device memory after move when mfem is built with hypre+gpu; 2 Memories (different host pointer, same device pointer) will be registered, one will be freed when the object is destroyed and MemoryManager::Destroy will try to free the other. use Delete instead of Reset to make sure only one Memory is registered 2022-12-13 08:13:37 -08:00
Dylan Copeland 5982c7624d Adding missing include. 2022-12-12 21:35:59 -08:00
Kenneth Weiss d8a223bd56 Adds a QuadratureFunction constructor over an external data pointer
This was present in mfem@4.4, but missing in mfem@4.5.
The following call: `QuadratureFunction(qspace, qf_data, vdim);`
is equivalent to: `QuadratureFunction qf; qf.SetSpace(qspace, qf_data, vdim);`
2022-12-12 19:17:32 -08:00
Dylan Copeland 8462d81c7c Initial implementation of new reflector miniapp. 2022-12-12 16:22:21 -08:00
Stowell, Mark L 30fffb8cc6 Merge remote-tracking branch 'origin/master' into bugfix/submesh-bdr-l2 2022-12-12 14:46:43 -08:00
Stowell, Mark L b6c88d5b24 Hard coding dimension in unit test to avoid errors in Windows build 2022-12-12 11:59:46 -08:00
Tzanio Kolev 486c43a197 Merge branch 'master' into artv3/raja-launch-updates 2022-12-12 10:50:36 -08:00
Tzanio Kolev e6ba86462c Merge pull request #3349 from mfem/l2-integral-support
Adding support for map type INTEGRAL in GridFunction::GetNodalValues
2022-12-12 08:12:50 -08:00
Tzanio Kolev 26444a366d Merge pull request #3348 from mfem/cmake-strumpack-metis-fix
Fix CMake TPLs ordering issue
2022-12-12 08:12:24 -08:00
Tzanio Kolev 51a5982eb6 Merge branch 'master' into artv3/raja-launch-updates 2022-12-11 16:07:13 -08:00
Tzanio Kolev c5f51d0f12 Merge branch 'master' into bugfix/submesh-bdr-l2 2022-12-11 16:04:33 -08:00
Tzanio Kolev 59c2056226 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-12-11 16:03:22 -08:00
Tzanio Kolev 05ed8c68cc Merge branch 'master' into cmake-strumpack-metis-fix 2022-12-11 16:03:10 -08:00
Tzanio Kolev 6f61468a93 Merge branch 'master' into l2-integral-support 2022-12-11 16:03:00 -08:00
Tzanio Kolev 881534e227 Merge pull request #3322 from mfem/tmop_exp_limiter
Exponential limiter integration [tmop_exp_limiter]
2022-12-11 16:02:15 -08:00
Tzanio Kolev 3155b5c7dc Merge pull request #3347 from mfem/fix-hip-compile
Fix hip compilation
2022-12-11 16:00:48 -08:00
Tzanio Kolev a2f529621c Merge pull request #3132 from mfem/ncmesh-pyramid-dev
NCMesh pyramid dev
2022-12-11 15:19:02 -08:00
Tzanio Kolev 3578622e42 Merge branch 'master' into ncmesh-pyramid-dev 2022-12-11 15:18:03 -08:00
Tzanio Kolev 371e625677 Updated CHANGELOG, other minor edits 2022-12-11 15:13:42 -08:00
Veselin Dobrev 9a7f764ac7 In the CMake build system, fixed broken build when NetCDF is
enabled and left some notes about future improvements.
2022-12-09 16:25:32 -08:00
Stowell, Mark L 58021339c0 Merge remote-tracking branch 'origin/master' into l2-integral-support
# Conflicts:
#	fem/gridfunc.cpp
2022-12-09 13:20:58 -08:00
Veselin Dobrev 640b86a094 Remove CMake version checks for versions older than the new
minimum required version, 3.8.

In defaults.mk, use C++14 when STRUMPACK is enabled, similar to CMake.
2022-12-09 10:52:45 -08:00
Stowell, Mark L 6ace118601 Merge remote-tracking branch 'origin/master' into sjg/multigrid-mult-rhs 2022-12-09 10:37:37 -08:00
Dylan Copeland bde55a3686 Merge branch 'master' into nurbs-attr 2022-12-09 09:59:43 -08:00
Tzanio Kolev 449b3e3393 Merge branch 'master' into cmake-strumpack-metis-fix 2022-12-09 09:04:35 -08:00
Tzanio Kolev 7d2eddd603 Merge branch 'master' into fix-hip-compile 2022-12-09 09:00:45 -08:00
Tzanio Kolev 975c0f2eab Merge pull request #3343 from mfem/geom-factors-dox-update
Document that Get(Face)GeometricFactors might return stale data
2022-12-09 08:57:55 -08:00
Tzanio Kolev a3aa202f36 Merge pull request #3194 from mfem/vector-remove-implicit-conversion
Deprecate implicit conversion from `Vector` to `double *`
2022-12-09 08:54:29 -08:00
Tzanio Kolev cc8e2de479 Merge branch 'master' into cmake-strumpack-metis-fix 2022-12-09 08:45:50 -08:00
Sebastian Grimberg e2e1d6428e Make suggested changes for CMake builds: Bumps CMake version to 3.8 for correct CMAKE_CXX_STANDARD handling, corrects use of OpenMP flags for test builds. 2022-12-08 14:21:47 -08:00
Stowell, Mark L 44b3ed9b21 Merge remote-tracking branch 'origin/master' into bugfix/submesh-bdr-l2 2022-12-08 12:22:44 -08:00
Veselin Dobrev 7f7dc51c70 Merge branch 'master' into l2-integral-support 2022-12-08 10:29:59 -08:00
Stowell, Mark L 81e38c3f54 Removing soon to be deprecated casts 2022-12-08 09:42:33 -08:00
Veselin Dobrev 7799d447a3 Merge branch 'master' into artv3/raja-launch-updates 2022-12-08 06:17:36 -08:00
Veselin Dobrev 892352e9cd In FindRAJA.cmake, remove a workaround that is no longer needed
with RAJA v2022.10.3.

In the CMake build system, disable the 'hooke' miniapp when
HIP is enabled to avoid AMD HIP compiler crash (already done
in the GNU make build system).
2022-12-08 06:07:32 -08:00
Vladimir Z Tomov 6e7429a889 minor 2022-12-07 23:13:17 -08:00
Vladimir Z Tomov 949db3ccdb Corresponding edits for PMesh. 2022-12-07 23:09:31 -08:00
Vladimir Z Tomov cb1cf8dfe7 Improved / unified documentation for Mesh::Get*Transformation. 2022-12-07 23:04:09 -08:00
Tzanio Kolev 4cca442814 Merge branch 'master' into FaceQuadratureSpace-bug-fix 2022-12-07 15:08:24 -08:00
Tzanio Kolev 74700f5bc8 Merge branch 'master' into vector-remove-implicit-conversion 2022-12-07 15:06:58 -08:00
Tzanio Kolev 5b173dc044 Merge pull request #3352 from mfem/vector-random-seed-removal
Removing global random seed in vector
2022-12-07 15:05:49 -08:00
Arturo Vargas 941f930bae Merge branch 'master' into artv3/raja-launch-updates 2022-12-07 13:21:40 -08:00
Stowell, Mark L b04ce9e375 Removing GetRangeType etc from derived FE collection classes 2022-12-07 11:24:31 -08:00
Stowell, Mark L b43cf3b1fe Implementing GetRangeType etc in FiniteElementCollection base class 2022-12-07 11:24:01 -08:00
Ketan Mittal 77f958695b some optimizations and fix node count in serial/parallel for weight of surface fitting term 2022-12-07 11:10:42 -08:00
Stowell, Mark L 0b773a9f23 Adding FiniteElementCollection::FiniteElementForDim 2022-12-07 10:31:15 -08:00
Vladimir Z Tomov ae2f95d946 style. 2022-12-07 09:35:25 -08:00
Vladimir Z Tomov 4a4e135c1a Merge branch 'master' into tmop_exp_limiter 2022-12-07 09:28:50 -08:00
Sebastian Grimberg 496b0750ca Fix clang compiler warnings 2022-12-07 00:12:41 -08:00
Sebastian Grimberg e11b0cd409 Merge branch 'master' into sjg/dof-to-quad-dev 2022-12-06 20:59:55 -08:00
Sebastian Grimberg 1f6b128837 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-12-06 20:59:48 -08:00
Tzanio Kolev a6c5b3b1e8 Merge branch 'master' into FaceQuadratureSpace-bug-fix 2022-12-06 17:41:52 -08:00
Veselin Dobrev 575547df7d Merge branch 'master' into cmake-strumpack-metis-fix 2022-12-06 17:04:23 -08:00
Veselin Dobrev 40b577d192 Merge pull request #3294 from mfem/doxygen-subdirs
Include several subdirectories in Doxygen docs
2022-12-06 16:40:28 -08:00
Will Pazner 41a2ada156 Bug fix 2022-12-06 14:56:11 -08:00
Will Pazner 1168f30492 Merge pull request #3355 from mfem/deprecate-get-face-geometry-type
Deprecate GetFaceGeometryType and GetFaceBaseGeometry
2022-12-06 14:06:27 -08:00
Will Pazner 50c238b1cf Add Doxygen comments to Mesh::GetFaceGeometry 2022-12-06 14:05:38 -08:00
Will Pazner 353d9b646e Move Mesh::GetFaceGeometryType implementation to header 2022-12-06 12:41:43 -08:00
Will Pazner 26073f789d Deprecate GetFaceGeometryType and GetFaceBaseGeometry
Now both of these functions call GetFaceGeometry.

GetFaceGeometry has been updated to handle ghost faces.
2022-12-06 12:21:12 -08:00
Tzanio Kolev c39459387a Merge branch 'master' into FaceQuadratureSpace-bug-fix 2022-12-06 12:03:20 -08:00
Will Pazner dcd8b0907f Merge remote-tracking branch 'origin/master' into vector-remove-implicit-conversion
# Conflicts:
#	CHANGELOG
#	fem/fe/fe_nd.cpp
#	fem/fe/fe_rt.cpp
2022-12-06 11:54:32 -08:00
Will Pazner 9e1c1ebc29 Merge pull request #3333 from mfem/vector-remove-implicit-conversion-tweaks
Various simplifications, tweaks, and fixes for PR #3194
2022-12-06 11:51:40 -08:00
Tzanio Kolev 615d13658e Merge branch 'master' into doxygen-subdirs 2022-12-06 11:32:02 -08:00
Tzanio Kolev 5ed071c026 Merge branch 'master' into geom-factors-dox-update 2022-12-06 11:24:07 -08:00
Tzanio Kolev db03d1e390 Merge branch 'master' into vector-random-seed-removal 2022-12-06 11:23:43 -08:00
Tzanio Kolev 7a24255cdb Merge branch 'master' into ncmesh-pyramid-dev 2022-12-06 10:28:44 -08:00
Tzanio Kolev f23b8135f5 Merge pull request #3287 from mfem/superlu-strumpack-cuda-fix
SuperLU_DIST and STRUMPACK with HYPRE+CUDA
2022-12-06 10:25:25 -08:00
Veselin Dobrev 84512a4733 [SQUASH MERGE] Fix GitHub CI failures with the new ubuntu-latest (#3351)
* Disable the test 'ubuntu-latest-cmake-opt-par-int32' which is
failing with 'ubuntu-latest' == 'ubuntu-22.04' to see if the
other tests pass.

* GH actions: update some action versions to fix warnings plus
some other tweaks

* GH actions: update more action versions to fix warnings

* GH actions: testing

* GH actions: testing

* GH actions: testing CMake fix

* GH actions: testing Doxygen fix
2022-12-06 10:20:12 -08:00
Tzanio Kolev 0c8a5d6530 Merge pull request #3353 from mfem/ceed-fix
Use renamed functions when libCEED version >= 0.10.2
2022-12-06 10:19:17 -08:00
Michael C Tyler Stees c1a78025ff Added missing parenthesis in limiting function and second derivative. 2022-12-06 09:06:18 -08:00
Veselin Dobrev 0eedd780f2 Merge branch 'master' into superlu-strumpack-cuda-fix 2022-12-05 15:24:12 -08:00
Aaron Fisher 21b7787aef Merge branch 'master' into ncmesh-pyramid-dev 2022-12-05 14:59:41 -08:00
Veselin Dobrev 44380ab02a Add calls to Mesh::NodesUpdated in both versions of Mesh::Transform 2022-12-05 02:30:45 -08:00
Veselin DobrevandsamuelpmishLLNL 8cdd2bb0c8 Doxygen tweak in Mesh::NodesUpdated
Co-authored-by: samuelpmishLLNL <61714427+samuelpmishLLNL@users.noreply.github.com>
2022-12-05 02:29:51 -08:00
Vladimir Z Tomov 8b5aa791e4 Added unit test for the expo limiting (failing, Mike will fix it). 2022-12-04 17:55:31 -08:00
Tzanio Kolev 70afda9c06 Merge pull request #3321 from mfem/rm-mesquite
Removed Mesquite support
2022-12-04 14:55:01 -08:00
Aaron Fisher 8bc44a8087 make style 2022-12-02 14:54:17 -08:00
Aaron Fisher ae93ec6887 Removed non-working anisotropic refinement of pyramids code. 2022-12-02 14:46:46 -08:00
Will Pazner caf638a3d3 Use renamed functions when libCEED version >= 0.10.2 2022-12-02 12:47:09 -08:00
Socratis Petrides aaec27a9ea removing global random seed in vector 2022-12-02 11:19:57 -08:00
Tzanio KolevandsamuelpmishLLNL 83dbeae7ab Update mesh/mesh.hpp
Co-authored-by: samuelpmishLLNL <61714427+samuelpmishLLNL@users.noreply.github.com>
2022-12-01 11:23:42 -08:00
Tzanio Kolev 3cd881e8b6 Merge branch 'master' into rm-mesquite 2022-12-01 11:20:50 -08:00
Veselin Dobrev 5b9dd0b42f Update doxygen docs based on reviewer feedback 2022-11-30 22:46:06 -08:00
Veselin Dobrevand@sebastiangrimberg 6947b3a639 In CMakeLists.txt, when removing duplicates from TPL_LIBRARIES,
keep the last occurrence instead of the first.

In the CMake function mfem_find_package, make sure the C++ standard
is used when calling check_cxx_source_compiles.

Fix a warning in STRUMPACKSolver::Mult.

Co-authored-by: @sebastiangrimberg
2022-11-30 18:34:12 -08:00
Stowell, Mark L 41a7679f19 Merge remote-tracking branch 'origin/master' into l2-integral-support 2022-11-30 10:46:25 -08:00
Stowell, Mark L 2b700c87d9 Improving doxygen comments 2022-11-30 10:33:45 -08:00
Stowell, Mark L 0d2f94be20 Exposing FiniteElement characteristics through FE_Collection 2022-11-30 10:18:19 -08:00
Michael C Tyler Stees 9c19c54114 Remove extra new line 2022-11-30 09:07:51 -08:00
Tzanio Kolev 8591e38a71 Merge pull request #3313 from mfem/sjg/dof-trans-cleanup
Fix minor copy-paste errors in DofTransformation
2022-11-30 08:02:32 -08:00
Tzanio Kolev acd46692a0 Merge pull request #3329 from mfem/bugfix/visit-dc-rfind
Bug fix for VisItDataCollection name parsing
2022-11-30 08:02:18 -08:00
Tzanio Kolev ca6588da7d Merge pull request #3305 from mfem/cmake-cuda-rdc-fix
Fix for CMake linking with TPLs built with CUDA relocatable device code (RDC)
2022-11-30 08:01:37 -08:00
Tzanio Kolev c60295e9c0 Merge pull request #3306 from mfem/cray-hip-gmake-support
Fix the building of the unit tests when using Cray HIP compilers
2022-11-30 08:01:04 -08:00
Stowell, Mark L a0bd50266c Adding support for map type INTEGRAL in GridFunction::GetNodalValues 2022-11-29 16:28:02 -08:00
Robert W. Anderson 5f74c1fa31 remove obsolete comment 2022-11-29 11:09:49 -08:00
Robert W. Anderson 5bb90b84e3 remove temp interactive testing files 2022-11-29 10:58:13 -08:00
Veselin Dobrev c2133437dd In CMakeLists.txt, move STRUMPACK before METIS in the list MFEM_TPLS 2022-11-28 21:13:55 -08:00
Tom Stitt 0c42f3751d fixes "no known conversion from 'int **' to 'void **'" compilation error during hip compilation 2022-11-28 16:49:22 -08:00
Tzanio Kolev 7830ee7877 Merge branch 'master' into bugfix/visit-dc-rfind 2022-11-28 14:32:19 -08:00
Tzanio Kolev 2196e61f4e Merge branch 'master' into rm-mesquite 2022-11-27 18:06:24 -08:00
Tzanio Kolev 42e979ebb6 Merge pull request #3337 from mfem/GradToCurl2D-fix
GradToCurl fix for vector and scalar valued curl.
2022-11-27 18:03:39 -08:00
Tzanio Kolev 5e0ffd933b Merge pull request #3268 from mfem/add-dist-solver
Fast distance solver
2022-11-27 18:02:56 -08:00
Tzanio Kolev 2d9850c642 Merge pull request #3278 from mfem/sjg/gslib-fix
Resolve compiler warnings in gslib.cpp
2022-11-27 18:01:51 -08:00
Tzanio Kolev 1301ed24fc Merge pull request #3290 from mfem/hipsparse-include-fix
Fix a warning with HIP >= 5.2.0
2022-11-27 18:01:21 -08:00
Veselin Dobrev 9b29c316e3 Update the doxygen docs of Mesh::GetGeometricFactors and
Mesh::GetFaceGeometricFactors to explicitly state that the
returned pointer to internal object may be invalidated by
some mesh operations.

Other small doxygen tweaks.
2022-11-26 19:46:03 -08:00
Vladimir Z Tomov cbdf014edf Reviewer comments. 2022-11-22 23:38:51 -08:00
Stowell, Mark L 7a277b6606 CHANGELOG entry 2022-11-22 14:03:04 -08:00
Stowell, Mark L 8976fe0284 Marking VisItDataCollection methods with "override" where appropriate 2022-11-22 13:49:08 -08:00
Arturo Vargas 41faa5428f add CAMP_LIB flag 2022-11-22 09:30:52 -08:00
Tzanio Kolev 1e17003af3 Merge pull request #3315 from mfem/fix-vismesh
Fixed `common::VisualizeMesh`
2022-11-22 08:57:46 -08:00
Socratis Petrides 818041228c fix MixedCurlIntegrator 2022-11-21 20:34:13 -08:00
Socratis Petrides cb5d670e01 revert changes in GradToCurl. Add new method for Vector-valued GradToCurl in 2D 2022-11-21 17:04:13 -08:00
Veselin Dobrev d7b1fb4880 CMake CUDA tweak 2022-11-20 22:14:28 -08:00
Veselin Dobrev 5578279386 In defaults.cmake, remove lines that are no longer needed 2022-11-20 20:20:27 -08:00
Veselin Dobrev 0a133cc3fa Update FindRAJA.cmake to use the exported RAJA CMake configs 2022-11-20 19:29:39 -08:00
Stowell, Mark L 8ef4bef094 Adding SubMesh support for discontinuous fields with vdim > 1 2022-11-20 14:12:58 -08:00
Veselin Dobrev 972a4c227e Various simplifications, tweaks, and fixes 2022-11-19 14:18:43 -08:00
Stowell, Mark L 6730ffeb6f Setting pad_digits_rank even in serial 2022-11-18 09:39:31 -08:00
Stowell, Mark L e33dd78845 Fixing pad digits calls in unit test 2022-11-17 15:58:41 -08:00
Stowell, Mark L 7b5b871eea Adding pad digits options to other DataCollection related tools 2022-11-17 15:25:47 -08:00
Stowell, Mark L d7b2c4a7b2 Declaring SetPadDigits* as virtual 2022-11-17 15:25:09 -08:00
Stowell, Mark L 77a745bd28 Modifying get-values to support arbitrary cycle number padding 2022-11-17 10:54:20 -08:00
Arturo Vargas 44f1c544fb Will need RAJA >= 2022.10.3 2022-11-17 10:20:53 -08:00
Arturo Vargas 67d95f4032 add -lcamp 2022-11-17 10:19:43 -08:00
Will Pazner 3027566eb5 Merge pull request #3327 from mfem/vector-distance-hostread
Add const Vector& overload for Distance
2022-11-16 10:45:47 -08:00
Stowell, Mark L a58aafb743 Search string from the end to extract data collection name 2022-11-16 10:35:28 -08:00
Tzanio Kolev b09cc38df9 Merge pull request #3288 from mfem/hiop-nvcc-warnings-fix
Fix nvcc warnings when HiOp integration is enabled
2022-11-16 10:27:42 -08:00
Will Pazner facf28e24c Add const Vector& overload for Distance 2022-11-16 09:52:23 -08:00
Vladimir Z Tomov 5913021d50 Removed dummy GridFunctions. 2022-11-15 23:59:41 -08:00
Tzanio Kolev 3fca8798f6 Merge pull request #3304 from mfem/fix-clang-warnings
Fix some clang 14 warnings
2022-11-15 16:20:41 -08:00
Tzanio Kolev 6a71b32f04 Merge pull request #3317 from mfem/hip-miniapps-build-fix
Fix two issues affecting the miniapps building with HIP enabled
2022-11-15 16:19:57 -08:00
Dylan Copeland 11abc26e00 Setting patch_to_el after setting el_to_patch. 2022-11-14 21:55:22 -08:00
Dylan Copeland 707befe264 Documenting some new functions. 2022-11-14 21:38:39 -08:00
Will Pazner 8ee9011b29 Merge pull request #3172 from mfem/yohann/sort+test
Add sorting of sparse matrix when assembled on device.
2022-11-14 09:37:30 -08:00
Michael C Tyler Stees 86530f1d5b Adding exponential limiter option in fem/tmop.hpp and partial assembly support. 2022-11-14 07:44:37 -08:00
Will Pazner b3a57feaae Use Device::IsEnabled and add explanation in ex1 and ex1p 2022-11-13 16:02:32 -08:00
Will Pazner fee80f9280 Revise comment for BilinearForm::EnableSparseMatrixSorting 2022-11-13 16:02:01 -08:00
Tzanio Kolev 49c8ff3a3b Small edit in CHANGELOG 2022-11-13 12:00:26 -08:00
Vladimir Z Tomov 2c7ecb75e2 Removed Mesquite. 2022-11-10 19:51:50 -08:00
Arturo Vargas 1d41202805 Bug fix for non-conforming meshes. 2022-11-10 17:34:10 -08:00
Robert W. Anderson 7797741733 make style 2022-11-10 09:59:03 -08:00
Veselin Dobrev 19105ba702 Fix two issues affecting the miniapps building with HIP enabled:
- the 'hooke' miniapp crashes the AMD HIP compiler, so for now
  we disabled it when building with HIP
- the building of the shared 'mfem-common' library was broken since
  the XLINKER make variable was left undefined with HIP enabled.
2022-11-10 00:15:09 -08:00
Robert W. Anderson 1030d3740f deactivate parallel stress test until exact projection is ready for positive basis 2022-11-09 21:40:47 -08:00
Robert W. Anderson 700a4aca47 revert projection to monotone version 2022-11-09 21:39:55 -08:00
Robert W. Anderson 1504729937 Merge branch 'master' into bugfix/rwa/coarsen-L2-proj 2022-11-09 19:23:44 -08:00
Dylan Copeland ae50320b05 Editing a comment. 2022-11-09 12:18:33 -08:00
Dylan Copeland 2366754d19 Adding functions to set and get attributes on NURBS patches. 2022-11-09 12:06:19 -08:00
Tzanio Kolev 37b61aab9d Merge pull request #3303 from mfem/disconnected-mesh-fix
Fix partitioning error for disconnected meshes with METIS 5
2022-11-09 07:45:03 -08:00
Vladimir Z Tomov 725c2db36a Fixed common::VisualizeMesh(). 2022-11-08 23:29:49 -08:00
Sebastian Grimberg 3ac57bb15a Add missing tests for CMake builds 2022-11-08 21:27:04 -08:00
Sebastian Grimberg 5e2f3f9490 Refactor GetDofToQuad to support H(curl) and H(div) for non-tensor elements 2022-11-08 21:26:11 -08:00
Sebastian Grimberg aed2054149 Add some override specifiers for compile-time checking 2022-11-08 12:45:17 -08:00
Sebastian Grimberg 24ffcca5cd Merge branch 'master' into sjg/multigrid-mult-rhs 2022-11-08 12:44:50 -08:00
Sebastian Grimberg 646d73b980 Fix minor copy-paste errors in DofTransformation 2022-11-08 12:35:25 -08:00
Tzanio Kolev 55ccded864 Merge pull request #3307 from mfem/petsc-warning-fix
Fix PETSc 3.18.0 deprecation warning about MATTRANSPOSEMAT
2022-11-08 10:21:32 -08:00
Tzanio Kolev 4227521a52 Merge pull request #3309 from mfem/stefanozampini/fix-nonzeroguess-ksp
PetscLinearSolver: respect command line option for nonzero initial guess
2022-11-08 10:21:09 -08:00
Tzanio Kolev b9d166a4a4 Merge pull request #3302 from mfem/fix-doxygen-dgdiffusion
Fix Doxygen formatting for DGDiffusionIntegrator
2022-11-08 10:20:18 -08:00
Will Pazner 40c49ed992 Merge pull request #3297 from mfem/artv3/quadspacebase-init
Initalize order in quadrature space base class
2022-11-07 20:45:55 -08:00
Yohann Dudouit 6e70e2883b Set diagonal policy to DIAG_ONE when using Full assembly. 2022-11-07 12:32:53 -08:00
Yohann Dudouit affa9185bd Set the diagonal policy to DIAG_ONE in ex1 and ex1p. 2022-11-07 11:17:26 -08:00
Stefano Zampini c5c9a002c0 PetscLinearSolver: respect command line option for nonzero initial guess 2022-11-07 10:40:39 +03:00
Tzanio Kolev 0043dc833e Merge branch 'doxygen-subdirs' of github.com:mfem/mfem into doxygen-subdirs 2022-11-06 12:42:02 -08:00
Tzanio Kolev 14c43e1f98 Fix Doxygen comments 2022-11-06 12:40:56 -08:00
Veselin Dobrev 319d383af9 Fix PETSc 3.18.0 deprecation warning about MATTRANSPOSEMAT 2022-11-05 19:49:20 -07:00
Will Pazner 059cb2ce80 Remove unused variable in ParNCMesh::MemoryUsage 2022-11-05 13:47:19 -07:00
Will Pazner aa40b0b819 Suppress unused variable warning 2022-11-05 13:46:53 -07:00
Will Pazner d264a57850 Remove unused variable in Mesh::PrintVTU 2022-11-05 13:39:06 -07:00
Will Pazner 24825a5d26 Replace sprintf with snprintf 2022-11-05 13:38:42 -07:00
Veselin Dobrev 18e02de412 When partitioning a disconnected mesh with METIS 5, disable
the option for contiguous partitions which generates an error.
2022-11-04 23:45:47 -07:00
Will Pazner a1f2a79c3a Fix Doxygen formatting for DGDiffusionIntegrator 2022-11-04 12:18:52 -07:00
Will Pazner a6830a367a Merge remote-tracking branch 'origin/master' into yohann/sort+test 2022-11-04 09:55:29 -07:00
Veselin Dobrev 7176ad1ddd Add MFEM_USE_SUPERLU5 to the list of variables that will be
written to config.hpp and config.mk.

Also print MFEM_USE_SUPERLU5 when running 'make info'.
2022-11-04 01:40:32 -07:00
Julian Andrej cdc9408d27 more doxygen 2022-11-03 17:29:28 -07:00
Julian Andrej 322aa742d2 changed doxygen comment 2022-11-03 17:04:50 -07:00
Arturo Vargas 092180b3f7 Update qspace.cpp 2022-11-02 21:19:12 -07:00
Veselin Dobrev 65d28896cb Merge pull request #3281 from mfem/bugfix/qfunc_inline
Bug fix related to qfunction.cpp
2022-11-02 21:03:04 -07:00
Arturo Vargas 1fb13fe1a4 initalize order and size in quadrature space base 2022-11-02 16:39:14 -07:00
Veselin Dobrev 716d97e535 Ensure MUMPS and MKL CPardiso can use hypre matrices in GPU
memory by moving them temporarily to CPU memory.
2022-11-01 20:33:17 -07:00
Tzanio Kolev 9cd66faee6 Include several subdirectories in Doxygen docs 2022-11-01 19:10:28 -07:00
Arturo Vargas eec6f95561 make note of raja change in change log 2022-11-01 15:22:36 -07:00
Arturo Vargas 23fcd110f5 updates for raja launch 2022-11-01 15:21:30 -07:00
Veselin Dobrev f3c390fc1e To support building with HIP using the Cray compilers (which
need the -xhip flag) move the $(MFEM_FLAGS) argument (that
contains the -xhip flag) before the file(s) to be compiled.
2022-11-01 13:07:27 -07:00
Vladimir Z Tomov f4f6ab0f56 Merge branch 'master' into parGF-grad 2022-10-31 16:04:05 -07:00
Vladimir Z Tomov 2edddc5f9a Wrong #endif placement. 2022-10-31 16:01:36 -07:00
Vladimir Z Tomov b0048a2ccb Merge branch 'master' into add-dist-solver 2022-10-31 14:44:11 -07:00
Vladimir Z Tomov 90ef7e72ef Compilation error in the diffusion example due to the interface change. 2022-10-31 14:42:38 -07:00
Vladimir Z Tomov 9213f43286 Fixed failing tests. 2022-10-31 11:14:35 -07:00
Veselin Dobrev 7940fbea51 Add closing #endif forgotten in the previous commit 2022-10-30 16:57:56 -07:00
Veselin Dobrev 6c0d431f90 Fix a warning with HIP >= 5.2.0 to include <hipsparse/hipsparse.h>
instead of just <hisparse.h>
2022-10-30 16:44:11 -07:00
Veselin Dobrev a7501a08d6 Fix style 2022-10-29 21:01:34 -07:00
Veselin Dobrev d7e03640d9 Fix nvcc warnings when HiOp integration is enabled 2022-10-29 12:24:36 -07:00
Veselin Dobrev 87596eaa38 Ensure SuperLU_DIST and STRUMPACK can use hypre matrices in GPU
memory by moving them temporarily to CPU memory.
2022-10-29 08:22:30 -07:00
Vladimir Z Tomov 1759f79026 Bug in metric 301. Fix check-tmop-metric when Hessian is exact. 2022-10-28 19:05:18 -07:00
Robert Carson 6e9f62ca86 bug fix qfunction inline funcs in wrong file 2022-10-28 14:31:02 -04:00
Tzanio Kolev 2eb2061fb0 Merge pull request #3270 from mfem/mondrian-miniapp-fix
Fix bug in mondrian miniapp
2022-10-28 09:23:54 -07:00
Veselin Dobrev 297ee682d4 Fix a linking issue in the CMake build system when using newer
CMake versions (e.g. 3.18 and later) and linking with CUDA
libraries compiled with relocatable device code (rdc). Some
older versions of hypre were built with CUDA rdc (e.g. 2.22.x)
and the build with CMake 3.18 and hypre-2.22.x was failing.

This fix will probably be needed if we are linking with any
other TPLs built with CUDA rdc.
2022-10-27 15:17:00 -07:00
Sebastian Grimberg b1dec1eda0 Resolve compiler warnings in gslib.cpp 2022-10-27 13:16:50 -07:00
Hugh Carson 5be88369ce Add default constructor to ParFiniteElementSpaceHierarchy, and use default for FiniteElementSpaceHierarchy 2022-10-27 10:38:56 -04:00
Biswapriyo Nath 3afef10951 Fix DLL install directory in mingw
This installs DLL in 'bin' directory instead of 'lib' by default.
In mingw environment, all DLLs and EXEs are installed in 'bin'
and static & import libraries are installed in 'lib' directory.
This does not affect other environment because the 'RUNTIME'
and 'LIBRARY' targets are automatically set by cmake. See
https://cmake.org/cmake/help/latest/command/install.html
2022-10-26 08:05:33 +05:30
Sebastian Grimberg ab4bd64a5e Fix bug in mondrian miniapp 2022-10-25 16:29:49 -07:00
Vladimir Z Tomov ea9c2d2b8f style. 2022-10-24 19:05:11 -07:00
Vladimir Z Tomov b1383e0f80 Use OrthoSolver. 2022-10-24 18:19:11 -07:00
Vladimir Z Tomov b0573f4cec Updated to use IterativeSolver::PrintLevel. 2022-10-24 18:05:33 -07:00
Sebastian Grimberg 93536a8492 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-10-24 17:53:03 -07:00
Vladimir Z Tomov 021532cebf 1d sample run, better eps value for gradient calculations. 2022-10-24 16:37:59 -07:00
Tzanio Kolev d84884d13c Merge pull request #3266 from mfem/new-dev-version-4.5.1
Update version numbers to 4.5.1 -- a new development version
2022-10-24 09:41:30 -07:00
Veselin Dobrev 6328e8b38c Update version numbers to 4.5.1 -- a new development version 2022-10-24 07:06:54 -07:00
Vladimir Z Tomov 93d87c5a90 Added a simple normalization solver, error computations. 2022-10-21 17:08:56 -07:00
Yohann Dudouit 612a94aef7 Add EnableSparseMatrixSorting in ex1 and ex1p. 2022-10-20 09:47:05 -07:00
Vladimir Z Tomov ef6cadeaf2 style 2022-10-13 17:27:31 -07:00
Vladimir Z Tomov d8a9ce16cc cmakelist 2022-10-13 17:18:04 -07:00
Vladimir Z Tomov 2c4a5300d1 changelog. 2022-10-13 17:15:45 -07:00
Vladimir Z Tomov 9db0863ba9 GetGradients and GetVectorGraient on share faces. 2022-10-13 17:12:17 -07:00
Vladimir Z Tomov 2af7fe401e Unit test for GetGradient on shared faces. 2022-10-12 10:56:12 -07:00
Sebastian Grimberg 35b1d71507 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-09-29 12:34:46 -04:00
Ketan Mittal 4ccf6d31ad Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2022-09-20 09:40:59 -06:00
Ketan Mittal 153dc6aeac make style and parameterize some components 2022-09-20 09:40:45 -06:00
Aaron Fisher bf287d6ae5 Fixed a comment. 2022-09-20 08:12:53 -07:00
Aaron Fisher 462842eea9 Merge branch 'master' into ncmesh-pyramid-dev 2022-09-20 08:11:01 -07:00
Will Pazner 86e9298c5a Fix deprecation warnings in ParTransferMap 2022-09-19 12:21:07 -07:00
Will Pazner f0d7789836 Merge remote-tracking branch 'origin/master' into vector-remove-implicit-conversion 2022-09-19 12:02:56 -07:00
Will Pazner 883120f0e9 Fix deprecation warning when LAPACK is enabled 2022-09-19 11:59:36 -07:00
Yohann 9ac1f3eec6 Rename SortSparseMatrix to EnableSparseMatrixSorting.
- Add a boolean parameter to enable/disable
- Also sort on CPU
2022-09-16 15:27:59 +02:00
Yohann 7c9710b559 Use SortSparseMatrix in test_fa_determinism. 2022-09-12 18:24:58 +02:00
Yohann 409e743bc4 Change sparse matrix sorting interface.
- Rename method to `SortSparseMatrix`.
- Default behavior is to not sort the sparse matrices.
- Improve documentation.
2022-09-12 15:57:36 +02:00
Yohann ccd01f2c58 Set ntrials to 2 in test_fa_determinism. 2022-09-12 15:49:25 +02:00
Stowell, Mark L 66077d66a1 Adding comments about DofTransformation as a returned object 2022-09-09 13:45:26 -07:00
Stowell, Mark L 8a8d2ec0d9 Adding a mention of DofTransformation in ldof description 2022-09-09 13:29:33 -07:00
Stowell, Mark L dd8a19d180 Merge remote-tracking branch 'origin/master' into mesh-ptr-doc-dev 2022-09-09 12:55:51 -07:00
Stowell, Mark L 30c728bc84 Merge remote-tracking branch 'origin/master' into dof-doc-dev 2022-09-09 12:55:03 -07:00
Stowell, Mark L bc745ada10 Expanding docs for the VDoF methods (mostly) 2022-09-09 10:48:47 -07:00
Stowell, Mark L 8e75633838 Adding references to dof type descriptions 2022-09-08 14:09:09 -07:00
Will Pazner bfc871481f Remove implicit Vector conversions in tests, miniapps, examples 2022-09-06 13:20:56 -07:00
Will Pazner 5a455dd141 Deprecate Vector implicit conversion to double* 2022-09-06 13:05:38 -07:00
Yohann Dudouit c4f5897b20 Use Cu/Hip allocations to avoid int overflow with Memory interface. 2022-09-01 10:29:36 -07:00
Yohann Dudouit 03ce7c1d4a Set ntrials to 1. 2022-08-31 18:00:29 -07:00
Yohann Dudouit 7404fbbaf1 Replace DEVICE_MASK with ~CPU_MASK. 2022-08-31 17:59:16 -07:00
Yohann Dudouit 5a18775378 Merge branch 'yohann/sort+test' of https://github.com/mfem/mfem into yohann/sort+test 2022-08-31 17:21:07 -07:00
Yohann Dudouit f1a2fc2295 Factor out isSorted. 2022-08-31 17:21:03 -07:00
YohannandWill Pazner cff4473374 Update fem/bilinearform.hpp
Co-authored-by: Will Pazner <11493037+pazner@users.noreply.github.com>
2022-08-31 17:19:08 -07:00
Ketan Mittal 84a43d74e6 add weighting for surface fitting terms 2022-08-28 07:59:51 -07:00
Yohann Dudouit dabae076c5 Reactivate full assembly sample runs in ex1 and ex1p. 2022-08-25 13:36:46 -07:00
Yohann Dudouit a49b8a5a63 Merge branch 'master' into yohann/sort+test 2022-08-25 13:35:30 -07:00
Yohann Dudouit 3a62136a70 Remove SortRows from HypreParMatrix. 2022-08-25 13:25:20 -07:00
Yohann Dudouit 1fe908294d Add method to disable sparse matrix sorting on device. 2022-08-25 13:17:54 -07:00
Yohann Dudouit 96f8aa4a89 Fix sorting of sparse matrices with hip. 2022-08-25 10:07:03 -07:00
Will Pazner 44663ed239 Clean up determinism test 2022-08-24 10:00:45 -07:00
Will Pazner 231ec7961d Add determinism test 2022-08-24 10:00:44 -07:00
Yohann Dudouit d7b5d07cce Create temporary cusparseMatDescr_t for sorting. 2022-08-23 17:37:46 -07:00
Yohann Dudouit 8029a5ace0 Use Arrays instead of Memory objects. 2022-08-23 17:37:14 -07:00
Yohann Dudouit 78ac894623 Use class methods to read and write. 2022-08-23 17:36:44 -07:00
Yohann Dudouit 6cd171ae05 Use Capacity instead of Size. 2022-08-23 17:33:30 -07:00
Yohann Dudouit 9f035181c1 Update SortColumnIndices to be device aware. 2022-08-23 15:27:28 -07:00
Ketan Mittal b8a62066b4 Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2022-08-22 15:12:42 -07:00
Stowell, Mark L f30fcbf828 Documenting dof types in FiniteElementSpace class docs 2022-08-19 14:23:51 -07:00
Ketan Mittal 477b676190 misc clean up, remove unneeded level sets 2022-08-11 16:26:17 -07:00
Aaron Fisher 15680b2052 make style 2022-08-11 12:32:20 -07:00
Aaron Fisher 64737fad46 Merge branch 'ncmesh-pyramid-dev' of github.com:mfem/mfem into ncmesh-pyramid-dev 2022-08-11 10:19:29 -07:00
Aaron Fisher dd0b13ec5a Fixed the deref table after I reshuffled the elements. 2022-08-11 10:18:55 -07:00
Aaron Fisher 1b4480552c make style 2022-08-10 16:36:00 -07:00
Aaron Fisher 0e24a2840a Reordered the refined pyramid elements to put the tets at the end. 2022-08-10 16:33:22 -07:00
Aaron Fisher 3add57b2f1 Merge branch 'ncmesh-pyramid-dev' of github.com:mfem/mfem into ncmesh-pyramid-dev 2022-08-10 14:44:38 -07:00
Aaron Fisher e8df0436ef Fixed problems that unit testing uncovered. 2022-08-10 14:40:06 -07:00
Ketan Mittal 64218c7509 make style 2022-08-09 16:27:16 -07:00
Ketan Mittal 1ce8f6ea37 merge with master and resolve conflicts 2022-08-09 16:26:55 -07:00
Ketan Mittal f17ee1133a remove spaces from inline-hex 2022-08-09 15:14:01 -07:00
Sebastian Grimberg ef7806d1a0 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-08-08 13:11:03 -07:00
Aaron Fisher 35afe5a468 make style 2022-08-05 19:36:09 -07:00
Aaron Fisher c8adac90f5 Added a unit test to make sure mesh volume is preserved on reference elements. 2022-08-05 16:27:30 -07:00
Aaron Fisher b3eaee247c Added pyramid support to ncmesh. 2022-08-05 15:44:25 -07:00
Stowell, Mark L 9f03e9f682 Extending documentation for pmesh nurbs and element 2022-08-04 14:59:45 -07:00
Stowell, Mark L 3fadacb72b Merge remote-tracking branch 'origin/master' into mesh-ptr-doc-dev 2022-08-03 17:12:04 -07:00
Stowell, Mark L 94ae0d9c5e Expanding comments in mesh.hpp 2022-08-03 17:09:33 -07:00
Ketan Mittal b3385367f0 misc updates.. still debugging 2022-08-01 15:45:59 -07:00
Sebastian Grimberg 7444aa5070 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-08-01 08:59:34 -07:00
Sebastian Grimberg b15b188c44 Update const for Mult with multiple RHS 2022-08-01 08:59:06 -07:00
Sebastian Grimberg 98ca552b74 Merge branch 'master' into sjg/multigrid-mult-rhs 2022-08-01 08:39:04 -07:00
Tzanio Kolev 5299a2fed1 Merge branch 'master' into bugfix/rwa/coarsen-L2-proj 2022-07-27 08:39:10 -07:00
Stowell, Mark L 8709602daa Small documentation changes to Mesh 2022-07-26 14:23:49 -07:00
Yohann Dudouit c39b1a905b Call sorting on "local" matrices. 2022-07-26 12:06:18 -07:00
Yohann Dudouit fa62bc0bd1 Use hypre_CSRMatrixSortRow. 2022-07-26 11:52:31 -07:00
Sebastian Grimberg 9a2f3d5c73 Upgrades to Multigrid for multiple RHS 2022-07-14 15:52:25 -07:00
Sebastian Grimberg 4ffe3ef158 Fix shadowed names, abiguous cases, and make style 2022-07-14 15:52:25 -07:00
Sebastian Grimberg 89b7031a7a Add interface for multiple RHS solves
Also adds AddMult, AddMultTranspose as Operator methods for the ones that support it already.
2022-07-14 15:52:25 -07:00
Ketan Mittal 1baccc786c modify LSF for 3D case to use r-function 2022-06-16 11:28:49 -07:00
Ketan Mittal 25d06a62b5 work for different node ordering 2022-06-14 13:14:33 -07:00
Robert W. Anderson 4e279ac6b4 fix typo 2022-05-24 13:40:37 -07:00
Ketan Mittal 0cf3bc7f14 doxygen comment 2022-05-24 13:33:22 -07:00
Ketan Mittal 42a7bd8e2f Merge branch 'pmesh-to-serial-mesh' of https://github.com/mfem/mfem into tmop-bif 2022-05-24 12:02:37 -07:00
Ketan Mittal fca9768dc2 Merge branch 'master' of https://github.com/mfem/mfem into tmop-bif 2022-05-24 11:49:46 -07:00
Ketan Mittal dce4047d0f remove par mesh save with attributes 2022-05-24 11:49:25 -07:00
Robert W. Anderson 33e13e1234 fix for sum op case 2022-05-20 07:36:17 -07:00
Robert W. Anderson d177af97b3 test triangles 2022-05-19 22:18:04 -07:00
Robert W. Anderson a0dfd67635 update CHANGELOG 2022-05-19 22:17:37 -07:00
Robert W. Anderson bfb85c80b7 unit tests for tris and tets 2022-05-19 21:46:09 -07:00
Robert W. Anderson b68f43c223 support local L2 proj AMR coarsening on non-conforming tris and tets 2022-05-19 21:45:37 -07:00
Robert W. Anderson 649346bdce minimize diff 2022-05-19 20:28:40 -07:00
Robert W. Anderson d2bba7e1bb fuse DG and CG loops in parallel restriction assembly 2022-05-19 20:27:00 -07:00
Robert W. Anderson 999c1be8af fuse DG and CG loops for global restriction assembly 2022-05-19 19:23:16 -07:00
Robert W. Anderson 452209bb27 add AMR tag to coarsen tests 2022-05-19 19:22:53 -07:00
Robert W. Anderson 38c9ba0b19 clean up unused variable 2022-05-19 16:58:57 -07:00
Robert W. Anderson 7764aee799 fix MPI guard 2022-05-19 16:33:28 -07:00
Robert W. Anderson a9e0a32888 small cleanups and make style 2022-05-19 16:16:45 -07:00
Robert W. Anderson f52d05ff19 fix bug in AggregateError with min option 2022-05-19 16:14:38 -07:00
Robert W. Anderson ef2fb0dfd2 create loop for offdiag parts of discontinuous case in parallel coarsening matrix assembly 2022-05-19 16:12:44 -07:00
Robert W. Anderson a056c91c6a add unit tests that stress the correctness of parallel coarsen 2022-05-19 16:11:40 -07:00
Robert W. Anderson af8ec69446 make style 2022-05-19 14:15:30 -07:00
Robert W. Anderson 116d7b3990 stress test for parallel correctness 2022-05-19 14:05:17 -07:00
Robert W. Anderson 73a8e67efc make style 2022-05-19 11:56:50 -07:00
Robert W. Anderson 3e5d06aa51 temporary test code for developing parallel derefinement; tests will be captured persistently in test_derefine.cpp as we go and this will be removed at the end 2022-05-19 11:56:34 -07:00
Robert W. Anderson 1224c30c06 split parallel global assembly of the diagonal part of the derefinement matrix into continous and discontinuous cases, analogous to fespace.cpp; one processor case now works 2022-05-19 11:53:29 -07:00
Robert W. Anderson 534c0c5c3b fix up a shadowing/scope issue 2022-05-18 22:24:01 -07:00
Robert W. Anderson c2c32d8f4c merge master 2022-05-18 22:06:55 -07:00
Robert W. Anderson d9971e817f use order+1 test function, other cleanups 2022-05-18 22:01:27 -07:00
Robert W. Anderson 5e59345ee8 make style 2022-05-18 21:55:58 -07:00
Robert W. Anderson ab916272ed add tests for conservation and L2 optimality of projection for L2 FE spaces across compatible element types, basis types, orders, and dimensions 2022-05-18 21:55:29 -07:00
Robert W. Anderson 0384621463 make style 2022-05-18 21:51:52 -07:00
Robert W. Anderson 66959f111e add specialized L2 restriction from fine to coarse for discontinuous space elements 2022-05-18 21:51:20 -07:00
Robert W. Anderson 86332c87ee fix optimality test 2022-05-18 21:47:57 -07:00
Robert W. Anderson 2799bbe8f7 start building out test suite for coarsening GridFunctions 2022-05-17 11:05:00 -07:00
Robert W. Anderson aed21777fa perform conservation check and check for local optimality of coarse projection 2022-05-17 11:03:00 -07:00
Robert W. Anderson 0f86f7f249 revert the element restriction for nodal finite elements to the original method - this is needed for coarsening mesh nodes in the H1 space - still need to figure out how to handle L2 spaces with nodal elements 2022-05-17 11:01:57 -07:00
Robert W. Anderson 684270f526 split the assembling of the global refinement matrix into different methods for continuous (old method) and discontinuous (new method) spaces 2022-05-17 10:59:06 -07:00
Robert W. Anderson ae566f467e temporary test code w/ visualization; will be removed before merging 2022-05-16 16:02:14 -07:00
Robert W. Anderson bd362b7612 compute coarse mass matrix and coarse-fine mass matrices separately over different domains of integration; use L2 projection matrices in NodalFiniteElement::GetLocalRestriction 2022-05-15 10:59:55 -07:00
Robert W. Anderson 995baf3b89 add isoparametric transform point matrix for 1D segments 2022-05-15 00:22:05 -07:00
Robert W. Anderson 949e866845 fixes for local L2 projection matrices for coarsening ScalarFiniteElements 2022-05-15 00:20:02 -07:00
Robert W. Anderson 47d8fd1622 when building global R matrix, each row will have multiple sets of entries, corresponding to multiple fine children; the mark and skip mechanism is not appropriate here 2022-05-15 00:11:31 -07:00
Ketan Mittal 6148f1e015 make style 2022-05-05 14:00:50 -07:00
Ketan Mittal b19a02b488 add 3D example and fix pmesh save with attributes 2022-05-05 14:00:31 -07:00
Ketan Mittal cb5e7adf45 misc changes 2022-04-21 09:57:53 -07:00
Ketan Mittal fab5fc1552 minor changes 2022-04-15 12:54:10 -07:00
Ketan Mittal 0f6c6d28fe use custom scaling for penalization weight and max num of increments 2022-04-11 08:32:51 -07:00
Ketan Mittal 4fc789bc7c option to work using distance function on current mesh 2022-04-04 18:09:13 -07:00
Ketan Mittal 92f246dd54 update miniapp 2022-04-04 14:31:42 -07:00
Ketan Mittal a2166e2dd1 add machinery for source mesh for fitting 2022-04-04 14:31:04 -07:00
Ketan Mittal e6198e2617 move distance solver to common 2022-04-04 14:30:32 -07:00
Ketan Mittal 78dc0db5d8 initial commit 2022-04-04 10:46:57 -07:00
869 changed files with 18416 additions and 5589 deletions
+14 -8
View File
@@ -31,7 +31,7 @@ install:
- ps: ( get-content "GKlib\gk_arch.h") | % { If ($_.ReadCount -ge 52) {$_ -replace "#ifdef __MSC__","#ifdef DISABLE_THIS_ANCIENT_MSC_CHECK"} Else {$_} } | set-content "GKlib\gk_arch.h"
- cmake -H. -Bbuild
# -DCMAKE_BUILD_TYPE=Release
- cmake --build build
- cmake --build build --target metis -j 4
- set METIS_PATH=%cd%
- cd ..
@@ -40,7 +40,7 @@ install:
- 7z x v2.19.0.tar.gz -so | 7z x -si -ttar > nul
- cd hypre-2.19.0/src
- cmake -H. -Bbuild
- cmake --build build
- cmake --build build -j 4
- cmake --build build --target install
- cd ../..
@@ -49,14 +49,20 @@ install:
# MFEM
before_build:
- cmake -H. -DCMAKE_INSTALL_PREFIX=install -Bbuild_parallel -DMFEM_USE_MPI=TRUE -DMFEM_USE_METIS_5=TRUE -DHYPRE_DIR=%cd%\..\hypre-2.19.0\src\hypre -DMETIS_LIBRARIES=%METIS_PATH%\build\libmetis\Debug\metis.lib -DMETIS_INCLUDE_DIRS=%METIS_PATH%\include
- cmake -H. -DCMAKE_INSTALL_PREFIX=install -Bbuild_serial -DMFEM_USE_MPI=FALSE
- cmake . -Bbuild_parallel -DMFEM_USE_MPI=TRUE -DMFEM_USE_METIS_5=TRUE -DHYPRE_DIR=%cd%\..\hypre-2.19.0\src\hypre -DMETIS_LIBRARIES=%METIS_PATH%\build\libmetis\Debug\metis.lib -DMETIS_INCLUDE_DIRS=%METIS_PATH%\include
# - cmake . -Bbuild_serial -DMFEM_USE_MPI=FALSE
- cmake . -Bbuild_shared_serial -DMFEM_USE_MPI=FALSE -DBUILD_SHARED_LIBS=ON
build_script:
- cmake --build build_parallel --config Release -j 4
- cmake --build build_serial --config Release -j 4
- cmake --build build_serial --target exec --config Release -j 4
- cmake --build build_parallel --config Debug -j 4
# - cmake --build build_serial --config Release -j 4
# - cmake --build build_serial --target exec --config Release -j 4
- cmake --build build_shared_serial --config Release -j 4
- cmake --build build_shared_serial --target exec --config Release -j 4
after_build:
- cd build_serial
# - cd build_serial
# - ctest -C Release --output-on-failure
# - cd ..
- cd build_shared_serial
- ctest -C Release --output-on-failure
+1 -1
View File
@@ -62,7 +62,7 @@ jobs:
- name: GHCR Login
if: (github.event_name != 'pull_request')
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
+26 -22
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -74,12 +74,19 @@ jobs:
codecov: YES
- os: windows-latest
codecov: NO
- os: windows-latest
target: opt
mpi: par
config-opts: '-DBUILD_SHARED_LIBS=ON'
- os: ubuntu-latest
target: opt
codecov: NO
mpi: par
build-system: cmake
hypre-target: int32
# This option can be set to pass additional configuration options to
# the MFEM configuration command.
# config-opts: '-DCMAKE_VERBOSE_MAKEFILE=ON'
- os: ubuntu-latest
target: opt
codecov: NO
@@ -94,7 +101,7 @@ jobs:
# This external action allows to interrupt a workflow already running on
# the same branch to save resource
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
@@ -102,7 +109,7 @@ jobs:
# /home/runner/work/mfem/mfem/mfem
# Note: Done now to access "install-hypre" and "install-metis" actions.
- name: checkout mfem
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ${{ env.MFEM_TOP_DIR }}
# Fetch the complete history for codecov to access commits ID
@@ -115,25 +122,25 @@ jobs:
if: matrix.mpi == 'par' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install mpich libmpich-dev
export MAKE_CXX_FLAG="MPICXX=mpic++"
- name: get lcov (Linux)
if: matrix.codecov == 'YES' && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install lcov
- name: Set up Homebrew
if: ( matrix.mpi == 'par' || matrix.codecov == 'YES' ) && matrix.os == 'macos-latest'
uses: Homebrew/actions/setup-homebrew@c4aafe8c4620bf08883dd4679c374f11e73329d3
# Keep the following section in case we need it again in the future,
# see: https://github.com/mfem/mfem/pull/3385#discussion_r1058013032
# - name: Set up Homebrew
# if: ( matrix.mpi == 'par' || matrix.codecov == 'YES' ) && matrix.os == 'macos-latest'
# uses: Homebrew/actions/setup-homebrew@master
- name: get MPI (MacOS)
if: matrix.mpi == 'par' && matrix.os == 'macos-latest'
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install openmpi
export MAKE_CXX_FLAG="MPICXX=mpic++"
- name: get MPI (MacOS)
- name: get lcov (MacOS)
if: matrix.codecov == 'YES' && matrix.os == 'macos-latest'
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
@@ -141,14 +148,14 @@ jobs:
- name: get MPI (Windows)
if: matrix.mpi == 'par' && matrix.os == 'windows-latest'
uses: mpi4py/setup-mpi@v1.0.3
uses: mpi4py/setup-mpi@v1.1.4
# Get Hypre through cache, or build it.
# Install will only run on cache miss.
- name: cache hypre
id: hypre-cache
if: matrix.mpi == 'par'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.HYPRE_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-${{ matrix.hypre-target }}-v2.2
@@ -176,7 +183,7 @@ jobs:
- name: cache metis
id: metis-cache
if: matrix.mpi == 'par' && matrix.os != 'windows-latest'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.METIS_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.2
@@ -190,12 +197,13 @@ jobs:
- name: cache vcpkg (Windows)
id: vcpkg-cache
if: matrix.os == 'windows-latest'
uses: actions/cache@v3
with:
path: vcpkg_cache
key: ${{ runner.os }}-${{ matrix.mpi }}-vcpkg-v1
- name: prepare binary cache location
- name: prepare vcpkg binary cache location (Windows)
if: matrix.os == 'windows-latest' && steps.vcpkg-cache.outputs.cache-hit != 'true'
run: |
mkdir -p vcpkg_cache
@@ -209,7 +217,7 @@ jobs:
# MFEM build and test
- name: build
uses: mfem/github-actions/build-mfem@v2.2
uses: mfem/github-actions/build-mfem@v2.3
env:
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_cache
with:
@@ -221,7 +229,7 @@ jobs:
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
metis-dir: ${{ env.METIS_TOP_DIR }}
mfem-dir: ${{ env.MFEM_TOP_DIR }}
config-options: ${{ env.MFEM_EXTRA_CONFIG }}
config-options: ${{ matrix.config-opts }}
library-only: ${{ matrix.target == 'dbg' }}
# Run checks (and only checks) on debug targets
@@ -230,11 +238,7 @@ jobs:
run: |
cd ${{ env.MFEM_TOP_DIR }} && make check
- name: unit tests
if: matrix.build-system == 'make' && matrix.target == 'opt'
run: |
cd ${{ env.MFEM_TOP_DIR }} && make unittest
# Note: 'tests' include the unit tests
- name: tests
if: matrix.build-system == 'make' && matrix.target == 'opt'
run: |
@@ -247,7 +251,7 @@ jobs:
cd ${{ env.MFEM_TOP_DIR }} && cmake --build build --target check --config ${CTEST_CONFIG}
shell: bash
- name: cmake unit tests (Ubuntu 20.04)
- name: cmake unit tests (Ubuntu)
if: matrix.build-system == 'cmake' && matrix.target == 'opt' && matrix.os == 'ubuntu-latest'
run: |
CTEST_CONFIG="Release"
@@ -265,7 +269,7 @@ jobs:
# Code coverage (process and upload reports)
- name: codecov
if: matrix.codecov == 'YES'
uses: mfem/github-actions/upload-coverage@v2.0
uses: mfem/github-actions/upload-coverage@v2.2
with:
name: ${{ matrix.os }}-${{ matrix.build-system }}-${{ matrix.target }}-${{ matrix.mpi }}-${{ matrix.hypre-target }}
project_dir: ${{ env.MFEM_TOP_DIR }}
+5 -6
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -35,23 +35,22 @@ jobs:
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: checkout MFEM
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: mfem
- name: Get MPI (Linux)
run: |
sudo apt-get install mpich libmpich-dev
export MAKE_CXX_FLAG="MPICXX=mpic++"
- name: Cache Hypre Install
id: hypre-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.HYPRE_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2.2
@@ -66,7 +65,7 @@ jobs:
- name: Cache Metis Install
id: metis-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.METIS_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.2
+9 -6
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -34,12 +34,12 @@ jobs:
github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: checkout mfem
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: copyright check
id: copyright
@@ -84,7 +84,7 @@ jobs:
github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: checkout mfem
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: get astyle
run: |
@@ -101,11 +101,14 @@ jobs:
github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: checkout mfem
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: get doxygen and graphviz
run: |
sudo apt-get install doxygen graphviz
- name: update doxygen config file
run: |
cd doc
doxygen -u CodeDocumentation.conf.in
@@ -123,7 +126,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout mfem
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
+18 -7
View File
@@ -21,6 +21,9 @@ CMakeFiles/
# Default install location
/mfem/
# Typical build directory
/build/
# Generated files in main directory, config/ and docs/
/deps.mk
config/_config.hpp
@@ -118,11 +121,9 @@ examples/amgx/sol.gf
examples/amgx/mesh.*
examples/amgx/sol.*
examples/gingko/ex1
examples/gingko/refined.mesh
examples/gingko/sol.gf
examples/gingko/mesh.*
examples/gingko/sol.*
examples/ginkgo/ex1
examples/ginkgo/refined.mesh
examples/ginkgo/sol.gf
examples/hiop/ex9
examples/hiop/ex9p
@@ -148,8 +149,8 @@ examples/petsc/velocity.*
examples/petsc/elastic_energy.*
examples/petsc/mode_*
examples/pumi/ex1
examples/pumi/ex[126]p
examples/pumi/ex[12]
examples/pumi/ex[16]p
examples/pumi/refined.mesh
examples/pumi/sol.gf
examples/pumi/mesh.*
@@ -194,6 +195,9 @@ miniapps/gslib/field-diff
miniapps/gslib/field-interp
miniapps/gslib/findpts
miniapps/gslib/pfindpts
miniapps/gslib/schwarz_ex1
miniapps/gslib/schwarz_ex1p
miniapps/gslib/interpolated.gf
miniapps/meshing/mobius-strip
miniapps/meshing/klein-bottle
@@ -203,8 +207,10 @@ miniapps/meshing/mesh-explorer
miniapps/meshing/shaper
miniapps/meshing/extruder
miniapps/meshing/trimmer
miniapps/meshing/reflector
miniapps/meshing/mesh-optimizer
miniapps/meshing/pmesh-optimizer
miniapps/meshing/pmesh-fitting
miniapps/meshing/minimal-surface
miniapps/meshing/pminimal-surface
miniapps/meshing/polar-nc
@@ -214,9 +220,12 @@ miniapps/meshing/toroid-*.mesh
miniapps/meshing/twist-*.mesh
miniapps/meshing/mesh-explorer.mesh
miniapps/meshing/partitioning.txt
miniapps/meshing/mesh-explorer-visit*
miniapps/meshing/mesh-explorer-paraview/
miniapps/meshing/shaper.mesh
miniapps/meshing/extruder.mesh
miniapps/meshing/trimmer.mesh
miniapps/meshing/reflected.mesh
miniapps/meshing/optimized*
miniapps/meshing/perturbed*
miniapps/meshing/polar-nc.mesh
@@ -241,6 +250,7 @@ miniapps/navier/navier_tgv
miniapps/navier/navier_shear
miniapps/navier/navier_3dfoc
miniapps/navier/navier_turbchan
miniapps/navier/navier_cht
miniapps/navier/tgv_out*.txt
miniapps/navier/*_output
@@ -276,6 +286,7 @@ miniapps/tools/convert-dc
miniapps/tools/lor-transfer
miniapps/tools/get-values
miniapps/tools/check-tmop-metric
miniapps/tools/tmop-metric-magnitude
miniapps/toys/automata
miniapps/toys/life
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+2 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -93,7 +93,7 @@ report_baseline:
git pull && \
git add ${rundir} && \
git commit -m "${msg}" && \
git push origin master
${CI_PROJECT_DIR}/.gitlab/scripts/git_try_to_push
else
for file in ${rundir}/*; do
echo "------------------------------"
+1 -6
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -27,11 +27,6 @@ allocate_resource:
timeout: 6h
# GitLab jobs for the Quartz machine at LLNL
debug_ser_gcc_4_9_3:
variables:
SPEC: "%gcc@4.9.3 +debug~mpi"
extends: .build_and_test_on_quartz
debug_ser_gcc_6_1_0:
variables:
SPEC: "%gcc@6.1.0 +debug~mpi"
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
# This file is part of the MFEM library. For more information and source code
# availability visit https://mfem.org.
#
# MFEM is free software; you can redistribute it and/or modify it under the
# terms of the BSD-3 license. We welcome feedback and contributions, see file
# CONTRIBUTING.md for details.
# Try to push to the remote 5 times. If the push fails, and the local and remote
# have diverged, then pull from the remote to merge changes, and try pushing
# again. If some other failure happens
for i in {1..5}; do
git push origin master && exit 0
# Wait for 20 seconds in case someone else is pushing to the remote
# concurrently
sleep 20
# Fetch any updates from the remote
git remote update
# Get the latest commit on the local branch
LOCAL=$(git rev-parse @)
# Get the latest commit on the remote
REMOTE=$(git rev-parse @{u})
# Get the common ancestor
BASE=$(git merge-base @ @{u})
# Have the local and remote diverged?
if [[ $LOCAL != $REMOTE && $LOCAL != $BASE && $REMOTE != $BASE ]]; then
git pull
if [[ $? == 0 ]]; then
continue
else
exit 1 # Something else went wrong trying to pull
fi
fi
done
exit 1 # Did not succeed in 5 attempts
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -32,7 +32,7 @@ if [[ "$AUTOTEST_COMMIT" != "NO" ]]; then
git pull && \
git add ${rundir} && \
git commit -m "${msg}" && \
git push origin master
${CI_PROJECT_DIR}/.gitlab/scripts/git_try_to_push
else
for file in ${rundir}/*; do
echo "------------------------------"
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -29,7 +29,7 @@ if [[ "$AUTOTEST_COMMIT" != "NO" ]]; then
git pull && \
git add ${rundir} && \
git commit -m "${msg}" && \
git push origin master
${CI_PROJECT_DIR}/.gitlab/scripts/git_try_to_push
else
for file in ${rundir}/*; do
echo "------------------------------"
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+78
View File
@@ -8,6 +8,84 @@
https://mfem.org
Version 4.5.3 (development)
===========================
- Added new methods in the Mesh class to set and get attributes on NURBS patches
and patch boundaries.
New and updated examples and miniapps
-------------------------------------
- Added a miniapp pmesh-fitting in miniapps/meshing for interface and boundary fitting to implicit domains defined using level-set functions.
- Moved the distance solver methods from miniapps/shifted to miniapps/common.
Discretization improvements
---------------------------
- Face restriction operators for Nedelec and Raviart-Thomas finite element
spaces are now supported through the ConformingFaceRestriction class.
- VectorFEBoundaryFluxLFIntegrator is now supported on device/GPU.
Version 4.5.2, released on March 23, 2023
=========================================
- Added support for pyramids in non-conforming meshes. Currently only isotropic
refinement is supported in this case.
- Removed the support for the Mesquite toolkit. We recommend using MFEM's TMOP
functionality instead for mesh optimization. See the mesh-optimizer miniapp.
- Added a fast normalization-based distance solver, see the Distance miniapp
in the miniapps/shifted/ directory.
- Added a new meshing miniapp, Reflector, which reflects a high-order or NURBS
hexahedral mesh about a plane.
- Updated logic in FindPointsGSLIB to ignore points found near (but outside) the
domain boundary.
- Added an option to auto-balance compound TMOP metrics.
- Fixed a bug in TMOP metric 301.
- When using discontinuous (L2) spaces, use local (element-wise) L2 projection
as the coarsening operator for non-conforming AMR meshes.
- Added support for GridFunction::GetGradients() and GetVectorGradient() on
face-neighbor elements.
- Added support for pyramids in Gmsh meshes.
- The Mesh Explorer miniapp can now save mesh files in the VisIt or ParaView
formats using the corresponding DataCollection. See option 'D' in the menu.
- VisItDataCollection now correctly handles data collection names containing
underscores.
- Added support for shared Windows builds with MSVC through CMake.
Developers note: this enhancement is facilitated by the addition of the macro
MFEM_EXPORT, see config.hpp for more details on its usage.
- The following integrations have updated minimum version requirements:
* RAJA >= 2022.10.3
API changes
-----------
- The implicit cast methods of class Vector to 'double *' and 'const double *'
have been deprecated and generate deprecation warnings if used. They will be
removed in a future release.
- The methods Mesh::GetFaceBaseGeometry and Mesh::GetFaceGeometryType have been
deprecated, and Mesh::GetFaceGeometry (which provides identical functionality)
should be used instead.
- VisItDataCollection::SetPadDigits() no longer alters the number of digits
used to represent the MPI rank because VisIt seems to require 6 digits.
This parameter can still be explicitly overridden with SetPadDigitsRank().
Version 4.5, released on October 22, 2022
=========================================
+88 -55
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -10,7 +10,10 @@
# CONTRIBUTING.md for details.
# The variable CMAKE_CXX_STANDARD and related were introduced in CMake v3.1
cmake_minimum_required(VERSION 3.1)
# Version 3.8 fixes the handling of CMAKE_CXX_STANDARD for try_compile.
# Version 3.8 or newer is required for direct CUDA support.
cmake_minimum_required(VERSION 3.8)
message(STATUS "CMake version: ${CMAKE_VERSION}")
set(USER_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/config/user.cmake" CACHE PATH
"Path to optional user configuration file.")
@@ -22,8 +25,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Load user settings before the defaults - this way the defaults will not
# overwrite the user set options. If the user has not set all options, we still
# have the defaults.
message(STATUS "(optional) USER_CONFIG = ${USER_CONFIG}")
include("${USER_CONFIG}" OPTIONAL)
include("${USER_CONFIG}" OPTIONAL RESULT_VARIABLE USER_CONFIG_LOADED)
if (USER_CONFIG_LOADED)
set(USER_CONFIG_LOADED "LOADED")
endif()
message(STATUS "Loading USER_CONFIG = ${USER_CONFIG} (${USER_CONFIG_LOADED})")
include("${CMAKE_CURRENT_SOURCE_DIR}/config/defaults.cmake")
# Allow overwriting of the compiler by setting CXX/MPICXX on the command line or
@@ -51,7 +57,7 @@ project(mfem NONE)
# Current version of MFEM, see also `makefile`.
# mfem_VERSION = (string)
# MFEM_VERSION = (int) [automatically derived from mfem_VERSION]
set(${PROJECT_NAME}_VERSION 4.5.0)
set(${PROJECT_NAME}_VERSION 4.5.3)
# Prohibit in-source build
if (${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
@@ -66,8 +72,7 @@ set(XSDK_ENABLE_C OFF)
set(XSDK_ENABLE_Fortran OFF)
# Check if we need to enable C or Fortran.
if (CMAKE_VERSION VERSION_LESS 3.2 OR
MFEM_USE_CONDUIT OR
if (MFEM_USE_CONDUIT OR
MFEM_USE_SIDRE OR
MFEM_USE_PETSC)
# This seems to be needed by:
@@ -81,11 +86,13 @@ if (MFEM_USE_STRUMPACK)
# Just needed to find the MPI_Fortran libraries to link with
set(XSDK_ENABLE_Fortran ON)
endif()
# SUNDIALS >= 6.4.0 requires C++14:
if (MFEM_USE_SUNDIALS AND ("${CMAKE_CXX_STANDARD}" LESS "14"))
set(CMAKE_CXX_STANDARD 14)
endif()
if (MFEM_USE_GINKGO AND ("${CMAKE_CXX_STANDARD}" LESS "14"))
# SUNDIALS, STRUMPACK, Ginkgo, RAJA and Umpire require C++14:
if ((MFEM_USE_SUNDIALS OR
MFEM_USE_STRUMPACK OR
MFEM_USE_GINKGO OR
MFEM_USE_RAJA OR
MFEM_USE_UMPIRE) AND
("${CMAKE_CXX_STANDARD}" LESS "14"))
set(CMAKE_CXX_STANDARD 14)
endif()
@@ -103,17 +110,12 @@ if (MFEM_USE_CUDA)
if (MFEM_USE_HIP)
message(FATAL_ERROR " *** MFEM_USE_HIP cannot be combined with MFEM_USE_CUDA.")
endif()
# MFEM_USE_CUDA requires CMake 3.8 or newer (for direct CUDA support)
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
# Use ${CMAKE_CXX_COMPILER} as the cuda host compiler.
if (NOT CMAKE_CUDA_HOST_COMPILER)
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
endif()
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 11)
if (MFEM_USE_GINKGO)
set(CMAKE_CUDA_STANDARD 14)
endif()
set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_EXTENSIONS OFF)
set(CUDA_FLAGS "--expt-extended-lambda")
@@ -136,8 +138,7 @@ if (MFEM_USE_CUDA)
set(CUDA_FLAGS "-ccbin=${CMAKE_CXX_COMPILER} ${CUDA_FLAGS}")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER ${CMAKE_CXX_COMPILER})
endif()
set(CMAKE_CUDA_FLAGS "${CUDA_FLAGS}" CACHE STRING
"CUDA flags set for MFEM" FORCE)
set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} ${CUDA_FLAGS})
set(CUSPARSE_FOUND TRUE)
set(CUSPARSE_LIBRARIES "cusparse")
set(CUBLAS_FOUND TRUE)
@@ -186,6 +187,23 @@ else()
set(MFEM_DEBUG OFF)
endif()
# Shared build on Windows
if (WIN32 AND BUILD_SHARED_LIBS)
# CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS works only with MSVC?
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON CACHE BOOL
"Automatically export symbols for shared Windows DLL build")
# Place all .dll and .exe files in the same sub-directory, 'bin/<config>', of
# the build directory, so that the .exe files can find the .dll files at
# runtime:
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Note: CMake tests are run from the build-tree sub-directory where the test
# is defined, e.g. <build-dir>/tests/unit, so hard coded paths to meshes still
# work fine.
# Not strictly necessary:
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
endif()
# AMD HIP
if (MFEM_USE_HIP)
if (HIP_ARCH)
@@ -199,6 +217,26 @@ if (MFEM_USE_HIP)
find_package(HIPSPARSE REQUIRED)
endif()
# OpenMP
if (MFEM_USE_OPENMP OR MFEM_USE_LEGACY_OPENMP)
if (NOT MFEM_THREAD_SAFE AND MFEM_USE_LEGACY_OPENMP)
message(FATAL_ERROR " *** MFEM_USE_LEGACY_OPENMP requires MFEM_THREAD_SAFE=ON.")
endif()
find_package(OpenMP REQUIRED)
set(OPENMP_LIBRARIES ${OpenMP_CXX_LIBRARIES})
if(APPLE)
# On macOS, the compiler needs additional help to find the <omp.h> header.
# See issue #2642 for more information.
set(OPENMP_INCLUDE_DIRS ${OpenMP_CXX_INCLUDE_DIRS})
endif(APPLE)
if (OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if (MFEM_USE_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS}")
endif()
endif()
endif()
# MPI -> hypre; PETSc (optional)
if (MFEM_USE_MPI)
find_package(MPI REQUIRED)
@@ -264,20 +302,6 @@ if (MFEM_USE_LAPACK)
find_package(LAPACK REQUIRED)
endif()
# OpenMP
if (MFEM_USE_OPENMP OR MFEM_USE_LEGACY_OPENMP)
if (NOT MFEM_THREAD_SAFE AND MFEM_USE_LEGACY_OPENMP)
message(FATAL_ERROR " *** MFEM_USE_LEGACY_OPENMP requires MFEM_THREAD_SAFE=ON.")
endif()
find_package(OpenMP REQUIRED)
set(OPENMP_LIBRARIES ${OpenMP_CXX_LIBRARIES})
if(APPLE)
# On macOS, the compiler needs additional help to find the <omp.h> header.
# See issue #2642 for more information.
set(OPENMP_INCLUDE_DIRS ${OpenMP_CXX_INCLUDE_DIRS})
endif(APPLE)
endif()
# SuiteSparse (before SUNDIALS which may depend on KLU)
if (MFEM_USE_SUITESPARSE)
find_package(SuiteSparse REQUIRED
@@ -296,11 +320,6 @@ if (MFEM_USE_SUNDIALS)
find_package(SUNDIALS REQUIRED ${SUNDIALS_COMPONENTS})
endif()
# Mesquite
if (MFEM_USE_MESQUITE)
find_package(Mesquite REQUIRED)
endif()
# SuperLU_DIST can only be enabled in parallel
if (MFEM_USE_SUPERLU)
if (MFEM_USE_MPI)
@@ -488,6 +507,10 @@ endif()
# an ALIAS target is missing?
# Call Stack (most recent call first):
# CMakeLists.txt:474 (mfem_add_library)
#
# NOTE: We need to figure out which TPL library adds the dependency on
# "Threads::Threads" and call the next line only when that TPL library is
# enabled. -V. Dobrev
find_package(Threads REQUIRED)
# List all possible libraries in order of dependencies.
@@ -495,8 +518,8 @@ find_package(Threads REQUIRED)
# With newer versions of SuiteSparse which include METIS header using 64-bit
# integers, the METIS header (with 32-bit indices, as used by mfem) needs to
# be before SuiteSparse.
set(MFEM_TPLS OPENMP HYPRE LAPACK BLAS SuperLUDist METIS SuiteSparse SUNDIALS
PETSC SLEPC MESQUITE MUMPS STRUMPACK AXOM FMS CONDUIT Ginkgo GNUTLS GSLIB
set(MFEM_TPLS OPENMP HYPRE LAPACK BLAS SuperLUDist STRUMPACK METIS SuiteSparse
SUNDIALS PETSC SLEPC MUMPS AXOM FMS CONDUIT Ginkgo GNUTLS GSLIB
NETCDF MPFR PUMI HIOP POSIXCLOCKS MFEMBacktrace ZLIB OCCA CEED RAJA UMPIRE
ADIOS2 CUBLAS CUSPARSE MKL_CPARDISO AMGX CALIPER CODIPACK BENCHMARK PARELAG
MPI_CXX HIP HIPSPARSE MOONOLITH BLITZ ALGOIM ENZYME)
@@ -511,18 +534,13 @@ foreach(TPL IN LISTS MFEM_TPLS)
list(APPEND TPL_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS})
endif()
endforeach(TPL)
list(REVERSE TPL_LIBRARIES)
list(REMOVE_DUPLICATES TPL_LIBRARIES)
list(REVERSE TPL_LIBRARIES)
list(REMOVE_DUPLICATES TPL_INCLUDE_DIRS)
# message(STATUS "TPL_INCLUDE_DIRS = ${TPL_INCLUDE_DIRS}")
if (OPENMP_FOUND)
message(STATUS "MFEM: using package OpenMP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if (MFEM_USE_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS}")
endif()
endif()
message(STATUS "MFEM shared library: BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}")
message(STATUS "MFEM build type: CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
message(STATUS "MFEM version: v${MFEM_VERSION_STRING}")
message(STATUS "MFEM git string: ${MFEM_GIT_STRING}")
@@ -578,7 +596,19 @@ target_include_directories(mfem
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
# The INSTALL_INTERFACE is handled below
${TPL_INCLUDE_DIRS})
if (MFEM_USE_MPI)
if (MPI_CXX_COMPILE_FLAGS)
separate_arguments(MPI_CXX_COMPILE_ARGS UNIX_COMMAND
"${MPI_CXX_COMPILE_FLAGS}")
target_compile_options(mfem PUBLIC ${MPI_CXX_COMPILE_ARGS})
endif()
if (MPI_CXX_LINK_FLAGS)
target_link_libraries(mfem PUBLIC ${MPI_CXX_LINK_FLAGS})
endif()
endif()
set_target_properties(mfem PROPERTIES VERSION "${mfem_VERSION}")
set_target_properties(mfem PROPERTIES SOVERSION "${mfem_VERSION}")
@@ -590,6 +620,7 @@ if (NOT ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}"))
endif()
# Generate configuration file in the build directory: config/_config.hpp.
set(MFEM_SHARED_BUILD ${BUILD_SHARED_LIBS})
configure_file(
"${PROJECT_SOURCE_DIR}/config/cmake/config.hpp.in"
"${PROJECT_BINARY_DIR}/config/_config.hpp")
@@ -701,13 +732,15 @@ add_subdirectory(doc)
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
set(INSTALL_INCLUDE_DIR include
CACHE PATH "Relative path for installing header files.")
set(INSTALL_BIN_DIR bin
CACHE PATH "Relative path for installing the binaries.")
set(INSTALL_LIB_DIR lib
CACHE PATH "Relative path for installing the library.")
# other options: "share/mfem/cmake", "lib/mfem/cmake"
set(INSTALL_CMAKE_DIR lib/cmake/mfem
CACHE PATH "Relative path for installing cmake config files.")
target_include_directories(mfem
target_include_directories(mfem BEFORE
PUBLIC
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>)
@@ -719,7 +752,9 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Development)
# Install the library
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME_UC}Targets
DESTINATION ${INSTALL_LIB_DIR})
RUNTIME DESTINATION ${INSTALL_BIN_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
# Install the master headers
foreach(Header mfem.hpp mfem-performance.hpp)
@@ -757,10 +792,8 @@ endif()
# Install the configuration header files
install(FILES ${PROJECT_BINARY_DIR}/config/_config.hpp
DESTINATION ${INSTALL_INCLUDE_DIR}/mfem/config
RENAME config.hpp)
install(FILES ${PROJECT_SOURCE_DIR}/config/tconfig.hpp
${PROJECT_SOURCE_DIR}/config/config.hpp
${PROJECT_SOURCE_DIR}/config/tconfig.hpp
DESTINATION ${INSTALL_INCLUDE_DIR}/mfem/config)
# Package the whole thing up nicely
+2 -13
View File
@@ -337,10 +337,6 @@ MFEM_USE_SUNDIALS = YES/NO
library. When enabled, this option uses the SUNDIALS_* library options,
see below.
MFEM_USE_MESQUITE = YES/NO
Enable MFEM functionality based on the Mesquite library. When enabled, this
option uses the MESQUITE_* library options, see below.
MFEM_USE_SUITESPARSE = YES/NO
Enable MFEM functionality based on the SuiteSparse library. Currently, this
option adds the classes UMFPackSolver and KLUSolver (both sparse serial
@@ -636,11 +632,6 @@ The specific libraries and their options are:
Options: SUNDIALS_OPT, SUNDIALS_LIB.
Versions: SUNDIALS >= 5.0.0, SUNDIALS >= 5.4.0 for CUDA support.
- Mesquite (optional), used when MFEM_USE_MESQUITE = YES.
URL: http://trilinos.org/oldsite/packages/mesquite
Options: MESQUITE_OPT, MESQUITE_LIB.
The Mesquite support is deprecated and will be removed in the future.
- SuiteSparse (optional), used when MFEM_USE_SUITESPARSE = YES.
URL: http://faculty.cse.tamu.edu/davis/suitesparse.html
Options: SUITESPARSE_OPT, SUITESPARSE_LIB.
@@ -802,10 +793,10 @@ The specific libraries and their options are:
Versions: libCEED >= 0.10.
- RAJA (optional), used when MFEM_USE_RAJA = YES.
Beginning with MFEM v4.3, only RAJA v0.14.0+ is supported.
Beginning with MFEM v4.5.1, only RAJA v2022.10.3+ is supported.
URL: https://github.com/LLNL/RAJA
Options: RAJA_DIR, RAJA_OPT, RAJA_LIB.
Versions: RAJA >= 0.14.0.
Versions: RAJA >= 2022.10.3.
- Moonolith (optional), use when MFEM_USE_MOONOLITH = YES.
URL: https://bitbucket.org/zulianp/par_moonolith
@@ -969,7 +960,6 @@ MFEM_USE_LEGACY_OPENMP
MFEM_USE_OPENMP
MFEM_USE_MEMALLOC
MFEM_TIMER_TYPE - Set automatically, can be overwritten.
MFEM_USE_MESQUITE
MFEM_USE_SUITESPARSE
MFEM_USE_SUPERLU
MFEM_USE_MUMPS
@@ -1034,7 +1024,6 @@ The CMake build system adds auto-detection for the following packages/libraries:
- HYPRE
- METIS - The option MFEM_USE_METIS_5 is auto-detected.
- ParMETIS
- MESQUITE
- SuiteSparse
- SuperLUDist, STRUMPACK
- Ginkgo
+1 -1
View File
@@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC
Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
-4
View File
@@ -212,10 +212,6 @@ IF (DEFINED TPL_ENABLE_SUNDIALS)
SET(MFEM_USE_SUNDIALS ${TPL_ENABLE_SUNDIALS} CACHE BOOL "Enable SUNDIALS usage" FORCE)
ENDIF()
IF (DEFINED TPL_ENABLE_MESQUITE)
SET(MFEM_USE_MESQUITE ${TPL_ENABLE_MESQUITE} CACHE BOOL "Enable MESQUITE usage" FORCE)
ENDIF()
IF (DEFINED TPL_ENABLE_SUITESPARSE)
SET(MFEM_USE_SUITESPARSE ${TPL_ENABLE_SUITESPARSE} CACHE BOOL "Enable SuiteSparse usage" FORCE)
ENDIF()
+1 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -29,7 +29,6 @@ set(MFEM_USE_LEGACY_OPENMP @MFEM_USE_LEGACY_OPENMP@)
set(MFEM_USE_MEMALLOC @MFEM_USE_MEMALLOC@)
set(MFEM_TIMER_TYPE @MFEM_TIMER_TYPE@)
set(MFEM_USE_SUNDIALS @MFEM_USE_SUNDIALS@)
set(MFEM_USE_MESQUITE @MFEM_USE_MESQUITE@)
set(MFEM_USE_SUITESPARSE @MFEM_USE_SUITESPARSE@)
set(MFEM_USE_SUPERLU @MFEM_USE_SUPERLU@)
set(MFEM_USE_MUMPS @MFEM_USE_MUMPS@)
+4 -4
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
@@ -39,6 +39,9 @@
// Description of the git commit used to build MFEM.
#cmakedefine MFEM_GIT_STRING "@MFEM_GIT_STRING@"
// Enable shared library build of MFEM.
#cmakedefine MFEM_SHARED_BUILD
// Build the parallel MFEM library.
// Requires an MPI compiler, and the libraries HYPRE and METIS.
#cmakedefine MFEM_USE_MPI
@@ -77,9 +80,6 @@
// Internal MFEM option: enable group/batch allocation for some small objects.
#cmakedefine MFEM_USE_MEMALLOC
// Enable MFEM functionality based on the Mesquite library.
#cmakedefine MFEM_USE_MESQUITE
// Enable MFEM functionality based on the SuiteSparse library.
#cmakedefine MFEM_USE_SUITESPARSE
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+4 -4
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -16,7 +16,7 @@
include(MfemCmakeUtilities)
mfem_find_package(Algoim ALGOIM ALGOIM_DIR
"include" "algoim_quad.hpp"
"include;src" "algoim_quad.hpp"
"" ""
"Paths to headers required by Algoim."
"Libraries required by Algoim.")
"Paths to headers required by Algoim."
"Libraries required by Algoim.")
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+20 -5
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -16,7 +16,22 @@
include(MfemCmakeUtilities)
mfem_find_package(Caliper CALIPER CALIPER_DIR
"include" "caliper/cali.h"
"lib" "caliper"
"Paths to headers required by Caliper."
"Libraries required by Caliper.")
"include" "caliper/cali.h"
"lib" "caliper"
"Paths to headers required by Caliper."
"Libraries required by Caliper.")
# Append adiak path/lib if the user provided ADIAK_DIR
if(ADIAK_DIR AND EXISTS ${ADIAK_DIR})
find_package(adiak NO_DEFAULT_PATH REQUIRED PATHS ${ADIAK_DIR}/lib/cmake/adiak ${ADIAK_DIR})
list(APPEND CALIPER_INCLUDE_DIRS ${adiak_INCLUDE_DIRS})
list(APPEND CALIPER_LIBRARIES ${adiak_LIBRARIES})
endif()
# Append gotcha path/lib if the user provided GOTCHA_DIR
if(GOTCHA_DIR AND EXISTS ${GOTCHA_DIR})
find_package(gotcha NO_DEFAULT_PATH REQUIRED PATHS ${GOTCHA_DIR}/lib/cmake/gotcha ${GOTCHA_DIR})
list(APPEND CALIPER_INCLUDE_DIRS ${gotcha_INCLUDE_DIRS})
list(APPEND CALIPER_LIBRARIES ${gotcha_LIBRARIES})
endif()
+11 -4
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -21,8 +21,15 @@ if(EXISTS ${CONDUIT_DIR}/include/conduit/conduit_relay_hdf5.hpp)
# we only need HDF5 if Conduit was built with HDF5 support
set(Conduit_REQUIRED_PACKAGES "HDF5" CACHE STRING
"Additional packages required by Conduit.")
else()
message(STATUS "Conduit Relay HDF5 Support is DISABLED")
# Suppress warning about HDF5_ROOT being set
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# HDF5_ROOT is needed in some cases, e.g. when HDF5_TARGET_NAMES is set and
# MFEM's FindHDF5.cmake is not used.
set(HDF5_ROOT ${HDF5_DIR} CACHE PATH "")
else()
message(STATUS "Conduit Relay HDF5 Support is DISABLED")
endif()
include(MfemCmakeUtilities)
@@ -32,4 +39,4 @@ mfem_find_package(Conduit CONDUIT CONDUIT_DIR
ADD_COMPONENT relay
"include;include/conduit" conduit_relay.hpp "lib" conduit_relay
ADD_COMPONENT blueprint
"include;include/conduit" conduit_blueprint.hpp "lib" conduit_blueprint)
"include;include/conduit" conduit_blueprint.hpp "lib" conduit_blueprint)
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+18 -5
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -14,9 +14,21 @@
# - HDF5_LIBRARIES - The HDF5 libraries
# - HDF5_INCLUDE_DIRS - The HDF5 include directories
# NOTE: Using this FindHDF5.cmake instead of the CMake provided version may lead
# to issues with some TPL libraries that depend (or may depend) on HDF5.
# For this reason, we should consider removing this file, or at least
# making it use the CMake provided version by default and apply the logic
# below only when specifically requested by a user. -V. Dobrev
# First Check for HDF5_DIR
if(NOT HDF5_DIR)
MESSAGE(FATAL_ERROR "Could not find HDF5. HDF5 support needs explicit HDF5_DIR")
message(FATAL_ERROR
"Could not find HDF5. HDF5 support needs explicit HDF5_DIR")
endif()
if (NOT HDF5_FIND_QUIETLY)
message(STATUS "Looking for HDF5 ...")
message(STATUS " in HDF5_DIR = ${HDF5_DIR}")
endif()
# Find includes
@@ -50,8 +62,9 @@ include(FindPackageHandleStandardArgs)
# Handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if all
# listed variables are TRUE
find_package_handle_standard_args(HDF5 DEFAULT_MSG
find_package_handle_standard_args(HDF5
" *** HDF5 not found. Please set HDF5_DIR."
HDF5_LIBRARIES
HDF5_INCLUDE_DIRS
__HDF5_LIBRARY
__HDF5_HL_LIBRARY
HDF5_LIBRARIES )
__HDF5_HL_LIBRARY)
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
-20
View File
@@ -1,20 +0,0 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
# This file is part of the MFEM library. For more information and source code
# availability visit https://mfem.org.
#
# MFEM is free software; you can redistribute it and/or modify it under the
# terms of the BSD-3 license. We welcome feedback and contributions, see file
# CONTRIBUTING.md for details.
# Defines the following variables:
# - MESQUITE_FOUND
# - MESQUITE_LIBRARIES
# - MESQUITE_INCLUDE_DIRS
include(MfemCmakeUtilities)
mfem_find_package(Mesquite MESQUITE MESQUITE_DIR
"include" "Mesquite_all_headers.hpp" "lib" "mesquite"
"Paths to headers required by Mesquite." "Libraries required by Mesquite.")
+19 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -14,21 +14,38 @@
# - NETCDF_LIBRARIES
# - NETCDF_INCLUDE_DIRS
# Suppress warning about HDF5_ROOT being set
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
include(MfemCmakeUtilities)
# FindHDF5.cmake uses HDF5_ROOT, so we "translate" from the MFEM convention
# (Needed in some cases, e.g. when HDF5_TARGET_NAMES is set and MFEM's
# FindHDF5.cmake is not used.)
set(HDF5_ROOT ${HDF5_DIR} CACHE PATH "")
# We need to guard against the case where HDF5 was already found but without
# the HL extensions (in which case mfem_find_package will treat the package
# as already having been found), so we reset the variable to force FindHDF5.cmake
# to be called for a second time
set(HDF5_FOUND OFF)
enable_language(C) # FindHDF5.cmake uses the C compiler
mfem_find_package(NetCDF NETCDF NETCDF_DIR "include" netcdf.h "lib" netcdf
"Paths to headers required by NetCDF." "Libraries required by NetCDF.")
# The HL extension libraries are in a separate variable and must precede
# the "regular" hdf5 library, as hdf5_hl depends on hdf5
# The netcdf library will always be the first element of NETCDF_LIBRARIES
# and we need to insert after that library but before the hdf5 library, so
# position 1 is used
list(INSERT NETCDF_LIBRARIES 1 ${HDF5_C_LIBRARY_hdf5_hl})
# (Needed in some cases, e.g. when HDF5_TARGET_NAMES is set and MFEM's
# FindHDF5.cmake is not used.)
if (HDF5_C_LIBRARY_hdf5_hl)
list(INSERT NETCDF_LIBRARIES 1 ${HDF5_C_LIBRARY_hdf5_hl})
if (NOT NetCDF_FIND_QUIETLY)
message(STATUS "Updated NetCDF libraries: ${NETCDF_LIBRARIES}")
endif()
endif()
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+22 -12
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -14,17 +14,27 @@
# - RAJA_LIBRARIES
# - RAJA_INCLUDE_DIRS
include(MfemCmakeUtilities)
mfem_find_package(RAJA RAJA RAJA_DIR "include" "RAJA/RAJA.hpp" "lib" "RAJA"
"Paths to headers required by RAJA." "Libraries required by RAJA.")
if (NOT RAJA_CONFIG_CMAKE)
set(RAJA_CONFIG_CMAKE "${RAJA_DIR}/share/raja/cmake/raja-config.cmake")
if (RAJA_FOUND)
return()
endif()
if (EXISTS "${RAJA_CONFIG_CMAKE}")
include("${RAJA_CONFIG_CMAKE}")
if (ENABLE_CUDA AND NOT MFEM_USE_CUDA)
message(FATAL_ERROR
"RAJA is built with CUDA: MFEM_USE_CUDA=YES is required")
message(STATUS "Looking for RAJA ...")
if (RAJA_DIR)
message(STATUS " in RAJA_DIR = ${RAJA_DIR}")
find_package(RAJA CONFIG NO_DEFAULT_PATH PATHS "${RAJA_DIR}")
endif()
if (NOT RAJA_FOUND)
message(STATUS " in standard CMake locations")
find_package(RAJA CONFIG)
endif()
if (RAJA_FOUND)
set(RAJA_LIBRARIES "RAJA" CACHE STRING "RAJA imported target." FORCE)
set(RAJA_INCLUDE_DIRS "" CACHE STRING "RAJA include dirs (not used)" FORCE)
message(STATUS
"Found RAJA target: ${RAJA_LIBRARIES} (version: ${RAJA_VERSION})")
else()
set(msg STATUS)
if (RAJA_FIND_REQUIRED)
set(msg FATAL_ERROR)
endif()
message(${msg} "RAJA not found. Please set RAJA_DIR to the RAJA prefix.")
endif()
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+19 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -14,6 +14,23 @@
# - UMPIRE_LIBRARIES
# - UMPIRE_INCLUDE_DIRS
find_package(umpire REQUIRED CONFIG)
if (NOT umpire_DIR AND UMPIRE_DIR)
set(umpire_DIR ${UMPIRE_DIR}/lib/cmake/umpire)
endif()
message(STATUS "Looking for UMPIRE ...")
message(STATUS " in UMPIRE_DIR = ${UMPIRE_DIR}")
message(STATUS " umpire_DIR = ${umpire_DIR}")
find_package(umpire CONFIG)
set(UMPIRE_FOUND ${umpire_FOUND})
set(UMPIRE_LIBRARIES "umpire")
if (UMPIRE_FOUND)
message(STATUS
"Found UMPIRE target: ${UMPIRE_LIBRARIES} (version: ${umpire_VERSION})")
else()
set(msg STATUS)
if (UMPIRE_FIND_REQUIRED)
set(msg FATAL_ERROR)
endif()
message(${msg}
"UMPIRE not found. Please set UMPIRE_DIR to the install prefix.")
endif()
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+45 -79
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -46,6 +46,10 @@ endfunction()
# Wrapper for add_executable
macro(mfem_add_executable NAME)
add_executable(${NAME} ${ARGN})
if (MFEM_USE_CUDA)
set_target_properties(${NAME} PROPERTIES
CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
endmacro()
# Wrapper for add_library
@@ -99,25 +103,6 @@ macro(add_mfem_examples EXE_SRCS)
${MFEM_EXEC_PREREQUISITES_TARGET_NAME} ${EXE_PREREQUISITE})
target_link_libraries(${EXE_NAME} mfem)
if (MFEM_USE_MPI)
# Not needed: (mfem already links with MPI_CXX_LIBRARIES)
# target_link_libraries(${EXE_NAME} ${MPI_CXX_LIBRARIES})
# Language-specific include directories:
if (MPI_CXX_INCLUDE_PATH)
target_include_directories(${EXE_NAME} PRIVATE "${MPI_CXX_INCLUDE_PATH}")
endif()
if (MPI_CXX_COMPILE_FLAGS)
separate_arguments(MPI_CXX_COMPILE_ARGS UNIX_COMMAND
"${MPI_CXX_COMPILE_FLAGS}")
target_compile_options(${EXE_NAME} PRIVATE ${MPI_CXX_COMPILE_ARGS})
endif()
if (MPI_CXX_LINK_FLAGS)
set_target_properties(${EXE_NAME} PROPERTIES
LINK_FLAGS "${MPI_CXX_LINK_FLAGS}")
endif()
endif()
endforeach(SRC_FILE)
endmacro()
@@ -158,53 +143,16 @@ macro(add_mfem_miniapp MFEM_EXE_NAME)
# Append the additional libraries and options
if (LIBRARIES_LIST)
if(CMAKE_VERSION VERSION_GREATER 2.8.11)
target_link_libraries(${MFEM_EXE_NAME} PRIVATE ${LIBRARIES_LIST})
else()
target_link_libraries(${MFEM_EXE_NAME} ${LIBRARIES_LIST})
endif()
target_link_libraries(${MFEM_EXE_NAME} PRIVATE ${LIBRARIES_LIST})
endif()
if (EXTRA_OPTIONS_LIST)
string(REPLACE ";" " " EXTRA_OPTIONS_STRING "${EXTRA_OPTIONS_LIST}")
message(STATUS "${MFEM_EXE_NAME}: add flags \"${EXTRA_OPTIONS_STRING}\"")
if(CMAKE_VERSION VERSION_GREATER 2.8.11)
target_compile_options(${MFEM_EXE_NAME} PRIVATE ${EXTRA_OPTIONS_LIST})
else()
get_target_property(THIS_COMPILE_FLAGS ${MFEM_EXE_NAME} COMPILE_FLAGS)
if (THIS_COMPILE_FLAGS)
set(THIS_COMPILE_FLAGS "${THIS_COMPILE_FLAGS} ${EXTRA_OPTIONS_STRING}")
else()
set(THIS_COMPILE_FLAGS "${EXTRA_OPTIONS_STRING}")
endif()
set_target_properties(${MFEM_EXE_NAME}
PROPERTIES COMPILE_FLAGS ${THIS_COMPILE_FLAGS})
endif()
target_compile_options(${MFEM_EXE_NAME} PRIVATE ${EXTRA_OPTIONS_LIST})
endif()
if (EXTRA_DEFINES_LIST)
target_compile_definitions(${MFEM_EXE_NAME} PRIVATE ${EXTRA_DEFINES_LIST})
endif()
# Handle the MPI separately
if (MFEM_USE_MPI)
# Add MPI_CXX_LIBRARIES, in case this target does not link with mfem.
if(CMAKE_VERSION VERSION_GREATER 2.8.11)
target_link_libraries(${MFEM_EXE_NAME} PRIVATE ${MPI_CXX_LIBRARIES})
else()
target_link_libraries(${MFEM_EXE_NAME} ${MPI_CXX_LIBRARIES})
endif()
if (MPI_CXX_INCLUDE_PATH)
target_include_directories(${MFEM_EXE_NAME} PRIVATE ${MPI_CXX_INCLUDE_PATH})
endif()
if (MPI_CXX_COMPILE_FLAGS)
target_compile_options(${MFEM_EXE_NAME} PRIVATE ${MPI_CXX_COMPILE_FLAGS})
endif()
if (MPI_CXX_LINK_FLAGS)
set_target_properties(${MFEM_EXE_NAME} PROPERTIES
LINK_FLAGS "${MPI_CXX_LINK_FLAGS}")
endif()
endif()
endmacro()
@@ -449,9 +397,9 @@ function(mfem_find_package Name Prefix DirVar IncSuffixes Header LibSuffixes
break()
endif()
endforeach()
if (${Required} AND NOT ${ReqPack}_FOUND)
if (Required AND NOT ${ReqPack}_FOUND)
message(FATAL_ERROR " *** Required package ${ReqPack} not found."
"Checked target names: ${ReqPack} ${${ReqPack}_TARGET_NAMES}")
" Checked target names: ${ReqPack} ${${ReqPack}_TARGET_NAMES}")
endif()
endif()
endif()
@@ -517,14 +465,18 @@ function(mfem_find_package Name Prefix DirVar IncSuffixes Header LibSuffixes
endif()
get_target_property(IsImported ${TargetName} IMPORTED)
if (IsImported)
get_target_property(ImpConfigs ${TargetName} IMPORTED_CONFIGURATIONS)
# message(STATUS "${ReqPack} imported configs: ${ImpConfigs}")
set(ImportConfig ${${ReqPack}_IMPORT_CONFIG})
if (NOT ImportConfig)
set(ImportConfig RELEASE)
list(FIND ImpConfigs ${ImportConfig} _Index)
if (_Index EQUAL -1)
list(GET ImpConfigs 0 ImportConfig)
endif()
endif()
set(ImportConfigSuffix "_${ImportConfig}")
get_target_property(ImpConfigs ${TargetName} IMPORTED_CONFIGURATIONS)
list(FIND ImpConfigs ${ImportConfig} _Index)
if ((_Index EQUAL -1) OR ("${ImportConfig}" STREQUAL "NO_CONFIG"))
if ((NOT ImportConfig) OR ("${ImportConfig}" STREQUAL "NO_CONFIG"))
set(ImportConfig "NO_CONFIG")
set(ImportConfigSuffix "")
# message(FATAL_ERROR " *** ${ReqPack}: configuration "
@@ -542,7 +494,8 @@ function(mfem_find_package Name Prefix DirVar IncSuffixes Header LibSuffixes
else()
# Set _Pack_LIBS from the target properties for ImportConfig
foreach (_prop IMPORTED_LOCATION${ImportConfigSuffix}
IMPORTED_LINK_INTERFACE_LIBRARIES${ImportConfigSuffix})
IMPORTED_LINK_INTERFACE_LIBRARIES${ImportConfigSuffix}
INTERFACE_LINK_LIBRARIES)
get_target_property(_value ${TargetName} ${_prop})
if (_value)
list(APPEND _Pack_LIBS ${_value})
@@ -793,6 +746,7 @@ function(mfem_get_target_options Target CompileOptsVar LinkOptsVar)
list(APPEND CompileOpts "-isystem \"${SysDir}\"")
endforeach()
endif()
set(AddInterfaceLinkLibs TRUE)
if ("${type}" STREQUAL "STATIC_LIBRARY")
get_target_property(Location ${tgt} LOCATION)
if (Location)
@@ -814,18 +768,7 @@ function(mfem_get_target_options Target CompileOptsVar LinkOptsVar)
message(STATUS " *** Warning: [${tgt}] LOCATION not defined!")
endif()
elseif ("${type}" STREQUAL "INTERFACE_LIBRARY")
get_target_property(Libs ${tgt} INTERFACE_LINK_LIBRARIES)
if (Libs)
foreach(Lib ${Libs})
if (NOT (TARGET ${Lib}))
list(APPEND LinkOpts "${Lib}")
else()
mfem_get_target_options(${Lib} COpts LOpts)
list(APPEND CompileOpts ${COpts})
list(APPEND LinkOpts ${LOpts})
endif()
endforeach()
endif()
# The INTERFACE_LINK_LIBRARIES property is handled below.
# Other properties we may need to handle:
# INTERFACE_LINK_DEPENDS
# INTERFACE_LINK_DIRECTORIES
@@ -833,6 +776,26 @@ function(mfem_get_target_options Target CompileOptsVar LinkOptsVar)
else()
message(STATUS " *** Warning: [${tgt}] uses target type '${type}'"
" which is not supported!")
set(AddInterfaceLinkLibs FALSE)
endif()
if (AddInterfaceLinkLibs)
get_target_property(Libs ${tgt} INTERFACE_LINK_LIBRARIES)
# message(STATUS "${tgt}[INTERFACE_LINK_LIBRARIES]: ${Libs}")
if (Libs)
foreach(Lib ${Libs})
if (NOT (TARGET ${Lib}))
# message(STATUS "Lib = ${Lib}")
# Filter-out generator expressions
if (NOT ("${Lib}" MATCHES "^\\$"))
list(APPEND LinkOpts "${Lib}")
endif()
else()
mfem_get_target_options(${Lib} COpts LOpts)
list(APPEND CompileOpts ${COpts})
list(APPEND LinkOpts ${LOpts})
endif()
endforeach()
endif()
endif()
# Other potentially relevant properties:
@@ -856,6 +819,9 @@ function(mfem_get_target_options Target CompileOptsVar LinkOptsVar)
set(${CompileOptsVar} "${CompileOpts}" PARENT_SCOPE)
set(${LinkOptsVar} "${LinkOpts}" PARENT_SCOPE)
# message(STATUS "${tgt}[CompileOpts]: ${CompileOpts}")
# message(STATUS "${tgt}[LinkOpts]: ${LinkOpts}")
endfunction(mfem_get_target_options)
@@ -878,7 +844,7 @@ function(mfem_export_mk_files)
set(CONFIG_MK_BOOL_VARS MFEM_USE_MPI MFEM_USE_METIS MFEM_USE_METIS_5
MFEM_DEBUG MFEM_USE_EXCEPTIONS MFEM_USE_ZLIB MFEM_USE_LIBUNWIND
MFEM_USE_LAPACK MFEM_THREAD_SAFE MFEM_USE_LEGACY_OPENMP MFEM_USE_OPENMP
MFEM_USE_MEMALLOC MFEM_USE_SUNDIALS MFEM_USE_MESQUITE MFEM_USE_SUITESPARSE
MFEM_USE_MEMALLOC MFEM_USE_SUNDIALS MFEM_USE_SUITESPARSE
MFEM_USE_SUPERLU MFEM_USE_SUPERLU5 MFEM_USE_MUMPS MFEM_USE_STRUMPACK
MFEM_USE_GINKGO MFEM_USE_AMGX MFEM_USE_GNUTLS MFEM_USE_NETCDF
MFEM_USE_PETSC MFEM_USE_SLEPC MFEM_USE_MPFR MFEM_USE_SIDRE MFEM_USE_FMS
@@ -907,7 +873,7 @@ function(mfem_export_mk_files)
"${cxx_std_flag} ${CMAKE_CXX_FLAGS_${BUILD_TYPE}} ${CMAKE_CXX_FLAGS}"
MFEM_CXXFLAGS)
set(MFEM_TPLFLAGS "")
foreach(dir ${MFEM_TPL_INCLUDE_DIRS})
foreach(dir ${TPL_INCLUDE_DIRS})
set(MFEM_TPLFLAGS "${MFEM_TPLFLAGS} -I${dir}")
endforeach()
# TODO: MFEM_TPLFLAGS: add other TPL flags, in addition to the -I flags.
+22 -3
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
@@ -30,11 +30,30 @@
#endif
// Windows specific options
#ifdef _WIN32
#ifndef _USE_MATH_DEFINES
#if defined(_WIN32) && !defined(_USE_MATH_DEFINES)
// Macro needed to get defines like M_PI from <cmath>. (Visual Studio C++ only?)
#define _USE_MATH_DEFINES
#endif
// Macro MFEM_EXPORT: this macro is used when declaring exported global
// variables and static class variables in public header files, e.g.:
// extern MFEM_EXPORT Geometry Geometries;
// static MFEM_EXPORT Device device_singleton;
// In cases where a class contains multiple static variables, instead of marking
// all such variables with MFEM_EXPORT, one can mark the class with MFEM_EXPORT,
// e.g.:
// class MFEM_EXPORT MemoryManager ...
// Note: MFEM's GitHub CI includes a shared MSVC build that will fail if a
// variable that needs MFEM_EXPORT does not have it. However, builds with
// optional external libraries are not tested and may require separate checks to
// determine the necessity of MFEM_EXPORT.
#if defined(_MSC_VER) && defined(MFEM_SHARED_BUILD)
#ifdef mfem_EXPORTS
#define MFEM_EXPORT __declspec(dllexport)
#else
#define MFEM_EXPORT __declspec(dllimport)
#endif
#else
#define MFEM_EXPORT
#endif
// On Cygwin the option -std=c++11 prevents the definition of M_PI. Defining
// the following macro allows us to get M_PI and some needed functions, e.g.
+4 -4
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
@@ -39,6 +39,9 @@
// Description of the git commit used to build MFEM.
// #define MFEM_GIT_STRING "@MFEM_GIT_STRING@"
// Enable shared library build of MFEM.
// #define MFEM_SHARED_BUILD
// Build the parallel MFEM library.
// Requires an MPI compiler, and the libraries HYPRE and METIS.
// #define MFEM_USE_MPI
@@ -85,9 +88,6 @@
// Enable MFEM functionality based on the SUNDIALS libraries.
// #define MFEM_USE_SUNDIALS
// Enable MFEM functionality based on the Mesquite library.
// #define MFEM_USE_MESQUITE
// Enable MFEM functionality based on the SuiteSparse library.
// #define MFEM_USE_SUITESPARSE
+1 -2
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -29,7 +29,6 @@ MFEM_USE_OPENMP = @MFEM_USE_OPENMP@
MFEM_USE_MEMALLOC = @MFEM_USE_MEMALLOC@
MFEM_TIMER_TYPE = @MFEM_TIMER_TYPE@
MFEM_USE_SUNDIALS = @MFEM_USE_SUNDIALS@
MFEM_USE_MESQUITE = @MFEM_USE_MESQUITE@
MFEM_USE_SUITESPARSE = @MFEM_USE_SUITESPARSE@
MFEM_USE_SUPERLU = @MFEM_USE_SUPERLU@
MFEM_USE_SUPERLU5 = @MFEM_USE_SUPERLU5@
+4 -11
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -19,6 +19,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
# MFEM options. Set to mimic the default "defaults.mk" file.
option(BUILD_SHARED_LIBS "Enable shared library build of MFEM" OFF)
option(MFEM_USE_MPI "Enable MPI parallel build" OFF)
option(MFEM_USE_METIS "Enable METIS usage" ${MFEM_USE_MPI})
option(MFEM_USE_EXCEPTIONS "Enable the use of exceptions" OFF)
@@ -30,7 +31,6 @@ option(MFEM_USE_OPENMP "Enable the OpenMP backend" OFF)
option(MFEM_USE_LEGACY_OPENMP "Enable legacy OpenMP usage" OFF)
option(MFEM_USE_MEMALLOC "Enable the internal MEMALLOC option." ON)
option(MFEM_USE_SUNDIALS "Enable SUNDIALS usage" OFF)
option(MFEM_USE_MESQUITE "Enable MESQUITE usage" OFF)
option(MFEM_USE_SUITESPARSE "Enable SuiteSparse usage" OFF)
option(MFEM_USE_SUPERLU "Enable SuperLU_DIST usage" OFF)
option(MFEM_USE_SUPERLU5 "Use the old SuperLU_DIST 5.1 version" OFF)
@@ -124,9 +124,6 @@ set(SUNDIALS_DIR "${MFEM_DIR}/../sundials-5.0.0/instdir" CACHE PATH
# set(SUNDIALS_REQUIRED_PACKAGES "SuiteSparse/KLU/AMD/BTF/COLAMD/config"
# CACHE STRING "Additional packages required by SUNDIALS.")
set(MESQUITE_DIR "${MFEM_DIR}/../mesquite-2.99" CACHE PATH
"Path to the Mesquite library.")
set(SuiteSparse_DIR "${MFEM_DIR}/../SuiteSparse" CACHE PATH
"Path to the SuiteSparse library.")
set(SuiteSparse_REQUIRED_PACKAGES "BLAS" "METIS"
@@ -188,6 +185,7 @@ set(GNUTLS_DIR "" CACHE PATH "Path to the GnuTLS library.")
set(GSLIB_DIR "" CACHE PATH "Path to the GSLIB library.")
set(HDF5_DIR "/usr" CACHE PATH "Path to the HDF5 library.")
set(NETCDF_DIR "" CACHE PATH "Path to the NetCDF library.")
set(NetCDF_REQUIRED_PACKAGES "HDF5/C/HL" CACHE STRING
"Additional packages required by NetCDF.")
@@ -230,17 +228,12 @@ set(MKL_LIBRARY_DIR "" CACHE STRING "Custom library subdirectory")
set(OCCA_DIR "${MFEM_DIR}/../occa" CACHE PATH "Path to OCCA")
set(RAJA_DIR "${MFEM_DIR}/../raja" CACHE PATH "Path to RAJA")
# If RAJA is built with external CAMP:
# set(RAJA_REQUIRED_PACKAGES "camp"
# CACHE STRING "Packages that RAJA depends on.")
# set(camp_DIR "${MFEM_DIR}/../camp/lib/cmake/camp"
# CACHE PATH "Path to CAMP CMake files.")
set(CEED_DIR "${MFEM_DIR}/../libCEED" CACHE PATH "Path to libCEED")
set(UMPIRE_DIR "${MFEM_DIR}/../umpire" CACHE PATH "Path to Umpire")
set(CALIPER_DIR "${MFEM_DIR}/../caliper" CACHE PATH "Path to Caliper")
set(BLITZ_DIR "${MFEM_DIR}/../blitz" CACHE PATH "Path to Blitz")
set(ALGOIM_DIR "${MFEM_DIR}/../algoim" CACHE PATH "Path to Algoim")
set(ALGOIM_REQUIRED_PACKAGES "BLITZ" CACHE STRING
set(Algoim_REQUIRED_PACKAGES "Blitz" CACHE STRING
"Packages that ALGOIM depends on.")
set(BENCHMARK_DIR "${MFEM_DIR}/../google-benchmark" CACHE PATH
+27 -11
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -58,7 +58,7 @@ HIP_CXX = hipcc
# example: gfx600 (tahiti), gfx700 (kaveri), gfx701 (hawaii), gfx801 (carrizo),
# gfx900, gfx1010, etc.
HIP_ARCH = gfx900
HIP_FLAGS = --amdgpu-target=$(HIP_ARCH)
HIP_FLAGS = --offload-arch=$(HIP_ARCH)
HIP_XCOMPILER =
HIP_XLINKER = -Wl,
@@ -131,7 +131,6 @@ MFEM_USE_LEGACY_OPENMP = NO
MFEM_USE_MEMALLOC = YES
MFEM_TIMER_TYPE = $(if $(NOTMAC),2,4)
MFEM_USE_SUNDIALS = NO
MFEM_USE_MESQUITE = NO
MFEM_USE_SUITESPARSE = NO
MFEM_USE_SUPERLU = NO
MFEM_USE_SUPERLU5 = NO
@@ -270,11 +269,6 @@ endif
# If SUNDIALS was built with KLU:
# MFEM_USE_SUITESPARSE = YES
# MESQUITE library configuration
MESQUITE_DIR = @MFEM_DIR@/../mesquite-2.99
MESQUITE_OPT = -I$(MESQUITE_DIR)/include
MESQUITE_LIB = -L$(MESQUITE_DIR)/lib -lmesquite
# SuiteSparse library configuration
LIB_RT = $(if $(NOTMAC),-lrt,)
SUITESPARSE_DIR = @MFEM_DIR@/../SuiteSparse
@@ -324,6 +318,9 @@ MUMPS_LIB = $(XLINKER)-rpath,$(MUMPS_DIR)/lib -L$(MUMPS_DIR)/lib -ldmumps\
# STRUMPACK library configuration
STRUMPACK_DIR = @MFEM_DIR@/../STRUMPACK-build
ifeq ($(MFEM_USE_STRUMPACK),YES)
BASE_FLAGS = -std=c++14
endif
STRUMPACK_OPT = -I$(STRUMPACK_DIR)/include $(SCOTCH_OPT)
# If STRUMPACK was build with OpenMP support, the following may be need:
# STRUMPACK_OPT += $(OPENMP_OPT)
@@ -476,7 +473,17 @@ OCCA_LIB = $(XLINKER)-rpath,$(OCCA_DIR)/lib -L$(OCCA_DIR)/lib -locca
# CALIPER library configuration
CALIPER_DIR = @MFEM_DIR@/../caliper
CALIPER_OPT = -I$(CALIPER_DIR)/include
CALIPER_LIB = $(XLINKER)-rpath,$(CALIPER_DIR)/lib64 -L$(CALIPER_DIR)/lib64 -lcaliper
CALIPER_LIB = $(XLINKER)-rpath,$(CALIPER_DIR)/lib64 $(XLINKER)-rpath,$(CALIPER_DIR)/lib -L$(CALIPER_DIR)/lib64 -L$(CALIPER_DIR)/lib -lcaliper
ifdef ADIAK_DIR
CALIPER_OPT += -I$(ADIAK_DIR)/include
CALIPER_LIB += $(XLINKER)-rpath,$(ADIAK_DIR)/lib64 $(XLINKER)-rpath,$(ADIAK_DIR)/lib -L$(ADIAK_DIR)/lib64 -L$(ADIAK_DIR)/lib -ladiak
endif
ifdef GOTCHA_DIR
CALIPER_OPT += -I$(GOTCHA_DIR)/include
CALIPER_LIB += $(XLINKER)-rpath,$(GOTCHA_DIR)/lib64 $(XLINKER)-rpath,$(GOTCHA_DIR)/lib -L$(GOTCHA_DIR)/lib64 -L$(GOTCHA_DIR)/lib -lgotcha
endif
# BLITZ library configuration
BLITZ_DIR = @MFEM_DIR@/../blitz
@@ -499,20 +506,29 @@ CEED_OPT = -I$(CEED_DIR)/include
CEED_LIB = $(XLINKER)-rpath,$(CEED_DIR)/lib -L$(CEED_DIR)/lib -lceed
# RAJA library configuration
ifeq ($(MFEM_USE_RAJA),YES)
BASE_FLAGS = -std=c++14
endif
RAJA_DIR = @MFEM_DIR@/../raja
RAJA_OPT = -I$(RAJA_DIR)/include
ifdef CUB_DIR
RAJA_OPT += -I$(CUB_DIR)
endif
CAMP_LIB = -lcamp
ifdef CAMP_DIR
RAJA_OPT += -I$(CAMP_DIR)/include
CAMP_LIB = $(XLINKER)-rpath,$(CAMP_DIR)/lib -L$(CAMP_DIR)/lib -lcamp
endif
RAJA_LIB = $(XLINKER)-rpath,$(RAJA_DIR)/lib -L$(RAJA_DIR)/lib -lRAJA
RAJA_LIB = $(XLINKER)-rpath,$(RAJA_DIR)/lib -L$(RAJA_DIR)/lib -lRAJA $(CAMP_LIB)
# UMPIRE library configuration
ifeq ($(MFEM_USE_UMPIRE),YES)
BASE_FLAGS = -std=c++14
endif
UMPIRE_DIR = @MFEM_DIR@/../umpire
UMPIRE_OPT = -I$(UMPIRE_DIR)/include $(if $(CAMP_DIR), -I$(CAMP_DIR)/include)
UMPIRE_LIB = -L$(UMPIRE_DIR)/lib -lumpire
UMPIRE_LIB = -L$(UMPIRE_DIR)/lib -lumpire $(CAMP_LIB)
# MKL CPardiso library configuration
MKL_CPARDISO_DIR ?=
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
+3 -3
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -35,8 +35,8 @@ cd $(git rev-parse --show-toplevel)
# copyright check
copyright=true
if [[ "${option}" == "--copyright" || "${option}" == "" ]]; then
if git grep -l "^\(#\|//\).*\(\-2021\|\ 2010,\)" > matches.txt; then
echo "Please update the following files to Copyright (c) 2010-2022:"
if git grep -n "^\(#\|//\).*Copyright.*2010-20\(2[^3]\|[^2].\)" > matches.txt; then
echo "Please update the following files to Copyright (c) 2010-2023:"
cat matches.txt
copyright=false
fi
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+3 -3
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -138,7 +138,7 @@ groups_parallel=(
'"meshing"
"Meshing miniapps:"
"miniapps/meshing"
"pmesh-optimizer.cpp pminimal-surface.cpp"'
"pmesh-optimizer.cpp pmesh-fitting.cpp pminimal-surface.cpp"'
'"electromagnetics"
"Electromagnetics miniapps:"
"miniapps/electromagnetics"
@@ -227,7 +227,7 @@ groups_all=(
"Meshing miniapps:"
"miniapps/meshing"
"mobius-strip.cpp klein-bottle.cpp extruder.cpp toroid.cpp
{,p}mesh-optimizer.cpp {,p}minimal-surface.cpp"'
{,p}mesh-optimizer.cpp pmesh-fitting.cpp {,p}minimal-surface.cpp"'
'"electromagnetics"
"Electromagnetics miniapps:"
"miniapps/electromagnetics"
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+109
View File
@@ -0,0 +1,109 @@
MFEM NURBS mesh v1.0
#
# MFEM Geometry Types (see mesh/geom.hpp):
#
# SEGMENT = 1
# SQUARE = 3
# CUBE = 5
#
dimension
2
elements
5
1 3 4 5 6 7
1 3 0 1 5 4
1 3 1 2 6 5
1 3 3 7 6 2
1 3 0 4 7 3
boundary
4
1 1 0 1
1 1 2 3
1 1 1 2
1 1 3 0
edges
12
0 0 1
0 4 5
0 7 6
0 3 2
1 1 2
1 5 6
1 4 7
1 0 3
2 0 4
2 1 5
2 2 6
2 3 7
vertices
8
knotvectors
3
2 3 0 0 0 1 1 1
2 3 0 0 0 1 1 1
2 3 0 0 0 1 1 1
weights
1
1
1
1
1
1
1
1
0.70710678118655
1
1
0.70710678118655
0.70710678118655
1
1
0.70710678118655
1
1
1
1
1
0.85355339059327
0.85355339059327
0.85355339059327
0.85355339059327
FiniteElementSpace
FiniteElementCollection: NURBS2
VDim: 2
Ordering: 1
-0.70710678118 -0.70710678118
0.70710678118 -0.70710678118
0.70710678118 0.70710678118
-0.70710678118 0.70710678118
-0.35355339059 -0.35355339059
0.35355339059 -0.35355339059
0.35355339059 0.35355339059
-0.35355339059 0.35355339059
0 -1.41421356236
0 -0.35355339059
0 0.35355339059
0 1.41421356236
1.41421356236 0
0.35355339059 0
-0.35355339059 0
-1.41421356236 0
-0.530330085885 -0.530330085885
0.530330085885 -0.530330085885
0.530330085885 0.530330085885
-0.530330085885 0.530330085885
0 0
0 -0.883883476475
0.883883476475 0
0 0.883883476475
-0.883883476475 0
+46
View File
@@ -0,0 +1,46 @@
MFEM NURBS mesh v1.0
#
# MFEM Geometry Types (see mesh/geom.hpp):
#
# SEGMENT = 1
# SQUARE = 3
# CUBE = 5
#
dimension
1
elements
1
1 1 0 1
boundary
2
1 0 0
2 0 1
edges
1
0 0 1
vertices
2
knotvectors
1
1 2 0 0 1 1
weights
1
1
FiniteElementSpace
FiniteElementCollection: NURBS1
VDim: 1
Ordering: 1
0
1
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+25 -7
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = "MFEM"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v4.5.0
PROJECT_NUMBER = v4.5.3
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -763,36 +763,54 @@ INPUT = @MFEM_SOURCE_DIR@/doc/CodeDocumentation.dox \
@MFEM_SOURCE_DIR@/config \
@MFEM_SOURCE_DIR@/general \
@MFEM_SOURCE_DIR@/linalg \
@MFEM_SOURCE_DIR@/linalg/simd \
@MFEM_SOURCE_DIR@/mesh \
@MFEM_SOURCE_DIR@/mesh/submesh \
@MFEM_SOURCE_DIR@/fem \
@MFEM_SOURCE_DIR@/fem/moonolith \
@MFEM_SOURCE_DIR@/fem/ceed \
@MFEM_SOURCE_DIR@/fem/ceed/integrators \
@MFEM_SOURCE_DIR@/fem/ceed/integrators/convection \
@MFEM_SOURCE_DIR@/fem/ceed/integrators/diffusion \
@MFEM_SOURCE_DIR@/fem/ceed/integrators/mass \
@MFEM_SOURCE_DIR@/fem/ceed/integrators/nlconvection \
@MFEM_SOURCE_DIR@/fem/ceed/interface \
@MFEM_SOURCE_DIR@/fem/ceed/solvers \
@MFEM_SOURCE_DIR@/fem/fe \
@MFEM_SOURCE_DIR@/fem/lor \
@MFEM_SOURCE_DIR@/fem/moonolith \
@MFEM_SOURCE_DIR@/fem/qinterp \
@MFEM_SOURCE_DIR@/fem/tmop \
@MFEM_SOURCE_DIR@/examples \
@MFEM_SOURCE_DIR@/examples/caliper \
@MFEM_SOURCE_DIR@/examples/amgx \
@MFEM_SOURCE_DIR@/examples/caliper \
@MFEM_SOURCE_DIR@/examples/ginkgo \
@MFEM_SOURCE_DIR@/examples/moonolith \
@MFEM_SOURCE_DIR@/examples/hiop \
@MFEM_SOURCE_DIR@/examples/moonolith \
@MFEM_SOURCE_DIR@/examples/petsc \
@MFEM_SOURCE_DIR@/examples/pumi \
@MFEM_SOURCE_DIR@/examples/sundials \
@MFEM_SOURCE_DIR@/examples/superlu \
@MFEM_SOURCE_DIR@/miniapps/adjoint \
@MFEM_SOURCE_DIR@/miniapps/autodiff \
@MFEM_SOURCE_DIR@/miniapps/common \
@MFEM_SOURCE_DIR@/miniapps/electromagnetics \
@MFEM_SOURCE_DIR@/miniapps/gslib \
@MFEM_SOURCE_DIR@/miniapps/hooke \
@MFEM_SOURCE_DIR@/miniapps/hooke/kernels \
@MFEM_SOURCE_DIR@/miniapps/hooke/materials \
@MFEM_SOURCE_DIR@/miniapps/hooke/operators \
@MFEM_SOURCE_DIR@/miniapps/hooke/preconditioners \
@MFEM_SOURCE_DIR@/miniapps/meshing \
@MFEM_SOURCE_DIR@/miniapps/mtop \
@MFEM_SOURCE_DIR@/miniapps/autodiff \
@MFEM_SOURCE_DIR@/miniapps/multidomain \
@MFEM_SOURCE_DIR@/miniapps/navier \
@MFEM_SOURCE_DIR@/miniapps/nurbs \
@MFEM_SOURCE_DIR@/miniapps/parelag \
@MFEM_SOURCE_DIR@/miniapps/performance \
@MFEM_SOURCE_DIR@/miniapps/shifted \
@MFEM_SOURCE_DIR@/miniapps/solvers \
@MFEM_SOURCE_DIR@/miniapps/tools \
@MFEM_SOURCE_DIR@/miniapps/toys \
@MFEM_SOURCE_DIR@/miniapps/parelag
@MFEM_SOURCE_DIR@/miniapps/toys
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
+3 -3
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -33,13 +33,13 @@ add_mfem_examples(CALIPER_EXE_SRCS ${PREFIX})
if (MFEM_ENABLE_TESTING)
foreach(SRC_FILE ${CALIPER_EXE_SRCS})
get_filename_component(SRC_FILENAME ${SRC_FILE} NAME)
string(REPLACE ".cpp" "" TEST_NAME ${SRC_FILENAME})
string(REPLACE ".cpp" "" TEST_NAME ${PREFIX}${SRC_FILENAME})
set(THIS_TEST_OPTIONS "-no-vis")
if (NOT (${TEST_NAME} MATCHES ".*p$"))
add_test(NAME ${TEST_NAME}_ser
COMMAND ${TEST_NAME} ${THIS_TEST_OPTIONS})
COMMAND $<TARGET_FILE:${TEST_NAME}> ${THIS_TEST_OPTIONS})
else()
add_test(NAME ${TEST_NAME}_np=${MFEM_MPI_NP}
COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP}
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
@@ -0,0 +1,141 @@
#include "mfem.hpp"
#include "Problems.hpp"
#include "IPsolver.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
double fRhs(const Vector &pt);
double obstacle(const Vector &pt);
double dmanufacturedFun(const Vector &pt);
int main(int argc, char *argv[])
{
int FEorder = 1; // order of the finite elements
int linSolver = 0;
int maxIPMiters = 30;
bool iAmRoot = true;
int ref_levels = 3;
OptionsParser args(argc, argv);
args.AddOption(&FEorder, "-o", "--order",\
"Order of the finite elements.");
args.AddOption(&linSolver, "-linSolver", "--linearSolver", \
"IP-Newton linear system solution strategy.");
args.AddOption(&maxIPMiters, "-IPMiters", "--IPMiters",\
"Maximum number of IPM iterations");
args.AddOption(&ref_levels, "-r", "--mesh_refinement", \
"Mesh Refinement");
args.Parse();
if(!args.Good())
{
args.PrintUsage(cout);
return 1;
}
else
{
if( iAmRoot )
{
args.PrintOptions(cout);
}
}
const char *meshFile = "../../data/inline-quad.mesh";
Mesh *mesh = new Mesh(meshFile, 1, 1);
int dim = mesh->Dimension(); // geometric dimension of the domain
for (int l = 0; l < ref_levels; l++)
{
mesh->UniformRefinement();
}
FiniteElementCollection *fec = new H1_FECollection(FEorder, dim);
FiniteElementSpace *Vh = new FiniteElementSpace(mesh, fec);
Array<int> ess_tdof_list;
if (mesh->bdr_attributes.Size())
{
Array<int> ess_bdr(mesh->bdr_attributes.Max());
ess_bdr = 1;
Vh->GetEssentialTrueDofs(ess_bdr, ess_tdof_list);
}
double DC_val = 0.0;
int dimD = Vh->GetTrueVSize();
Vector x0(dimD); x0 = DC_val;
Vector xf(dimD); xf = 0.0;
ObstacleProblem problem(Vh, x0, &fRhs, &obstacle, ess_tdof_list);
InteriorPointSolver optimizer(&problem);
optimizer.SetTol(1.e-7);
optimizer.SetLinearSolver(linSolver);
optimizer.SetMaxIter(maxIPMiters);
optimizer.Mult(x0, xf);
double Einitial = problem.E(x0);
double Efinal = problem.E(xf);
cout << "Energy objective at initial point = " << Einitial << endl;
cout << "Energy objective at optimizer = " << Efinal << endl;
GridFunction d_gf(Vh);
d_gf = xf;
FunctionCoefficient dm_fc(dmanufacturedFun); // pseudo-manufactured solution
GridFunction dm_gf(Vh);
dm_gf.ProjectCoefficient(dm_fc);
ParaViewDataCollection paraview_dc("BarrierProblemSolution", mesh);
paraview_dc.SetPrefixPath("ParaView");
paraview_dc.SetLevelsOfDetail(FEorder);
paraview_dc.SetDataFormat(VTKFormat::BINARY);
paraview_dc.SetHighOrderOutput(true);
paraview_dc.SetCycle(0);
paraview_dc.SetTime(0.0);
paraview_dc.RegisterField("d(x) (numerical)", &d_gf);
paraview_dc.RegisterField("d(x) (pseudo-manufactured)", &dm_gf);
paraview_dc.Save();
delete Vh;
delete fec;
delete mesh;
return 0;
}
double dmanufacturedFun(const Vector &pt)
{
double alpha = 16.5;
return sin(M_PI * pt(1)) * (sin(M_PI * pt(0)) - alpha * pow(pt(0) * (1. - pt(0)), 2));
}
// f(x) forcing term... which enters the objective energy functional
// E(d) = 0.5 d^T K d - f^T d, where f is a discrete vector representation
// of f(x). f(x) is such that in the absence of bound-constraints then
// the solution of the optimization problem satisfies the PDE
// -div(grad(d)) + d = f + homogeneous Neumann conditions on the unit interval,
// for d(x) = cos(2 \pi x) + a0 + a3 (x^3 - 1.5 x^2), a2 = 0.2, a3 = -2
double fRhs(const Vector &pt)
{
double alpha = 16.5;
double fx;
fx = pow(M_PI, 2) * sin(M_PI * pt(0));
fx += alpha * (2. * pow(pt(0), 2) + 2. * pow(1.-pt(0), 2) - 8. * pt(0) * (1.-pt(0)));
fx += pow(M_PI, 2) * sin(M_PI * pt(0)) * dmanufacturedFun(pt);
fx *= sin(M_PI * pt(1));
return fx;
}
double obstacle(const Vector &pt)
{
return 0.0;
}
@@ -0,0 +1,156 @@
#include "mfem.hpp"
#include "Problems.hpp"
#include "IPsolver.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
double fRhs(const Vector &pt);
double obstacle(const Vector &pt);
double dmanufacturedFun(const Vector &pt);
int main(int argc, char *argv[])
{
int FEorder = 1; // order of the finite elements
int linSolver = 0;
int maxIPMiters = 30;
bool iAmRoot = true;
int ref_levels = 3;
OptionsParser args(argc, argv);
args.AddOption(&FEorder, "-o", "--order",\
"Order of the finite elements.");
args.AddOption(&linSolver, "-linSolver", "--linearSolver", \
"IP-Newton linear system solution strategy.");
args.AddOption(&maxIPMiters, "-IPMiters", "--IPMiters",\
"Maximum number of IPM iterations");
args.AddOption(&ref_levels, "-r", "--mesh_refinement", \
"Mesh Refinement");
args.Parse();
if(!args.Good())
{
args.PrintUsage(cout);
return 1;
}
else
{
if( iAmRoot )
{
args.PrintOptions(cout);
}
}
const char *meshFile = "../../data/inline-quad.mesh";
Mesh *mesh = new Mesh(meshFile, 1, 1);
int dim = mesh->Dimension(); // geometric dimension of the domain
for (int l = 0; l < ref_levels; l++)
{
mesh->UniformRefinement();
}
FiniteElementCollection *fec = new H1_FECollection(FEorder, dim);
FiniteElementSpace *Vh = new FiniteElementSpace(mesh, fec);
Array<int> ess_tdof_list;
if (mesh->bdr_attributes.Size())
{
Array<int> ess_bdr(mesh->bdr_attributes.Max());
ess_bdr = 1;
Vh->GetEssentialTrueDofs(ess_bdr, ess_tdof_list);
}
double DC_val = 0.06;
Vector x0DC(Vh->GetTrueVSize()); x0DC = DC_val;
int dimD = Vh->GetTrueVSize() - ess_tdof_list.Size();
Vector x0(dimD); x0 = 0.0;
Vector xf(dimD); xf = 0.0;
ObstacleProblemVariant problem(Vh, x0DC, &fRhs, &obstacle, ess_tdof_list);
InteriorPointSolver optimizer(&problem);
optimizer.SetTol(1.e-7);
optimizer.SetLinearSolver(linSolver);
optimizer.SetMaxIter(maxIPMiters);
optimizer.Mult(x0, xf);
double Einitial = problem.E(x0);
double Efinal = problem.E(xf);
cout << "Energy objective at initial point = " << Einitial << endl;
cout << "Energy objective at optimizer = " << Efinal << endl;
Array<int> noness_tdof_list;
noness_tdof_list.SetSize(dimD);
int i = 0;
for(int j = 0; j < Vh->GetTrueVSize(); j++)
{
if(ess_tdof_list.Find(j) == -1)
{
noness_tdof_list[i] = j;
i += 1;
}
}
GridFunction d_gf(Vh);
d_gf.Set(1.0, x0DC);
d_gf.SetSubVector(noness_tdof_list, xf);
FunctionCoefficient dm_fc(dmanufacturedFun); // pseudo-manufactured solution
GridFunction dm_gf(Vh);
dm_gf.ProjectCoefficient(dm_fc);
ParaViewDataCollection paraview_dc("BarrierProblemSolution", mesh);
paraview_dc.SetPrefixPath("ParaView");
paraview_dc.SetLevelsOfDetail(FEorder);
paraview_dc.SetDataFormat(VTKFormat::BINARY);
paraview_dc.SetHighOrderOutput(true);
paraview_dc.SetCycle(0);
paraview_dc.SetTime(0.0);
paraview_dc.RegisterField("d(x) (numerical)", &d_gf);
paraview_dc.RegisterField("d(x) (pseudo-manufactured)", &dm_gf);
paraview_dc.Save();
delete Vh;
delete fec;
delete mesh;
return 0;
}
double dmanufacturedFun(const Vector &pt)
{
double alpha = 16.5;
return sin(M_PI * pt(1)) * (sin(M_PI * pt(0)) - alpha * pow(pt(0) * (1. - pt(0)), 2));
}
// f(x) forcing term... which enters the objective energy functional
// E(d) = 0.5 d^T K d - f^T d, where f is a discrete vector representation
// of f(x). f(x) is such that in the absence of bound-constraints then
// the solution of the optimization problem satisfies the PDE
// -div(grad(d)) + d = f + homogeneous Neumann conditions on the unit interval,
// for d(x) = cos(2 \pi x) + a0 + a3 (x^3 - 1.5 x^2), a2 = 0.2, a3 = -2
double fRhs(const Vector &pt)
{
double alpha = 16.5;
double fx;
fx = pow(M_PI, 2) * sin(M_PI * pt(0));
fx += alpha * (2. * pow(pt(0), 2) + 2. * pow(1.-pt(0), 2) - 8. * pt(0) * (1.-pt(0)));
fx += pow(M_PI, 2) * sin(M_PI * pt(0)) * dmanufacturedFun(pt);
fx *= sin(M_PI * pt(1));
return fx;
}
double obstacle(const Vector &pt)
{
return 0.0;
}
+827
View File
@@ -0,0 +1,827 @@
#include "mfem.hpp"
#include "IPsolver.hpp"
#include "Problems.hpp"
#include <fstream>
#include <iostream>
#include <cstdlib>
using namespace std;
using namespace mfem;
InteriorPointSolver::InteriorPointSolver(GeneralOptProblem * Problem) : optProblem(Problem), block_offsetsumlz(5), block_offsetsuml(4), block_offsetsx(3),
Huu(nullptr), Hum(nullptr), Hmu(nullptr), Hmm(nullptr), Wmm(nullptr), D(nullptr), Ju(nullptr), Jm(nullptr), JuT(nullptr), JmT(nullptr), Huucl(nullptr), HLuu(nullptr), saveLogBarrierIterates(false)
{
rel_tol = 1.e-2;
max_iter = 20;
mu_k = 1.0;
sMax = 1.e2;
kSig = 1.e10; // control deviation from primal Hessian
tauMin = 0.8; // control rate at which iterates can approach the boundary
eta = 1.e-4; // backtracking constant
thetaMin = 1.e-4; // allowed violation of the equality constraints
// constants in line-step A-5.4
delta = 1.0;
sTheta = 1.1;
sPhi = 2.3;
// control the rate at which the penalty parameter is decreased
kMu = 0.2;
thetaMu = 1.5;
// TO DO -- include the filter
thetaMax = 1.e6; // maximum constraint violation
// data for the second order correction
kSoc = 0.99;
// equation (18)
gTheta = 1.e-5;
gPhi = 1.e-5;
kEps = 1.e1;
dimU = optProblem->GetDimU();
dimM = optProblem->GetDimM();
dimC = optProblem->GetDimC();
ckSoc.SetSize(dimC);
block_offsetsumlz[0] = 0;
block_offsetsumlz[1] = dimU; // u
block_offsetsumlz[2] = dimM; // m
block_offsetsumlz[3] = dimC; // lambda
block_offsetsumlz[4] = dimM; // zl
block_offsetsumlz.PartialSum();
for(int i = 0; i < block_offsetsuml.Size(); i++) { block_offsetsuml[i] = block_offsetsumlz[i]; }
for(int i = 0; i < block_offsetsx.Size(); i++) { block_offsetsx[i] = block_offsetsuml[i] ; }
// lower-bound for the inequality constraint m >= ml
ml = optProblem->Getml();
lk.SetSize(dimC); lk = 0.0;
zlk.SetSize(dimM); zlk = 0.0;
linSolver = 0;
MyRank = 0;
iAmRoot = MyRank == 0 ? true : false;
}
double InteriorPointSolver::MaxStepSize(Vector &x, Vector &xl, Vector &xhat, double tau)
{
double alphaMaxloc = 1.0;
double alphaTmp;
for(int i = 0; i < x.Size(); i++)
{
if( xhat(i) < 0. )
{
alphaTmp = -1. * tau * (x(i) - xl(i)) / xhat(i);
alphaMaxloc = min(alphaMaxloc, alphaTmp);
}
}
// alphaMaxloc is the local maximum step size which is
// distinct on each MPI process. Need to compute
// the global maximum step size
double alphaMaxglb;
alphaMaxglb = alphaMaxloc;
return alphaMaxglb;
}
double InteriorPointSolver::MaxStepSize(Vector &x, Vector &xhat, double tau)
{
Vector zero(x.Size()); zero = 0.0;
return MaxStepSize(x, zero, xhat, tau);
}
void InteriorPointSolver::Mult(const Vector &x0, Vector &xf)
{
BlockVector x0block(block_offsetsx); x0block = 0.0;
x0block.GetBlock(0).Set(1.0, x0);
// To do: give options for user specificiation of initialization m0
x0block.GetBlock(1) = 100.;
x0block.GetBlock(1).Add(1.0, ml);
BlockVector xfblock(block_offsetsx); xfblock = 0.0;
Mult(x0block, xfblock);
xf.Set(1.0, xfblock.GetBlock(0));
}
void InteriorPointSolver::Mult(const BlockVector &x0, BlockVector &xf)
{
converged = false;
BlockVector xk(block_offsetsx), xhat(block_offsetsx); xk = 0; xhat = 0.0;
BlockVector Xk(block_offsetsumlz), Xhat(block_offsetsumlz); Xk = 0.0; Xhat = 0.0;
BlockVector Xhatuml(block_offsetsuml); Xhatuml = 0.0;
Vector zlhat(dimM); zlhat = 0.0;
xk.GetBlock(0).Set(1.0, x0.GetBlock(0));
xk.GetBlock(1).Set(1.0, x0.GetBlock(1));
// running estimate of the final values of the Lagrange multipliers
lk = 0.0;
zlk = 0.0;
for(int i = 0; i < dimM; i++)
{
zlk(i) = 1.e1 * mu_k / (xk(i+dimU) - ml(i));
}
Xk.GetBlock(0).Set(1.0, xk.GetBlock(0));
Xk.GetBlock(1).Set(1.0, xk.GetBlock(1));
Xk.GetBlock(2).Set(1.0, lk);
Xk.GetBlock(3).Set(1.0, zlk);
/* set theta0 = theta(x0)
* thetaMin
* thetaMax
* when theta(xk) < thetaMin and the switching condition holds
* then we ask for the Armijo sufficient decrease of the barrier
* objective to be satisfied, in order to accept the trial step length alphakl
*
* thetaMax controls how the filter is initialized for each log-barrier subproblem
* F0 = {(th, phi) s.t. th > thetaMax}
* that is the filter does not allow for iterates where the constraint violation
* is larger than that of thetaMax
*/
double theta0 = theta(xk);
thetaMin = 1.e-4 * max(1.0, theta0);
thetaMax = 1.e8 * thetaMin;
double Eeval, maxBarrierSolves, Eevalmu0;
bool printOptimalityError; // control optimality error print to console for log-barrier subproblems
maxBarrierSolves = 10;
for(jOpt = 0; jOpt < max_iter; jOpt++)
{
mfem::out << "interior-point solve step " << jOpt << endl;
// A-2. Check convergence of overall optimization problem
printOptimalityError = false;
Eevalmu0 = E(xk, lk, zlk, printOptimalityError);
if(Eevalmu0 < rel_tol)
{
converged = true;
mfem::out << "solved optimization problem :)\n";
break;
}
if(jOpt > 0) { maxBarrierSolves = 1; }
for(int i = 0; i < maxBarrierSolves; i++)
{
// A-3. Check convergence of the barrier subproblem
printOptimalityError = true;
Eeval = E(xk, lk, zlk, mu_k, printOptimalityError);
if(Eeval < kEps * mu_k)
{
mfem::out << "solved barrier subproblem, for mu = " << mu_k << endl;
// A-3.1. Recompute the barrier parameter
mu_k = max(rel_tol / 10., min(kMu * mu_k, pow(mu_k, thetaMu)));
// A-3.2. Re-initialize the filter
F1.DeleteAll();
F2.DeleteAll();
}
else
{
break;
}
}
// A-4. Compute the search direction
// solve for (uhat, mhat, lhat)
mfem::out << "\n** A-4. IP-Newton solve **\n";
zlhat = 0.0; Xhatuml = 0.0;
// why do we have Xhatuml ....???
// TO DO: remove Xhatuml in favor of passing Xhat
IPNewtonSolve(xk, lk, zlk, zlhat, Xhatuml, mu_k, false);
// assign data stack, X = (u, m, l, zl)
Xk = 0.0;
Xk.GetBlock(0).Set(1.0, xk.GetBlock(0));
Xk.GetBlock(1).Set(1.0, xk.GetBlock(1));
Xk.GetBlock(2).Set(1.0, lk);
Xk.GetBlock(3).Set(1.0, zlk);
// assign data stack, Xhat = (uhat, mhat, lhat, zlhat)
Xhat = 0.0;
for(int i = 0; i < 3; i++)
{
Xhat.GetBlock(i).Set(1.0, Xhatuml.GetBlock(i));
}
Xhat.GetBlock(3).Set(1.0, zlhat);
// A-5. Backtracking line search.
mfem::out << "\n** A-5. Linesearch **\n";
mfem::out << "mu = " << mu_k << endl;
lineSearch(Xk, Xhat, mu_k);
if(lineSearchSuccess)
{
if(!switchCondition || !sufficientDecrease)
{
F1.Append( (1. - gTheta) * thx0);
F2.Append( phx0 - gPhi * thx0);
}
// ----- A-6: Accept the trial point
// print info regarding zl...
xk.GetBlock(0).Add(alpha, Xhat.GetBlock(0));
xk.GetBlock(1).Add(alpha, Xhat.GetBlock(1));
lk.Add(alpha, Xhat.GetBlock(2));
zlk.Add(alphaz, Xhat.GetBlock(3));
projectZ(xk, zlk, mu_k);
}
else
{
mfem::out << "lineSearch not successful :(\n";
mfem::out << "attempting feasibility restoration with theta = " << thx0 << endl;
mfem::out << "no feasibility restoration implemented, exiting now \n";
break;
}
//
if(jOpt + 1 == max_iter)
{
mfem::out << "maximum optimization iterations :(\n";
}
}
// done with optimization routine, just reassign data to xf reference so
// that the application code has access to the optimal point
xf = 0.0;
xf.GetBlock(0).Set(1.0, xk.GetBlock(0));
xf.GetBlock(1).Set(1.0, xk.GetBlock(1));
}
void InteriorPointSolver::FormIPNewtonMat(BlockVector & x, Vector & l, Vector &zl, BlockOperator &Ak)
{
// WARNING: Huu, Hum, Hmu, Hmm should all be Hessian terms of the Lagrangian, currently we
// them by Hessian terms of the objective function and neglect the Hessian of l^T c
Huu = optProblem->Duuf(x); Hum = optProblem->Dumf(x);
Hmu = optProblem->Dmuf(x); Hmm = optProblem->Dmmf(x);
Vector DiagLogBar(dimM); DiagLogBar = 0.0;
for(int ii = 0; ii < dimM; ii++)
{
DiagLogBar(ii) = zl(ii) / (x(ii+dimU) - ml(ii));
}
if(saveLogBarrierIterates)
{
std::ofstream diagStream;
char diagString[100];
snprintf(diagString, 100, "logBarrierHessiandata/D%d.dat", jOpt);
diagStream.open(diagString, ios::out | ios::trunc);
for(int ii = 0; ii < dimM; ii++)
{
diagStream << setprecision(30) << DiagLogBar(ii) << endl;
}
diagStream.close();
}
D = new SparseMatrix(DiagLogBar);
if(Hmm != nullptr)
{
Wmm = new SparseMatrix(*Hmm);
Wmm->Add(1.0, *D);
}
else
{
Wmm = D;
}
Ju = optProblem->Duc(x); JuT = Transpose(*Ju);
Jm = optProblem->Dmc(x); JmT = Transpose(*Jm);
Huucl = optProblem->lDuuc(x, l);
if(Huucl != nullptr)
{
HLuu = Add(*Huucl, *Huu);
Ak.SetBlock(0, 0, HLuu);
}
else
{
Ak.SetBlock(0, 0, Huu);
}
// IP-Newton system matrix
// Ak = [[H_(u,u) H_(u,m) J_u^T]
// [H_(m,u) W_(m,m) J_m^T]
// [ J_u J_m 0 ]]
Ak.SetBlock(0, 2, JuT);
Ak.SetBlock(1, 1, Wmm); Ak.SetBlock(1, 2, JmT);
Ak.SetBlock(2, 0, Ju); Ak.SetBlock(2, 1, Jm);
if(Hum != nullptr) { Ak.SetBlock(0, 1, Hum); Ak.SetBlock(1, 0, Hmu); }
}
// perturbed KKT system solve
// determine the search direction
void InteriorPointSolver::IPNewtonSolve(BlockVector &x, Vector &l, Vector &zl, Vector &zlhat, BlockVector &Xhat, double mu, bool socSolve)
{
// solve A x = b, where A is the IP-Newton matrix
BlockOperator A(block_offsetsuml, block_offsetsuml); BlockVector b(block_offsetsuml); b = 0.0;
FormIPNewtonMat(x, l, zl, A);
// [grad_u phi + Ju^T l]
// b = - [grad_m phi + Jm^T l]
// [ c ]
BlockVector gradphi(block_offsetsx); gradphi = 0.0;
BlockVector JTl(block_offsetsx); JTl = 0.0;
Dxphi(x, mu, gradphi);
(A.GetBlock(0,2)).Mult(l, JTl.GetBlock(0));
(A.GetBlock(1,2)).Mult(l, JTl.GetBlock(1));
for(int ii = 0; ii < 2; ii++)
{
b.GetBlock(ii).Set(1.0, gradphi.GetBlock(ii));
b.GetBlock(ii).Add(1.0, JTl.GetBlock(ii));
}
if(!socSolve)
{
optProblem->c(x, b.GetBlock(2));
}
else
{
b.GetBlock(2).Set(1.0, ckSoc);
}
b *= -1.0;
Xhat = 0.0;
#ifdef MFEM_USE_SUITESPARSE
// Direct solve for IP-Newton saddle-point system
// A = [ [ Huu 0 Ju^T]
// [ 0 D -I ]
// [ Ju -I 0 ]]
if(linSolver == 0)
{
BlockMatrix ABlockMatrix(block_offsetsuml, block_offsetsuml);
for(int ii = 0; ii < 3; ii++)
{
for(int jj = 0; jj < 3; jj++)
{
if(!A.IsZeroBlock(ii, jj))
{
ABlockMatrix.SetBlock(ii, jj, dynamic_cast<SparseMatrix *>(&(A.GetBlock(ii, jj))));
}
}
}
/* direct solve of the 3x3 IP-Newton linear system */
UMFPackSolver ASolver;
SparseMatrix *ASparse = ABlockMatrix.CreateMonolithic();
ASolver.SetOperator(*ASparse);
ASolver.Mult(b, Xhat);
Vector residual(Xhat.Size());
ASparse->Mult(Xhat, residual);
residual.Add(-1.0, b);
delete ASparse;
}
else if(linSolver == 1)
{
// Direct solve for 0,0 Schur complement of IP-Newton system, Huu + Ju^T Wmm Ju,
// where Wmm = D for contact problems
SparseMatrix * Huuloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(0, 0)));
SparseMatrix * Wmmloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(1, 1)));
SparseMatrix * Juloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(2, 0)));
SparseMatrix * JuTloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(0, 2)));
Vector DVec(dimM); DVec = 0.0;
Vector one(dimM); one = 1.0;
D->Mult(one, DVec);
SparseMatrix *JuTDJu = Mult_AtDA(*Juloc, DVec); // Ju^T D Ju
SparseMatrix *Areduced = Add(*Huuloc, *JuTDJu); // Huu + Ju^T D Ju
/* prepare the reduced rhs */
// breduced = bu + Ju^T (bm + Wmm bl)
Vector breduced(dimU); breduced = 0.0;
Vector tempVec(dimM); tempVec = 0.0;
Wmmloc->Mult(b.GetBlock(2), tempVec);
tempVec.Add(1.0, b.GetBlock(1));
JuTloc->Mult(tempVec, breduced);
breduced.Add(1.0, b.GetBlock(0));
// solve the reduced linear system
UMFPackSolver AreducedSolver;
AreducedSolver.SetOperator(*Areduced);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
// now propagate solved uhat to obtain mhat and lhat
// xm = Ju xu - bl
Juloc->Mult(Xhat.GetBlock(0), Xhat.GetBlock(1));
Xhat.GetBlock(1).Add(-1.0, b.GetBlock(2));
// xl = Wmm xm - bm
Wmmloc->Mult(Xhat.GetBlock(1), Xhat.GetBlock(2));
Xhat.GetBlock(2).Add(-1.0, b.GetBlock(1));
delete JuTDJu;
delete Areduced;
}
#else
MFEM_VERIFY(linSolver > 1, "linSolver = 0, 1 require MFEM_USE_SUITESPARSE=YES");
#endif
if(linSolver > 1)
{
// Iterative solve for 0,0 Schur complement of IP-Newton system, Huu + Ju^T Wmm Ju,
// where Wmm = D for contact problems
// here the iterative solver is a Jacobi-preconditioned CG-solve
SparseMatrix * Huuloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(0, 0)));
SparseMatrix * Wmmloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(1, 1)));
SparseMatrix * Juloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(2, 0)));
SparseMatrix * JuTloc = dynamic_cast<SparseMatrix *>(&(A.GetBlock(0, 2)));
Vector DVec(dimM); DVec = 0.0;
Vector one(dimM); one = 1.0;
D->Mult(one, DVec);
SparseMatrix *JuTDJu = Mult_AtDA(*Juloc, DVec); // Ju^T D Ju
SparseMatrix *Areduced = Add(*Huuloc, *JuTDJu); // Huu + Ju^T D Ju
/* prepare the reduced rhs */
// breduced = bu + Ju^T (bm + Wmm bl)
Vector breduced(dimU); breduced = 0.0;
Vector tempVec(dimM); tempVec = 0.0;
Wmmloc->Mult(b.GetBlock(2), tempVec);
tempVec.Add(1.0, b.GetBlock(1));
JuTloc->Mult(tempVec, breduced);
breduced.Add(1.0, b.GetBlock(0));
if (linSolver == 2)
{
/* Jacobi preconditioned conjugate-gradient solve */
DSmoother AreducedPrec((SparseMatrix &)(*Areduced));
CGSolver AreducedSolver;
AreducedSolver.SetOperator(*Areduced);
AreducedSolver.SetAbsTol(1.e-12);
AreducedSolver.SetRelTol(1.e-8);
AreducedSolver.SetMaxIter(500);
AreducedSolver.SetPreconditioner(AreducedPrec);
AreducedSolver.SetPrintLevel(1);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
}
else
{
/* Gauss-Seidel preconditioned GMRES solve */
GSSmoother AreducedPrec((SparseMatrix &)(*Areduced));
GMRESSolver AreducedSolver;
AreducedSolver.SetOperator(*Areduced);
AreducedSolver.SetAbsTol(1.e-12);
AreducedSolver.SetRelTol(1.e-8);
AreducedSolver.SetMaxIter(500);
AreducedSolver.SetPreconditioner(AreducedPrec);
AreducedSolver.SetPrintLevel(1);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
}
// now propagate solved uhat to obtain mhat and lhat
// xm = Ju xu - bl
Juloc->Mult(Xhat.GetBlock(0), Xhat.GetBlock(1));
Xhat.GetBlock(1).Add(-1.0, b.GetBlock(2));
// xl = Wmm xm - bm
Wmmloc->Mult(Xhat.GetBlock(1), Xhat.GetBlock(2));
Xhat.GetBlock(2).Add(-1.0, b.GetBlock(1));
delete JuTDJu;
delete Areduced;
}
/* backsolve to determine zlhat */
for(int ii = 0; ii < dimM; ii++)
{
zlhat(ii) = -1.*(zl(ii) + (zl(ii) * Xhat(ii + dimU) - mu) / (x(ii + dimU) - ml(ii)) );
}
// free memory
if(Hmm != nullptr)
{
delete Wmm;
}
if( Huucl != nullptr)
{
delete HLuu; HLuu = nullptr;
}
delete D;
delete JuT;
delete JmT;
}
// here Xhat, X will be BlockVectors w.r.t. the 4 partitioning X = (u, m, l, zl)
void InteriorPointSolver::lineSearch(BlockVector& X0, BlockVector& Xhat, double mu)
{
double tau = max(tauMin, 1.0 - mu);
Vector u0 = X0.GetBlock(0);
Vector m0 = X0.GetBlock(1);
Vector l0 = X0.GetBlock(2);
Vector z0 = X0.GetBlock(3);
Vector uhat = Xhat.GetBlock(0);
Vector mhat = Xhat.GetBlock(1);
Vector lhat = Xhat.GetBlock(2);
Vector zhat = Xhat.GetBlock(3);
double alphaMax = MaxStepSize(m0, ml, mhat, tau);
double alphaMaxz = MaxStepSize(z0, zhat, tau);
alphaz = alphaMaxz;
BlockVector x0(block_offsetsx); x0 = 0.0;
x0.GetBlock(0).Set(1.0, u0);
x0.GetBlock(1).Set(1.0, m0);
BlockVector xhat(block_offsetsx); xhat = 0.0;
xhat.GetBlock(0).Set(1.0, uhat);
xhat.GetBlock(1).Set(1.0, mhat);
BlockVector xtrial(block_offsetsx); xtrial = 0.0;
BlockVector Dxphi0(block_offsetsx); Dxphi0 = 0.0;
int maxBacktrack = 20;
alpha = alphaMax;
Vector ck0(dimC); ck0 = 0.0;
Vector zhatsoc(dimM); zhatsoc = 0.0;
BlockVector Xhatumlsoc(block_offsetsuml); Xhatumlsoc = 0.0;
BlockVector xhatsoc(block_offsetsx); xhatsoc = 0.0;
Vector uhatsoc(dimU); uhatsoc = 0.0;
Vector mhatsoc(dimM); mhatsoc = 0.0;
Dxphi(x0, mu, Dxphi0);
Dxphi0_xhat = InnerProduct(Dxphi0, xhat);
descentDirection = Dxphi0_xhat < 0. ? true : false;
if(descentDirection)
{
mfem::out << "is a descent direction for the log-barrier objective\n";
}
else
{
mfem::out << "is not a descent direction for the log-barrier objective\n";
}
mfem::out << "Dxphi^T xhat / (|| Dxphi||_2 * || xhat ||_2) = " << Dxphi0_xhat / (xhat.Norml2() * Dxphi0.Norml2()) << endl;
thx0 = theta(x0);
phx0 = phi(x0, mu);
lineSearchSuccess = false;
for(int i = 0; i < maxBacktrack; i++)
{
mfem::out << "\n--------- alpha = " << alpha << " ---------\n";
// ----- A-5.2. Compute trial point: xtrial = x0 + alpha_i xhat
xtrial.Set(1.0, x0);
xtrial.Add(alpha, xhat);
// ------ A-5.3. if not in filter region go to A.5.4 otherwise go to A-5.5.
thxtrial = theta(xtrial);
phxtrial = phi(xtrial, mu);
filterCheck(thxtrial, phxtrial);
if(!inFilterRegion)
{
mfem::out << "not in filter region :)\n";
// ------ A.5.4: Check sufficient decrease
if(!descentDirection)
{
switchCondition = false;
}
else
{
switchCondition = (alpha * pow(abs(Dxphi0_xhat), sPhi) > delta * pow(thx0, sTheta)) ? true : false;
}
mfem::out << "theta(x0) = " << thx0 << ", thetaMin = " << thetaMin << endl;
mfem::out << "theta(xtrial) = " << thxtrial << ", (1-gTheta) *theta(x0) = " << (1. - gTheta) * thx0 << endl;
mfem::out << "phi(xtrial) = " << phxtrial << ", phi(x0) - gPhi *theta(x0) = " << phx0 - gPhi * thx0 << endl;
// Case I
if(thx0 <= thetaMin && switchCondition)
{
sufficientDecrease = phxtrial <= phx0 + eta * alpha * Dxphi0_xhat ? true : false;
if(sufficientDecrease)
{
mfem::out << "Accepted step length -- sufficient decrease in log-barrier objective.\n";
// accept the trial step
lineSearchSuccess = true;
break;
}
}
else
{
if(thxtrial <= (1. - gTheta) * thx0 || phxtrial <= phx0 - gPhi * thx0)
{
mfem::out << "Accepted step length -- decrease in either constraint violation or log-barrier objective.\n";
// accept the trial step
lineSearchSuccess = true;
break;
}
}
// A-5.5: Initialize the second-order correction
if((!(thx0 < thxtrial)) && i == 0)
{
mfem::out << "second order correction\n";
optProblem->c(xtrial, ckSoc);
optProblem->c(x0, ck0);
ckSoc.Add(alphaMax, ck0);
// A-5.6 Compute the second-order correction.
IPNewtonSolve(x0, l0, z0, zhatsoc, Xhatumlsoc, mu, true);
mhatsoc.Set(1.0, Xhatumlsoc.GetBlock(1));
// alphasoc = MaxStepSize(m0, ml, mhatsoc, tau);
//WARNING: not complete but currently solver isn't entering this region
}
}
else
{
mfem::out << "in filter region\n";
}
// include more if needed
alpha *= 0.5;
}
}
void InteriorPointSolver::projectZ(const Vector &x, Vector &z, double mu)
{
double zi;
double mudivmml;
for(int i = 0; i < dimM; i++)
{
zi = z(i);
mudivmml = mu / (x(i + dimU) - ml(i));
z(i) = max(min(zi, kSig * mudivmml), mudivmml / kSig);
}
}
void InteriorPointSolver::filterCheck(double th, double ph)
{
inFilterRegion = false;
if(th > thetaMax)
{
inFilterRegion = true;
}
else
{
for(int i = 0; i < F1.Size(); i++)
{
if(th >= F1[i] && ph >= F2[i])
{
inFilterRegion = true;
break;
}
}
}
}
double InteriorPointSolver::E(const BlockVector &x, const Vector &l, const Vector &zl, double mu, bool print)
{
double E1, E2, E3;
double sc, sd;
BlockVector gradL(block_offsetsx); gradL = 0.0; // stationarity grad L = grad f + J^T l - z
Vector cx(dimC); cx = 0.0; // feasibility c = c(x)
Vector comp(dimM); comp = 0.0; // complementarity M Z - mu 1
DxL(x, l, zl, gradL);
E1 = gradL.Normlinf();
optProblem->c(x, cx);
E2 = cx.Normlinf();
for(int ii = 0; ii < dimM; ii++)
{
comp(ii) = x(dimU + ii) * zl(ii) - mu;
}
E3 = comp.Normlinf();
double ll1, zl1;
zl1 = zl.Norml1() / double(dimC + dimM);
ll1 = l.Norml1();
sc = max(sMax, zl1 / (double(dimM)) ) / sMax;
sd = max(sMax, (ll1 + zl1) / (double(dimC + dimM))) / sMax;
if(print)
{
mfem::out << "evaluating optimality error for mu = " << mu << endl;
mfem::out << "stationarity measure = " << E1 / sd << endl;
mfem::out << "feasibility measure = " << E2 << endl;
mfem::out << "complimentarity measure = " << E3 / sc << endl;
}
return max(max(E1 / sd, E2), E3 / sc);
}
double InteriorPointSolver::E(const BlockVector &x, const Vector &l, const Vector &zl, bool print)
{
return E(x, l, zl, 0.0, print);
}
double InteriorPointSolver::theta(const BlockVector &x)
{
Vector cx(dimC); cx = 0.0;
optProblem->c(x, cx);
return cx.Norml2();
}
// log-barrier objective
double InteriorPointSolver::phi(const BlockVector &x, double mu)
{
double fx = optProblem->CalcObjective(x);
double logBarrierLoc = 0.0;
for(int i = 0; i < dimM; i++)
{
logBarrierLoc += log(x(dimU+i)-ml(i));
}
double logBarrierGlb = 0.0;
logBarrierGlb = logBarrierLoc;
return fx - mu * logBarrierGlb;
}
// gradient of log-barrier objective with respect to x = (u, m)
void InteriorPointSolver::Dxphi(const BlockVector &x, double mu, BlockVector &y)
{
optProblem->CalcObjectiveGrad(x, y);
for(int i = 0; i < dimM; i++)
{
y(dimU + i) -= mu / (x(dimU + i));
}
}
// Lagrangian function evaluation
// L(x, l, zl) = f(x) + l^T c(x) - zl^T m
double InteriorPointSolver::L(const BlockVector &x, const Vector &l, const Vector &zl)
{
double fx = optProblem->CalcObjective(x);
Vector cx(dimC); optProblem->c(x, cx);
return (fx + InnerProduct(cx, l) - InnerProduct(x.GetBlock(1), zl));
}
void InteriorPointSolver::DxL(const BlockVector &x, const Vector &l, const Vector &zl, BlockVector &y)
{
// evaluate the gradient of the objective with respect to the primal variables x = (u, m)
BlockVector gradxf(block_offsetsx); gradxf = 0.0;
optProblem->CalcObjectiveGrad(x, gradxf);
SparseMatrix *Jacu, *Jacm, *JacuT, *JacmT;
Jacu = optProblem->Duc(x); Jacm = optProblem->Dmc(x);
JacuT = Transpose(*Jacu);
JacmT = Transpose(*Jacm);
JacuT->Mult(l, y.GetBlock(0));
JacmT->Mult(l, y.GetBlock(1));
delete JacuT;
delete JacmT;
y.Add(1.0, gradxf);
(y.GetBlock(1)).Add(-1.0, zl);
}
bool InteriorPointSolver::GetConverged() const
{
return converged;
}
void InteriorPointSolver::SetTol(double Tol)
{
rel_tol = Tol;
}
void InteriorPointSolver::SetMaxIter(int max_it)
{
max_iter = max_it;
}
void InteriorPointSolver::SetBarrierParameter(double mu_0)
{
mu_k = mu_0;
}
void InteriorPointSolver::SaveLogBarrierHessianIterates(bool save)
{
MFEM_ASSERT(MyRank == 0 || save == false, "currently can only save logbarrier hessian in serial codes");
saveLogBarrierIterates = save;
}
void InteriorPointSolver::SetLinearSolver(int LinSolver)
{
linSolver = LinSolver;
}
InteriorPointSolver::~InteriorPointSolver()
{
F1.DeleteAll();
F2.DeleteAll();
block_offsetsx.DeleteAll();
block_offsetsumlz.DeleteAll();
block_offsetsuml.DeleteAll();
ml.SetSize(0);
}
+80
View File
@@ -0,0 +1,80 @@
#include "mfem.hpp"
#include "Problems.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
#ifndef IPSOLVER
#define IPSOLVER
class InteriorPointSolver
{
protected:
GeneralOptProblem* optProblem;
double rel_tol;
int max_iter;
double mu_k; // \mu_k
Vector lk, zlk;
double sMax, kSig, tauMin, eta, thetaMin, delta, sTheta, sPhi, kMu, thetaMu;
double thetaMax, kSoc, gTheta, gPhi, kEps;
// filter
Array<double> F1, F2;
// quantities computed in lineSearch
double alpha, alphaz;
double thx0, thxtrial;
double phx0, phxtrial;
bool descentDirection, switchCondition, sufficientDecrease, lineSearchSuccess, inFilterRegion;
double Dxphi0_xhat;
int dimU, dimM, dimC;
Array<int> block_offsetsumlz, block_offsetsuml, block_offsetsx;
Vector ml;
Vector ckSoc;
SparseMatrix * Huu, * Hum, * Hmu, * Hmm, * Wmm, *D, * Ju, * Jm, * JuT, * JmT;
SparseMatrix * Huucl, *HLuu;
int jOpt;
bool converged;
int MyRank;
bool iAmRoot;
bool saveLogBarrierIterates;
int linSolver;
public:
InteriorPointSolver(GeneralOptProblem*);
void Mult(const BlockVector& , BlockVector&); // used when the user wants to be aware of bound-constrained variable m >= ml
void Mult(const Vector&, Vector &); // useful when the user doesn't need to know about bound-constrained variable m >= ml, e.g., when m is a slack variable
double MaxStepSize(Vector& , Vector& , Vector& , double);
double MaxStepSize(Vector& , Vector& , double);
void FormIPNewtonMat(BlockVector& , Vector& , Vector& , BlockOperator &);
void IPNewtonSolve(BlockVector& , Vector& , Vector& , Vector&, BlockVector& , double, bool);
void lineSearch(BlockVector& , BlockVector& , double);
void projectZ(const Vector & , Vector &, double);
void filterCheck(double, double);
double E(const BlockVector &, const Vector &, const Vector &, double, bool);
double E(const BlockVector &, const Vector &, const Vector &, bool);
bool GetConverged() const;
// TO DO: include Hessian of Lagrangian
double theta(const BlockVector &);
double phi(const BlockVector &, double);
void Dxphi(const BlockVector &, double, BlockVector &);
double L(const BlockVector &, const Vector &, const Vector &);
void DxL(const BlockVector &, const Vector &, const Vector &, BlockVector &);
void SetTol(double);
void SetMaxIter(int);
void SetBarrierParameter(double);
void SaveLogBarrierHessianIterates(bool);
void SetLinearSolver(int);
virtual ~InteriorPointSolver();
};
#endif
+125
View File
@@ -0,0 +1,125 @@
#include "mfem.hpp"
#include "Problems.hpp"
#include "IPsolver.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
double dmanufacturedFun(const Vector &);
double fRhs(const Vector &);
double obstacle(const Vector &);
int main(int argc, char *argv[])
{
int FEorder = 1; // order of the finite elements
int linSolver = 0;
int maxIPMiters = 30;
bool iAmRoot = true;
OptionsParser args(argc, argv);
args.AddOption(&FEorder, "-o", "--order",\
"Order of the finite elements.");
args.AddOption(&linSolver, "-linSolver", "--linearSolver", \
"IP-Newton linear system solution strategy.");
args.AddOption(&maxIPMiters, "-IPMiters", "--IPMiters",\
"Maximum number of IPM iterations");
args.Parse();
if(!args.Good())
{
args.PrintUsage(cout);
return 1;
}
else
{
if( iAmRoot )
{
args.PrintOptions(cout);
}
}
const char *meshFile = "../../data/inline-quad.mesh";
Mesh *mesh = new Mesh(meshFile, 1, 1);
int dim = mesh->Dimension(); // geometric dimension of the domain
{
int ref_levels = 3;
for (int l = 0; l < ref_levels; l++)
{
mesh->UniformRefinement();
}
}
FiniteElementCollection *fec = new H1_FECollection(FEorder, dim);
FiniteElementSpace *Vh = new FiniteElementSpace(mesh, fec);
ObstacleProblem problem(Vh, &fRhs, &obstacle);
int dimD = problem.GetDimD();
Vector x0(dimD); x0 = 0.0;
Vector xf(dimD); xf = 0.0;
InteriorPointSolver optimizer(&problem);
optimizer.SetTol(1.e-7);
optimizer.SetLinearSolver(linSolver);
optimizer.SetMaxIter(maxIPMiters);
optimizer.Mult(x0, xf);
double Einitial = problem->E(x0);
double Efinal = problem->E(xf);
cout << "Energy objective at initial point = " << Einitial << endl;
cout << "Energy objective at QP optimizer = " << Efinal << endl;
GridFunction d_gf(Vh);
d_gf = xf;
FunctionCoefficient dm_fc(dmanufacturedFun); // pseudo-manufactured solution
GridFunction dm_gf(Vh);
dm_gf.ProjectCoefficient(dm_fc);
ParaViewDataCollection paraview_dc("BarrierProblemSolution", mesh);
paraview_dc.SetPrefixPath("ParaView");
paraview_dc.SetLevelsOfDetail(FEorder);
paraview_dc.SetDataFormat(VTKFormat::BINARY);
paraview_dc.SetHighOrderOutput(true);
paraview_dc.SetCycle(0);
paraview_dc.SetTime(0.0);
paraview_dc.RegisterField("d(x) (numerical)", &d_gf);
paraview_dc.RegisterField("d(x) (pseudo-manufactured)", &dm_gf);
paraview_dc.Save();
delete Vh;
delete fec;
delete mesh;
return 0;
}
double dmanufacturedFun(const Vector &x)
{
return cos(2*M_PI*x(0)) + 0.2 - 2.0*(pow(x(0),3) - 1.5*pow(x(0),2));
}
// f(x) forcing term... which enters the objective energy functional
// E(d) = 0.5 d^T K d - f^T d, where f is a discrete vector representation
// of f(x). f(x) is such that in the absence of bound-constraints then
// the solution of the optimization problem satisfies the PDE
// -div(grad(d)) + d = f + homogeneous Neumann conditions on the unit interval,
// for d(x) = cos(2 \pi x) + a0 + a3 (x^3 - 1.5 x^2), a2 = 0.2, a3 = -2
double fRhs(const Vector &x)
{
double fx = 0.;
fx = 0.2 - 2.0 * (pow(x(0),3)- 1.5*pow(x(0),2.) - 6 * x(0) + 3.) + (1. + pow(2.*M_PI,2))*cos(2.*M_PI*x(0));
return fx;
}
double obstacle(const Vector &x)
{
return 0.0;
}
+834
View File
@@ -0,0 +1,834 @@
#include "mfem.hpp"
#include "ParIPsolver.hpp"
#include "ParProblems.hpp"
#include <fstream>
#include <iostream>
#include <cstdlib>
using namespace std;
using namespace mfem;
ParInteriorPointSolver::ParInteriorPointSolver(ParGeneralOptProblem * problem_)
: problem(problem_),
block_offsetsumlz(5), block_offsetsuml(4), block_offsetsx(3),
Huu(nullptr), Hum(nullptr), Hmu(nullptr),
Hmm(nullptr), Wmm(nullptr), D(nullptr),
Ju(nullptr), Jm(nullptr), JuT(nullptr), JmT(nullptr),
saveLogBarrierIterates(false)
{
OptTol = 1.e-2;
max_iter = 20;
mu_k = 1.0;
sMax = 1.e2;
kSig = 1.e10; // control deviation from primal Hessian
tauMin = 0.8; // control rate at which iterates can approach the boundary
eta = 1.e-4; // backtracking constant
thetaMin = 1.e-4; // allowed violation of the equality constraints
// constants in line-step A-5.4
delta = 1.0;
sTheta = 1.1;
sPhi = 2.3;
// control the rate at which the penalty parameter is decreased
kMu = 0.2;
thetaMu = 1.5;
thetaMax = 1.e6; // maximum constraint violation
// data for the second order correction
kSoc = 0.99;
// equation (18)
gTheta = 1.e-5;
gPhi = 1.e-5;
kEps = 1.e1;
dimU = problem->GetDimU();
dimM = problem->GetDimM();
dimC = problem->GetDimC();
MPI_Allreduce(&dimU, &dimUglb, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
MPI_Allreduce(&dimM, &dimMglb, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
MPI_Allreduce(&dimC, &dimCglb, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
ckSoc.SetSize(dimC);
block_offsetsumlz[0] = 0;
block_offsetsumlz[1] = dimU; // u
block_offsetsumlz[2] = dimM; // m
block_offsetsumlz[3] = dimC; // lambda
block_offsetsumlz[4] = dimM; // zl
block_offsetsumlz.PartialSum();
for(int i = 0; i < block_offsetsuml.Size(); i++)
{
block_offsetsuml[i] = block_offsetsumlz[i];
}
for(int i = 0; i < block_offsetsx.Size(); i++)
{
block_offsetsx[i] = block_offsetsuml[i] ;
}
ml = problem->Getml();
lk.SetSize(dimC); lk = 0.0;
zlk.SetSize(dimM); zlk = 0.0;
linSolver = 0;
linSolveTol = 1.e-8;
MyRank = Mpi::WorldRank();
iAmRoot = MyRank == 0 ? true : false;
}
double ParInteriorPointSolver::MaxStepSize(Vector &x, Vector &xl, Vector &xhat, double tau)
{
double alphaMaxloc = 1.0;
double alphaTmp;
for(int i = 0; i < x.Size(); i++)
{
if( xhat(i) < 0. )
{
alphaTmp = -1. * tau * (x(i) - xl(i)) / xhat(i);
alphaMaxloc = min(alphaMaxloc, alphaTmp);
}
}
// alphaMaxloc is the local maximum step size which is
// distinct on each MPI process. Need to compute
// the global maximum step size
double alphaMaxglb;
MPI_Allreduce(&alphaMaxloc, &alphaMaxglb, 1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
return alphaMaxglb;
}
double ParInteriorPointSolver::MaxStepSize(Vector &x, Vector &xhat, double tau)
{
Vector zero(x.Size()); zero = 0.0;
return MaxStepSize(x, zero, xhat, tau);
}
void ParInteriorPointSolver::Mult(const Vector &x0, Vector &xf)
{
BlockVector x0block(block_offsetsx); x0block = 0.0;
x0block.GetBlock(0).Set(1.0, x0);
x0block.GetBlock(1) = 100.;
x0block.GetBlock(1).Add(1.0, ml);
BlockVector xfblock(block_offsetsx); xfblock = 0.0;
Mult(x0block, xfblock);
xf.Set(1.0, xfblock.GetBlock(0));
}
void ParInteriorPointSolver::Mult(const BlockVector &x0, BlockVector &xf)
{
converged = false;
BlockVector xk(block_offsetsx), xhat(block_offsetsx); xk = 0; xhat = 0.0;
BlockVector Xk(block_offsetsumlz), Xhat(block_offsetsumlz); Xk = 0.0; Xhat = 0.0;
BlockVector Xhatuml(block_offsetsuml); Xhatuml = 0.0;
Vector zlhat(dimM); zlhat = 0.0;
xk.GetBlock(0).Set(1.0, x0.GetBlock(0));
xk.GetBlock(1).Set(1.0, x0.GetBlock(1));
// running estimate of the final values of the Lagrange multipliers
lk = 0.0;
zlk = 0.0;
for(int i = 0; i < dimM; i++)
{
zlk(i) = 1.e1 * mu_k / (xk(i+dimU) - ml(i));
}
Xk.GetBlock(0).Set(1.0, xk.GetBlock(0));
Xk.GetBlock(1).Set(1.0, xk.GetBlock(1));
Xk.GetBlock(2).Set(1.0, lk);
Xk.GetBlock(3).Set(1.0, zlk);
/* set theta0 = theta(x0)
* thetaMin
* thetaMax
* when theta(xk) < thetaMin and the switching condition holds
* then we ask for the Armijo sufficient decrease of the barrier
* objective to be satisfied, in order to accept the trial step length alphakl
*
* thetaMax controls how the filter is initialized for each log-barrier subproblem
* F0 = {(th, phi) s.t. th > thetaMax}
* that is the filter does not allow for iterates where the constraint violation
* is larger than that of thetaMax
*/
double theta0 = theta(xk);
thetaMin = 1.e-4 * max(1.0, theta0);
thetaMax = 1.e8 * thetaMin; // 1.e4 * max(1.0, theta0)
double Eeval, maxBarrierSolves, Eevalmu0;
bool printOptimalityError; // control optimality error print to console for log-barrier subproblems
maxBarrierSolves = 10;
for(jOpt = 0; jOpt < max_iter; jOpt++)
{
if(iAmRoot)
{
cout << "interior-point solve step " << jOpt << endl;
}
// A-2. Check convergence of overall optimization problem
printOptimalityError = false;
Eevalmu0 = E(xk, lk, zlk, printOptimalityError);
if(Eevalmu0 < OptTol)
{
converged = true;
if(iAmRoot)
{
cout << "solved optimization problem :)\n";
}
break;
}
if(jOpt > 0) { maxBarrierSolves = 1; }
for(int i = 0; i < maxBarrierSolves; i++)
{
// A-3. Check convergence of the barrier subproblem
printOptimalityError = true;
Eeval = E(xk, lk, zlk, mu_k, printOptimalityError);
if(iAmRoot)
{
cout << "E = " << Eeval << endl;
}
if(Eeval < kEps * mu_k)
{
if(iAmRoot)
{
cout << "solved barrier subproblem :), for mu = " << mu_k << endl;
}
// A-3.1. Recompute the barrier parameter
mu_k = max(OptTol / 10., min(kMu * mu_k, pow(mu_k, thetaMu)));
// A-3.2. Re-initialize the filter
F1.DeleteAll();
F2.DeleteAll();
}
else
{
break;
}
}
// A-4. Compute the search direction
// solve for (uhat, mhat, lhat)
if(iAmRoot)
{
cout << "\n** A-4. IP-Newton solve **\n";
}
zlhat = 0.0; Xhatuml = 0.0;
// why do we have Xhatuml ....???
// TO DO: remove Xhatuml in favor of passing Xhat
IPNewtonSolve(xk, lk, zlk, zlhat, Xhatuml, mu_k, false);
// assign data stack, X = (u, m, l, zl)
Xk = 0.0;
Xk.GetBlock(0).Set(1.0, xk.GetBlock(0));
Xk.GetBlock(1).Set(1.0, xk.GetBlock(1));
Xk.GetBlock(2).Set(1.0, lk);
Xk.GetBlock(3).Set(1.0, zlk);
// assign data stack, Xhat = (uhat, mhat, lhat, zlhat)
Xhat = 0.0;
for(int i = 0; i < 3; i++)
{
Xhat.GetBlock(i).Set(1.0, Xhatuml.GetBlock(i));
}
Xhat.GetBlock(3).Set(1.0, zlhat);
// A-5. Backtracking line search.
if(iAmRoot)
{
cout << "\n** A-5. Linesearch **\n";
cout << "mu = " << mu_k << endl;
}
lineSearch(Xk, Xhat, mu_k);
if(lineSearchSuccess)
{
if(iAmRoot)
{
cout << "lineSearch successful :)\n";
}
if(!switchCondition || !sufficientDecrease)
{
F1.Append( (1. - gTheta) * thx0);
F2.Append( phx0 - gPhi * thx0);
}
// ----- A-6: Accept the trial point
// print info regarding zl...
xk.GetBlock(0).Add(alpha, Xhat.GetBlock(0));
xk.GetBlock(1).Add(alpha, Xhat.GetBlock(1));
lk.Add(alpha, Xhat.GetBlock(2));
zlk.Add(alphaz, Xhat.GetBlock(3));
projectZ(xk, zlk, mu_k);
}
else
{
if(iAmRoot)
{
cout << "lineSearch not successful :(\n";
cout << "attempting feasibility restoration with theta = " << thx0 << endl;
cout << "no feasibility restoration implemented, exiting now \n";
}
break;
}
if(jOpt + 1 == max_iter && iAmRoot)
{
cout << "maximum optimization iterations :(\n";
}
}
// done with optimization routine, just reassign data to xf reference so
// that the application code has access to the optimal point
xf = 0.0;
xf.GetBlock(0).Set(1.0, xk.GetBlock(0));
xf.GetBlock(1).Set(1.0, xk.GetBlock(1));
}
void ParInteriorPointSolver::FormIPNewtonMat(BlockVector & x, Vector & l, Vector &zl, BlockOperator &Ak)
{
// WARNING: Huu, Hum, Hmu, Hmm should all be Hessian terms of the Lagrangian, currently we
// them by Hessian terms of the objective function and neglect the Hessian of l^T c
Huu = problem->Duuf(x);
Hum = problem->Dumf(x);
Hmu = problem->Dmuf(x);
Hmm = problem->Dmmf(x);
Vector DiagLogBar(dimM); DiagLogBar = 0.0;
for(int ii = 0; ii < dimM; ii++)
{
DiagLogBar(ii) = zl(ii) / (x(ii+dimU) - ml(ii));
}
if(saveLogBarrierIterates)
{
std::ofstream diagStream;
char diagString[100];
snprintf(diagString, 100, "logBarrierHessiandata/D%d.dat", jOpt);
diagStream.open(diagString, ios::out | ios::trunc);
for(int ii = 0; ii < dimM; ii++)
{
diagStream << setprecision(30) << DiagLogBar(ii) << endl;
}
diagStream.close();
}
SparseMatrix * Ds = new SparseMatrix(DiagLogBar);
ParFiniteElementSpace * fes = problem->GetfesM();
D = new HypreParMatrix(fes->GetComm(), fes->GlobalTrueVSize(), fes->GetTrueDofOffsets(), Ds);
HypreStealOwnership(*D,*Ds);
delete Ds;
if(Hmm != nullptr)
{
Wmm = Hmm;
Wmm->Add(1.0, *D);
}
else
{
Wmm = D;
}
Ju = problem->Duc(x); JuT = Ju->Transpose();
Jm = problem->Dmc(x); JmT = Jm->Transpose();
// IP-Newton system matrix
// Ak = [[H_(u,u) H_(u,m) J_u^T]
// [H_(m,u) W_(m,m) J_m^T]
// [ J_u J_m 0 ]]
Ak.SetBlock(0, 0, Huu); Ak.SetBlock(0, 2, JuT);
Ak.SetBlock(1, 1, Wmm); Ak.SetBlock(1, 2, JmT);
Ak.SetBlock(2, 0, Ju); Ak.SetBlock(2, 1, Jm);
if(Hum != nullptr) { Ak.SetBlock(0, 1, Hum); Ak.SetBlock(1, 0, Hmu); }
}
// perturbed KKT system solve
// determine the search direction
void ParInteriorPointSolver::IPNewtonSolve(BlockVector &x, Vector &l, Vector &zl, Vector &zlhat, BlockVector &Xhat, double mu, bool socSolve)
{
// solve A x = b, where A is the IP-Newton matrix
BlockOperator A(block_offsetsuml, block_offsetsuml); BlockVector b(block_offsetsuml); b = 0.0;
FormIPNewtonMat(x, l, zl, A);
// [grad_u phi + Ju^T l]
// b = - [grad_m phi + Jm^T l]
// [ c ]
BlockVector gradphi(block_offsetsx); gradphi = 0.0;
BlockVector JTl(block_offsetsx); JTl = 0.0;
Dxphi(x, mu, gradphi);
(A.GetBlock(0,2)).Mult(l, JTl.GetBlock(0));
(A.GetBlock(1,2)).Mult(l, JTl.GetBlock(1));
for(int ii = 0; ii < 2; ii++)
{
b.GetBlock(ii).Set(1.0, gradphi.GetBlock(ii));
b.GetBlock(ii).Add(1.0, JTl.GetBlock(ii));
}
if(!socSolve)
{
problem->c(x, b.GetBlock(2));
}
else
{
b.GetBlock(2).Set(1.0, ckSoc);
}
b *= -1.0;
Xhat = 0.0;
// Direct solver (default)
if(linSolver == 0)
{
Array2D<HypreParMatrix *> ABlockMatrix(3,3);
for(int ii = 0; ii < 3; ii++)
{
for(int jj = 0; jj < 3; jj++)
{
if(!A.IsZeroBlock(ii, jj))
{
ABlockMatrix(ii, jj) = dynamic_cast<HypreParMatrix *>(&(A.GetBlock(ii, jj)));
}
else
{
ABlockMatrix(ii, jj) = nullptr;
}
}
}
HypreParMatrix * Ah = HypreParMatrixFromBlocks(ABlockMatrix);
/* direct solve of the 3x3 IP-Newton linear system */
#ifdef MFEM_USE_MUMPS
MUMPSSolver ASolver;
ASolver.SetPrintLevel(0);
ASolver.SetMatrixSymType(MUMPSSolver::MatType::SYMMETRIC_INDEFINITE);
ASolver.SetOperator(*Ah);
ASolver.Mult(b, Xhat);
#else
#ifdef MFEM_USE_MKL_CPARDISO
CPardisoSolver ASolver(MPI_COMM_WORLD);
ASolver.SetOperator(*Ah);
ASolver.Mult(b, Xhat);
#else
MFEM_VERIFY(false, "linSolver 0 will not work unless compiled with MUMPS or MKL");
#endif
#endif
delete Ah;
}
else if(linSolver == 1 || linSolver == 2)
{
// form A = Huu + Ju^T D Ju, Wmm = D for contact
HypreParMatrix * Huuloc = dynamic_cast<HypreParMatrix *>(&(A.GetBlock(0, 0)));
HypreParMatrix * Wmmloc = dynamic_cast<HypreParMatrix *>(&(A.GetBlock(1, 1)));
HypreParMatrix * Juloc = dynamic_cast<HypreParMatrix *>(&(A.GetBlock(2, 0)));
HypreParMatrix * JuTloc = dynamic_cast<HypreParMatrix *>(&(A.GetBlock(0, 2)));
HypreParMatrix *JuTDJu = RAP(Wmmloc, Juloc); // Ju^T D Ju
HypreParMatrix *Areduced = ParAdd(Huuloc, JuTDJu); // Huu + Ju^T D Ju
/* prepare the reduced rhs */
// breduced = bu + Ju^T (bm + Wmm bl)
Vector breduced(dimU); breduced = 0.0;
Vector tempVec(dimM); tempVec = 0.0;
Wmmloc->Mult(b.GetBlock(2), tempVec);
tempVec.Add(1.0, b.GetBlock(1));
JuTloc->Mult(tempVec, breduced);
breduced.Add(1.0, b.GetBlock(0));
if(linSolver == 1)
{
// setup the solver for the reduced linear system
#ifdef MFEM_USE_MUMPS
MUMPSSolver AreducedSolver;
AreducedSolver.SetPrintLevel(0);
AreducedSolver.SetMatrixSymType(MUMPSSolver::MatType::SYMMETRIC_INDEFINITE);
AreducedSolver.SetOperator(*Areduced);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
#else
#ifdef MFEM_USE_MKL_CPARDISO
CPardisoSolver AreducedSolver(MPI_COMM_WORLD);
AreducedSolver.SetOperator(*Areduced);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
#else
MFEM_VERIFY(false, "linSolver 1 will not work unless compiled with MUMPS or MKL");
#endif
#endif
}
else
{
HyprePCG AreducedSolver(MPI_COMM_WORLD);
AreducedSolver.SetOperator(*Areduced);
HypreBoomerAMG AreducedPrec;
AreducedSolver.SetTol(linSolveTol);
AreducedSolver.SetMaxIter(500);
AreducedSolver.SetPreconditioner(AreducedPrec);
AreducedSolver.SetResidualConvergenceOptions(); // convergence criteria based on residual norm
AreducedSolver.SetPrintLevel(2);
AreducedSolver.Mult(breduced, Xhat.GetBlock(0));
}
// now propagate solved uhat to obtain mhat and lhat
// xm = Ju xu - bl
Juloc->Mult(Xhat.GetBlock(0), Xhat.GetBlock(1));
Xhat.GetBlock(1).Add(-1.0, b.GetBlock(2));
// xl = Wmm xm - bm
Wmmloc->Mult(Xhat.GetBlock(1), Xhat.GetBlock(2));
Xhat.GetBlock(2).Add(-1.0, b.GetBlock(1));
delete JuTDJu;
delete Areduced;
}
/* backsolve to determine zlhat */
for(int ii = 0; ii < dimM; ii++)
{
zlhat(ii) = -1.*(zl(ii) + (zl(ii) * Xhat(ii + dimU) - mu) / (x(ii + dimU) - ml(ii)) );
}
// free memory
delete D;
delete JuT;
delete JmT;
if(Hmm != nullptr)
{
delete Wmm;
}
}
// here Xhat, X will be BlockVectors w.r.t. the 4 partitioning X = (u, m, l, zl)
void ParInteriorPointSolver::lineSearch(BlockVector& X0, BlockVector& Xhat, double mu)
{
double tau = max(tauMin, 1.0 - mu);
Vector u0 = X0.GetBlock(0);
Vector m0 = X0.GetBlock(1);
Vector l0 = X0.GetBlock(2);
Vector z0 = X0.GetBlock(3);
Vector uhat = Xhat.GetBlock(0);
Vector mhat = Xhat.GetBlock(1);
Vector lhat = Xhat.GetBlock(2);
Vector zhat = Xhat.GetBlock(3);
double alphaMax = MaxStepSize(m0, ml, mhat, tau);
double alphaMaxz = MaxStepSize(z0, zhat, tau);
alphaz = alphaMaxz;
BlockVector x0(block_offsetsx); x0 = 0.0;
x0.GetBlock(0).Set(1.0, u0);
x0.GetBlock(1).Set(1.0, m0);
BlockVector xhat(block_offsetsx); xhat = 0.0;
xhat.GetBlock(0).Set(1.0, uhat);
xhat.GetBlock(1).Set(1.0, mhat);
BlockVector xtrial(block_offsetsx); xtrial = 0.0;
BlockVector Dxphi0(block_offsetsx); Dxphi0 = 0.0;
int maxBacktrack = 20;
alpha = alphaMax;
Vector ck0(dimC); ck0 = 0.0;
Vector zhatsoc(dimM); zhatsoc = 0.0;
BlockVector Xhatumlsoc(block_offsetsuml); Xhatumlsoc = 0.0;
BlockVector xhatsoc(block_offsetsx); xhatsoc = 0.0;
Vector uhatsoc(dimU); uhatsoc = 0.0;
Vector mhatsoc(dimM); mhatsoc = 0.0;
Dxphi(x0, mu, Dxphi0);
Dxphi0_xhat = InnerProduct(MPI_COMM_WORLD, Dxphi0, xhat);
descentDirection = Dxphi0_xhat < 0. ? true : false;
if(descentDirection)
{
if (iAmRoot)
{
cout << "is a descent direction for the log-barrier objective\n";
}
}
else
{
cout << "is not a descent direction for the log-barrier objective\n";
}
thx0 = theta(x0);
phx0 = phi(x0, mu);
lineSearchSuccess = false;
for(int i = 0; i < maxBacktrack; i++)
{
if (iAmRoot)
{
cout << "\n--------- alpha = " << alpha << " ---------\n";
}
// ----- A-5.2. Compute trial point: xtrial = x0 + alpha_i xhat
xtrial.Set(1.0, x0);
xtrial.Add(alpha, xhat);
// ------ A-5.3. if not in filter region go to A.5.4 otherwise go to A-5.5.
thxtrial = theta(xtrial);
phxtrial = phi(xtrial, mu);
filterCheck(thxtrial, phxtrial);
if(!inFilterRegion)
{
if (iAmRoot)
{
cout << "not in filter region :)\n";
}
// ------ A.5.4: Check sufficient decrease
if(!descentDirection)
{
switchCondition = false;
}
else
{
switchCondition = (alpha * pow(abs(Dxphi0_xhat), sPhi) > delta * pow(thx0, sTheta)) ? true : false;
}
if (iAmRoot)
{
cout << "theta(x0) = " << thx0 << ", thetaMin = " << thetaMin << endl;
cout << "theta(xtrial) = " << thxtrial << ", (1-gTheta) *theta(x0) = " << (1. - gTheta) * thx0 << endl;
cout << "phi(xtrial) = " << phxtrial << ", phi(x0) - gPhi *theta(x0) = " << phx0 - gPhi * thx0 << endl;
}
// Case I
if(thx0 <= thetaMin && switchCondition)
{
sufficientDecrease = (phxtrial <= phx0 + eta * alpha * Dxphi0_xhat) ? true : false;
if(sufficientDecrease)
{
if(iAmRoot) { cout << "Line search successful: sufficient decrease in log-barrier objective.\n"; }
// accept the trial step
lineSearchSuccess = true;
break;
}
}
else
{
if(thxtrial <= (1. - gTheta) * thx0 || phxtrial <= phx0 - gPhi * thx0)
{
if(iAmRoot) { cout << "Line search successful: infeasibility or log-barrier objective decreased.\n"; }
// accept the trial step
lineSearchSuccess = true;
break;
}
}
// A-5.5: Initialize the second-order correction
if((!(thx0 < thxtrial)) && i == 0)
{
if (iAmRoot)
{
cout << "second order correction\n";
}
problem->c(xtrial, ckSoc);
problem->c(x0, ck0);
ckSoc.Add(alphaMax, ck0);
// A-5.6 Compute the second-order correction.
IPNewtonSolve(x0, l0, z0, zhatsoc, Xhatumlsoc, mu, true);
mhatsoc.Set(1.0, Xhatumlsoc.GetBlock(1));
//WARNING: not complete but currently solver isn't entering this region
}
}
else
{
if (iAmRoot)
{
cout << "in filter region :(\n";
}
}
// include more if needed
alpha *= 0.5;
}
}
void ParInteriorPointSolver::projectZ(const Vector &x, Vector &z, double mu)
{
double zi;
double mudivmml;
for(int i = 0; i < dimM; i++)
{
zi = z(i);
mudivmml = mu / (x(i + dimU) - ml(i));
z(i) = max(min(zi, kSig * mudivmml), mudivmml / kSig);
}
}
void ParInteriorPointSolver::filterCheck(double th, double ph)
{
inFilterRegion = false;
if(th > thetaMax)
{
inFilterRegion = true;
}
else
{
for(int i = 0; i < F1.Size(); i++)
{
if(th >= F1[i] && ph >= F2[i])
{
inFilterRegion = true;
break;
}
}
}
}
double ParInteriorPointSolver::E(const BlockVector &x, const Vector &l, const Vector &zl, double mu, bool printEeval)
{
double E1, E2, E3;
double sc, sd;
BlockVector gradL(block_offsetsx); gradL = 0.0; // stationarity grad L = grad f + J^T l - z
Vector cx(dimC); cx = 0.0; // feasibility c = c(x)
Vector comp(dimM); comp = 0.0; // complementarity M Z - mu 1
DxL(x, l, zl, gradL);
E1 = GlobalLpNorm(infinity(), gradL.Normlinf(), MPI_COMM_WORLD);
problem->c(x, cx);
E2 = GlobalLpNorm(infinity(), cx.Normlinf(), MPI_COMM_WORLD);
for(int ii = 0; ii < dimM; ii++)
{
comp(ii) = x(dimU + ii) * zl(ii) - mu;
}
E3 = GlobalLpNorm(infinity(), comp.Normlinf(), MPI_COMM_WORLD);
double ll1, zl1;
zl1 = GlobalLpNorm(1, zl.Norml1(), MPI_COMM_WORLD)/ double(dimCglb + dimMglb);
ll1 = GlobalLpNorm(1, l.Norml1(), MPI_COMM_WORLD);
sc = max(sMax, zl1 / (double(dimMglb)) ) / sMax;
sd = max(sMax, (ll1 + zl1) / (double(dimCglb + dimMglb))) / sMax;
if(iAmRoot && printEeval)
{
cout << "evaluating optimality error for mu = " << mu << endl;
cout << "stationarity measure = " << E1 / sd << endl;
cout << "feasibility measure = " << E2 << endl;
cout << "complimentarity measure = " << E3 / sc << endl;
}
return max(max(E1 / sd, E2), E3 / sc);
}
double ParInteriorPointSolver::E(const BlockVector &x, const Vector &l, const Vector &zl, bool printEeval)
{
return E(x, l, zl, 0.0, printEeval);
}
double ParInteriorPointSolver::theta(const BlockVector &x)
{
Vector cx(dimC); cx = 0.0;
problem->c(x, cx);
return sqrt(InnerProduct(MPI_COMM_WORLD,cx, cx));
}
// log-barrier objective
double ParInteriorPointSolver::phi(const BlockVector &x, double mu)
{
double fx = problem->CalcObjective(x);
double logBarrierLoc = 0.0;
for(int i = 0; i < dimM; i++)
{
logBarrierLoc += log(x(dimU+i)-ml(i));
}
double logBarrierGlb;
MPI_Allreduce(&logBarrierLoc, &logBarrierGlb, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
return fx - mu * logBarrierGlb;
}
// gradient of log-barrier objective with respect to x = (u, m)
void ParInteriorPointSolver::Dxphi(const BlockVector &x, double mu, BlockVector &y)
{
problem->CalcObjectiveGrad(x, y);
for(int i = 0; i < dimM; i++)
{
y(dimU + i) -= mu / (x(dimU + i));
}
}
// Lagrangian function evaluation
// L(x, l, zl) = f(x) + l^T c(x) - zl^T m
double ParInteriorPointSolver::L(const BlockVector &x, const Vector &l, const Vector &zl)
{
double fx = problem->CalcObjective(x);
Vector cx(dimC); problem->c(x, cx);
return (fx + InnerProduct(MPI_COMM_WORLD,cx, l) - InnerProduct(MPI_COMM_WORLD, x.GetBlock(1), zl));
}
void ParInteriorPointSolver::DxL(const BlockVector &x, const Vector &l, const Vector &zl, BlockVector &y)
{
// evaluate the gradient of the objective with respect to the primal variables x = (u, m)
BlockVector gradxf(block_offsetsx); gradxf = 0.0;
problem->CalcObjectiveGrad(x, gradxf);
HypreParMatrix *Jacu, *Jacm, *JacuT, *JacmT;
Jacu = problem->Duc(x);
Jacm = problem->Dmc(x);
JacuT = Jacu->Transpose();
JacmT = Jacm->Transpose();
JacuT->Mult(l, y.GetBlock(0));
JacmT->Mult(l, y.GetBlock(1));
delete JacuT;
delete JacmT;
y.Add(1.0, gradxf);
(y.GetBlock(1)).Add(-1.0, zl);
}
bool ParInteriorPointSolver::GetConverged() const
{
return converged;
}
void ParInteriorPointSolver::SetTol(double Tol)
{
OptTol = Tol;
}
void ParInteriorPointSolver::SetMaxIter(int max_it)
{
max_iter = max_it;
}
void ParInteriorPointSolver::SetBarrierParameter(double mu_0)
{
mu_k = mu_0;
}
void ParInteriorPointSolver::SaveLogBarrierHessianIterates(bool save)
{
MFEM_ASSERT(MyRank == 0 || save == false, "currently can only save logbarrier hessian in serial codes");
saveLogBarrierIterates = save;
}
void ParInteriorPointSolver::SetLinearSolver(int LinSolver)
{
linSolver = LinSolver;
}
void ParInteriorPointSolver::SetLinearSolveTol(double Tol)
{
linSolveTol = Tol;
}
ParInteriorPointSolver::~ParInteriorPointSolver()
{
F1.DeleteAll();
F2.DeleteAll();
block_offsetsx.DeleteAll();
block_offsetsumlz.DeleteAll();
block_offsetsuml.DeleteAll();
ml.SetSize(0);
}
+82
View File
@@ -0,0 +1,82 @@
#include "mfem.hpp"
#include "ParProblems.hpp"
#include <fstream>
#include <iostream>
using namespace std;
using namespace mfem;
#ifndef PARIPSOLVER
#define PARIPSOLVER
class ParInteriorPointSolver
{
protected:
ParGeneralOptProblem* problem;
double OptTol;
int max_iter;
double mu_k; // \mu_k
Vector lk, zlk;
double sMax, kSig, tauMin, eta, thetaMin, delta, sTheta, sPhi, kMu, thetaMu;
double thetaMax, kSoc, gTheta, gPhi, kEps;
// filter
Array<double> F1, F2;
// quantities computed in lineSearch
double alpha, alphaz;
double thx0, thxtrial;
double phx0, phxtrial;
bool descentDirection, switchCondition, sufficientDecrease, lineSearchSuccess, inFilterRegion;
double Dxphi0_xhat;
int dimU, dimM, dimC;
int dimUglb, dimMglb, dimCglb;
Array<int> block_offsetsumlz, block_offsetsuml, block_offsetsx;
Vector ml;
Vector ckSoc;
HypreParMatrix * Huu, * Hum, * Hmu, * Hmm, * Wmm, *D, * Ju, * Jm, * JuT, * JmT;
int jOpt;
bool converged;
int MyRank;
bool iAmRoot;
bool saveLogBarrierIterates;
int linSolver;
double linSolveTol;
public:
ParInteriorPointSolver(ParGeneralOptProblem*);
double MaxStepSize(Vector& , Vector& , Vector& , double);
double MaxStepSize(Vector& , Vector& , double);
void Mult(const BlockVector& , BlockVector&);
void Mult(const Vector&, Vector &);
void FormIPNewtonMat(BlockVector& , Vector& , Vector& , BlockOperator &);
void IPNewtonSolve(BlockVector& , Vector& , Vector& , Vector&, BlockVector& , double, bool);
void lineSearch(BlockVector& , BlockVector& , double);
void projectZ(const Vector & , Vector &, double);
void filterCheck(double, double);
double E(const BlockVector &, const Vector &, const Vector &, double, bool);
double E(const BlockVector &, const Vector &, const Vector &, bool);
bool GetConverged() const;
// TO DO: include Hessian of Lagrangian
double theta(const BlockVector &);
double phi(const BlockVector &, double);
void Dxphi(const BlockVector &, double, BlockVector &);
double L(const BlockVector &, const Vector &, const Vector &);
void DxL(const BlockVector &, const Vector &, const Vector &, BlockVector &);
void SetTol(double);
void SetMaxIter(int);
void SetBarrierParameter(double);
void SaveLogBarrierHessianIterates(bool);
void SetLinearSolver(int);
void SetLinearSolveTol(double);
virtual ~ParInteriorPointSolver();
};
#endif

Some files were not shown because too many files have changed in this diff Show More