SheafSystem  0.0.0.0
fiber_bundle::bilinear_2d Class Reference

A section evaluator using bilinear interpolation over a square 2D domain. More...

#include <bilinear_2d.h>

Inheritance diagram for fiber_bundle::bilinear_2d:
fiber_bundle::linear_fcn_space fiber_bundle::integrable_section_evaluator fiber_bundle::differentiable_section_evaluator fiber_bundle::section_evaluator sheaf::any

BILINEAR_2D FACET

 bilinear_2d ()
 Default constructor. More...
 
 bilinear_2d (const bilinear_2d &xother)
 Copy constructor. More...
 
virtual ~bilinear_2d ()
 Destructor. More...
 
double inverse_jacobian (const double xjacobian[2][2], double xinverse_jacobian[2][2])
 

LINEAR_FCN_SPACE FACET

virtual int dl () const
 The dimension of this function space. More...
 
virtual void basis_at_coord (const dof_type xlocal_coord[], size_type xlocal_coord_ub)
 Computes the value of each basis function at local coordinates xlocal_coord. More...
 
virtual void basis_derivs_at_coord (const dof_type xlocal_coords[], size_type xlocal_coords_ub)
 Computes the value of the derivatives each basis function at local coordinates xlocal_coord. More...
 

INTEGRABLE_SECTION_EVALUATOR FACET

virtual value_type jacobian_determinant (const dof_type xcoord_dofs[], size_type xcoord_dofs_ub, size_type xdf, const coord_type xlocal_coords[], size_type xlocal_coords_ub)
 Computes the the determinant of the jacobian matrix at local coordinates xlocal_coords with coordinate dofs xcoord_dofs. More...
 
virtual value_type volume (const dof_type xcoord_dofs[], size_type xcoord_dofs_ub, size_type xdf)
 Volume for specified coordinate dofs xcoord_dofs and fiber space dimension xdf. More...
 
virtual void integrate (const dof_type xcoord_dofs[], size_type xcoord_dofs_ub, size_type xdf, const dof_type xintegrands[], size_type xintegrands_ub, value_type xresult_integrals[], size_type xresult_integrals_ub)
 Computes the value of the integral of the integrand array... More...
 
virtual void integrate (const dof_type xcoord_dofs[], size_type xcoord_dofs_ub, size_type xdf, const dof_type xintegrand, value_type xresult_integrals[], size_type xresult_integrals_ub)
 Computes the value of the integral of the integrand... More...
 
virtual void gauss_point (pod_index_type xindex, coord_type xresult[], size_type xresult_ub)
 The local coordinates of the gauss point with index xindex. More...
 

DIFFERENTIABLE_SECTION_EVALUATOR FACET

void dxi_local (size_type xlocal_coord_index, const dof_type xsource_dofs[], size_type xsource_dofs_ub, dof_type xresult_dofs[], size_type xresult_dofs_ub) const
 First partial derivative of this with respect to local coordinate xlocal_coord_index. More...
 
virtual void jacobian (const dof_type xcoord_dofs[], size_type xcoord_dofs_ub, size_type xdf, const dof_type xlocal_coords[], size_type xlocal_coords_ub)
 Computes the the jacobian matrix at local coordinates xlocal_coords with coordinate dofs xcoord_dofs. More...
 

DOMAIN FACET

virtual int db () const
 The base dimension; the dimension of the local coordinates (independent variable). More...
 
virtual void local_coordinates (pod_index_type xindex, coord_type xresult[], size_type xresult_ub) const
 The local coordinates of the dof with local index xindex. More...
 
void edge_center (pod_index_type xi, coord_type xresult[], size_type xresult_ub) const
 The local cordinates of the xi-th edge. More...
 
void edge_center (pod_index_type xi, block< coord_type > &xresult) const
 The local cordinates of the xi-th edge (boundary). More...
 
virtual bool in_standard_domain (const dof_type xlocal_coords[], size_type xlocal_coords_ub) const
 Return true if the specified local coordinates are in the "standard" domain; otherwise return false. More...
 

EVALUATION FACET

virtual void coord_at_value (const dof_type xdofs[], size_type xdofs_ub, const dof_type xglobal_coords[], size_type xglobal_coord_ub, dof_type xlocal_coords[], size_type xlocal_coords_ub) const
 The local coordinates of a point at which the field has the value xvalue. The dofs are assumed to be interleaved (x0, y0, x1, y1, ...). More...
 

ANY FACET

virtual bilinear_2dclone () const
 Virtual constructor, creates a new instance of the same type as this. More...
 
virtual bilinear_2doperator= (const section_evaluator &xother)
 Assignment operator. More...
 
bilinear_2doperator= (const bilinear_2d &xother)
 Assignment operator. More...
 
virtual bool invariant () const
 Class invariant. More...
 
virtual bool is_ancestor_of (const any *xother) const
 Conformance test; true if other conforms to this. More...
 

Additional Inherited Members

- Public Types inherited from fiber_bundle::section_evaluator
typedef chart_point_coord_type coord_type
 The type of local coordinate; the scalar type for the local coordinate vector space. More...
 
typedef vd_value_type value_type
 The type of component in the value; the scalar type in the range vector space. More...
 
typedef sec_vd_dof_type dof_type
 The type of degree of freedom. More...
 
- Public Member Functions inherited from fiber_bundle::linear_fcn_space
 linear_fcn_space (const linear_fcn_space &xother)
 Copy constructor. More...
 
virtual ~linear_fcn_space ()
 Destructor. More...
 
const value_typebasis_values () const
 The result of the preceding call to basis_at_coord. More...
 
const value_typebasis_deriv_values () const
 The result of the preceding call to basis_derivs_at_coord. More...
 
virtual size_type dof_ct () const
 The number of dofs required for each component of the dependent variable. More...
 
virtual void value_at_coord (const dof_type xdofs[], size_type xdofs_ub, const dof_type xlocal_coords[], size_type xlocal_coords_ub, dof_type xresult[], size_type xresult_ub) const
 Computes the value of the function at local coordinates xlocal_coords using the degrees of freedom xdofs. More...
 
linear_fcn_spaceoperator= (const linear_fcn_space &xother)
 Assignment operator. More...
 
- Public Member Functions inherited from fiber_bundle::integrable_section_evaluator
 integrable_section_evaluator (const integrable_section_evaluator &xother)
 Copy constructor. More...
 
virtual ~integrable_section_evaluator ()
 Destructor. More...
 
virtual integrable_section_evaluatoroperator= (const integrable_section_evaluator &xother)
 Assignment operator. More...
 
- Public Member Functions inherited from fiber_bundle::differentiable_section_evaluator
 differentiable_section_evaluator (const differentiable_section_evaluator &xother)
 Copy constructor. More...
 
virtual ~differentiable_section_evaluator ()
 Destructor. More...
 
void dxi_local (size_type xlocal_coord_index, const block< dof_type > &xsource_dofs, block< dof_type > &xresult_dofs) const
 First partial derivative of this with respect to local coordinate xlocal_coord_index. More...
 
const value_typejacobian_values () const
 The result of the preceding call to jacobian. More...
 
virtual differentiable_section_evaluatoroperator= (const differentiable_section_evaluator &xother)
 Assignment operator. More...
 
- Public Member Functions inherited from fiber_bundle::section_evaluator
 section_evaluator (const section_evaluator &xother)
 Copy constructor. More...
 
virtual ~section_evaluator ()
 Destructor. More...
 
void local_coordinates (pod_index_type xindex, block< coord_type > &xresult) const
 The local coordinates of the dof with local index xindex. More...
 
virtual void center (coord_type xresult[], size_type xresult_ub) const
 The local coordinates at the center of the evaluator. More...
 
void center (block< coord_type > &xresult) const
 The local coordinates at the center of the evaluator. More...
 
bool in_standard_domain (const block< dof_type > &xlocal_coords) const
 True if the specified local coordinates are in the "standard" domain. More...
 
bool df_is_variable () const
 True if and only if the fiber dimension (number of components of the dependent variable) is variable. More...
 
virtual int df () const
 The fiber dimension (number of components of dependent variable). More...
 
