<commit_before>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>, <NAME>, <NAME>, <NAME>
// =============================================================================
// ANCF laminated shell element with four nodes.
// =============================================================================

#ifndef CHELEMENTSHELLANCF_H
#define CHELEMENTSHELLANCF_H

#include "chrono/physics/ChContinuumMaterial.h"
#include "chrono_fea/ChApiFEA.h"
#include "chrono_fea/ChElementShell.h"
#include "chrono_fea/ChNodeFEAxyzD.h"
#include "chrono_fea/ChUtilsFEA.h"
#include "core/ChQuadrature.h"

namespace chrono {
namespace fea {

// ----------------------------------------------------------------------------
/// Material definition
class ChMaterialShellANCF {
  public:
    ChMaterialShellANCF(double rho, const ChVector<>& E, const ChVector<>& nu, const ChVector<>& G)
        : m_rho(rho), m_E(E), m_nu(nu), m_G(G), m_damping_K(0) {
        // Calculate E_eps
        double delta = 1.0 - (m_nu.x * m_nu.x) * m_E.y / m_E.x - (m_nu.y * m_nu.y) * m_E.z / m_E.x -
                       (m_nu.z * m_nu.z) * m_E.z / m_E.y - 2.0 * m_nu.x * m_nu.y * m_nu.z * m_E.z / m_E.x;
        double nu_yx = m_nu.x * m_E.y / m_E.x;
        double nu_zx = m_nu.y * m_E.z / m_E.x;
        double nu_zy = m_nu.z * m_E.z / m_E.y;
        m_E_eps(0, 0) = m_E.x * (1.0 - (m_nu.z * m_nu.z) * m_E.z / m_E.y) / delta;
        m_E_eps(1, 1) = m_E.y * (1.0 - (m_nu.y * m_nu.y) * m_E.z / m_E.x) / delta;
        m_E_eps(3, 3) = m_E.z * (1.0 - (m_nu.x * m_nu.x) * m_E.y / m_E.x) / delta;
        m_E_eps(0, 1) = m_E.y * (m_nu.x + m_nu.y * m_nu.z * m_E.z / m_E.y) / delta;
        m_E_eps(0, 3) = m_E.z * (m_nu.y + m_nu.z * m_nu.x) / delta;
        m_E_eps(1, 0) = m_E.y * (m_nu.x + m_nu.y * m_nu.z * m_E.z / m_E.y) / delta;
        m_E_eps(1, 3) = m_E.z * (m_nu.z + m_nu.y * m_nu.x * m_E.y / m_E.x) / delta;
        m_E_eps(3, 0) = m_E.z * (m_nu.y + m_nu.z * m_nu.x) / delta;
        m_E_eps(3, 1) = m_E.z * (m_nu.z + m_nu.y * m_nu.x * m_E.y / m_E.x) / delta;
        m_E_eps(2, 2) = m_G.x;
        m_E_eps(4, 4) = m_G.y;
        m_E_eps(5, 5) = m_G.z;
    }

    double Get_rho() const { return m_rho; }

    void Set_RayleighDampingK(double damping_K) { m_damping_K = damping_K; }
    double Get_RayleighDampingK() const { return m_damping_K; }

    const ChMatrixNM<double, 6, 6>& Get_E_eps() const { return m_E_eps; }

    double m_rho;     ///< density
    ChVector<> m_E;   ///< E_x, E_y, E_z
    ChVector<> m_nu;  ///< nu_xy, nu_xz, nu_yz
    ChVector<> m_G;   ///< G_xy, G_xz, G_yz

    double m_damping_K;  ///< Rayleigh damping coefficient

    ChMatrixNM<double, 6, 6> m_E_eps;  ///< matrix of elastic coefficients
};

// ----------------------------------------------------------------------------
/// ANCF laminated shell element with four nodes.
/// This class implements composite material elastic
/// force formulations
class ChApiFea ChElementShellANCF : public ChElementShell, public ChLoadableUV, public ChLoadableUVW {
  public:
    ChElementShellANCF();
    ~ChElementShellANCF() {}

    /// Definition of a layer
    class Layer {
      public:
        double Get_thickness() const { return m_thickness; }
        double Get_theta() const { return m_theta; }
        const ChMaterialShellANCF& Get_material() const { return m_material; }

