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

Save_Cgns_Results and Save_Vtu_Results are very difficult to read #20

Open
Niceno opened this issue May 31, 2018 · 1 comment
Open

Save_Cgns_Results and Save_Vtu_Results are very difficult to read #20

Niceno opened this issue May 31, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Niceno
Copy link
Collaborator

Niceno commented May 31, 2018

In the present form, Save_Cgns_Results and Save_Vtu_Results are very difficult to read. If a developer focuses on one model at a time (which he or she always does), he or she has to jump from one if condition to another, and make a separate checklist to see what is saved for each model. Very fuzzy.

It should be done in the following way:

if(turbulence_model .eq. K_EPS) then
   call Save_Vtu_Scalar(kin % n ...
   call Save_Vtu_Scalar(eps % n ...
   ...
end if
if(turbulence_model .eq. K_EPS_ZETA_F22) then
   call Save_Vtu_Scalar(kin % n ...
   call Save_Vtu_Scalar(eps % n ...
   call Save_Vtu_Scalar(zeta % n ...
   call Save_Vtu_Scalar(f22 % n ...
   ...
end if
if(turbulence_model .eq. HANJALIC_JAKIRLIC .or.
   turbulence_model .eq. REYNOLDS_STRESS) then
   call Save_Vtu_Scalar(uu % n ...
   call Save_Vtu_Scalar(vv % n ...
   call Save_Vtu_Scalar(ww % n ...
   call Save_Vtu_Scalar(uv % n ...
   call Save_Vtu_Scalar(uw % n ...
   call Save_Vtu_Scalar(vw % n ...
   call Save_Vtu_Scalar(kin % n ...
   call Save_Vtu_Scalar(eps % n ...
   if(turbulence_model .eq. REYNOLDS_STRESS) then
     call Save_Vtu_Cells(f22 % n ...
   end if
   ...
end if

I understand that it would mean repeating some lines of the code (Save_Vtu_Scalar(kin % n ... for example), but the way we have it now, we have repetition of if statements which are scattered over hundreds of lines of code.

@mhadziabdic
Copy link
Collaborator

Originally I was doing it as you suggest but I then wanted to make as few line as possible but also I wanted to make structure of file such that I can switch from one model to another as easy as possible. But this is another story and it should be done by using different approach.
To summarize, I agree with proposal.

@Niceno Niceno added the enhancement New feature or request label May 31, 2018
@Niceno Niceno self-assigned this Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants