Skip to content

Commit 24c6dda

Browse files
committed
Further extended the documentation
1 parent a72d923 commit 24c6dda

2 files changed

Lines changed: 116 additions & 50 deletions

File tree

src/solid/solid_plastic_elements.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lp(
512512
DenseMatrix<double>& bar_Lp,
513513
RankFourTensor<double>& dbar_Lp_dbarbar_M,
514514
RankFourTensor<double>& dbar_Lp_dbar_M,
515-
bool computeDerivative)
515+
const bool& compute_derivative)
516516
{
517517
const double eta = (*this->Plastic_consitutive_law_pt->eta_p_pt);
518518

@@ -547,7 +547,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lp(
547547
}
548548

549549
// The derivative.
550-
if (computeDerivative)
550+
if (compute_derivative)
551551
{
552552
// We do not need to initialize the value, it is done in the next for loop
553553
dbar_Lp_dbarbar_M.resize(DIM, DIM, DIM, DIM);
@@ -634,7 +634,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpkd(
634634
DenseMatrix<double>& bar_Lpkd,
635635
RankFourTensor<double>& dbar_Lpkd_dbar_M,
636636
RankFourTensor<double>& dbar_Lpkd_dbar_Mk,
637-
bool computeDerivative)
637+
const bool& compute_derivative)
638638
{
639639
bar_Lpkd.resize(DIM, DIM);
640640
const double inv_bk =
@@ -666,7 +666,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpkd(
666666
}
667667
}
668668

669-
if (computeDerivative)
669+
if (compute_derivative)
670670
{
671671
dbar_Lpkd_dbar_M.resize(DIM, DIM, DIM, DIM, 0.0);
672672
dbar_Lpkd_dbar_Mk.resize(DIM, DIM, DIM, DIM, 0.0);
@@ -714,7 +714,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_hat_bar_Nc(
714714
const DenseMatrix<double>& df_Mc_dMc,
715715
DenseMatrix<double>& hat_bar_Nc,
716716
RankFourTensor<double>& dhat_bar_Nc_dMc,
717-
bool computeDerivative)
717+
const bool& compute_derivative)
718718
{
719719
hat_bar_Nc.resize(DIM, DIM);
720720

@@ -723,7 +723,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_hat_bar_Nc(
723723
if (nMag < 1.0e-15)
724724
{
725725
hat_bar_Nc.initialise(0.0);
726-
if (computeDerivative)
726+
if (compute_derivative)
727727
{
728728
dhat_bar_Nc_dMc.resize(DIM, DIM, DIM, DIM, 0.0);
729729
}
@@ -739,7 +739,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_hat_bar_Nc(
739739
}
740740
}
741741

742-
if (!computeDerivative) return;
742+
if (!compute_derivative) return;
743743

744744
// The derivative is (A = df_Mc_dMc)
745745
// dN_ij/dA_mn = (\delta_im \delta_jn - N_ij N_mn) / nMag
@@ -790,21 +790,21 @@ template<unsigned DIM>
790790
void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpcd(
791791
const DenseMatrix<double>& bar_M,
792792
const DenseMatrix<double>& hat_bar_Nc,
793-
const double& Rc,
793+
const double& rc,
794794
const RankFourTensor<double>& dhat_bar_Nc_dhat_bar_Mc,
795-
const DenseMatrix<double>& dRc_dMc,
796-
const double& dRc_dH,
795+
const DenseMatrix<double>& drc_dMc,
796+
const double& drc_dh,
797797
DenseMatrix<double>& bar_Lpcd,
798798
RankFourTensor<double>& dbar_Lpcd_dbar_M,
799799
RankFourTensor<double>& dbar_Lpcd_dhat_bar_Mc,
800800
DenseMatrix<double>& dbar_Lpcd_dh,
801-
bool computeDerivative)
801+
const bool& compute_derivative)
802802
{
803803
bar_Lpcd.resize(DIM, DIM);
804804

805805
const double invX =
806806
1 / (*this->Plastic_consitutive_law_pt->elastic_core_x_pt);
807-
const double Rc_by_X = Rc * invX;
807+
const double Rc_by_X = rc * invX;
808808
const double eta = (*this->Plastic_consitutive_law_pt->elastic_core_eta_pt);
809809
const double eta_prefactor = Rc_by_X * eta;
810810

@@ -828,7 +828,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpcd(
828828
}
829829
}
830830

831-
if (computeDerivative)
831+
if (compute_derivative)
832832
{
833833
// dLpcs_ij/dbar_M_kl =
834834
// Rc/X * eta (\delta_ik \hat\bar{Nc}_lj - \hat\bar{Nc}_ik
@@ -842,7 +842,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpcd(
842842
{
843843
for (unsigned int j = 0; j < DIM; j++)
844844
{
845-
dbar_Lpcd_dh(i, j) = bar_Lpcd(i, j) * dRc_dH;
845+
dbar_Lpcd_dh(i, j) = bar_Lpcd(i, j) * drc_dh;
846846

847847
for (unsigned int k = 0; k < DIM; k++)
848848
{
@@ -864,7 +864,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpcd(
864864

865865
// the total derivative
866866
dbar_Lpcd_dhat_bar_Mc(i, j, k, l) =
867-
Rc_by_X * dNdMc + bar_Lpcd(i, j) * dRc_dMc(k, l);
867+
Rc_by_X * dNdMc + bar_Lpcd(i, j) * drc_dMc(k, l);
868868
}
869869
}
870870
}
@@ -897,7 +897,7 @@ void oomph::PlasticEquationsBase<DIM>::compute_bar_Lpcd(
897897
{
898898
for (unsigned int j = 0; j < DIM; j++)
899899
{
900-
bar_Lpcd(i, j) = Rc * bar_Lpcd(i, j);
900+
bar_Lpcd(i, j) = rc * bar_Lpcd(i, j);
901901
}
902902
}
903903
}

src/solid/solid_plastic_elements.h

Lines changed: 100 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ namespace oomph
199199
/// possible.
200200
///
201201
/// \param[in] time_stepper_pt The time stepper to set.
202-
/// \param[in] preserve_existing_data Wether the internal data should be
202+
/// \param[in] preserve_existing_data Whether the internal data should be
203203
/// copied over to the new structure.
204204
// =========================================================================
205205
void assign_plastic_timestepper_pt(TimeStepper* time_stepper_pt,
@@ -733,7 +733,7 @@ namespace oomph
733733
/// \param[out] barbar_N The normalised and symmetrised tensor.
734734
/// \param[out] dbarbar_N_dbarba_M The derivative of barbar_N w.r.t.
735735
/// barbar_M.
736-
/// \param[in] compute_derivative Wether to compute the derivative
736+
/// \param[in] compute_derivative Whether to compute the derivative.
737737
// =========================================================================
738738
void compute_barbar_N(const DenseMatrix<double>& barbar_M,
739739
const double& f,
@@ -759,17 +759,36 @@ namespace oomph
759759
false);
760760
}
761761

762-
/*!
763-
* \brief This function computes \bar{L}^\text{p}/\dot{\bar{\lambda}}
764-
*/
762+
// =========================================================================
763+
/// \short this function computes Lp / \dot{lambda}. Lp is the velocity
764+
/// gradient of the plastic deformation, see Eq. (114). \dot{lambda} is the
765+
/// time derivative of the plastic multiplier.
766+
///
767+
/// The division by \dot{lambda} is done to get a better separation. L_p is
768+
/// linear in \dot{lambda}.
769+
///
770+
/// \param[in] bar_M The elastic mandel stress
771+
/// \param[in] barbar_N A a normalised and symmetrised (\see
772+
/// compute_barbar_N).
773+
/// \param[in] dbarbar_N_dbarbar_M The derivative of barbar_N w.r.t.
774+
/// barbar_M.
775+
/// \param[out] bar_Lp The velocity gradient (actually Lp / \dot{lambda}).
776+
/// \param[out] dbar_Lp_dbarbar_M The derivative of bar_Lp w.r.t. barbar_M.
777+
/// \param[out] dbar_Lp_dbar_M The derivative of bar_Lp w.r.t. bar_M.
778+
/// \param[in] compute_derivative Whether to compute the derivatives.
779+
// =========================================================================
765780
void compute_bar_Lp(const DenseMatrix<double>& bar_M,
766781
const DenseMatrix<double>& barbar_N,
767782
const RankFourTensor<double>& dbarbar_N_dbarbar_M,
768783
DenseMatrix<double>& bar_Lp,
769784
RankFourTensor<double>& dbar_Lp_dbarbar_M,
770785
RankFourTensor<double>& dbar_Lp_dbar_M,
771-
bool computeDerivative);
786+
const bool& compute_derivative);
772787

788+
// =========================================================================
789+
/// \brief A convenience wrapper to compute Lp, the velocity gradient of the
790+
/// plastic deformation, see Eq. (114).
791+
// =========================================================================
773792
void compute_bar_Lp(const DenseMatrix<double>& bar_M,
774793
const DenseMatrix<double>& barbar_N,
775794
DenseMatrix<double>& bar_Lp)
@@ -783,16 +802,29 @@ namespace oomph
783802
false);
784803
}
785804

786-
/*!
787-
* \brief This function computes \bar{L}^\text{pkd}/\dot{\bar{\lambda}}
788-
*/
805+
// =========================================================================
806+
/// \short this function computes Lpkd * \dot{lambda}. Lpkd is the velocity
807+
/// gradient of the kinematic hardening variable, see Eq. (114).
808+
///
809+
/// \param[in] bar_M The elastic mandel stress
810+
/// \param[in] bar_Mk The mandel-like kinematic hardening variable.
811+
/// \param[out] bar_Lpkd The velocity gradient (actually Lpkd /
812+
/// \dot{lambda}).
813+
/// \param[out] dbar_Lpkd_dbar_M The derivative of bar_Lpkd w.r.t. bar_M.
814+
/// \param[out] dbar_Lpkd_dbar_Mk The derivative of bar_Lpkd w.r.t. bar_Mk.
815+
/// \param[in] compute_derivative Whether to compute the derivatives.
816+
// =========================================================================
789817
void compute_bar_Lpkd(const DenseMatrix<double>& bar_M,
790818
const DenseMatrix<double>& bar_Mk,
791819
DenseMatrix<double>& bar_Lpkd,
792820
RankFourTensor<double>& dbar_Lpkd_dbar_M,
793821
RankFourTensor<double>& dbar_Lpkd_dbar_Mk,
794-
bool computeDerivative);
822+
const bool& compute_derivative);
795823

824+
// =========================================================================
825+
/// \brief A convenience wrapper to compute Lpkd, the velocity gradient of
826+
/// the kinematic hardening variable, see Eq. (114).
827+
// =========================================================================
796828
void compute_bar_Lpkd(const DenseMatrix<double>& bar_M,
797829
const DenseMatrix<double>& bar_Mk,
798830
DenseMatrix<double>& bar_Lpkd)
@@ -805,12 +837,26 @@ namespace oomph
805837
false);
806838
}
807839

