Skip to content

Commit

Permalink
Applied all of review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blaisb committed Oct 19, 2024
1 parent 08ba096 commit f7725b5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ subsection analytical solution
set Function expression = 1 ; 0 ; 0
end
subsection tracer
set Function constants = Pe=100
set Function expression = -tanh(20*(sqrt(x*x+y*y)-0.5))
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ subsection analytical solution
set Function expression = -y ; x ; 0
end
subsection tracer
set Function constants = Pe=100
set Function expression = -tanh(20*(sqrt(x*x+y*y)-0.5))
end
end
Expand Down
17 changes: 3 additions & 14 deletions include/solvers/tracer_assemblers.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ template <int dim>
class TracerAssemblerDGCore : public TracerAssemblerBase<dim>
{
public:
TracerAssemblerDGCore(std::shared_ptr<SimulationControl> simulation_control)
: simulation_control(simulation_control)
TracerAssemblerDGCore()
{}

/**
Expand All @@ -131,10 +130,6 @@ class TracerAssemblerDGCore : public TracerAssemblerBase<dim>
virtual void
assemble_rhs(const TracerScratchData<dim> &scratch_data,
StabilizedMethodsCopyData &copy_data) override;

// The simulation control must be a part of the core assembler since the
// inverse time-step is used within the stabilization
std::shared_ptr<SimulationControl> simulation_control;
};


Expand Down Expand Up @@ -238,8 +233,7 @@ template <int dim>
class TracerAssemblerSIPG : public TracerFaceAssembler<dim>
{
public:
TracerAssemblerSIPG(std::shared_ptr<SimulationControl> simulation_control)
: simulation_control(simulation_control)
TracerAssemblerSIPG()
{}

/**
Expand All @@ -266,8 +260,6 @@ class TracerAssemblerSIPG : public TracerFaceAssembler<dim>
virtual void
assemble_rhs(const TracerScratchData<dim> &scratch_data,
StabilizedDGMethodsCopyData &copy_data) override;

std::shared_ptr<SimulationControl> simulation_control;
};

/**
Expand All @@ -285,11 +277,9 @@ class TracerAssemblerBoundaryNitsche : public TracerFaceAssembler<dim>
{
public:
TracerAssemblerBoundaryNitsche(
std::shared_ptr<SimulationControl> simulation_control,
const BoundaryConditions::TracerBoundaryConditions<dim>
&p_boundary_conditions_tracer)
: simulation_control(simulation_control)
, boundary_conditions_tracer(p_boundary_conditions_tracer)
: boundary_conditions_tracer(p_boundary_conditions_tracer)
{}

/**
Expand Down Expand Up @@ -317,7 +307,6 @@ class TracerAssemblerBoundaryNitsche : public TracerFaceAssembler<dim>
assemble_rhs(const TracerScratchData<dim> &scratch_data,
StabilizedDGMethodsCopyData &copy_data) override;

std::shared_ptr<SimulationControl> simulation_control;
BoundaryConditions::TracerBoundaryConditions<dim> boundary_conditions_tracer;
};

Expand Down
6 changes: 3 additions & 3 deletions include/solvers/tracer_scratch_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,21 +312,21 @@ class TracerScratchData
const typename DoFHandler<dim>::active_cell_iterator &cell,
const unsigned int &face_no,
const unsigned int &sub_face_no,
const typename DoFHandler<dim>::active_cell_iterator &ncell,
const typename DoFHandler<dim>::active_cell_iterator &neigh_cell,
const unsigned int &neigh_face_no,
const unsigned int &neigh_sub_face_no,
const VectorType &current_solution,
const Function<dim> *levelset_function)
{
fe_interface_values_tracer.reinit(
cell, face_no, sub_face_no, ncell, neigh_face_no, neigh_sub_face_no);
cell, face_no, sub_face_no, neigh_cell, neigh_face_no, neigh_sub_face_no);
face_quadrature_points = fe_interface_values_tracer.get_quadrature_points();

n_interface_dofs = fe_interface_values_tracer.n_current_interface_dofs();

const double extent_here = cell->measure() / cell->face(face_no)->measure();
const double extent_there =
ncell->measure() / ncell->face(neigh_face_no)->measure();
neigh_cell->measure() / neigh_cell->face(neigh_face_no)->measure();

penalty_factor = get_penalty_factor(fe_values_tracer.get_fe().degree,
extent_here,
Expand Down
9 changes: 4 additions & 5 deletions source/solvers/tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ Tracer<dim>::setup_assemblers()
this->assemblers.emplace_back(
std::make_shared<TracerAssemblerBDF<dim>>(this->simulation_control));
}
// Core assembler are different between DG and CG versions.
// Core assemblers are different between DG and CG versions.
if (simulation_parameters.fem_parameters.tracer_uses_dg)
{
this->assemblers.emplace_back(
std::make_shared<TracerAssemblerDGCore<dim>>(this->simulation_control));
this->inner_face_assembler =
std::make_shared<TracerAssemblerSIPG<dim>>(simulation_control);
std::make_shared<TracerAssemblerDGCore<dim>>());
this->inner_face_assembler = std::make_shared<TracerAssemblerSIPG<dim>>();
this->boundary_face_assembler =
std::make_shared<TracerAssemblerBoundaryNitsche<dim>>(
simulation_control, simulation_parameters.boundary_conditions_tracer);
simulation_parameters.boundary_conditions_tracer);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions source/solvers/tracer_assemblers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,15 @@ TracerAssemblerSIPG<dim>::assemble_rhs(
copy_data_face.face_rhs(i) -=
fe_iv.jump_in_shape_values(i, q) // [\phi_i]
* scratch_data.values_here[q] // \phi_i^{upwind}
* velocity_dot_n // (\beta . n)
* velocity_dot_n // (u . n)
* JxW[q]; // dx
}
else
{
copy_data_face.face_rhs(i) -=
fe_iv.jump_in_shape_values(i, q) // [\phi_i]
* scratch_data.values_there[q] // \phi_i^{upwind}
* velocity_dot_n // (\beta . n)
* velocity_dot_n // (u . n)
* JxW[q]; // dx
}

Expand Down Expand Up @@ -644,7 +644,7 @@ TracerAssemblerBoundaryNitsche<dim>::assemble_rhs(
for (unsigned int i = 0; i < n_facet_dofs; ++i)
copy_data.local_rhs(i) -= fe_face.shape_value(i, point) // \phi_i
* scratch_data.values_here[point] *
velocity_dot_n // \beta . n
velocity_dot_n // u . n
* JxW[point]; // dx
}
}
Expand Down

0 comments on commit f7725b5

Please sign in to comment.