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

Updating Doc String: Address Issue #258 #263

Open
wants to merge 10 commits into
base: devel
Choose a base branch
from

Conversation

csdechant
Copy link
Collaborator

This PR updates the Zapdos header files to include previously missing Doc String, which will close Issue #258. This PR also includes minor edits that remove previously unused parameters in Zapdos objects.

Updating the docstings in Zapdos is in progress with the following objects completed:
- Actions
- Auxkernels
- bcs
- constraits
- indicators
- interfacekernels
- postprocessors
- userobjects
Also minor edits of head and body files were done, which involved removing out dated parameters
@csdechant
Copy link
Collaborator Author

csdechant commented Nov 13, 2024

The PR for updating Zapdos Doc Sting is ready for review. @gsgall is the primary reviewer, but I included @cticenhour in case he would like to look at this PR too.

@moosebuild
Copy link
Collaborator

moosebuild commented Nov 13, 2024

Job Documentation, step Sync to remote on c4b976a wanted to post the following:

View the site here

This comment will be updated on new commits.

Copy link
Collaborator

@gsgall gsgall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, a few typos and some missing documentation, and lack of detail in comments but thank you for doing this @csdechant.

/*
* Helper function that supplies the Kernels for drift-diffusion for the electrons,
* energy independent charged particles, neutral particles, and
* electron mean energy depending
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence seems incomplete. Is this suppose to be mean electron energy dependent particles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should read "electron mean energy density". Will edit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in 4b5a202

virtual void addADKernels(const std::string & name,
const std::string & potential_name,
const bool & Using_offset,
const bool & charged,
const bool & energy);

/// Helper function that supplies the Aux kernels to convert scaled position units
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the scaled position units in this case referring to? Is this for when the user is using a non-dimensioqnalized spatial domain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. For clarity, I can add edit to:
/// Helper function that supplies the Aux kernels to convert scaled position units when parameter position_units is set to non-unity

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in 4b5a202

include/actions/AddPeriodicControllers.h Outdated Show resolved Hide resolved
Real _period;
/// The number of cycles to calculate the difference
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is unclear to me. Can you add some more detail here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, a probably better description is "The number of cycles PeriodicRelativeNodalDifference is active"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in 4b5a202

include/auxkernels/AbsValueAux.h Outdated Show resolved Hide resolved
include/materials/GasBase.h Outdated Show resolved Hide resolved
include/userobjects/ProvideMobility.h Outdated Show resolved Hide resolved
@@ -56,13 +56,12 @@ AddPeriodicRelativeNodalDifference::validParams()
params.addParam<Real>(
"starting_cycle", 0.0, "The number of the cycles before starting the difference calculation");
params.addRequiredParam<Real>("cycle_frequency", "The cycle's frequency in Hz");
params.addParam<Real>(
"num_cycles", 2000.0, "The number of cycles to calculation the difference for.");
params.addParam<Real>("num_cycles", 2000.0, "The number of cycles to calculate the difference.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit unclear to me. Does this mean the number of cycles for which the difference between the current and previous cycle is calculated. Or is this something like the number of cycles between cycles that are being compared?

Copy link
Collaborator Author

@csdechant csdechant Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the former description. I can edit it to simply say "The number of cycles this object is active".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in 4b5a202

src/interfacekernels/InterfaceAdvection.C Outdated Show resolved Hide resolved
Comment on lines 40 to 92

/*
* Helper function that supplies the Kernels for drift-diffusion for the electrons,
* energy independent charged particles, neutral particles, and
* electron mean energy depending
*/
virtual void addADKernels(const std::string & name,
const std::string & potential_name,
const bool & Using_offset,
const bool & charged,
const bool & energy);

/// Helper function that supplies the Aux kernels to convert scaled position units
virtual void addPosition(const std::string & position_name, const int & component);

/// Helper function that supplies the Aux kernels to convert densities from log form
virtual void addDensityLog(const std::string & particle_name);

/// Helper function that supplies the Aux kernels for current
virtual void addCurrent(const std::string & particle_name, const std::string & potential_name);

/// Helper function that supplies the Aux kernels for the electric field
virtual void addEfield(const std::string & Efield_name,
const std::string & potential_name,
const int & component);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cticenhour correct me if I am wrong but I believe the MOOSE standard should be to have a description for each of the parameters of every custom function. In the style of

@param name description

This comment is also applicable for the rest of the actions that do not have the parameter doc strings for their internal functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for most MOOSE header files I have seen and should add them regardless for better documentation. This was an oversight and will edit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in 4b5a202

@csdechant
Copy link
Collaborator Author

@gsgall everything should be addressed now, and this PR is ready for a re-review.

@gsgall
Copy link
Collaborator

gsgall commented Jan 9, 2025

@gsgall everything should be addressed now, and this PR is ready for a re-review.

@csdechant @cticenhour Is there something weird going on with the civit build. I would like to review the website but when I try to use the most recent link to the site preview I am getting a 404 error.

@cticenhour
Copy link
Member

cticenhour commented Jan 9, 2025

@gsgall It's because the website was built almost 3 weeks ago. CIVET regularly cleans out old PR websites on the order of weekly. So @csdechant will need to push again to trigger a new one.

@csdechant
Copy link
Collaborator Author

@gsgall just push a no edit commit (using the git commit --amend --no-edit command). After this build, a review version of the website should be available.

@csdechant
Copy link
Collaborator Author

@gsgall the git commit --amend --no-edit messed with the commit history (I must have not done a proper git fetch while working between two machines). The problem is fixed and the commit history is restored, so commits like 4b5a202 can be viewed again.

@gsgall
Copy link
Collaborator

gsgall commented Jan 16, 2025

@gsgall the git commit --amend --no-edit messed with the commit history (I must have not done a proper git fetch while working between two machines). The problem is fixed and the commit history is restored, so commits like 4b5a202 can be viewed again.

Thank you @csdechant! I am working on the review now.

Copy link
Collaborator

@gsgall gsgall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @csdechant there are only a few small types and grammar issues I found this time around

include/actions/AddPeriodicControllers.h Outdated Show resolved Hide resolved
include/actions/AddPeriodicControllers.h Outdated Show resolved Hide resolved
include/actions/AddPeriodicControllers.h Outdated Show resolved Hide resolved
include/actions/AddPeriodicRelativeNodalDifference.h Outdated Show resolved Hide resolved
include/actions/AddPeriodicRelativeNodalDifference.h Outdated Show resolved Hide resolved
include/postprocessors/MultiPeriodAverager.h Outdated Show resolved Hide resolved
Comment on lines +27 to +50
/**
* This is called before execute so you can reset any internal data.
*/
virtual void initialize();
/**
* Called on every "object" (like every element or node).
* In this case, it is called at every quadrature point on every element.
*/
virtual void execute();

/**
* Implement this function to compute Jacobian terms for this UserObject. The
* shape function index _j and its corrsponding global DOF index _j_global
* will be provided.
*/
virtual void executeJacobian(unsigned int jvar);
/**
* Called _once_ after execute has been called all all "objects".
*/
virtual void finalize();
/**
* Called when using threading. You need to combine the data from "y"
* into _this_ object.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These descriptions seem like they are almost the same as the ones for base object. They should probably be more descriptive of this objects behaviour.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsgall which base object are you looking at? I looked at ShapeSideUserObject and ShapeUserObject, and I didn't see a description for this functions. If these are already defined somewhere in the hierarchy, and I don't think they need to be redefined here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base object I am referencing is the UserObject. These descriptions just seem to echo what a general user object would do with these methods but there are object specific implementations for all of them. I would be my preference that some description which is specific to what this object does are used rather than just describing what the general use of these methods is.

If this is not the standard in other MOOSE applications I am fine with these descriptions.

Comment on lines +33 to 45
/**
* This is called before execute so you can reset any internal data.
*/
virtual void initialize();