840+
// =========================================================================
841+
/// \short This function computes hat_bar_Nc, a unit normal to the yield
842+
/// surface defined by the elastic core Mandel-like variable (bar_Mc). For
843+
/// details, see Eq. (100).
844+
///
845+
/// \param[in] f_Mc The yield function evaluated at bar_Mc.
846+
/// \param[in] df_Mc_dMc The derivative of f_Mc w.r.t Mc.
847+
/// \param[out] hat_bar_Nc The unit normal.
848+
/// \param[out] dhat_bar_Nc_dMc The derivative of hat_bar_Nc w.r.t. Mc.
849+
/// \param[in] compute_derivative Whether to compute the derivative.
850+
// =========================================================================
808851
void compute_hat_bar_Nc(const double& f_Mc,
809852
const DenseMatrix<double>& df_Mc_dMc,
810853
DenseMatrix<double>& hat_bar_Nc,
811-
RankFourTensor<double>& dhar_bar_Nc_dMc,
812-
bool computederivative);
854+
RankFourTensor<double>& dhat_bar_Nc_dMc,
855+
const bool& compute_derivative);
813856

857+
// =========================================================================
858+
/// \brief A convenience wrapper to compute hat_bar_Nc, see Eq. (100).
859+
// =========================================================================
814860
void compute_hat_bar_Nc(const double& f_Mc,
815861
const DenseMatrix<double>& df_Mc_dMc,
816862
DenseMatrix<double>& hat_bar_Nc)
@@ -822,21 +868,41 @@ namespace oomph
822868
false);
823869
}
824870

