b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC > Class Template Reference

#include "b2element_field_transfer.H"

Inheritance diagram for b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >:
Collaboration diagram for b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >:

Public Member Functions

std::pair< int, Node *const * > get_nodes () const override
 
void set_nodes (std::pair< int, Node *const * > nodes_) override
 
int get_number_of_dof () const override
 
size_t set_global_dof_numbering (size_t index) override
 
std::pair< size_t, size_t > get_global_dof_numbering () const override
 
int edge_field_order (const int edge_id, const std::string &field_name) override
 
bool edge_field_linear_on_dof (const int edge_id, const std::string &field_name) override
 
int edge_field_polynomial_sub_edge (const int edge_id, const std::string &field_name, b2linalg::Vector< double, b2linalg::Vdense > &sub_nodes) override
 
void edge_geom (const int edge_id, const double internal_coor, b2linalg::Vector< double > &geom, b2linalg::Vector< double > &d_geom_d_icoor) override
 
void edge_field_value (const int edge_id, const std::string &field_name, const double internal_coor, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, const double time, b2linalg::Vector< double, b2linalg::Vdense > &value, b2linalg::Vector< double, b2linalg::Vdense > &d_value_d_icoor, b2linalg::Index &dof_numbering, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_value_d_dof, b2linalg::Index &d_value_d_dof_dep) override
 
- Public Member Functions inherited from b2000::TypedElement< double >
virtual void get_constraint (Model &model, const bool linear, const double time, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &constraint, b2linalg::Matrix< double, b2linalg::Mcompressed_col > &trans_d_constraint_d_dof, b2linalg::Vector< double, b2linalg::Vdense > &d_constraint_d_time)
 
virtual void face_field_value (const int face_id, const std::string &field_name, const b2linalg::Vector< double, b2linalg::Vdense_constref > &internal_coor, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, const double time, b2linalg::Vector< double, b2linalg::Vdense > &value, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_value_d_icoor, b2linalg::Index &dof_numbering, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_value_d_dof, b2linalg::Index &d_value_d_dof_dep_col)
 
virtual void body_field_value (const std::string &field_name, const b2linalg::Vector< double, b2linalg::Vdense_constref > &internal_coor, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, const double time, b2linalg::Vector< double, b2linalg::Vdense > &value, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_value_d_icoor, b2linalg::Index &dof_numbering, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_value_d_dof)
 
virtual void field_volume_integration (const b2linalg::Vector< double, b2linalg::Vdense_constref > &dof, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdot, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdotdot, const Field< double > &f, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &discretised_field, b2linalg::Matrix< double, b2linalg::Mpacked > &d_discretised_field_d_dof)
 
virtual void field_face_integration (const b2linalg::Vector< double, b2linalg::Vdense_constref > &dof, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdot, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdotdot, const Field< double > &field, int face, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &discretised_field, b2linalg::Matrix< double, b2linalg::Mpacked > &d_discretised_field_d_dof)
 
virtual void field_edge_integration (const b2linalg::Vector< double, b2linalg::Vdense_constref > &dof, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdot, const b2linalg::Vector< double, b2linalg::Vdense_constref > &dofdotdot, const Field< double > &f, int edge, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &discretised_field, b2linalg::Matrix< double, b2linalg::Mpacked > &d_discretised_field_d_dof)
 
void AssembleElementEffectiveSystem (const solver::TypedSolver< double, MATRIX_FORMAT > &solver, b2linalg::Matrix< double, typename MATRIX_FORMAT::dense > &k_eff, b2linalg::Vector< double, b2linalg::Vdense > &f_eff, b2linalg::Index &index)
 Assembles the element effective matrix and vector.
 
b2linalg::Matrix< double, typename MATRIX_FORMAT::dense > AssembleElementEffectiveMatrix (const solver::TypedSolver< double, MATRIX_FORMAT > &solver, b2linalg::Index &index)
 Assembles the element effective matrix.
 
double ComputeElementError (const solver::TypedSolver< double, MATRIX_FORMAT > &solver)
 TODO.
 
b2linalg::Vector< double, b2linalg::Vdense > AssembleElementEffectiveVector (const solver::TypedSolver< double, MATRIX_FORMAT > &solver, b2linalg::Index index)
 Assembles the element effective vector.
 
void ComputeElementGradient (const solver::TypedSolver< double, MATRIX_FORMAT > &solver, GradientContainer *const gradient_container)
 Compute the gradients for post-processing.
 
