trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.19k stars 565 forks source link

Panzer: Ordering of equations/variables names in residual vector and Jacobian matrix #12899

Open delcmo opened 5 months ago

delcmo commented 5 months ago

Question

I would like to plot the Jacobian matrix at a given time step for a system of PDEs. What order are variables/equations registered in? For instance, if I have three variables V1, V2 and V3 and I register them in the same order, is that order conserved in Panzer? What about the corresponding equations E1, E2 and E3?

Marco

ccober6 commented 5 months ago

@rppawlo

rppawlo commented 5 months ago

The DOF manager will preserve the order in which the DOFs are registered/added. There is a function to reorder the DOFs if needed.

delcmo commented 4 months ago

Thanks Roger for getting back to me.

What would be the function to reorder DOFs?

Is that also true for equations? In the code, we register variables/DOFs first and then create residuals by looping over the variables.

Marco

On Thu, Apr 11, 2024 at 2:56 PM Roger Pawlowski @.***> wrote:

The DOF manager will preserve the order in which the DOFs are registered/added. There is a function to reorder the DOFs if needed.

— Reply to this email directly, view it on GitHub https://github.com/trilinos/Trilinos/issues/12899#issuecomment-2050321001, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4GCRCQO7XZZHHQNMN7SDY43METAVCNFSM6AAAAABF5L6UOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGMZDCMBQGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Marc-Olivier Delchini

rppawlo commented 4 months ago

If you are using the assembly tools in disc-fe, then in the input file, under the "Assembly" sublist, there is a "Field Order" parameter. This takes a string listing the DOF names, delimited by spaces. The code supports ordering for both blocked and non-blocked, but all of our examples with ordering seem to use the blocked path. I'll add an example for that with the other changes Steve requested.

The equations are tied to a particular DOF by the EquationSet objects which register Evaluators that scatter to a particular DOF residual. The base class is pure virtual, so you are free to define this however you like. Panzer provides a default implementation in Panzer_EquationSet_DefaultImpl_*.hpp. It stores the dof names/basis in a std::map - within a physics block, the ordering is dependent on the map ordering.

delcmo commented 4 months ago

Ok, thanks Roger.

Marco

On Mon, Apr 15, 2024 at 11:25 AM Roger Pawlowski @.***> wrote:

If you are using the assembly tools in disc-fe, then in the input file, under the "Assembly" sublist, there is a "Field Order" parameter. This takes a string listing the DOF names, delimited by spaces. The code supports ordering for both blocked and non-blocked, but all of our examples with ordering seem to use the blocked path. I'll add an example for that with the other changes Steve requested.

The equations are tied to a particular DOF by the EquationSet objects which register Evaluators that scatter to a particular DOF residual. The base class is pure virtual, so you are free to define this however you like. Panzer provides a default implementation in Panzer_EquationSetDefaultImpl*.hpp. It stores the dof names/basis in a std::map - within a physics block, the ordering is dependent on the map ordering.

— Reply to this email directly, view it on GitHub https://github.com/trilinos/Trilinos/issues/12899#issuecomment-2057129999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD4GCVVYYI2CP5QCJ43DBDY5PWOPAVCNFSM6AAAAABF5L6UOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJXGEZDSOJZHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Marc-Olivier Delchini