(Translated by https://www.hiragana.jp/)
Refactored the diffusive flux reconstructor a bit · mlwong/HAMeRS@5ee859a · GitHub
Skip to content

Commit

Permalink
Refactored the diffusive flux reconstructor a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mlwong committed Oct 3, 2022
1 parent 36f880a commit 5ee859a
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,242 +46,242 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
* Compute the derivatives in x-direction at midpoints.
*/
void computeFirstDerivativesInXAtMidpointX(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_x_midpoint_x,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_x_midpoint_x_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_x,
const std::vector<int>& data_component_idx_x,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in x-direction at midpoints.
*/
void computeFirstDerivativesInXAtMidpointX(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_x_midpoint_x,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_x_midpoint_x_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_x,
const std::vector<std::vector<int> >& data_component_idx_x,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in y-direction at midpoints.
*/
void computeFirstDerivativesInYAtMidpointY(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_y_midpoint_y,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_y_midpoint_y_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_y,
const std::vector<int>& data_component_idx_y,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in y-direction at midpoints.
*/
void computeFirstDerivativesInYAtMidpointY(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_y_midpoint_y,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_y_midpoint_y_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_y,
const std::vector<std::vector<int> >& data_component_idx_y,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in z-direction at midpoints.
*/
void computeFirstDerivativesInZAtMidpointZ(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_z_midpoint_z,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_z_midpoint_z_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_z,
const std::vector<int>& data_component_idx_z,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in z-direction at midpoints.
*/
void computeFirstDerivativesInZAtMidpointZ(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_z_midpoint_z,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_z_midpoint_z_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_z,
const std::vector<std::vector<int> >& data_component_idx_z,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Compute the derivatives in x-direction at nodes.
*/
void computeFirstDerivativesInXAtNode(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_x_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_x_node_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_x,
const std::vector<int>& data_component_idx_x,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Compute the derivatives in x-direction at nodes.
*/
void computeFirstDerivativesInXAtNode(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivatives_x_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_x_node_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_x,
const std::vector<std::vector<int> >& data_component_idx_x,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Compute the derivatives in y-direction at nodes.
*/
void computeFirstDerivativesInYAtNode(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_y_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_y_node_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_y,
const std::vector<int>& data_component_idx_y,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Compute the derivatives in y-direction at nodes.
*/
void computeFirstDerivativesInYAtNode(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivatives_y_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_y_node_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_y,
const std::vector<std::vector<int> >& data_component_idx_y,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Compute the derivatives in z-direction at nodes.
*/
void computeFirstDerivativesInZAtNode(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_z_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_z_node_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data_z,
const std::vector<int>& data_component_idx_z,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Compute the derivatives in z-direction at nodes.
*/
void computeFirstDerivativesInZAtNode(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivatives_z_node,
std::map<double*, HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivatives_z_node_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data_z,
const std::vector<std::vector<int> >& data_component_idx_z,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_node);

/*
* Interpolate the diffusivities from nodes to midpoints.
*/
void interpolateDiffusivitiesFromNodeToMidpoint(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& var_side_data_for_diffusivities,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& var_cell_data_for_diffusivities,
const std::vector<int>& var_cell_data_for_diffusivities_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_diffusivities_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in x-direction.
*/
void interpolateDerivativesFromNodeToMidpointX(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_x,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_x_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivative_node,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data,
const std::vector<int>& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in x-direction.
*/
void interpolateDerivativesFromNodeToMidpointX(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_midpoint_x,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_x_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivative_node,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data,
const std::vector<std::vector<int> >& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in y-direction.
*/
void interpolateDerivativesFromNodeToMidpointY(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_y,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_y_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivative_node,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data,
const std::vector<int>& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in y-direction.
*/
void interpolateDerivativesFromNodeToMidpointY(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_midpoint_y,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_y_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivative_node,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data,
const std::vector<std::vector<int> >& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in z-direction.
*/
void interpolateDerivativesFromNodeToMidpointZ(
hier::Patch& patch,
std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_z,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_z_computed,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& derivative_node,
const std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > >& data,
const std::vector<int>& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Interpolate the derivatives from nodes to midpoints in z-direction.
*/
void interpolateDerivativesFromNodeToMidpointZ(
hier::Patch& patch,
std::vector<std::vector<HAMERS_SHARED_PTR<pdat::SideData<double> > > >& derivatives_midpoint_z,
std::map<double*, HAMERS_SHARED_PTR<pdat::SideData<double> > >& derivatives_midpoint_z_computed,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& derivative_node,
const std::vector<std::vector<HAMERS_SHARED_PTR<pdat::CellData<double> > > >& data,
const std::vector<std::vector<int> >& data_component_idx,
const hier::Patch& patch,
const bool allocate_scratch_derivatives_midpoint);

/*
* Reconstruct the flux using flux at midpoints in x-direction.
*/
void reconstructFluxX(
hier::Patch& patch,
HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux,
const HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux_midpoint,
const double dt);
const hier::Patch& patch,
const double dt) const;

/*
* Reconstruct the flux using flux at midpoints in y-direction.
*/
void reconstructFluxY(
hier::Patch& patch,
HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux,
const HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux_midpoint,
const double dt);
const hier::Patch& patch,
const double dt) const;

/*
* Reconstruct the flux using flux at midpoints in z-direction.
*/
void reconstructFluxZ(
hier::Patch& patch,
HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux,
const HAMERS_SHARED_PTR<pdat::SideData<double> >& diffusive_flux_midpoint,
const double dt);
const hier::Patch& patch,
const double dt) const;

///

Expand All @@ -297,7 +297,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_0_inv);
const double& dx_0_inv) const;

/*
* Kernel to compute the derivatives in y-direction at midpoints.
Expand All @@ -311,7 +311,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_1_inv);
const double& dx_1_inv) const;

/*
* Kernel to compute the derivatives in z-direction at midpoints.
Expand All @@ -325,7 +325,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_2_inv);
const double& dx_2_inv) const;

/*
* Kernel to compute the derivatives in x-direction at nodes.
Expand All @@ -339,7 +339,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_0_inv);
const double& dx_0_inv) const;

/*
* Kernel to compute the derivatives in y-direction at nodes.
Expand All @@ -353,7 +353,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_1_inv);
const double& dx_1_inv) const;

/*
* Kernel to compute the derivatives in z-direction at nodes.
Expand All @@ -367,7 +367,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const double& dx_2_inv);
const double& dx_2_inv) const;

/*
* Kernel to interpolate the data from nodes to midpoints in x-direction.
Expand All @@ -380,7 +380,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_midpoint,
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims);
const hier::IntVector& domain_dims) const;

/*
* Kernel to interpolate the data from nodes to midpoints in y-direction.
Expand All @@ -393,7 +393,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_midpoint,
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims);
const hier::IntVector& domain_dims) const;

/*
* Kernel to interpolate the data from nodes to midpoints in z-direction.
Expand All @@ -406,7 +406,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& ghostcell_dims_data_midpoint,
const hier::IntVector& ghostcell_dims_data_node,
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims);
const hier::IntVector& domain_dims) const;

/*
* Kernel to reconstruct the flux using flux at midpoints in x-direction.
Expand All @@ -420,7 +420,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const hier::IntVector& interior_dims,
const double& dt);
const double& dt) const;

/*
* Kernel to reconstruct the flux using flux at midpoints in y-direction.
Expand All @@ -434,7 +434,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const hier::IntVector& interior_dims,
const double& dt);
const double& dt) const;

/*
* Kernel to reconstruct the flux using flux at midpoints in z-direction.
Expand All @@ -448,7 +448,7 @@ class DiffusiveFluxReconstructorMidpointSixthOrder: public DiffusiveFluxReconstr
const hier::IntVector& domain_lo,
const hier::IntVector& domain_dims,
const hier::IntVector& interior_dims,
const double& dt);
const double& dt) const;

/*
* Numbers of ghost cells needed for the stencil operations.
Expand Down
Loading

0 comments on commit 5ee859a

Please sign in to comment.