Commit Graph

87 Commits

Author SHA1 Message Date
829e53d56e build(meson): updated build system. Note that this build system should be able to bring in MFEM and all needed deps automatically (tested on ubuntu, fedora, and macos) 2026-11-09 13:50:06 -05:00
811bbd9694 feat(backend): Added backend FEM code (specifically MFEM backend)
Much of the code to do actual finite element computations lives in this backend. The idea here is that the physics is all seperate and more descriptive than the backend. Further, we could, in principal swap out to another finite element backend (e.g. deal.II) without messing up stuff outside of this backend. Note LLM's made signifigant contributions to this module

LLMs (ChatGPT6 astra max and Claude Opus 5.5 medium) made signifigant contributions to this module. All LLM written code has been read over and verified.
2026-11-09 13:48:09 -05:00
e9a9fc7653 feat(serif): utility headers (e.g. config, version, etc...) 2026-11-09 13:45:57 -05:00
fff2b55832 feat(utils/checks): runtime is finite check
Probably this should be removed...
2026-11-09 13:45:32 -05:00
35e5d5a249 feat(utils/types): compile time string for error types 2026-11-09 13:45:00 -05:00
9f3a2fca44 feat(utils/misc): added a number of misc things (e.g. float roundoff compensated summation class) 2026-11-09 13:44:41 -05:00
585d6e3bf8 feat(utils/error): updated error codes 2026-11-09 13:44:08 -05:00
7ab8641f51 feat(utils/serialize): System for serializing anything that can be serialized in SERiF (note LLM's made signifigant contributions to this module)
There are loads of things (solutions, models, solver descriptions, mesh's, etc..) which need to be exported from SERiF and then either reimported into SERiF or into some other program. This module is responsible for all of that. Generally with the goal of feeling like the fmt / new format module in C++23 and on (e.g. by specializing formatting structs)

Note that LLM's made signifigant contributions to this module (ChatGPT 6 astra max and Claude Opus 5.5 Medium). All code has been reviewd manually
2026-11-09 13:43:31 -05:00
c854fcc590 feat(utils/projection): infrastructure for projecting some known field into FEM space 2026-11-09 13:40:31 -05:00
7134f99d7c feat(utils/laneemden): 1D lane-emden solver
simple rk4 lane emden solver. reimplemented from work in Dartmouth A115
2026-11-09 13:39:32 -05:00
ba457e7d10 feat(utils/dependencies): Added computational graph system
The initial prototype for this code used a number of bespoke so-called "prepared" operators to avoid recomputation of values which we could be sure would not change. However, this system was hard to scale. Here we implement an equivalent, but much more scalable, solution through a computational graph which keeps track of inputs and outputs to each node and only reruns the node when the inputs have changed. Note that this is a simplistic optimization scheme, we are do not check for example if the outputs change strongly or even at all with different inputs (generally that would require derivatives of the outputs wrt. each input) nor do we do any sort of graph optimization.
2026-11-09 13:38:55 -05:00
4ebdb7d058 feat(solver): high level solver interface
High level solver interface allowing for robust compile-time claims to be made
2026-11-09 13:36:11 -05:00
ac2cccda29 feat(solver/seed): Initial guess system
the seed system has two jobs, get the lane-emden solution for a reasonable n and project that onto the mesh. Note that the seed system does not solve lane-emden, that is in utils/laneemden (so that it can be reused by other systems). Currently SERiF only solves polytrope so the lane-emden initial guess is generally very good; however, as we move to non polytropic EOS we will still use a projected lane-emden as our initial guess for the starting model
2026-11-09 13:35:24 -05:00
9f4207bc6a feat(solver/preconditioner): Implements preconditioner system
The system matrix for a problem may be poorly conditioned, preconditioners are supposed to efficiently estimate the inverse of the system matrix so that a simpler problem, with the approximate identity matrix may be solved instead. The problem is that the best approach to this varies with different fields. The preconditioner system implements infrastructure to define seperate preconditioners for different fields which are then composed together.
2026-11-09 13:33:10 -05:00
24d4c20f82 feat(solver/normalization): Added normalization system
The dynamical range of different fields SERiF must solve for is massive. This just breaks any reasonable preconditioner / spreads the eigen modes of the system matrix out. This is a normalization system which uses charectaristic scale factors (e.g. the approximate radius estimated using the lane-emden equation) to rescale different fields to a more similar numeric scale. This turns out to be essential for stable convergence. Broadly this implements Riesz normalization along with exact diagnoal normalization.
2026-11-09 13:30:20 -05:00
9da779417b feat(solver/nonlinear): Implements a damped newton line-search with backtracking
This uses a linear solver from solver/linear which then calls some linear solver from the backend. Note that MFEM's build in newton solver is very simplistic and not sufficient for our needs; therefore we implement a more robust one here (and this is why newton is in the frontend and not the backend)
2026-11-09 13:27:14 -05:00
f520fe5f03 feat(solver/linear): Implemented a few linear solver frontends
As with much of the code, the actual solvers are implemented (through MFEM) in the backend. This provides an interface so we can more easily swap out the linear solvers on the backend in the future
2026-11-09 13:25:52 -05:00
64cc306a2c feat(solver/continuation): system to auto continue a solver along some number of parameters
A representative example is angular momentum. It may be useful to not spin a model up all the way initially (due to convergence issues) rather the continuation system allows for a model to be spun up over a few solves so that it can more reliably reach a stable state
2026-11-09 13:24:42 -05:00
87a1026be6 feat(operators): Moved most of operators to backend
Operators defines how SERiF concepts map into MFEM (or generally any backend) concenpts and types. Since we are trying to seperate the specific MFEM implementation out of SERiF most of the code that was here has moved to backend. However, what remains is some general code related to the block layout of a systen and the contributions of different equations to different parts of that block layout
2026-11-09 13:23:08 -05:00
48c6bac1cc feat(model): added model sub system
SERiF defines a so-called "model" subsystem. A model is a fully compile-time description of a problem. Note that this is a description not an evaluation tool. The basic idea is that since we have this robust description we can more easily serialize and be confident that others who load a model are getting the exact same thing. Further, this provides a convient place to do things like validate that all options are compatible, do some limited initial construction of the needed computational graph, allocate needed memory, etc... Some of the stuff that might initially seem to belong to a model will be in the discritization system though (e.g. FEM object lifetimes)
2026-11-09 13:20:46 -05:00
c6d1686c5d feat(mapping): The mapping code was all moved to the backend, this module now just brings the MFEM backend in
The mapping code is fundamentally backend dependent. Previously we had DomainMapper here; however, since it depende on MFEM we have moved it to the backend. The mapping module now just includes parts of the backend so that prior code will not break
2026-11-09 13:16:36 -05:00
30af52ccea feat(geometry/surface): System for prescripting surface condition and building computational node for surface condition
The surface needs some defined condition (e.g. Isobaric) This module defines how the surface is defined. Again, much like the deformation system this does not actually implement much of the code to deform the surface to that condition; rather, it implements code to allow the prescription to be described robustly at compile time
2026-11-09 13:13:53 -05:00
4bbbf1c418 feat(geometry/deformation): Added deformation subsystem
The model must be able to deform to capture the shape induced by rotation or an external potential. Here we add the precription to descibe how we allow deformation. Note that the code to define how deformation is actually implemented is in the backend.
2026-11-09 13:11:29 -05:00
9760e46477 feat(equations): simplified the supported equation set
previously we modeled gravity as a mixed formulation. However, this turns out to not be needed with the improved surface prescription. Removing this and returning to a simpler gravity system dramatically reduces the number of unknowns and therefore speeds up the system.
2026-11-09 13:08:08 -05:00
48bc7d5472 feat(dimensions): added second partial type and new dimensions 2026-11-02 10:06:47 -05:00
9a7e4a7112 feat(equations): Loads of simple getters
The continuation and snapshotting systems needed more getters in order to reliably serialize a model. Added those getters
2026-10-14 11:16:29 -04:00
f353deef57 feat(discretization/quadrature): added rules getter 2026-10-14 11:15:02 -04:00
4c3a9ab3a2 docs(discretization/domain/schema/validation): updated docs and brought some imports over from the new backend/mfem 2026-10-14 11:14:25 -04:00
c2ec94b9b7 docs(discretization/domain/schema): removed some whitespace 2026-10-14 11:13:27 -04:00
7f3ebbae45 feat(discretization/domain): updated domain system to use unified mfem backend
This means that the domain system never directly uses mfem code any more
2026-10-14 11:01:33 -04:00
d2e43c82f1 feat(discretization): added implementation of checked_block_size
tho see the note in the header, this could be made more general likeley
2026-10-14 10:58:52 -04:00
d3ff5add71 feat(discretization): Added SystemLayout and associated helpers to allow for more robust access to parts of the block system 2026-10-14 10:57:52 -04:00
5908f49e05 feat(dimensions): added InverseTimeSquared and GravitationalConstant 2026-10-14 10:05:40 -04:00
a9db87b834 feat(geometry/deformation/backend/mfem/detail): added reference tracking structs
Note, I say this in the todo's in the files too. This system is something of a holdover from the older MeanField system which used a bespoke (per module) caching system. We may want to consider ripping this out in favor of the more general depedencies graph system now that we have it in SERiF
2026-10-12 14:25:16 -04:00
0a1fb8d8db feat(geometry/deformation/backend/mfem): added radial_location implementation 2026-10-12 14:10:52 -04:00
eb9da56438 feat(geometry/deformation/backend/mfem/detail): added radial loactor to help identify points on a surface 2026-10-12 14:10:10 -04:00
c440134059 docs(mapping): added doxygen comments 2026-10-12 13:58:37 -04:00
546dc42d3e docs(mapping/compactification): added compactification documentation 2026-10-12 11:16:57 -04:00
eb521f3f01 feat(equations): Added point-wise datastructurs which equations return to the operator backend
These include all the information needed to integrate the global residual over the domain
2026-10-12 10:55:58 -04:00
0875831525 feat(equations): added rotation_force. This constrains the rotation force based on ridig rotation. When we add differential rotation we will need to dramatically modify this equation 2026-10-12 10:48:08 -04:00
51012252a0 docs(equations): removed old documentation from rigid rotation 2026-10-12 10:33:55 -04:00
f8bc1a37a5 feat(equations): added rigid rotation helper
This is a class which adds some helper utilities for computing the effective potential and the hessian of a body under rigid rotation. Note this is not an equation in and of itself
2026-10-12 10:33:24 -04:00
fee05a621d feat(equations): Added EquationRegistry
This is a compile time pack of equations which can be used to do things like say "this model is described by this set of equations"
2026-10-12 09:37:03 -04:00
cb2ac127aa feat(equations): added pressure_force equation
this equation describes the contribution of pressure to the mechanical balance of the system
2026-10-12 09:15:32 -04:00
1a222ef4b1 feat(equations): Added mixed formulation gravity equations
we solve gravity with a mixed formulation to avoid the loss of one order of accuracy while differentiating the potential.
2026-10-09 16:15:26 -04:00
747f37a10e docs(discretization/forms): made some small corrections 2026-10-09 15:59:51 -04:00
8154949bb7 docs(discretization/forms): expanded operand documentation with example 2026-10-09 15:55:57 -04:00
7432596642 docs(equations): added missing \f for latex rendering 2026-10-08 16:17:17 -04:00
9fd18d834a feat(equations): added mass normalization
This equation weakly constrains the total mass of the system to some prescribed mass by integrating the density over the volume
2026-10-08 16:16:34 -04:00
be9aec541f docs(equations): fixed missing * in doxygen comment preventing it from parsing right 2026-10-08 13:16:51 -04:00