      private:
        // Private constructor (a layer can be created only by adding it to an element)
        Layer(ChElementShellANCF* element, double thickness, double theta, const ChMaterialShellANCF& material)<commit_msg>ShellANCF: remove Rayleigh damping from material definition<commit_after>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>, <NAME>, <NAME>, <NAME>
// =============================================================================
// ANCF laminated shell element with four nodes.
// =============================================================================

#ifndef CHELEMENTSHELLANCF_H
#define CHELEMENTSHELLANCF_H

#include "chrono/physics/ChContinuumMaterial.h"
#include "chrono_fea/ChApiFEA.h"
#include "chrono_fea/ChElementShell.h"
#include "chrono_fea/ChNodeFEAxyzD.h"
#include "chrono_fea/ChUtilsFEA.h"
#include "core/ChQuadrature.h"

namespace chrono {
namespace fea {

// ----------------------------------------------------------------------------
/// Material definition
class ChMaterialShellANCF {
  public:
    ChMaterialShellANCF(double rho, const ChVector<>& E, const ChVector<>& nu, const ChVector<>& G)
        : m_rho(rho), m_E(E), m_nu(nu), m_G(G) {
        // Calculate E_eps
        double delta = 1.0 - (m_nu.x * m_nu.x) * m_E.y / m_E.x - (m_nu.y * m_nu.y) * m_E.z / m_E.x -
                       (m_nu.z * m_nu.z) * m_E.z / m_E.y - 2.0 * m_nu.x * m_nu.y * m_nu.z * m_E.z / m_E.x;
        double nu_yx = m_nu.x * m_E.y / m_E.x;
        double nu_zx = m_nu.y * m_E.z / m_E.x;
        double nu_zy = m_nu.z * m_E.z / m_E.y;
        m_E_eps(0, 0) = m_E.x * (1.0 - (m_nu.z * m_nu.z) * m_E.z / m_E.y) / delta;
        m_E_eps(1, 1) = m_E.y * (1.0 - (m_nu.y * m_nu.y) * m_E.z / m_E.x) / delta;
        m_E_eps(3, 3) = m_E.z * (1.0 - (m_nu.x * m_nu.x) * m_E.y / m_E.x) / delta;
        m_E_eps(0, 1) = m_E.y * (m_nu.x + m_nu.y * m_nu.z * m_E.z / m_E.y) / delta;
        m_E_eps(0, 3) = m_E.z * (m_nu.y + m_nu.z * m_nu.x) / delta;
        m_E_eps(1, 0) = m_E.y * (m_nu.x + m_nu.y * m_nu.z * m_E.z / m_E.y) / delta;
        m_E_eps(1, 3) = m_E.z * (m_nu.z + m_nu.y * m_nu.x * m_E.y / m_E.x) / delta;
        m_E_eps(3, 0) = m_E.z * (m_nu.y + m_nu.z * m_nu.x) / delta;
        m_E_eps(3, 1) = m_E.z * (m_nu.z + m_nu.y * m_nu.x * m_E.y / m_E.x) / delta;
        m_E_eps(2, 2) = m_G.x;
        m_E_eps(4, 4) = m_G.y;
        m_E_eps(5, 5) = m_G.z;
    }

    double Get_rho() const { return m_rho; }

    const ChMatrixNM<double, 6, 6>& Get_E_eps() const { return m_E_eps; }

    double m_rho;     ///< density
    ChVector<> m_E;   ///< E_x, E_y, E_z
    ChVector<> m_nu;  ///< nu_xy, nu_xz, nu_yz
    ChVector<> m_G;   ///< G_xy, G_xz, G_yz

    ChMatrixNM<double, 6, 6> m_E_eps;  ///< matrix of elastic coefficients
};

// ----------------------------------------------------------------------------
/// ANCF laminated shell element with four nodes.
/// This class implements composite material elastic
/// force formulations
class ChApiFea ChElementShellANCF : public ChElementShell, public ChLoadableUV, public ChLoadableUVW {
  public:
    ChElementShellANCF();
    ~ChElementShellANCF() {}

    /// Definition of a layer
    class Layer {
      public:
        double Get_thickness() const { return m_thickness; }
        double Get_theta() const { return m_theta; }
        const ChMaterialShellANCF& Get_material() const { return m_material; }

      private:
        // Private constructor (a layer can be created only by adding it to an element)
        Layer(ChElementShellANCF* element, double thickness, double theta, const ChMaterialShellANCF& material)
{'fraction_non_alphanumeric': 0.24942440521872603, 'fraction_numerical': 0.01087234586850857, 'mean_word_length': 2.389250108365843, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2253057', 'n_tokens_mistral': 3088, 'n_tokens_neox': 2940, 'n_words': 679}