virtual dof_type value_at_coord (const dof_type xdofs[], size_type xdofs_ub, const dof_type xlocal_coords[], size_type xlocal_coords_ub) const
 Value at a specified local_coordinate. Single component version. More...
 
dof_type value_at_coord (const block< dof_type > &xdofs, const block< dof_type > &xlocal_coords) const
 Value at a specified local_coordinate. Single component version. More...
 
void value_at_coord (const block< dof_type > &xdofs, const block< dof_type > &xlocal_coords, block< dof_type > &xresult) const
 Values at a specified local_coordinate. Multiple component version. More...
 
void coord_at_value (const block< dof_type > &xdofs, const block< dof_type > &xvalue, block< dof_type > &xlocal_coords) const
 The local coordinates of a point at which the field has the value xvalue. The dofs are assumed to be interleaved. More...
 
virtual dof_type min (const dof_type xdofs[], size_type xdofs_ub) const
 The minimum value of the scalar or component section defined by xdofs. More...
 
dof_type min (const block< dof_type > &xdofs) const
 The minimum value of the scalar or component section defined by xdofs. More...
 
virtual void min (const dof_type xdofs[], size_type xdofs_ub, dof_type xresult[], size_type xresult_ub) const
 The minimum value of the vector section defined by xdofs. More...
 
void min (const block< dof_type > &xdofs, block< dof_type > &xresult) const
 The minimum value of the vector section defined by xdofs. More...
 
virtual dof_type max (const dof_type xdofs[], size_type xdofs_ub) const
 The maximum value of the scalar or component section defined by xdofs. More...
 
dof_type max (const block< dof_type > &xdofs) const
 The maximum value of the scalar or component section defined by xdofs. More...
 
virtual void max (const dof_type xdofs[], size_type xdofs_ub, dof_type xresult[], size_type xresult_ub) const
 The maximum value of the vector section defined by xdofs. More...
 
void max (const block< dof_type > &xdofs, block< dof_type > &xresult) const
 The maximum value of the vector section defined by xdofs. More...
 
- Public Member Functions inherited from sheaf::any
bool is_same_type (const any *other) const
 True if other is the same type as this. More...
 
virtual ~any ()
 Destructor. More...
 
bool invariant_check () const
 True if invariant checking is enabled. More...
 
void enable_invariant_check () const
 Enable invariant checking. More...
 
void disable_invariant_check () const
 Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More...
 
int disable_invariance_check_request_depth () const
 Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More...
 
- Protected Member Functions inherited from fiber_bundle::linear_fcn_space
 linear_fcn_space ()
 Default constructor. More...
 
- Protected Member Functions inherited from fiber_bundle::integrable_section_evaluator
 integrable_section_evaluator ()
 Default constructor. More...
 
- Protected Member Functions inherited from fiber_bundle::differentiable_section_evaluator
 differentiable_section_evaluator ()
 Default constructor. More...
 
- Protected Member Functions inherited from fiber_bundle::section_evaluator
 section_evaluator ()
 Default constructor. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from fiber_bundle::linear_fcn_space
value_type_basis_values
 The result of the preceding call to basis_at_coord. More...
 
value_type_basis_deriv_values
 The result of the preceding call to basis_derivs_at_coord. More...
 
- Protected Attributes inherited from fiber_bundle::differentiable_section_evaluator
value_type_jacobian_values
 The result of the preceding call to "jacobian". More...
 

Detailed Description

A section evaluator using bilinear interpolation over a square 2D domain.

Definition at line 42 of file bilinear_2d.h.

Constructor & Destructor Documentation

◆ bilinear_2d() [1/2]

fiber_bundle::bilinear_2d::bilinear_2d ( )

Default constructor.

Postcondition

Definition at line 35 of file bilinear_2d.cc.

◆ bilinear_2d() [2/2]

fiber_bundle::bilinear_2d::bilinear_2d ( const bilinear_2d xother)

Copy constructor.

Postcondition

Definition at line 55 of file bilinear_2d.cc.

References ~bilinear_2d().

◆ ~bilinear_2d()

