Commit Graph
109 Commits
Author SHA1 Message Date
Tzanio Kolev cd4e583f9f Merge pull request #4659 from mfem/najlkin/parform-impro
Improvements of Par(Mixed)BilinearForm and Par(Block)NonlinearForm
2025-10-18 10:48:44 -07:00
Jan Nikl e13d1a1d53 Fixed support of non-conforming meshes in BlockNonlinearForm. 2025-10-10 13:32:53 -07:00
Tzanio Kolev bce6e2ca76 Merge branch 'master' into najlkin/parform-impro 2025-10-05 13:25:11 -07:00
Dohyun Kim 80c69e9856 style 2025-09-24 14:27:40 -04:00
Tzanio Kolev 40d1550fd6 Merge branch 'master' into najlkin/parform-impro 2025-09-17 03:31:41 -07:00
Dohyun Kim 9125bf8291 add SetEssentialTrueDofs 2025-08-29 17:32:48 -04:00
Jan Nikl 058fdaae3f Implemented gradient of ParBlockNonlinearForm with shared face contributions. 2025-06-11 16:23:42 -07:00
Will Pazner 11b878612b Use three-argument version of GetElementDofs…
…and related functions that return a pointer to an internal DofTransformation
object that may be invalidated unexpectedly.
2025-06-02 21:04:31 -07:00
Jan Nikl 9dab032bd0 Merge branch 'master' into najlkin/parform-impro 2025-04-24 15:40:44 -07:00
Jan Nikl cdfe8102ae Added gradient of ParNonlinearForm with face integrators. 2025-03-18 16:44:51 -07:00
camierjs 999d6e9e94 Merge branch 'master' into bltp 2025-02-04 12:53:53 -08:00
camierjs ea041467ae Address reviewers comments 2025-02-04 10:32:44 -08:00
Tzanio Kolev e4c2152419 Update Copyright to 2010-2025 2025-02-03 12:17:26 -08:00
camierjs 27c526578d Use device vectors in solvers 2025-01-29 11:45:24 -08:00
aa1d6441f8 General hyperbolic class and Refactored Ex18, Ex18p (#3598)
* include cfl

* include 2x2 periodic mesh to have 2^N elements.

* include computation of initial max char speed for t=0

* reorder classes to avoid incomplete type

* fix function spaces for solution variables

* Initial conditions and problems. Not yet done I think

* problem setting

* begin time stepping implementation

* Initial state assignment

* arg parser!

* default periodic square mesh updated

it seems that 2x2 periodic mesh does not work.
-> This is because 2x2 contains both 0->1 edge and 1->0 edge on the boundary
due to periodic constraint.
I believe that is why 3x3 elements are used in the data folder.

* correct errors in euler flux functions

* General Hyperbolic Form updated

* Burgers example included

* Rename FE_Evolution to HCL

* Give operators more meaningful names

* remove Aflux and include divA.
This will allow us to update operators within HCL class

* Allow variable size of invMe to handle p-refine.
invMe Type: DenseTensor -> vector<DenseMatrix>

* Update method included for HCL.
It is not tested yet.
Also, since Operator does not have Update method,
we needed to restrict Operator to NonlinearForm

* Finalize update functionality. Visualization not yet implemented.
Tested with derefine and refine after system construction.
Current code seems to give correct result.
May require further verification.

* update burgers equation

* Fix 1-d bug!
As MFEM positive/negative elements ordering
does not respect the original mesh ordering,
normal vector can be positive or negative in 1D.
We check this by checking integration point is either right or left for 1D.

* move global constants (num_eq, gas.. etc) inside of the classes

* revert back visualization code.

* Add comments and reorder classes

* Remove redundant example code as it is not used anymore.

* rename and move problem-specific defintions to cpp files

* Merged debugged code.

* shallow water an example with periodic boundary included

* rename num_equation to num_equations and include GetIntRule

* Element-wise form integrator for further refactoring

* just testing...

* rename to DGHyperbolicConservationLaws

* max_char_speed now shared by pointer

* use reference instead of pointer

* Rename HCL class to DGHCL

* Form now have pointer to max_char_speed which points to HCL class max_char_speed.
max_char_speed is not exposed to outside.
Use getter instead.

* MPI_Reduce -> MPI_All_Reduce as all workers share the same max_char_speed

* rename faceform to hyperbolic faceform

* Include HyperbolicElementForm for accurate flux evaluation

* Rename form to formintegrator as this is appropriate name

* evaluation template for element assembly

* funval -> state for readibility

* fix bug in the arguments of AssembleElementVector

* compute flux now takes correct function arguments

* ElementFormIntegrator is done. Not yet tested.🤞

* Euler problem is verified.
Burgers and shallow water will be updated

* correct typo Hyperboilic.... :(

* Burgers done. Euler typo fixed

* Shallow water also done!

* Shallow water gauss bump problem included

* include transformations to flux evaluation functions

* This fixes Allow HCL flux functions utilize space-dependent evaluation dohyun-cse/mfem#1.
Advection equation is now included

* Now DGHCL takes nonlinear form as an input argument to handle ParNonlinearForm

* Parallel euler implementation

* remove hello from..

* print function updated

* code cleanup

* Euler cleanup and parallel version bug fix

* Burgers code cleanup and parallel implementation

* shallow water updated.

* advection serial parallel done.

* correct typo in option (parallel refine)

* move hyperbolic_conservation_laws file to fem folder

* include path update

* Take NonlinearForm as reference, not a pointer. Updated Makefile, too.

* Documentation and change some variable names

* form integrators are now in heap memory to avoid malloc error

* changed nonlinear form as a pointer
It seems that PyMFEM does not like reference of nonlinear form... :(

* ignore generated files

* max_char_speed get set method instead of pointer

* nonilnForm pointer update

* nonlinearForm pass by reference

* typo correction

* Test for PyMFEM.. Other examples are not updated yet

* example scripts updated

* ternary to max function

* simplify creating parallel version.

* p-refinement done. test needed.

* testing begins!

* update procedure for main class is included.

* Testing. Still having problem. Not identified yet

* Correct size, but incorrect values.

* p-refinement done and remove nonlinear form exposure.
Parallel checking is done by dynamic_cast.
Therefore, there is no reason to expose nonlienar form to user.
This simplifies class creation :)

* p-refinement test done.

It seems that p-refinement does not result in more accurate solution.

* add option for refinement. h-refinement impl start

* h-refine works fine, but threshold should be modified to obtain bounded number of elements.

* namespace update

* examples tested.

* h-refinement done. Update marking procedure by using confidence interval

* formatting and remove cout from derefine

* include adaptive code to make file

* visualization update

* NumericalFlux -> RiemannSolver

* It seems that set is ambiguous for SWIG..

* comment on hDerefine and now use VectorFunctionCoefficient for IC and Velocity

* testing....

* make flux related methods public

* remove commented out codes

* make style

* doxygen update

* update ex18 with new implementation

* Combine Element/Face Form integrators.

* astyle

* remove redundant ;

* remove refinement procedures.

* thread safe clause

* remove using namespace from hpp file

* ProlongToMaxOrderDG included with interpolation

* remove lambda_function type and return VectorFunctionCoeff for initial/velocity

* removed sinpi

* Some comments

* remove other examples and style

* remove examples not included anymore

* std::cout to mfem::out and correct minor bugs

* ignore mesh file

* update makefile

* remove MPI from serial

* remove unused captured variables in lambda functions

* style

* remove ex34 from makefile and reorder initialization

* remove initialization for auxiliary variables in formintegrator

* remove gas constant from the euler system

* fix broken parts due to uninitialization

* move initialization of local variables inside of FormIntegrator constructor

* forgot to update the other constructor!

* ignore mesh and gridfunctions

* resolved memory leak. Need to check

* remove pragma omp atomic

* remove delete nonlinearForm

* resolve shadowing

* correct dof report and remove barrier in visualization

* forgot to update variable name in euler form

* nonlinearForm memory leak resolved.

destructor of nonlinearForm always delete integrators.
This results in double deletion of the form integrator if we use for both domain and face integration.
To resolve this issue, just create two integrators and pass it to nonlinearForm

* proper header setting and faster test by reducing mesh size

* delete ex18.hpp

* move lengthy functions to cpp

* header order changed

* simpler inclusion.. still have duplicated symbols

* resolved linker problem and include pnonlinear

* remove commented out functions

* documentation

* fixing memory leak..

* delete nonlinearForm

* formatting

* distclean update

* Ignore binaries and result files

* copyright

* Riemann solver comment, input updated.
Riemann solver is now passed as reference

* pass riemann solver by reference

* move default normal flux eval to cpp

* Advection uses inferred dimension from velocity field

* integration rule uses Jacobian order, too

* delete not implemented

* mark override

* format

* unique ptr and mark override

* use single HyperbolicFormIntegrator

* static GetRule

* proper creation without copying

* proper jacobian order in GetRule

* moved member function implementation to cpp file

* new line

* pass by reference

* removed 4x4 mesh and update ignore

* doxygen updated

* remove constructor with integration rule.
Users can set integration rule via NonlinearFormIntegrator::SetIntRule

* useExternalData to indicate ownership of integrator for nonlinear form

* extract flux function from the form integrator

As suggested by @pazner, flux function is now seperated from form integrator. By doing so, riemann solver takes simpler argument but can access to equation-specific information.

* documentation

* documentation --

* initialization order

* update naming of form integrators

* initialization order...

* use normal wavespeed

* shorter Rusanov flux evaluation

* minor code style update

See, https://github.com/mfem/mfem/pull/3598#pullrequestreview-1803234677

* fix syntax error due to pointer -> reference

* std::

* Update fem/nonlinearform.hpp

Co-authored-by: Will Pazner <11493037+pazner@users.noreply.github.com>

* return Mesh instead of string

* Moved DG to ex18.hpp and other styling updates
- Ex18p not yet updated

* update similar to previous commit

* remove ResetMaxChar in the constructor + comment update

Since reset max char will be called each Mult() call, we do not need reset in the constructor

* comment and include functional

* removed inlined namewspace

* style

* move common functions to hpp

* formatting and minor fixes in parallel code.

* update filename and fix typo in `GetMovingVortexInit`

* add hyperbolic to changelog and ex18 comment update

* removed Kelvin–Helmholtz instability example

It is hard to get a satisfactory result with the current DG method without additional treatment.

* fluxFunction is now input of RiemannSolver::Eval instead of being a member.

* compatibility check between flux function and Riemann solver

Some Riemann solver are system-specific. Such Riemann solver can prevent user-error by overriding `IsCompatible`.

* More error-proofing constructors of `RiemannSolver` and `HyperbolicFormIntegrator`

* documentation

* header file description updated

* add examples in the comment

* style

* copyright update

* use unique_ptr in the constructor to make ownership clear

* removed unused member, dim

* Some minor edits, mostly formatting

* add option for pre-assembly

* remove unused ComputeFlux

* keep momentum variable as in serial code

* Fix warnings

* preassembly by default and minor optimization

* remove mutable vector and revert back variable name

flux is now a local variable that changes size at each element. So, it would better to remove it from member variables.

* std::sqrt instead of sqrt

* another minor optimization

* rename options and add comments

* linearized->interpolated

* typo correction in comment

* remove auto from example

Co-authored-by: Chris Vogl <vogl2@llnl.gov>

* Comment update
Correct condition check comment on weak-divergence, and additional comments on auxiliary variable

* Momentum for visualization should be shifted.
FE implementation is correct, but visualization was using u[0,dim). It should be u[1,dim) and now fixed.

* example comments

* style..

* strangely, a trailing space was not updated.

* Fix the thread-safe build. Some doxygen and formatting tweaks.

* fix doxygen error

* Some small tweaks in ex18/ex18p; remove small diffs between the
serial and the parallel versions.

* Small formatting tweaks in ex18.hpp

* unused problem mesh transform

* Remove transformation dependent integration order

* Minor formatting

* support general precision

* format

---------

Co-authored-by: adam-sim-dev <adam.d.schmidt@hotmail.com>
Co-authored-by: Will Pazner <11493037+pazner@users.noreply.github.com>
Co-authored-by: Veselin Dobrev <dobrev@llnl.gov>
Co-authored-by: Chris Vogl <vogl2@llnl.gov>
Co-authored-by: Veselin Dobrev <v-dobrev@users.noreply.github.com>
2024-04-03 13:30:41 -07:00
Dylan Copeland d2e89166f9 Merge branch 'master' of github.com:mfem/mfem into float 2024-03-05 10:23:02 -08:00
Vladimir Z Tomov 706ef524c7 Merge branch 'master' into nlf-boundaryintegrators-dev 2024-02-06 12:31:03 -08:00
Dylan Copeland 046a874cfb Merge branch 'master' of github.com:mfem/mfem into float 2024-02-06 10:56:41 -08:00
Tzanio Kolev 87290fbf56 Update Copyright to 2010-2024 2024-01-27 13:06:49 -08:00
Joseph Signorelli 88fe87f4bc Application of make style 2024-01-20 17:48:20 -06:00
Joseph Signorelli 18301c0dbc BNFI for GetGridFunctionEnergy and GetEnergyBlocked 2024-01-03 16:05:55 -06:00
Joseph Signorelli 1f65d89031 Delete bnfi added to destructors 2024-01-03 15:47:17 -06:00
Joseph Signorelli 018da9aee1 Addition of bnfi to MultBlocked + ComputeGradientBlocked 2024-01-03 15:46:09 -06:00
Joseph Signorelli 5ee2001860 Addition of bnfi to Mult and GetGradient 2024-01-03 15:09:08 -06:00
Tzanio Kolev d983b34924 Renamed ftype -> real_t 2023-12-13 12:51:43 -08:00
Dylan Copeland d41b97552c Merge branch 'master' of github.com:mfem/mfem into float 2023-11-16 17:37:34 -08:00
Dylan Copeland 9017b9700d Finished generalizing type in fem directory. 2023-11-01 15:54:41 -07:00
Sebastian Grimberg 35bd5c84e9 Merge branch 'master' into sjg/bilinearform-integs-marker 2023-05-02 17:46:05 -07:00
Sebastian Grimberg ad21adbf57 Merge branch 'master' into sjg/bilinearform-integs-marker 2023-04-18 11:10:33 -07:00
camierjs dce372389b Merge master in forall 2023-03-24 07:52:56 -07:00
Tzanio Kolev 96e00dc815 Updated COPYRIGHT to 2010-2023 2023-03-11 16:58:18 -08:00
Sebastian Grimberg 6738a32c03 Add domain integrator markers for MixedBilinearForm, DiscreteLinearOperator, and NonlinearFormclasses 2023-03-01 10:48:18 -08:00
camierjs 018d5cfb8b Debugging lambdas in mfem::forall 2023-02-08 15:03:34 -08:00
Tzanio 6d2530775b Extended copyright to 2022 2022-02-25 10:24:50 -08:00
Tucker Babcock 5ad64b058b fix compile error, changed ComputeGradientBlocked doftrans usage to be similar to MixedBilinearForm::Assemble. 2021-09-07 14:35:00 -06:00
Tucker Babcock dd5f50bb40 store DofTransformations in Array for BlockNonlinearForm::MultBlocked and ::ComputeGradientBlocked since they need to be reused 2021-09-07 14:24:33 -06:00
Tucker Babcock 3a8908e6bf add DofTransformation to BlockNonlinearForm methods 2021-09-07 14:16:08 -06:00
Tucker Babcock 091ff0c475 adding DofTransformation objects to NonlinearForm Mult, GetGridFunctionEnergy, and GetGradient methods similar to those used in BilinearForm::Assemble and LinearForm::Assemble 2021-09-03 18:13:19 -06:00
Veselin Dobrev 3f40c5796f More bugfixes and tweaks for hypre+cuda support. 2021-07-22 08:57:25 -07:00
blaz 49a47922f2 make style 2021-07-07 21:26:44 -07:00
blaz f3b094d8d8 bug in the assembly for faces 2021-07-07 21:14:41 -07:00
F3dR19 5063dffcc7 fixes #2144 2021-04-20 20:34:30 +01:00
Veselin Dobrev 656b976340 Merge branch 'master' into tmopt-split-api
Resolved conflicts:
   fem/nonlinearform.cpp
   fem/nonlinearform.hpp
   fem/nonlinearform_ext.cpp
   fem/nonlinearform_ext.hpp
   fem/nonlininteg.cpp
   fem/nonlininteg.hpp
2021-02-16 23:31:53 -08:00
Yohann Dudouit a3a1640c1d Revert "Rename MFNonlinearFormExtension to UANonlinearFormExtension."
This reverts commit 726ede0e37.
2021-02-08 10:18:56 -08:00
Yohann Dudouit 726ede0e37 Rename MFNonlinearFormExtension to UANonlinearFormExtension. 2021-02-05 15:04:19 -08:00
Yohann Dudouit 30f0264449 Rename LEGACYFULL to LEGACY. 2021-02-05 15:03:42 -08:00
Yohann Dudouit aab4cb154a Rename Setup to Assemble. 2021-02-05 11:21:05 -08:00
Yohann Dudouit ab7ebe5556 Merge branch 'master' into yohann/ceed-convection 2021-02-03 16:52:26 -08:00
Veselin Dobrev 86895821b9 Re-worked class PANonlinearFormExtension::Gradient to implement
an Update method, reuse vectors from PANonlinearFormExtension,
and support FormSystemOperator by implementing GetProlongation.

Fix the size of the NonlinearFormExtension operator -- it is an
L-to-L operator.

In class NonlinearForm, add methods to access the interior and
boundary face integrators.

Small tweaks the methods (Par)NonlinearForm::GetGradient,
ConstrainedOperator::AssembleDiagonal, and
RAPOperator::AssembleDiagonal.

Add more doxygen documentation and other comments.
2021-01-27 13:07:45 -08:00
Veselin Dobrev 2384dea3b4 Remove the methods NonlinearForm::SetupGradient and
NonlinearFormExtension::AssembleGradient -- in both cases
the method GetGradient should be sufficient.

Add method NonlinearFormExtension::Update and use it in
NonlinearForm::Update.

Simplify a bit class PANonlinearFormExtension::Gradient.

Update some doxygen documentation.
2021-01-26 17:28:01 -08:00