Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytacsadapt #14

Merged
merged 8 commits into from
Aug 31, 2023
Merged

pytacsadapt #14

merged 8 commits into from
Aug 31, 2023

Conversation

bradenfrigoletto24
Copy link
Contributor

I've put together a high-level interface for doing output-based mesh adaptation on static problems using TACS and TMR.

The pyTACSAdapt class contains the "coarse" and "fine" models consisting of their TACS/TMR finite-element and geometry information. This class also provides a higher-level interface for conducting the primal analysis and doing adjoint-based error estimation and mesh adaptation via routines implemented in TMR.

The adjoint-based error estimation in TMR for Quads is currently in working order, I have not yet updated the Oct implementation. One significant change made to the code was the method used for error localization from mesh nodes to the elements. Previously, a partition-of-unity basis was used to localize the error to the elements, which was implemented at the element level within TACS. I moved the adjoint-weighted residual computation to occur solely within TMR to avoid a lot of repeated code in the TACS elements. I removed the partition of unity basis, and now the error localization is simply a weighted sum of the nodal errors contained within each element, though there may be an issue with how dependent nodes are currently being accounted for which I'd like some feedback on.

Included here is a simple example that demonstrates pyTACSAdapt usage. Essentially, the user must provide a geometry input file, a callback function for loading the geometry and initializing the coarse model, a callback function for creating elements for the TACS assembler, and a callback function for setting up the static TACS problem. The example should walk through the steps of the adaptive analysis in a straightforward manner.

Please let me know if you have any comments, questions, or suggestions on ways to improve this.

- added pyTACSAdapt class
- added pyApproximationSpace class
- added plate example that demonstrates pyTACSAdapt usage
- updated TMR_AdjointErrorEst() error localization (quad only)
- minor updates and added documentation to TMR.pyx
@sean-engelstad
Copy link

sean-engelstad commented May 19, 2023

You could compare the unit_tests.yml for tmr to that of funtofem since it has a similar conda build. It looks like you conda install mpi4py whereas ours is pip installed automatically with TACS (so doesn't appear directly in the yml file). That's the only difference I see.
https://github.com/smdogroup/funtofem/blob/master/.github/workflows/unit_tests.yml#L111

@timryanb timryanb mentioned this pull request May 19, 2023
bradenfrigoletto24 and others added 6 commits June 28, 2023 14:13
- updated error localization, dependent nodes no longer double counted
- added return vector of nodal errors, for visualizing error field
- added functionality to sew IGES/STEP model
- added functionality to apply shape fixing to a loaded compound
- EGADS IO updated to allow for setting units
- add sewModel() functionality
- updated loadModel() to allow units to be specified
- updated adjointError() for quads, returns node-wise errors
- necessary changes made in .pxd file
- added writeField() to pyApproximationSpace
- updated adaptation parameter specification in pyTACSAdapt
- added evaluateResidual() to pyTACSAdapt
- added collectErrors() to pyTACSAdapt
- added refineModel() to pyTACSAdapt, simplifies mesh refinement
- added adaptModelFixedGrowth() to pyTACSAdapt
- added writeModelHistory() to pyTACSAdapt
- added h5py as a dependency for writeModelHistory()
@gjkennedy gjkennedy merged commit 4d74fc8 into smdogroup:master Aug 31, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants