Skip to content

Commit

Permalink
(D) Removal of unused classes
Browse files Browse the repository at this point in the history
  • Loading branch information
j507 committed Sep 13, 2024
1 parent c387e1d commit d4ff16f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 334 deletions.
5 changes: 0 additions & 5 deletions applications/simple_shear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ class SimpleShearProblem

Postprocessing::Postprocessor<dim> postprocessor;

Postprocessing::ResidualPostprocessor<dim> residual_postprocessor;

Postprocessing::SimpleShear<dim> simple_shear;

const double string_width;
Expand Down Expand Up @@ -166,9 +164,6 @@ homogenization(
postprocessor(
fe_field,
crystals_data),
residual_postprocessor(
fe_field,
crystals_data),
simple_shear(
fe_field,
mapping,
Expand Down
63 changes: 0 additions & 63 deletions include/gCP/postprocessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,69 +89,6 @@ class Postprocessor : public dealii::DataPostprocessor<dim>



template <int dim>
class ResidualPostprocessor : public dealii::DataPostprocessor<dim>
{
public:
ResidualPostprocessor(
std::shared_ptr<FEField<dim>> &fe_field,
std::shared_ptr<CrystalsData<dim>> &crystals_data);

virtual void evaluate_vector_field(
const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<dealii::Vector<double>> &computed_quantities)
const override;

virtual std::vector<std::string> get_names() const override;

virtual std::vector<
dealii::DataComponentInterpretation::DataComponentInterpretation>
get_data_component_interpretation() const override;

virtual dealii::UpdateFlags get_needed_update_flags() const override;

private:
std::shared_ptr<const FEField<dim>> fe_field;

std::shared_ptr<const CrystalsData<dim>> crystals_data;
};


/*!
* @note Only for debugging purposes
*/
template <int dim>
class RatePostprocessor : public dealii::DataPostprocessor<dim>
{
public:
RatePostprocessor(
const dealii::DiscreteTime &discrete_time,
std::shared_ptr<FEField<dim>> &fe_field,
std::shared_ptr<CrystalsData<dim>> &crystals_data);

virtual void evaluate_vector_field(
const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<dealii::Vector<double>> &computed_quantities)
const override;

virtual std::vector<std::string> get_names() const override;

virtual std::vector<
dealii::DataComponentInterpretation::DataComponentInterpretation>
get_data_component_interpretation() const override;

virtual dealii::UpdateFlags get_needed_update_flags() const override;

private:
const dealii::DiscreteTime &discrete_time;

std::shared_ptr<const FEField<dim>> fe_field;

std::shared_ptr<const CrystalsData<dim>> crystals_data;
};



template <int dim>
class TrialstressPostprocessor : public dealii::DataPostprocessor<dim>
{
Expand Down
266 changes: 0 additions & 266 deletions source/postprocessing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -664,272 +664,6 @@ double Postprocessor<dim>::get_von_mises_plastic_strain(



template <int dim>
ResidualPostprocessor<dim>::ResidualPostprocessor(
std::shared_ptr<FEField<dim>> &fe_field,
std::shared_ptr<CrystalsData<dim>> &crystals_data)
:
fe_field(fe_field),
crystals_data(crystals_data)
{}



template <int dim>
std::vector<std::string>
ResidualPostprocessor<dim>::get_names() const
{
std::vector<std::string> solution_names(dim, "ResidualDisplacement");

for (unsigned int slip_id = 0;
slip_id < crystals_data->get_n_slips();
++slip_id)
solution_names.emplace_back(
"ResidualSlip_" + std::to_string(slip_id));

return solution_names;
}


template <int dim>
std::vector<dealii::DataComponentInterpretation::DataComponentInterpretation>
ResidualPostprocessor<dim>::get_data_component_interpretation()
const
{
std::vector<
dealii::DataComponentInterpretation::DataComponentInterpretation>
interpretation(
dim,
dealii::DataComponentInterpretation::component_is_part_of_vector);

for (unsigned int slip_id = 0;
slip_id < crystals_data->get_n_slips();
++slip_id)
interpretation.push_back(
dealii::DataComponentInterpretation::component_is_scalar);

return interpretation;
}


template <int dim>
dealii::UpdateFlags
ResidualPostprocessor<dim>::get_needed_update_flags() const
{
return dealii::update_values |
dealii::update_quadrature_points;
}



template <int dim>
void ResidualPostprocessor<dim>::evaluate_vector_field(
const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<dealii::Vector<double>> &computed_quantities) const
{
const unsigned int n_q_points = inputs.solution_values.size();

const unsigned int n_components = fe_field->get_n_components();

const unsigned int n_slips = crystals_data->get_n_slips();

const unsigned int n_crystals = crystals_data->get_n_crystals();

(void)n_components;

Assert(inputs.solution_gradients.size() == n_q_points,
dealii::ExcInternalError());

Assert(computed_quantities.size() == n_q_points,
dealii::ExcInternalError());

Assert(inputs.solution_values[0].size() == n_components,
dealii::ExcInternalError());

// Reset
for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
for (unsigned int d = 0; d < computed_quantities[0].size(); ++d)
computed_quantities[q_point](d) = 0.0;

for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
{

/*!
* @note This if-else can probably be done in a way more elegant
* manner
*/
if (fe_field->is_decohesion_allowed())
{
// Displacement
for (unsigned int d = 0; d < dim; ++d)
for (unsigned int crystal_id = 0;
crystal_id < n_crystals; ++crystal_id)
{
computed_quantities[q_point](d) +=
inputs.solution_values[q_point](d + dim * crystal_id);
}

for (unsigned int slip_id = 0;
slip_id < n_slips; ++slip_id)
for (unsigned int crystal_id = 0;
crystal_id < n_crystals; ++crystal_id)
{
// Slips
computed_quantities[q_point](dim + slip_id) +=
inputs.solution_values[q_point](
dim * n_crystals + slip_id + n_slips * crystal_id);
}
}
else
{
// Displacement
for (unsigned int d = 0; d < dim; ++d)
{
computed_quantities[q_point](d) =
inputs.solution_values[q_point](d);
}

for (unsigned int slip_id = 0;
slip_id < n_slips; ++slip_id)
for (unsigned int crystal_id = 0;
crystal_id < n_crystals; ++crystal_id)
{
// Slips
computed_quantities[q_point](dim + slip_id) +=
inputs.solution_values[q_point](
dim + slip_id + n_slips * crystal_id);
}
}
}
}



template <int dim>
RatePostprocessor<dim>::RatePostprocessor(
const dealii::DiscreteTime &discrete_time,
std::shared_ptr<FEField<dim>> &fe_field,
std::shared_ptr<CrystalsData<dim>> &crystals_data)
:
discrete_time(discrete_time),
fe_field(fe_field),
crystals_data(crystals_data)
{}



template <int dim>
std::vector<std::string>
RatePostprocessor<dim>::get_names() const
{
std::vector<std::string> solution_names;

for (unsigned int slip_id = 0;
slip_id < crystals_data->get_n_slips();
++slip_id)
solution_names.emplace_back(
"SlipRate" + std::to_string(slip_id));

return solution_names;
}


template <int dim>
std::vector<dealii::DataComponentInterpretation::DataComponentInterpretation>
RatePostprocessor<dim>::get_data_component_interpretation()
const
{
std::vector<
dealii::DataComponentInterpretation::DataComponentInterpretation>
interpretation;

for (unsigned int slip_id = 0;
slip_id < crystals_data->get_n_slips();
++slip_id)
interpretation.push_back(
dealii::DataComponentInterpretation::component_is_scalar);

return interpretation;
}


template <int dim>
dealii::UpdateFlags
RatePostprocessor<dim>::get_needed_update_flags() const
{
return dealii::update_values |
dealii::update_quadrature_points;
}



template <int dim>
void RatePostprocessor<dim>::evaluate_vector_field(
const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<dealii::Vector<double>> &computed_quantities) const
{
const unsigned int n_q_points = inputs.solution_values.size();

const unsigned int n_components = fe_field->get_n_components();

const unsigned int n_slips = crystals_data->get_n_slips();

const unsigned int n_crystals = crystals_data->get_n_crystals();

(void)n_components;

Assert(inputs.solution_gradients.size() == n_q_points,
dealii::ExcInternalError());

Assert(computed_quantities.size() == n_q_points,
dealii::ExcInternalError());

Assert(inputs.solution_values[0].size() == n_components,
dealii::ExcInternalError());

// Reset
for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
for (unsigned int d = 0; d < computed_quantities[0].size(); ++d)
computed_quantities[q_point](d) = 0.0;

for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
{

/*!
* @note This if-else can probably be done in a way more elegant
* manner
*/
if (fe_field->is_decohesion_allowed())
{
for (unsigned int slip_id = 0;
slip_id < n_slips; ++slip_id)
for (unsigned int crystal_id = 0;
crystal_id < n_crystals; ++crystal_id)
{
// Slips
computed_quantities[q_point](slip_id) +=
inputs.solution_values[q_point](
dim * n_crystals + slip_id + n_slips * crystal_id);
}
}
else
{
for (unsigned int slip_id = 0;
slip_id < n_slips; ++slip_id)
for (unsigned int crystal_id = 0;
crystal_id < n_crystals; ++crystal_id)
{
// Slips
computed_quantities[q_point](slip_id) +=
inputs.solution_values[q_point](
dim + slip_id + n_slips * crystal_id);
}
}
}
}



template <int dim>
void TrialstressPostprocessor<dim>::reinit(
std::shared_ptr<FEField<dim>> &trial_microstress,
Expand Down

0 comments on commit d4ff16f

Please sign in to comment.