dougshidong / PHiLiP

Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
Other
45 stars 36 forks source link

Parameterization of design variables for optimization. #173

Closed PranshulThakur closed 1 year ago

PranshulThakur commented 1 year ago

Currently, the objective function and flow constraints use a specific parameterization of design variables (free form deformation). This pull request is aimed at creating an abstract design parameterization class from which the required parameterizations will be derived. Creating these classes would ensure that we could run different test cases (shape or mesh optimization) using a common optimization framework.

PranshulThakur commented 1 year ago

You don't have to prefix all the parameterization by design_parameterization_*

Why is free-form parameterization not a design paramerization?

What kind of test will you be putting in?

Changed names of files. It still contains "parameterization" for clarity, but is put at the end as a suffix for easier navigation of files.

The original FFD class requires ffd_design_variables_indices_dim as an external input. Deriving FFD from design parameterization would require making ffd_design_variables_indices_dim as a class member which would, in turn require significant restructuring of FFD functions and cause conflicts with #146 . For now, I have created an intermediate class derived from design parameterization which holds FFD object and ffd_design_variables_indices_dim. It calls FFD functions and passes in ffd_design_variables_indices_dim when needed.

As the objective function and flow constraints now use design parameterization, existing unit & integration tests based on FFD should be good enough to check the intermediate ffd class derived from design parameterization. For inner volume nodes parameterization (which I will be using for mesh adaptation), I have included a unit test to see if the updates are actually made on the inner nodes (which verifies dXvolume_dXparameter). Thanks for the suggestion. I figured out a small bug after putting this test case and have fixed it in the latest commit. I will be putting more tests once the objective function for mesh adaptation is implemented (in the next PR).

PranshulThakur commented 1 year ago

Please do provide a unit test for identity and FFD parameterization similar to inner_vol.

I understand that the FFD is technically already tested, however you have wrapped the FFD into this FFD parameterization. Therefore, you want to ensure that you haven't broken it.

Similarly for identity parameterization. I understand it is "trivial", however that just means it's also easy to test.

Added unit tests for both of them in the recent commit.

PranshulThakur commented 1 year ago

Finished running ctest and all tests pass (except those with label of testfail).