13 #ifndef KRATOS_WAVE_ELEMENT_H_INCLUDED
14 #define KRATOS_WAVE_ELEMENT_H_INCLUDED
53 template<std::
size_t TNumNodes>
119 return Kratos::make_intrusive<WaveElement<TNumNodes>>(NewId, this->
GetGeometry().
Create(ThisNodes), pProperties);
129 Element::Pointer
Create(
IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties)
const override
131 return Kratos::make_intrusive<WaveElement<TNumNodes>>(NewId, pGeom, pProperties);
143 p_new_elem->SetData(this->
GetData());
144 p_new_elem->Set(
Flags(*
this));
191 std::vector<double>& rValues,
255 std::string
Info()
const override
257 return "WaveElement";
265 rOStream <<
Info() <<
" : " <<
Id();
355 const std::size_t
J);
394 const double Weight = 1.0);
402 const double Weight = 1.0);
410 const double Weight = 1.0);
417 const double Weight = 1.0);
424 const double Weight = 1.0);
446 void save(
Serializer& rSerializer)
const override
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
Matrix MatrixType
Definition: element.h:90
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
PropertiesType::Pointer pGetProperties()
returns the pointer to the property of the element. Does not throw an error, to allow copying of elem...
Definition: element.h:1014
std::size_t IndexType
Definition: flags.h:74
Flags()
Default constructor.
Definition: flags.h:119
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
DataValueContainer & GetData()
Definition: geometrical_object.h:212
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
IndexType Id() const
Definition: indexed_object.h:107
Definition: amatrix_interface.h:41
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Implementation of a linear element for shallow water problems.
Definition: wave_element.h:55
virtual void AddDispersiveTerms(LocalVectorType &rVector, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX, const double Weight=1.0)
Definition: wave_element.cpp:567
Node NodeType
Definition: wave_element.h:62
GeometryData::IntegrationMethod GetIntegrationMethod() const override
GetIntegrationMethod Return the integration order to be used.
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Fill given array with containing the element's degrees of freedom.
Definition: wave_element.cpp:96
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: wave_element.h:129
virtual void CalculateArtificialDamping(BoundedMatrix< double, 3, 3 > &rDamping, const ElementData &rData)
Definition: wave_element.cpp:436
void AddFrictionTerms(LocalMatrixType &rMatrix, LocalVectorType &rVector, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX, const double Weight=1.0)
Definition: wave_element.cpp:526
std::size_t IndexType
Definition: wave_element.h:60
virtual void CalculateArtificialViscosity(BoundedMatrix< double, 3, 3 > &rViscosity, BoundedMatrix< double, 2, 2 > &rDiffusion, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX)
Definition: wave_element.cpp:425
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Calculate the elemental mass matrix.
Definition: wave_element.cpp:710
GeometryType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: wave_element.h:68
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(WaveElement)
Pointer definition.
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
Create a new element pointer and clone the previous element data.
Definition: wave_element.h:140
virtual void GetNodalData(ElementData &rData, const GeometryType &rGeometry, int Step=0)
Definition: wave_element.cpp:217
void AddArtificialViscosityTerms(LocalMatrixType &rMatrix, LocalVectorType &rVector, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX, const double Weight=1.0)
Definition: wave_element.cpp:577
WaveElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: wave_element.h:89
static double ShapeFunctionProduct(const array_1d< double, TNumNodes > &rN, const std::size_t I, const std::size_t J)
Definition: wave_element.cpp:338
~ WaveElement() override
Destructor.
Definition: wave_element.h:104
void CalculateGeometryData(const GeometryType &rGeometry, Vector &rGaussWeights, Matrix &rNContainer, ShapeFunctionsGradientsType &rDN_DX)
Definition: wave_element.cpp:305
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Fill given vector with the linear system row index for the element's degrees of freedom.
Definition: wave_element.cpp:75
static double WetFraction(const ElementData &rData)
Definition: wave_element.cpp:417
static constexpr IndexType mLocalSize
Definition: wave_element.h:287
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Check that all required data containers are properly initialized and registered in Kratos.
Definition: wave_element.cpp:45
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Access for variables on Integration points.
Definition: wave_element.cpp:157
void Calculate(const Variable< array_1d< double, 3 >> &rVariable, array_1d< double, 3 > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Access for variables on Integration points.
Definition: wave_element.cpp:750
static array_1d< double, 3 > VectorProduct(const array_1d< array_1d< double, 3 >, TNumNodes > &rV, const array_1d< double, TNumNodes > &rN)
Definition: wave_element.cpp:348
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Is called in the beginning of each solution step.
Definition: wave_element.cpp:168
static array_1d< double, 3 > ScalarGradient(const array_1d< double, TNumNodes > &rS, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX)
Definition: wave_element.cpp:362
BoundedMatrix< double, 3 *TNumNodes, 3 *TNumNodes > LocalMatrixType
Definition: wave_element.h:66
void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo) override
Calculate the diffusion matrix for monotonic corrected schemes.
Definition: wave_element.cpp:744
static double InverseHeight(const ElementData &rData)
Definition: wave_element.cpp:409
WaveElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Geometry and Properties.
Definition: wave_element.h:99
void GetSecondDerivativesVector(Vector &rValues, int Step=0) const override
Get the second time derivative of variable which defines the degrees of freedom.
Definition: wave_element.cpp:150
array_1d< double, 3 *TNumNodes > LocalVectorType
Definition: wave_element.h:64
virtual const Variable< double > & GetUnknownComponent(int Index) const
Definition: wave_element.cpp:174
void AddWaveTerms(LocalMatrixType &rMatrix, LocalVectorType &rVector, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX, const double Weight=1.0)
Definition: wave_element.cpp:458
void GetValuesVector(Vector &rValues, int Step=0) const override
Get the variable which defines the degrees of freedom.
Definition: wave_element.cpp:117
virtual double StabilizationParameter(const ElementData &rData) const
Definition: wave_element.cpp:656
WaveElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: wave_element.h:94
std::string Info() const override
Turn back information as a string.
Definition: wave_element.h:255
virtual LocalVectorType GetUnknownVector(const ElementData &rData) const
Definition: wave_element.cpp:186
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: wave_element.h:263
virtual void UpdateGaussPointData(ElementData &rData, const array_1d< double, TNumNodes > &rN)
Definition: wave_element.cpp:231
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Calculate the elemental contribution to the problem.
Definition: wave_element.cpp:664
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new element pointer.
Definition: wave_element.h:117
void GetFirstDerivativesVector(Vector &rValues, int Step=0) const override
Get the time derivative of variable which defines the degrees of freedom.
Definition: wave_element.cpp:134
static BoundedMatrix< double, 3, 3 > VectorGradient(const array_1d< array_1d< double, 3 >, TNumNodes > &rV, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX)
Definition: wave_element.cpp:392
WaveElement()
Default constructor.
Definition: wave_element.h:84
const Parameters GetSpecifications() const override
This method provides the specifications/requirements of the element.
Definition: wave_element.cpp:32
virtual void InitializeData(ElementData &rData, const ProcessInfo &rCurrentProcessInfo)
Definition: wave_element.cpp:200
virtual void AddMassTerms(LocalMatrixType &rMatrix, const ElementData &rData, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX, const double Weight=1.0)
Definition: wave_element.cpp:625
static double VectorDivergence(const array_1d< array_1d< double, 3 >, TNumNodes > &rV, const BoundedMatrix< double, TNumNodes, 2 > &rDN_DX)
Definition: wave_element.cpp:377
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: wave_element.h:271
Short class definition.
Definition: array_1d.h:61
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307
J
Definition: sensitivityMatrix.py:58
Definition: wave_element.h:299
double stab_factor
Definition: wave_element.h:301
double length
Definition: wave_element.h:305
array_1d< array_1d< double, 3 >, TNumNodes > nodal_q
Definition: wave_element.h:323
double height
Definition: wave_element.h:310
array_1d< double, TNumNodes > nodal_f
Definition: wave_element.h:318
array_1d< array_1d< double, 3 >, TNumNodes > nodal_a
Definition: wave_element.h:324
array_1d< double, TNumNodes > nodal_w
Definition: wave_element.h:321
array_1d< array_1d< double, 3 >, TNumNodes > nodal_Jh
Definition: wave_element.h:325
double relative_dry_height
Definition: wave_element.h:303
double depth
Definition: wave_element.h:309
double gravity
Definition: wave_element.h:304
array_1d< double, 3 > velocity
Definition: wave_element.h:311
BoundedMatrix< double, 3, 3 > A1
Definition: wave_element.h:313
bool integrate_by_parts
Definition: wave_element.h:300
BoundedMatrix< double, 3, 3 > A2
Definition: wave_element.h:314
array_1d< array_1d< double, 3 >, TNumNodes > nodal_v_mesh
Definition: wave_element.h:327
array_1d< array_1d< double, 3 >, TNumNodes > nodal_Ju
Definition: wave_element.h:326
double absorbing_distance
Definition: wave_element.h:306
double absorbing_damping
Definition: wave_element.h:307
array_1d< double, 3 > b1
Definition: wave_element.h:315
FrictionLaw::Pointer p_bottom_friction
Definition: wave_element.h:329
array_1d< double, TNumNodes > nodal_h
Definition: wave_element.h:319
double shock_stab_factor
Definition: wave_element.h:302
array_1d< double, TNumNodes > nodal_z
Definition: wave_element.h:320
array_1d< double, 3 > b2
Definition: wave_element.h:316
array_1d< array_1d< double, 3 >, TNumNodes > nodal_v
Definition: wave_element.h:322