virtual void get_value (Model &model, const bool linear, const EquilibriumSolution equilibrium_solution, const double time, const double delta_time, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, GradientContainer *gradient_container, SolverHints *solver_hints, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &value, const std::vector< bool > &d_value_d_dof_flags, std::vector< b2linalg::Matrix< double, b2linalg::Mrectangle > > &d_value_d_dof, b2linalg::Vector< double, b2linalg::Vdense > &d_value_d_time)
 Compute the internal forces and their derivatives of the element.
 
virtual void get_value (Model &model, const bool linear, const EquilibriumSolution equilibrium_solution, const double time, const double delta_time, const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &dof, GradientContainer *gradient_container, SolverHints *solver_hints, b2linalg::Index &dof_numbering, b2linalg::Vector< double, b2linalg::Vdense > &value, const std::vector< bool > &d_value_d_dof_flags, std::vector< b2linalg::Matrix< double, b2linalg::Mpacked > > &d_value_d_dof, b2linalg::Vector< double, b2linalg::Vdense > &d_value_d_time)
 Compute the internal forces and their derivatives of the element.
 
- Public Member Functions inherited from b2000::Element
virtual const std::vector< VariableInfoget_value_info () const
 
virtual std::pair< int, VariableInfoget_constraint_info ()
 
 Element (const bool symmetric)
 Sets the symmetry property of this element. Call this constructor if your newly defined element is not symmetric.
 
size_t get_id () const
 
void set_id (size_t id_)
 
int get_elem_type_number () const
 
void set_elem_type_number (int elno)
 
const std::string & get_object_name () const override
 
void set_object_name (const std::string &name)
 
virtual void get_dof_numbering (b2linalg::Index &dof_numbering)
 
virtual const ElementPropertyget_property () const
 
virtual void set_property (ElementProperty *property)
 
virtual void set_additional_properties (const RTable &rtable)
 
virtual void init (Model &model)
 
virtual std::pair< size_t, Element ** > get_subelements ()
 
iterator begin ()
 
iterator end () const
 
virtual int face_field_order (const int face_id, const std::string &field_name)
 
virtual bool face_field_linear_on_dof (const int face_id, const std::string &field_name)
 
virtual int face_field_polynomial_sub_face (const int face_id, const std::string &field_name, b2linalg::Matrix< double, b2linalg::Mrectangle > &sub_nodes, std::vector< Triangle > &sub_faces)
 
virtual void face_geom (const int face_id, const b2linalg::Vector< double, b2linalg::Vdense_constref > &internal_coor, b2linalg::Vector< double > &geom, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_geom_d_icoor)
 
virtual int body_field_order (const std::string &field_name)
 
virtual bool body_field_linear_on_dof (const std::string &field_name)
 
virtual int body_field_polynomial_sub_volume (const std::string &field_name, b2linalg::Matrix< double, b2linalg::Mrectangle > &sub_nodes, std::vector< Tetrahedral > &sub_volumes)
 
virtual void body_geom (const b2linalg::Vector< double, b2linalg::Vdense_constref > &internal_coor, b2linalg::Vector< double > &geom, b2linalg::Matrix< double, b2linalg::Mrectangle > &d_geom_d_icoor)
 
virtual std::pair< int, int > get_state_buffer_size () const
 
virtual std::pair< int *, double * > get_state_buffer (std::pair< int *, double * > buffers) const
 
virtual std::pair< const int *, const double * > set_state_buffer (std::pair< const int *, const double * > buffers)
 
- Public Member Functions inherited from b2000::Object
virtual ~Object ()
 

Additional Inherited Members

- Public Types inherited from b2000::Element
enum  VariableInfo { zero = 0 , constant = 1 , linear = 2 , nonlinear = 3 }
 
- Static Public Attributes inherited from b2000::TypedElement< double >
static type_t type
 Element interface typed by the dof.
 
- Static Public Attributes inherited from b2000::Object
static ObjectType type
 

Detailed Description

template<bool FLUX, bool AXISYMMETRIC>
class b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >

CFD Element with two constant fields: Temperature and HeatFlux The nodes don't have dof. The first element's dof is the temperature. The second element's dof is the heat flux peer surface unit.

Member Function Documentation

◆ edge_field_linear_on_dof()

template<bool FLUX, bool AXISYMMETRIC>
bool b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::edge_field_linear_on_dof ( const int  edge_id,
const std::string &  field_name 
)
inlineoverridevirtual
Returns
Whether the integrated field depends linearly on the dof (true), or whether the field depends in nonlinear fashion (false). Most elements should return true.
Parameters
edge_idThe edge number, starting at 1, according to the B2000++ conventions.
field_nameThe field name.