fiber_bundle::bilinear_2d::~bilinear_2d ( )
virtual

Member Function Documentation

◆ basis_at_coord()

void fiber_bundle::bilinear_2d::basis_at_coord ( const dof_type  xlocal_coord[],
size_type  xlocal_coord_ub 
)
virtual

Computes the value of each basis function at local coordinates xlocal_coord.

Precondition
  • xlocal_coord != 0
  • xlocal_coord_ub >= db()
Postcondition

Implements fiber_bundle::linear_fcn_space.

Definition at line 242 of file bilinear_2d.cc.

References basis_derivs_at_coord().

Referenced by dl().

◆ basis_derivs_at_coord()

void fiber_bundle::bilinear_2d::basis_derivs_at_coord ( const dof_type  xlocal_coords[],
size_type  xlocal_coords_ub 
)
virtual

Computes the value of the derivatives each basis function at local coordinates xlocal_coord.

Precondition
  • xlocal_coords != 0
  • xlocal_coords_ub >= db()
Postcondition

Implements fiber_bundle::linear_fcn_space.

Definition at line 275 of file bilinear_2d.cc.

References jacobian_determinant().

Referenced by basis_at_coord().

◆ clone()

fiber_bundle::bilinear_2d * fiber_bundle::bilinear_2d::clone ( ) const
virtual

Virtual constructor, creates a new instance of the same type as this.

Postcondition
  • result != 0
  • is_same_type(result)

Implements fiber_bundle::linear_fcn_space.

Definition at line 1124 of file bilinear_2d.cc.

References invariant(), and operator=().

Referenced by coord_at_value().

◆ coord_at_value()

void fiber_bundle::bilinear_2d::coord_at_value ( const dof_type  xdofs[],
size_type  xdofs_ub,
const dof_type  xglobal_coords[],
size_type  xglobal_coord_ub,
dof_type  xlocal_coords[],
size_type  xlocal_coords_ub 
) const
virtual

The local coordinates of a point at which the field has the value xvalue. The dofs are assumed to be interleaved (x0, y0, x1, y1, ...).

Precondition
  • xdofs != 0
  • xdofs_ub >= 8
  • xglobal_coords != 0
  • xglobal_coord_ub >= 2
  • xlocal_coords != 0
  • xlocal_coords_ub >= 2
  • -unexecutable( xdofs must be interleaved )
Postcondition

Implements fiber_bundle::section_evaluator.

Definition at line 1044 of file bilinear_2d.cc.

References clone().

Referenced by in_standard_domain().

◆ db()

int fiber_bundle::bilinear_2d::db ( ) const
virtual

The base dimension; the dimension of the local coordinates (independent variable).

Todo:
xlocal_coords_ub, etc.
Postcondition
  • result == 2

Implements fiber_bundle::section_evaluator.

Definition at line 881 of file bilinear_2d.cc.

References local_coordinates().

Referenced by jacobian().

◆ dl()

int fiber_bundle::bilinear_2d::dl ( ) const
virtual

The dimension of this function space.

Postcondition
  • result == 4

Implements fiber_bundle::linear_fcn_space.

Definition at line 219 of file bilinear_2d.cc.

References basis_at_coord().

Referenced by ~bilinear_2d().

◆ dxi_local()

void fiber_bundle::bilinear_2d::dxi_local ( size_type  xlocal_coord_index,
const dof_type  xsource_dofs[],
size_type  xsource_dofs_ub,
dof_type  xresult_dofs[],
size_type  xresult_dofs_ub 
) const
virtual

First partial derivative of this with respect to local coordinate xlocal_coord_index.

Precondition
  • xlocal_coord_index < db()
  • xsource_dofs != 0
  • xresult_dofs != 0

Implements fiber_bundle::differentiable_section_evaluator.

Definition at line 608 of file bilinear_2d.cc.

References jacobian().

Referenced by gauss_point().

◆ edge_center() [1/2]

void fiber_bundle::bilinear_2d::edge_center ( pod_index_type  xi,
coord_type  xresult[],
size_type  xresult_ub 
) const

The local cordinates of the xi-th edge.

Precondition
  • xresult != 0
  • xresult_ub >= db()