825-
/*!
826-
* \brief This function computes \bar{L}^\text{pcd}/\dot{\bar{\lambda}}
827-
*/
871+
// =========================================================================
872+
/// \short this function computes Lpcd * \dot{lambda}. Lpcd is the velocity
873+
/// gradient of the elastic core variable, see Eq. (114).
874+
///
875+
/// \param[in] bar_M The elastic mandel stress.
876+
/// \param[in] hat_bar_Nc A unit normal, \see compute_hat_bar_Nc.
877+
/// \param[in] rc The elastic core surface ratio, see Eq. (105).
878+
/// \param[in] dhat_bar_Nc_dhat_bar_Mc The derivative of hat_bar_Nc w.r.t
879+
/// hat_bar_Mc.
880+
/// \param[in] drc_dMc The derivative of rc w.r.t. Mc.
881+
/// \param[in] drc_dh The derivative of rc w.r.t h (the isotropic hardening
882+
/// variable).
883+
/// \param[out] bar_Lpcd The velocity gradient (actually Lpcd /
884+
/// \dot{lambda}).
885+
/// \param[out] dbar_Lpcd_dbar_M The derivative of bar_Lpcd w.r.t. bar_M.
886+
/// \param[out] dbar_Lpcd_dhat_bar_Mc The derivative of bar_Lpcd w.r.t.
887+
/// hat_bar_Mc.
888+
/// \param[out] dbar_Lpcd_dh The derivative of bar_Lpcd w.r.t. h.
889+
/// \param[in] compute_derivative Whether to compute the derivatives.
890+
// =========================================================================
828891
void compute_bar_Lpcd(const DenseMatrix<double>& bar_M,
829892
const DenseMatrix<double>& hat_bar_Nc,
830-
const double& Rc,
893+
const double& rc,
831894
const RankFourTensor<double>& dhat_bar_Nc_dhat_bar_Mc,
832-
const DenseMatrix<double>& dRc_dMc,
833-
const double& dRc_dH,
895+
const DenseMatrix<double>& drc_dMc,
896+
const double& drc_dh,
834897
DenseMatrix<double>& bar_Lpcd,
835898
RankFourTensor<double>& dbar_Lpcd_dbar_M,
836899
RankFourTensor<double>& dbar_Lpcd_dhat_bar_Mc,
837900
DenseMatrix<double>& dbar_Lpcd_dh,
838-
bool computeDerivative);
901+
const bool& compute_derivative);
839902

