Commit Graph
29 Commits
Author SHA1 Message Date
IdoAkkerman 4230779792 Merge branch 'master' into ab-am-refactor 2024-04-04 14:05:24 +02: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
IdoAkkerman 43533b51d5 Merge branch 'master' into ab-am-refactor 2024-04-02 16:58:57 +02:00
Will Pazner cd6919ce29 Return unique_ptr from ODESolver::Select (and others) 2023-12-19 12:24:34 -08:00
Tzanio Kolev d983b34924 Renamed ftype -> real_t 2023-12-13 12:51:43 -08:00
Dylan Copeland b89222762d Generalized floating point type for all remaining examples. 2023-11-06 15:34:42 -08:00
Ido Akkerman 1f564b2674 Split implicit and explicit solvers in selection routine 2023-03-27 10:52:14 +02:00
Keith afa9ddac83 remove redundant class in ex18 2022-05-10 16:45:56 -07:00
Veselin Dobrev 6b572a01d4 Address a few more warnings and feedback from the PR (#379). 2017-12-10 19:43:56 -08:00
Johann Dahm d767dc25d1 Incorporate comments from @tzanio 2017-10-20 10:31:05 -07:00
Tzanio 1a7cfa5a06 Small updates related to Example 18. 2017-10-17 17:27:27 -07:00
Johann Dahm 34009d2d8d Add comments from @YohannDudouit 2017-10-06 10:02:11 -07:00
Tzanio 10c27dd942 Some small changes 2017-10-01 21:42:41 -07:00
Tzanio e88994e444 make style 2017-09-22 07:34:11 -07:00
Johann Dahm 4c01eed5a4 Move shared code in ex18{,p} to a "header" file 2017-09-21 13:48:25 -07:00
Johann Dahm a988d654c3 Fix ex18p and make consistent with ex18 2017-09-19 15:57:03 -07:00
Johann Dahm 83550244bb GLVis output in parallel version and misc tweaks
Parallel version still only works with a single processor.
2017-09-06 21:26:59 -07:00
Johann Dahm 168441e48a Refactor serial example to visualize density with GLVis 2017-09-06 14:27:32 -07:00
Johann Dahm 2d542f3ce3 Remove method 1 and add comments 2017-09-05 21:52:03 -07:00
Johann Dahm 50e2b28d84 Add flux interpolation method
This works very well.
2017-09-05 21:17:08 -07:00
Johann Dahm e01b2cf3fd Turn off visualization by default 2017-09-05 16:25:12 -07:00
Johann Dahm 3632b6b95c Store the mass matrix inverse and apply element-by-element 2017-09-05 16:24:16 -07:00
Johann Dahm 2f4f088970 Remove TODO relating to element size 2017-08-31 22:31:45 -07:00
Johann Dahm 4ad51301c9 Use a temporary string to avoid compiler error 2017-08-30 14:36:08 -07:00
Johann Dahm 3b7277c0bd Change default vis_steps to 50 2017-08-30 09:48:59 -07:00
Johann Dahm bf1de64e57 Replace C++11 to_string feature with stringstream 2017-08-30 09:48:15 -07:00
Johann Dahm fb5d974e25 Write intermediate gf only when visualization = true 2017-08-30 09:47:05 -07:00
Johann Dahm 49f6944742 Include header with std::to_string for CI test 2017-08-30 08:05:14 -07:00
Johann Dahm c88656420c Add Euler vortex transport example 2017-08-29 22:42:43 -07:00