Definition at line 939 of file bilinear_2d.cc.

Referenced by local_coordinates(), and fields::edge_centered_polygon_refiner::refine_coordinates().

◆ edge_center() [2/2]

void fiber_bundle::bilinear_2d::edge_center ( pod_index_type  xi,
block< coord_type > &  xresult 
) const

The local cordinates of the xi-th edge (boundary).

Precondition
  • precondition_of(center(xresult.base(), xresult.ub()))
Postcondition
  • postcondition_of(edge_center(xresult.base(), xresult.ub()))
  • xresult.ct() == db()

Definition at line 985 of file bilinear_2d.cc.

References sheaf::auto_block< T, un_block_initialization_policy< T > >::base(), sheaf::auto_block< T, un_block_initialization_policy< T > >::ct(), in_standard_domain(), sheaf::auto_block< T, un_block_initialization_policy< T > >::set_ct(), and sheaf::auto_block< T, un_block_initialization_policy< T > >::ub().

◆ gauss_point()

void fiber_bundle::bilinear_2d::gauss_point ( pod_index_type  xindex,
coord_type  xresult[],
size_type  xresult_ub 
)
virtual

The local coordinates of the gauss point with index xindex.

Precondition
  • xresult_ub >= db()
Postcondition
  • in_standard_domain(xresult, xresult_ub)

Implements fiber_bundle::integrable_section_evaluator.

Definition at line 567 of file bilinear_2d.cc.

References dxi_local(), and fiber_bundle::sec_at0_algebra::sqrt().

Referenced by integrate().

◆ in_standard_domain()

bool fiber_bundle::bilinear_2d::in_standard_domain ( const dof_type  xlocal_coords[],
size_type  xlocal_coords_ub 
) const
virtual

Return true if the specified local coordinates are in the "standard" domain; otherwise return false.

Precondition
  • xlocal_coords != 0
  • xlocal_coords_ub >= 2

Implements fiber_bundle::section_evaluator.

Definition at line 1009 of file bilinear_2d.cc.

References coord_at_value().

Referenced by edge_center().

◆ integrate() [1/2]

void fiber_bundle::bilinear_2d::integrate ( const dof_type  xcoord_dofs[],
size_type  xcoord_dofs_ub,
size_type  xdf,
const dof_type  xintegrands[],
size_type  xintegrands_ub,
value_type  xresult_integrals[],
size_type  xresult_integrals_ub 
)
virtual

Computes the value of the integral of the integrand array...

Todo:
Get these correct.
Precondition
  • xcoord_dofs != 0
  • xcoord_dofs_ub >= dl()*db()
  • xintegrands != 0
  • xintegrands_ub >= dl()
  • xresult_integrals != 0
  • xresult_integrals_ub > 0
Issue:
Interpreting the number of integrands per node as xintegrands_ub/xresult_integrals_ub.
Todo:
Add method number_of_gauss_points().
Postcondition

Implements fiber_bundle::integrable_section_evaluator.

Definition at line 429 of file bilinear_2d.cc.

Referenced by volume().

◆ integrate() [2/2]

void fiber_bundle::bilinear_2d::integrate ( const dof_type  xcoord_dofs[],
size_type  xcoord_dofs_ub,
size_type  xdf,
const dof_type  xintegrand,
value_type  xresult_integrals[],
size_type  xresult_integrals_ub 
)
virtual

Computes the value of the integral of the integrand...

Todo:
Get these correct.
Precondition
  • xcoord_dofs != 0
  • xcoord_dofs_ub >= dl()*db()
  • xresult_integrals != 0
  • xresult_integrals_ub >= dl()
Todo:
Add method number_of_gauss_points().
Postcondition

Reimplemented from fiber_bundle::integrable_section_evaluator.

Definition at line 506 of file bilinear_2d.cc.

References gauss_point().

◆ invariant()

bool fiber_bundle::bilinear_2d::invariant ( ) const
virtual

Class invariant.

Invariant

Reimplemented from fiber_bundle::linear_fcn_space.

Definition at line 1193 of file bilinear_2d.cc.