Reimplemented from b2000::Element.

◆ edge_field_order()

template<bool FLUX, bool AXISYMMETRIC>
int b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::edge_field_order ( const int  edge_id,
const std::string &  field_name 
)
inlineoverridevirtual
Returns
The integration order along the edge. This depends on the shape functions. Linear elements return 1, quadratic elements return 2, etc.
Parameters
edge_idThe edge number, starting at 1, according to the B2000++ conventions.
field_nameThe field name. Usually, the integration order is independent of the field name.

Reimplemented from b2000::Element.

◆ edge_field_polynomial_sub_edge()

template<bool FLUX, bool AXISYMMETRIC>
int b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::edge_field_polynomial_sub_edge ( const int  edge_id,
const std::string &  field_name,
b2linalg::Vector< double, b2linalg::Vdense > &  sub_nodes 
)
inlineoverridevirtual

Sub-divide the edge into polynomial sub-edges and compute the edge-internal coordinates of the nodes at the sub-edge boundaries. Most elements should put [-1, +1] (one sub-edge).

Parameters
edge_idThe edge number, starting at 1, according to the B2000++ conventions.
field_nameThe field name.
sub_nodesA vector containing the edge-internal coordinates of the sub-nodes. The coordinates must be strictly increasing, and the first sub-node must be at -1, and the last sub-node must be at +1.
Returns
The number of sub-edges, it must be equal to sub_nodes.size() - 1. Most elements should return 1.

Reimplemented from b2000::Element.

◆ edge_field_value()

template<bool FLUX, bool AXISYMMETRIC>
void b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::edge_field_value ( const int  edge_id,
const std::string &  field_name,
const double  internal_coor,
const b2linalg::Matrix< double, b2linalg::Mrectangle_constref > &  dof,
const double  time,
b2linalg::Vector< double, b2linalg::Vdense > &  value,
b2linalg::Vector< double, b2linalg::Vdense > &  d_value_d_icoor,
b2linalg::Index &  dof_numbering,
b2linalg::Matrix< double, b2linalg::Mrectangle > &  d_value_d_dof,
b2linalg::Index &  d_value_d_dof_dep_col 
)
inlineoverridevirtual

Interpolate the value of the field and its derivatives at a specified edge integration point for real-valued elements.

Parameters
edge_idThe edge number, starting at 1, according to the B2000++ conventions (input).
field_nameThe field name.
internal_coorThe edge-internal coordinate (from -1 to +1) of the integration point (input).
dofThe solution vector (input).
timeThe current time (input).
valueThe value of the field interpolated at the given edge-internal coordinate for the given dof and time.
d_value_d_icoorThe derivatives of the interpolated field value w.r.t. the internal coordinate (vector, output).
dof_numberingArray of the global dof indices on which the interpolated field value depends (vector, output).
d_value_d_dofThe derivatives of the interpolated field values w.r.t. the dof's (matrix, output).
d_value_d_dof_dep_colArray of the global dof indices on which the interpolated field value depends for the current deformation (vector, output).

Reimplemented from b2000::TypedElement< double >.

◆ edge_geom()

template<bool FLUX, bool AXISYMMETRIC>
void b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::edge_geom ( const int  edge_id,
const double  internal_coor,
b2linalg::Vector< double > &  geom,
b2linalg::Vector< double > &  d_geom_d_icoor 
)
inlineoverridevirtual

Compute the edge geometry at a specified integration point.

Parameters
edge_idThe edge number, starting at 1, according to the B2000++ conventions (input).
internal_coorThe edge-internal coordinate (from -1 to +1) of the integration point (input).
geomThe branch-global coordinates of the integration point (vector, output).
d_geom_d_icoorThe derivatives of the branch-global coordinates w.r.t. the internal coordinate; this is the edge tangential vector (vector, output).

Reimplemented from b2000::Element.

◆ get_global_dof_numbering()

template<bool FLUX, bool AXISYMMETRIC>
std::pair< size_t, size_t > b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::get_global_dof_numbering ( ) const
inlineoverridevirtual

Elements without internal dof's do not need to override this function.

Returns
A pair (i, i+n), with i being the global number of the first dof of the element, and n equal to get_number_of_dof().

Example

std::pair<size_t, size_t>
return std::pair<size_t, size_t>(
internal_dof_index, internal_dof_index + 4);
}
std::pair< size_t, size_t > get_global_dof_numbering() const override
Definition b2element_field_transfer.H:767

The variable internal_dof_index is a member of the element class and was set in set_global_dof_numbering().