/**
* Called on every "object" (like every element or node).
* In this case, it is called at every quadrature point on every element.
*/
virtual void execute();

/**
* Called _once_ after execute has been called on all "objects".
*/
virtual void finalize();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my comment on the other user object. This is really generic and doesn't really say anything about this specific object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these docstring comments will be inherited by UserObject.h, so I can remove them. As for why the comments are generic, it is because these are generic functions and are not custom made for the specific object (i.e. all userobjects need an initialize, execute, and finalize function).

src/interfacekernels/InterfaceAdvection.C Outdated Show resolved Hide resolved
@moosebuild
Copy link
Collaborator

Job Precheck, step Clang format on dab4f0f wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/zapdos/docs/PRs/263/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 9720bf2cc323e22d551ac23549cf7f9c2f944b91

Copy link
Collaborator Author

@csdechant csdechant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsgall All grammar fixes should be applied now. As for the comments involving docstrings, if a generic function is already defined somewhere in the hierarchy somewhere, I don't believe it needs to be redefined since they are not object specific (e.g. functions such as initialize, execute, finalize). I added those comments because I must of overlooked their inclusion elsewhere. If you have an objection removing those comments, please let me know.

Comment on lines 119 to +123
MaterialProperty<Real> & _Avogadro;
MaterialProperty<Real> & _vthermal_em;
MaterialProperty<Real> & _vthermal_ip;
MaterialProperty<Real> & _iz_coeff_efield_a;
MaterialProperty<Real> & _iz_coeff_efield_b;
MaterialProperty<Real> & _iz_coeff_efield_c;
MaterialProperty<Real> & _iz_coeff_energy_a;
MaterialProperty<Real> & _iz_coeff_energy_b;
MaterialProperty<Real> & _iz_coeff_energy_c;
/// Avogadro's number (reduced significant figures)
MaterialProperty<Real> & _N_A;
MaterialProperty<Real> & _el_coeff_energy_a;
MaterialProperty<Real> & _el_coeff_energy_b;
MaterialProperty<Real> & _el_coeff_energy_c;

/// Charge sign of electrons
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, to be honest. This object is a more general version of Gas, which also has two different versions of Avagadro's number. I made a comment in the PR #265 that will should make a issues regarding re-examining the material objects. I made this into an issue, Issue #270

Comment on lines +27 to +50
/**
* This is called before execute so you can reset any internal data.
*/
virtual void initialize();
/**
* Called on every "object" (like every element or node).
* In this case, it is called at every quadrature point on every element.
*/
virtual void execute();

/**
* Implement this function to compute Jacobian terms for this UserObject. The
* shape function index _j and its corrsponding global DOF index _j_global
* will be provided.
*/
virtual void executeJacobian(unsigned int jvar);
/**
* Called _once_ after execute has been called all all "objects".
*/
virtual void finalize();
/**
* Called when using threading. You need to combine the data from "y"
* into _this_ object.
*/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsgall which base object are you looking at? I looked at ShapeSideUserObject and ShapeUserObject, and I didn't see a description for this functions. If these are already defined somewhere in the hierarchy, and I don't think they need to be redefined here.

Comment on lines +33 to 45
/**
* This is called before execute so you can reset any internal data.
*/
virtual void initialize();

/**
* Called on every "object" (like every element or node).
* In this case, it is called at every quadrature point on every element.
*/
virtual void execute();

/**
* Called _once_ after execute has been called on all "objects".
*/
virtual void finalize();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these docstring comments will be inherited by UserObject.h, so I can remove them. As for why the comments are generic, it is because these are generic functions and are not custom made for the specific object (i.e. all userobjects need an initialize, execute, and finalize function).

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.

4 participants