References is_ancestor_of().

Referenced by clone(), and operator=().

◆ is_ancestor_of()

bool fiber_bundle::bilinear_2d::is_ancestor_of ( const any xother) const
virtual

Conformance test; true if other conforms to this.

Precondition
  • xother != 0

Reimplemented from fiber_bundle::linear_fcn_space.

Definition at line 1226 of file bilinear_2d.cc.

Referenced by invariant().

◆ jacobian()

void fiber_bundle::bilinear_2d::jacobian ( const dof_type  xcoord_dofs[],
size_type  xcoord_dofs_ub,
size_type  xdf,
const dof_type  xlocal_coords[],
size_type  xlocal_coords_ub 
)
virtual

Computes the the jacobian matrix at local coordinates xlocal_coords with coordinate dofs xcoord_dofs.

Todo:
Fix!
Precondition
  • xcoord_dofs != 0
  • xcoord_dofs_ub >= xdf*dl()
  • xdf == 2 || xdf == 3
  • xlocal_coords != 0
  • xlocal_coords_ub >= 2
///
Issue:
This can probably be made more efficient by reordering /// the loops.
Postcondition

Reimplemented from fiber_bundle::differentiable_section_evaluator.

Definition at line 657 of file bilinear_2d.cc.

References db(), and fiber_bundle::differentiable_section_evaluator::jacobian_values().

Referenced by dxi_local().

◆ jacobian_determinant()

fiber_bundle::section_evaluator::value_type fiber_bundle::bilinear_2d::jacobian_determinant ( const dof_type  xcoord_dofs[],
size_type  xcoord_dofs_ub,
size_type  xdf,
const coord_type  xlocal_coords[],
size_type  xlocal_coords_ub 
)
virtual

Computes the the determinant of the jacobian matrix at local coordinates xlocal_coords with coordinate dofs xcoord_dofs.

Precondition
  • xcoord_dofs != 0
  • xcoord_dofs_ub >= dl()*db()
  • xdf == 2 || xdf == 3

Reimplemented from fiber_bundle::differentiable_section_evaluator.

Definition at line 329 of file bilinear_2d.cc.

References fiber_bundle::sec_at0_algebra::fabs(), fiber_bundle::sec_at0_algebra::sqrt(), and volume().

Referenced by basis_derivs_at_coord().

◆ local_coordinates()

void fiber_bundle::bilinear_2d::local_coordinates ( pod_index_type  xindex,
coord_type  xresult[],
size_type  xresult_ub 
) const
virtual

The local coordinates of the dof with local index xindex.

Precondition
  • xresult_ub >= db()
Postcondition
  • in_standard_domain(xresult, xresult_ub)

Implements fiber_bundle::section_evaluator.

Definition at line 905 of file bilinear_2d.cc.

References edge_center().

Referenced by db().

◆ operator=() [1/2]

fiber_bundle::bilinear_2d & fiber_bundle::bilinear_2d::operator= ( const section_evaluator xother)
virtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Not Implemented.
Postcondition

Reimplemented from fiber_bundle::linear_fcn_space.

Definition at line 1148 of file bilinear_2d.cc.

Referenced by clone().

◆ operator=() [2/2]

fiber_bundle::bilinear_2d & fiber_bundle::bilinear_2d::operator= ( const bilinear_2d xother)

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Not Implemented.
Postcondition

Definition at line 1168 of file bilinear_2d.cc.

References invariant().

◆ volume()

fiber_bundle::section_evaluator::value_type fiber_bundle::bilinear_2d::volume ( const dof_type  xcoord_dofs[],
size_type  xcoord_dofs_ub,
size_type  xdf 
)
virtual

Volume for specified coordinate dofs xcoord_dofs and fiber space dimension xdf.

Precondition
  • xcoord_dofs != 0
  • xcoord_dofs_ub >= dl()*db()
  • xdf == 2 || xdf == 3
Todo:
Add method number_of_gauss_points().
Postcondition

Implements fiber_bundle::integrable_section_evaluator.

Definition at line 387 of file bilinear_2d.cc.

References integrate().

Referenced by jacobian_determinant().


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