903+
// =========================================================================
904+
/// \brief A convenience wrapper to compute Lpcd, see Eq. (114).
905+
// =========================================================================
840906
void compute_bar_Lpcd(const DenseMatrix<double>& bar_M,
841907
const DenseMatrix<double>& hat_bar_Nc,
842908
const double& Rc,
@@ -857,7 +923,7 @@ namespace oomph
857923
}
858924

859925
////////////////////////////////////////////////////////////////////////////
860-
// Functions for constructing the plastic data below //
926+
// Functions for constructing the plastic data below //
861927
////////////////////////////////////////////////////////////////////////////
862928

863929
void construct_plastic_data()
@@ -1234,8 +1300,8 @@ namespace oomph
12341300
}
12351301

12361302
/*!
1237-
* \brief returns the time derivative of the elastic deformation gradient as
1238-
* a matrix
1303+
* \brief returns the time derivative of the elastic deformation gradient
1304+
* as a matrix
12391305
* \details Uses the data's time stepper to compute the derivative
12401306
*/
12411307
void get_dot_inv_fp_matrix(const unsigned& ipt,
@@ -1343,8 +1409,8 @@ namespace oomph
13431409
}
13441410

13451411
/*!
1346-
* \brief returns the time derivative of the kinematic hardening deformation
1347-
* gradient as a matrix
1412+
* \brief returns the time derivative of the kinematic hardening
1413+
* deformation gradient as a matrix
13481414
* \details Uses the data's time stepper to compute the derivative
13491415
*/
13501416
void get_dot_invBpks_matrix(const unsigned& ipt,
@@ -1702,8 +1768,8 @@ namespace oomph
17021768
/// Stores, if finite difference should be used for the plastic solve.
17031769
bool Plastic_solve_use_fd = false;
17041770

1705-
/// The step used to determine the jacobian, if plastic Plastic_solve_use_fd
1706-
/// is set to true.
1771+
/// The step used to determine the jacobian, if plastic
1772+
/// Plastic_solve_use_fd is set to true.
17071773
double* Plastic_fd_jacobian_step_pt =
17081774
&FiniteElement::Default_fd_jacobian_step;
17091775

@@ -1730,13 +1796,13 @@ namespace oomph
17301796
const static std::vector<std::string> Plastic_data_names;
17311797
// We store a vector of indices of the plastic data in internal data
17321798
// so we can assign timesteppers etc more easily
1733-
// We resize this every time we build a new set of plastic internal data but
1734-
// since we only do this once when the element is constructed this shouldn't
1735-
// be a problem - we can't do this at construction of this class because
1736-
// the number of integral points is defined by derived classes
1799+
// We resize this every time we build a new set of plastic internal data
1800+
// but since we only do this once when the element is constructed this
1801+
// shouldn't be a problem - we can't do this at construction of this class
1802+
// because the number of integral points is defined by derived classes
17371803

1738-
// We store a separate set of plastic: internal data indices, pinned status,
1739-
// and eqn numbers per integral point in the element.
1804+
// We store a separate set of plastic: internal data indices, pinned
1805+
// status, and eqn numbers per integral point in the element.
17401806

17411807
// [Number of ipts, number of types of plastic data]
17421808
// Pointer to the plastic data at the given integral point and of the given
@@ -1753,8 +1819,8 @@ namespace oomph
17531819
Vector<Vector<double*>> Plastic_dof_data_pt;
17541820

17551821
// Keeps track of if data for the plastic dof numbers has been allocated
1756-
// We do it within this function because this allows us to reliably zero the
1757-
// counters Num_plastic_Dofs and Num_plastic_residuals
1822+
// We do it within this function because this allows us to reliably zero
1823+
// the counters Num_plastic_Dofs and Num_plastic_residuals
17581824
bool Plastic_dof_nunbers_has_been_resized = false;
17591825

17601826
// The solver tolerance for the plastic newton solve

0 commit comments

Comments
 (0)