Reimplemented from b2000::Element.

◆ get_nodes()

template<bool FLUX, bool AXISYMMETRIC>
std::pair< int, Node *const * > b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::get_nodes ( ) const
inlineoverridevirtual

Must be overridden.

Returns
A pair containing the number of nodes and a const pointer to an array of pointers to Node instances.
See also
set_nodes()

Reimplemented from b2000::Element.

◆ get_number_of_dof()

template<bool FLUX, bool AXISYMMETRIC>
int b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::get_number_of_dof ( ) const
inlineoverridevirtual

Elements without internal dof's do not need to override this function.

Returns
The number of degrees-of-freedom of the entity.

Example

A Finite Element with 4 internal dof's would return 4.

Reimplemented from b2000::Element.

◆ set_global_dof_numbering()

template<bool FLUX, bool AXISYMMETRIC>
size_t b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::set_global_dof_numbering ( size_t  index)
inlineoverridevirtual

Elements without internal dof's do not need to override this function.

Set the global degree-of-freedom numbers of the degrees-of-freedom belonging to the entity.

Parameters
indexThe index into the global solution vector of the first degree-of-freedom of the entity.
Returns
The index into the global solution vector past the last degree-of-freedom of the entity.

Example

A Finite Element with 4 internal dof's:

size_t
set_global_dof_numbering(size_t index) {
internal_dof_index = index;
return index + 4;
}
size_t set_global_dof_numbering(size_t index) override
Definition b2element_field_transfer.H:762

The variable internal_dof_index is a member of the element class.

Reimplemented from b2000::Element.

◆ set_nodes()

template<bool FLUX, bool AXISYMMETRIC>
void b2000::ElementCFDHeat2DFieldL2Constant< FLUX, AXISYMMETRIC >::set_nodes ( std::pair< int, Node *const * >  nodes)
inlineoverridevirtual

Must be overridden. Set the nodes of the element. This function is called by the Domain object.

todo: not all elements override this function!

Parameters
nodesA pair (first, second) with first being the number of nodes, and second a pointer to a const array containing pointers to the Node instances. The length of the array corresponds to the number of nodes.

Implementations should verify the number of nodes. The checking of the correct node type is optional.

It is recommended to perform a dynamic cast to the exact node type, this allows the use of the get_coor_s() and get_dof_numbering_s() functions without the overhead of the virtual functions Node::get_coor() and DegreesOfFreedom::get_global_dof_numbering().

Example

A quadrilateral 2D stress element named Q4.S.2D.EXAMPLE. It has 3 coordinates (the Z-coordinate set to 0) and displacement dof's in X- and Y-direction. The following using statement gives the alias NodeType for the exact Node type:

using NodeType = HNode<Coor<Trans<X,Y,Z>>,Dof<DTrans<DX,DY>>>;

The class has an array of NodeType pointers.

private:
NodeType* nodes[4];

This array is initialized in the set_nodes() function:

void
set_nodes(std::pair<int, Node* const *> nodes_) {
if (nodes_.first != 4)
SizeError() << "Element " << get_object_name() << " of type "
"Q4.S.2D.EXAMPLE needs 4 nodes." << THROW;
for (int i = 0; i != 4; ++i) {
nodes[i] = dynamic_cast<NodeType*>(nodes_.second[i]);
if (nodes[i] == 0)
TypeError() << "Element " << get_object_name() <<
" of type Q4.S.2D.EXAMPLE requires nodes of type " <<
typeid(NodeType) << "." << THROW;
}
}
#define THROW
Definition b2exception.H:198
void set_nodes(std::pair< int, Node *const * > nodes_) override
Definition b2element_field_transfer.H:755
const std::string & get_object_name() const override
Definition b2element.H:220
GenericException< SizeError_name > SizeError
Definition b2exception.H:346
GenericException< TypeError_name > TypeError
Definition b2exception.H:325

The code to retrieve the coordinates of all 4 nodes of the element, without the overhead of virtual functions could then look like this:

double coor[4][3];
for (int i = 0; i != 4; ++i)
NodeType::get_coor_s(coor[i], nodes[i]);

The dof_numbering index vector (as given in the get_value(), get_constraint(), etc. functions) can then be initialized without the overhead of virtual functions:

{
dof_numbering.resize(8);
size_t* ptr = &dof_numbering[0];
for (int i = 0; i != 4; ++i)
ptr = NodeType::get_global_dof_numbering_s(ptr, nodes[i]);
}

Reimplemented from b2000::Element.


The documentation for this class was generated from the following file: