Poster of Linux kernelThe best gift for a Linux geek
DiffContext

DiffContext

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

DiffContext -  

SYNOPSIS


#include <diff_context.h>

Inherited by FEMContext.  

Public Member Functions


DiffContext (const DifferentiableSystem &)

virtual ~DiffContext ()

virtual void elem_reinit (Real)

virtual void elem_side_reinit (Real)
 

Public Attributes


bool postprocess_sides

Real time

DenseVector< Number > elem_solution

std::vector< DenseSubVector< Number > * > elem_subsolutions

DenseVector< Number > elem_fixed_solution

std::vector< DenseSubVector< Number > * > elem_fixed_subsolutions

bool request_jacobian

Real elem_solution_derivative

Real fixed_solution_derivative

DenseVector< Number > elem_residual

DenseMatrix< Number > elem_jacobian

std::vector< DenseSubVector< Number > * > elem_subresiduals

std::vector< std::vector< DenseSubMatrix< Number > * > > elem_subjacobians

std::vector< unsigned int > dof_indices

std::vector< std::vector< unsigned int > > dof_indices_var
 

Detailed Description

This class provides all data required for a physics package (e.g. a DifferentiableSystem subclass) to perform local element residual and jacobian integrations.

This class is part of the new DifferentiableSystem framework, which is still experimental. Users of this framework should beware of bugs and future API changes.

Author:

Roy H. Stogner 2009

Definition at line 52 of file diff_context.h.  

Constructor & Destructor Documentation

 

DiffContext::DiffContext (const DifferentiableSystem &sys)Constructor. Optionally initializes required data structures.

Definition at line 26 of file diff_context.C.

References elem_fixed_solution, elem_fixed_subsolutions, elem_jacobian, elem_residual, elem_solution, elem_subjacobians, elem_subresiduals, elem_subsolutions, System::n_vars(), and DifferentiableSystem::use_fixed_solution.

                                                         :
  time(sys.time),
  elem_solution_derivative(1.),
  fixed_solution_derivative(0.),
  dof_indices_var(sys.n_vars())
{
  // Finally initialize solution/residual/jacobian data structures
  unsigned int n_vars = sys.n_vars();

  elem_subsolutions.reserve(n_vars);
  elem_subresiduals.reserve(n_vars);
  elem_subjacobians.resize(n_vars);
  if (sys.use_fixed_solution)
    elem_fixed_subsolutions.reserve(n_vars);

  for (unsigned int i=0; i != n_vars; ++i)
    {
      elem_subsolutions.push_back(new DenseSubVector<Number>(elem_solution));
      elem_subresiduals.push_back(new DenseSubVector<Number>(elem_residual));
      elem_subjacobians[i].reserve(n_vars);

      if (sys.use_fixed_solution)
        elem_fixed_subsolutions.push_back
          (new DenseSubVector<Number>(elem_fixed_solution));

      for (unsigned int j=0; j != n_vars; ++j)
        elem_subjacobians[i].push_back
          (new DenseSubMatrix<Number>(elem_jacobian));
    }
}
 

DiffContext::~DiffContext () [virtual]Destructor.

Definition at line 59 of file diff_context.C.

References elem_fixed_subsolutions, elem_subjacobians, elem_subresiduals, and elem_subsolutions.

{
  for (unsigned int i=0; i != elem_subsolutions.size(); ++i)
    {
      delete elem_subsolutions[i];
      delete elem_subresiduals[i];
      if (!elem_fixed_subsolutions.empty())
        delete elem_fixed_subsolutions[i];

      for (unsigned int j=0; j != elem_subjacobians[i].size(); ++j)
        delete elem_subjacobians[i][j];
    }
}
 

Member Function Documentation

 

virtual void DiffContext::elem_reinit (Real) [inline, virtual]Gives derived classes the opportunity to reinitialize data (FE objects in FEMSystem, for example) needed for an interior integration at a new point within a timestep

Reimplemented in FEMContext.

Definition at line 78 of file diff_context.h.

Referenced by EulerSolver::element_residual(), and Euler2Solver::element_residual().

{}
 

virtual void DiffContext::elem_side_reinit (Real) [inline, virtual]Gives derived classes the opportunity to reinitialize data needed for a side integration at a new point within a timestep

Reimplemented in FEMContext.

Definition at line 84 of file diff_context.h.

Referenced by EulerSolver::side_residual(), and Euler2Solver::side_residual().

{}
 

Member Data Documentation

 

std::vector<unsigned int> DiffContext::dof_indicesGlobal Degree of freedom index lists

Definition at line 148 of file diff_context.h.

Referenced by FEMSystem::assemble_qoi_derivative(), FEMSystem::assembly(), EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMContext::fixed_interior_gradient(), FEMContext::fixed_interior_hessian(), FEMContext::fixed_interior_value(), FEMContext::fixed_point_value(), FEMContext::fixed_side_gradient(), FEMContext::fixed_side_hessian(), FEMContext::fixed_side_value(), FEMContext::interior_gradient(), FEMContext::interior_hessian(), FEMContext::interior_value(), FEMSystem::numerical_jacobian(), FEMContext::point_value(), FEMContext::reinit(), FEMContext::side_gradient(), FEMContext::side_hessian(), EulerSolver::side_residual(), Euler2Solver::side_residual(), and FEMContext::side_value().  

std::vector<std::vector<unsigned int> > DiffContext::dof_indices_var

Definition at line 149 of file diff_context.h.

Referenced by FEMSystem::eulerian_residual(), FEMContext::fixed_interior_gradient(), FEMContext::fixed_interior_hessian(), FEMContext::fixed_interior_value(), FEMContext::fixed_point_value(), FEMContext::fixed_side_gradient(), FEMContext::fixed_side_hessian(), FEMContext::fixed_side_value(), FEMContext::interior_gradient(), FEMContext::interior_hessian(), FEMContext::interior_value(), FEMSystem::mass_residual(), FEMSystem::mesh_position_get(), FEMSystem::numerical_jacobian(), FEMContext::point_value(), FEMContext::reinit(), FEMContext::side_gradient(), FEMContext::side_hessian(), and FEMContext::side_value().  

DenseVector<Number> DiffContext::elem_fixed_solutionElement by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g. stabilized methods

Definition at line 105 of file diff_context.h.

Referenced by DiffContext(), SteadySolver::element_residual(), EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMContext::reinit(), SteadySolver::side_residual(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

std::vector<DenseSubVector<Number> *> DiffContext::elem_fixed_subsolutions

Definition at line 106 of file diff_context.h.

Referenced by DiffContext(), FEMContext::fixed_interior_gradient(), FEMContext::fixed_interior_hessian(), FEMContext::fixed_interior_value(), FEMContext::fixed_point_value(), FEMContext::fixed_side_gradient(), FEMContext::fixed_side_hessian(), FEMContext::fixed_side_value(), FEMContext::reinit(), and ~DiffContext().  

DenseMatrix<Number> DiffContext::elem_jacobianElement jacobian: derivatives of elem_residual with respect to elem_solution

Definition at line 137 of file diff_context.h.

Referenced by FEMSystem::assembly(), DiffContext(), EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMSystem::numerical_jacobian(), FEMContext::reinit(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

DenseVector<Number> DiffContext::elem_residualElement residual vector

Definition at line 131 of file diff_context.h.

Referenced by FEMSystem::assemble_qoi_derivative(), FEMSystem::assembly(), DiffContext(), EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMSystem::numerical_jacobian(), FEMContext::reinit(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

DenseVector<Number> DiffContext::elem_solutionElement by element components of nonlinear_solution as adjusted by a time_solver

Definition at line 97 of file diff_context.h.

Referenced by DiffContext(), SteadySolver::element_residual(), EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMSystem::numerical_jacobian(), FEMContext::reinit(), SteadySolver::side_residual(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

Real DiffContext::elem_solution_derivativeThe derivative of elem_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods

Definition at line 119 of file diff_context.h.

Referenced by EulerSolver::element_residual(), Euler2Solver::element_residual(), FEMSystem::mass_residual(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

std::vector<std::vector<DenseSubMatrix<Number> *> > DiffContext::elem_subjacobians

Definition at line 143 of file diff_context.h.

Referenced by DiffContext(), FEMSystem::eulerian_residual(), FEMSystem::mass_residual(), FEMContext::reinit(), and ~DiffContext().  

std::vector<DenseSubVector<Number> *> DiffContext::elem_subresidualsElement residual subvectors and Jacobian submatrices

Definition at line 142 of file diff_context.h.

Referenced by DiffContext(), FEMSystem::eulerian_residual(), FEMSystem::mass_residual(), FEMContext::reinit(), and ~DiffContext().  

std::vector<DenseSubVector<Number> *> DiffContext::elem_subsolutions

Definition at line 98 of file diff_context.h.

Referenced by DiffContext(), FEMContext::elem_position_get(), FEMContext::elem_position_set(), FEMContext::interior_gradient(), FEMContext::interior_hessian(), FEMContext::interior_value(), FEMSystem::mesh_position_get(), FEMContext::point_value(), FEMContext::reinit(), FEMContext::side_gradient(), FEMContext::side_hessian(), FEMContext::side_value(), and ~DiffContext().  

Real DiffContext::fixed_solution_derivativeThe derivative of elem_fixed_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods

Definition at line 126 of file diff_context.h.

Referenced by SteadySolver::element_residual(), EulerSolver::element_residual(), Euler2Solver::element_residual(), SteadySolver::side_residual(), EulerSolver::side_residual(), and Euler2Solver::side_residual().  

bool DiffContext::postprocess_sidesIf postprocess_sides is true (it is false by default), the postprocessing loop will loop over all sides as well as all elements.

Definition at line 71 of file diff_context.h.  

bool DiffContext::request_jacobianA boolean to be set to true by the library whenever a jacobian evaluation is being requested.

Definition at line 112 of file diff_context.h.  

Real DiffContext::timeFor time-dependent problems, this is the time t for which the current nonlinear_solution is defined. FIXME - this needs to be tweaked mid-timestep by all transient solvers!

Definition at line 91 of file diff_context.h.

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Public Attributes
Detailed Description
Constructor & Destructor Documentation
DiffContext::DiffContext (const DifferentiableSystem &sys)Constructor. Optionally initializes required data structures.
DiffContext::~DiffContext () [virtual]Destructor.
Member Function Documentation
virtual void DiffContext::elem_reinit (Real) [inline, virtual]Gives derived classes the opportunity to reinitialize data (FE objects in FEMSystem, for example) needed for an interior integration at a new point within a timestep
virtual void DiffContext::elem_side_reinit (Real) [inline, virtual]Gives derived classes the opportunity to reinitialize data needed for a side integration at a new point within a timestep
Member Data Documentation
std::vector<unsigned int> DiffContext::dof_indicesGlobal Degree of freedom index lists
std::vector<std::vector<unsigned int> > DiffContext::dof_indices_var
DenseVector<Number> DiffContext::elem_fixed_solutionElement by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g. stabilized methods
std::vector<DenseSubVector<Number> *> DiffContext::elem_fixed_subsolutions
DenseMatrix<Number> DiffContext::elem_jacobianElement jacobian: derivatives of elem_residual with respect to elem_solution
DenseVector<Number> DiffContext::elem_residualElement residual vector
DenseVector<Number> DiffContext::elem_solutionElement by element components of nonlinear_solution as adjusted by a time_solver
Real DiffContext::elem_solution_derivativeThe derivative of elem_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods
std::vector<std::vector<DenseSubMatrix<Number> *> > DiffContext::elem_subjacobians
std::vector<DenseSubVector<Number> *> DiffContext::elem_subresidualsElement residual subvectors and Jacobian submatrices
std::vector<DenseSubVector<Number> *> DiffContext::elem_subsolutions
Real DiffContext::fixed_solution_derivativeThe derivative of elem_fixed_solution with respect to the nonlinear solution, for use by systems constructing jacobians with elem_fixed_solution based methods
bool DiffContext::postprocess_sidesIf postprocess_sides is true (it is false by default), the postprocessing loop will loop over all sides as well as all elements.
bool DiffContext::request_jacobianA boolean to be set to true by the library whenever a jacobian evaluation is being requested.
Real DiffContext::timeFor time-dependent problems, this is the time t for which the current nonlinear_solution is defined. FIXME - this needs to be tweaked mid-timestep by all transient solvers!
Author

This document was created by man2html, using the manual pages.
Time: 21:45:00 GMT, April 16, 2011