SimVascular / svZeroDSolver

A C++ lumped-parameter solver for blood flow and pressure in hemodynamic networks
https://simvascular.github.io/documentation/rom_simulation.html#0d-solver
Other
7 stars 18 forks source link

Clean up code #59

Closed ktbolt closed 1 year ago

ktbolt commented 1 year ago

I will clean up the code a bit to follow best practices and such.

menon-karthik commented 1 year ago

@ktbolt Can you elaborate a little bit on the best practices you have in mind? Might be useful to have this documented somewhere for posterity.

ktbolt commented 1 year ago

@menon-karthik Some of these are stated in Coding Guidlines but most are C++ practices that everybody knows.

I should create a Lab document for this with links to appropriate websites and such.

ktbolt commented 1 year ago

Note that developers will look at the current code to see how things are done.

mrp089 commented 1 year ago

@ktbolt, it would be great to add your C++ standards to https://github.com/SimVascular/.github on the off chance that not everybody has the same ideas as you. The one you linked is very svFSI/FORTRAN specific.

Can you briefly say what you plan for 0D+ specifically?

ktbolt commented 1 year ago

@mrp089 These are not really my standards.

C++ best practices have been developed over the years by the C++ community, Bjarne Stroustrup, Herb Sutter, Scott Meyers and others.

I will try to produce a document that distills the essence of the C++ best practices.

mrp089 commented 1 year ago

Cool!

Specifically for 0D+, what are your plans?

ktbolt commented 1 year ago

I have no grand plan for the ZeroDSolver. I will just go through the code and add/modify it as needed.

However, a couple of things I have noticed when removing templates and testing

ktbolt commented 1 year ago

I've made several changes

ktbolt commented 1 year ago

I've made some more changes

This all I'm going to do for this Issue.

There are other specific parts of the implementation that I would like to improve like removing the heavy use for string literals in the code to identify parameters, types and such. I'll open separate Issues for those improvements.

ktbolt commented 1 year ago

Merge into main.