PolyFEM
Loading...
Searching...
No Matches
polyfem::problem::KernelProblem Class Reference

#include <KernelProblem.hpp>

Inheritance diagram for polyfem::problem::KernelProblem:
[legend]
Collaboration diagram for polyfem::problem::KernelProblem:
[legend]

Public Member Functions

 KernelProblem (const std::string &name, const assembler::Assembler &assembler)
 
VectorNd eval_fun (const VectorNd &pt, const double t) const override
 
AutodiffGradPt eval_fun (const AutodiffGradPt &pt, const double t) const override
 
AutodiffHessianPt eval_fun (const AutodiffHessianPt &pt, const double t) const override
 
void rhs (const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
 
void set_parameters (const json &params) override
 
bool is_scalar () const override
 
- Public Member Functions inherited from polyfem::problem::ProblemWithSolution
 ProblemWithSolution (const std::string &name)
 
virtual void dirichlet_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
 
virtual void exact (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
 
virtual void exact_grad (const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
 
virtual bool has_exact_sol () const override
 
virtual bool is_rhs_zero () const override
 
virtual ~ProblemWithSolution ()
 
- Public Member Functions inherited from polyfem::assembler::Problem
 Problem (const std::string &name)
 
virtual void set_units (const assembler::Assembler &assembler, const Units &units)
 
virtual ~Problem ()
 
virtual void init (const mesh::Mesh &mesh)
 
const std::string & name () const
 
virtual void neumann_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const Eigen::MatrixXd &normals, const double t, Eigen::MatrixXd &val) const
 
virtual void pressure_bc (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const Eigen::MatrixXd &normals, const double t, Eigen::MatrixXd &val) const
 
virtual double pressure_cavity_bc (const int boundary_id, const double t) const
 
virtual bool is_boundary_pressure (const int boundary_id) const
 
virtual void dirichlet_nodal_value (const mesh::Mesh &mesh, const int node_id, const RowVectorNd &pt, const double t, Eigen::MatrixXd &val) const
 
virtual void neumann_nodal_value (const mesh::Mesh &mesh, const int node_id, const RowVectorNd &pt, const Eigen::MatrixXd &normal, const double t, Eigen::MatrixXd &val) const
 
virtual bool is_nodal_dirichlet_boundary (const int n_id, const int tag)
 
virtual bool is_nodal_neumann_boundary (const int n_id, const int tag)
 
virtual bool has_nodal_dirichlet ()
 
virtual bool has_nodal_neumann ()
 
virtual void clear ()
 
virtual bool is_time_dependent () const
 
virtual bool is_constant_in_time () const
 
virtual void initial_solution (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_velocity (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_acceleration (const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual void initial_density (const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const
 
virtual bool might_have_no_dirichlet ()
 
virtual bool is_dimension_dirichet (const int tag, const int dim) const
 
virtual bool is_nodal_dimension_dirichlet (const int n_id, const int tag, const int dim) const
 
virtual bool all_dimensions_dirichlet () const
 
void setup_bc (const mesh::Mesh &mesh, const int n_bases, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< basis::ElementBases > &pressure_bases, std::vector< mesh::LocalBoundary > &local_boundary, std::vector< int > &boundary_nodes, std::vector< mesh::LocalBoundary > &local_neumann_boundary, std::vector< mesh::LocalBoundary > &local_pressure_boundary, std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, std::vector< int > &pressure_boundary_nodes, std::vector< int > &dirichlet_nodes, std::vector< int > &neumann_nodes)
 
virtual void update_nodes (const Eigen::VectorXi &in_node_to_node)
 

Private Attributes

const assembler::Assemblerassembler_
 
int n_kernels_ = 5
 
double kernel_distance_ = 0.05
 
Eigen::VectorXd kernel_weights_
 

Additional Inherited Members

- Protected Member Functions inherited from polyfem::problem::ProblemWithSolution
virtual int size_for (const Eigen::MatrixXd &pts) const
 
- Protected Attributes inherited from polyfem::assembler::Problem
std::vector< int > boundary_ids_
 
std::vector< int > neumann_boundary_ids_
 
std::vector< int > normal_aligned_neumann_boundary_ids_
 
std::vector< int > pressure_boundary_ids_
 
std::vector< int > pressure_cavity_ids_
 
std::vector< int > splitting_pressure_boundary_ids_
 

Detailed Description

Definition at line 15 of file KernelProblem.hpp.

Constructor & Destructor Documentation

◆ KernelProblem()

polyfem::problem::KernelProblem::KernelProblem ( const std::string &  name,
const assembler::Assembler assembler 
)

Definition at line 11 of file KernelProblem.cpp.

Member Function Documentation

◆ eval_fun() [1/3]

AutodiffGradPt polyfem::problem::KernelProblem::eval_fun ( const AutodiffGradPt pt,
const double  t 
) const
overridevirtual

Implements polyfem::problem::ProblemWithSolution.

Definition at line 34 of file KernelProblem.cpp.

References assembler_, is_scalar(), polyfem::assembler::Assembler::kernel(), kernel_distance_, kernel_weights_, and n_kernels_.

Here is the call graph for this function:

◆ eval_fun() [2/3]

AutodiffHessianPt polyfem::problem::KernelProblem::eval_fun ( const AutodiffHessianPt pt,
const double  t 
) const
inlineoverridevirtual

Implements polyfem::problem::ProblemWithSolution.

Definition at line 22 of file KernelProblem.hpp.

◆ eval_fun() [3/3]

VectorNd polyfem::problem::KernelProblem::eval_fun ( const VectorNd pt,
const double  t 
) const
overridevirtual

Implements polyfem::problem::ProblemWithSolution.

Definition at line 16 of file KernelProblem.cpp.

References eval_fun(), and DiffScalarBase::setVariableCount().

Referenced by eval_fun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_scalar()

bool polyfem::problem::KernelProblem::is_scalar ( ) const
overridevirtual

Implements polyfem::assembler::Problem.

Definition at line 231 of file KernelProblem.cpp.

References assembler_, and polyfem::assembler::Assembler::is_tensor().

Referenced by eval_fun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rhs()

void polyfem::problem::KernelProblem::rhs ( const assembler::Assembler assembler,
const Eigen::MatrixXd &  pts,
const double  t,
Eigen::MatrixXd &  val 
) const
overridevirtual

Reimplemented from polyfem::problem::ProblemWithSolution.

Definition at line 203 of file KernelProblem.cpp.

References polyfem::problem::ProblemWithSolution::size_for(), and val.

Here is the call graph for this function:

◆ set_parameters()

void polyfem::problem::KernelProblem::set_parameters ( const json params)
overridevirtual

Reimplemented from polyfem::assembler::Problem.

Definition at line 210 of file KernelProblem.cpp.

References kernel_distance_, kernel_weights_, and n_kernels_.

Member Data Documentation

◆ assembler_

const assembler::Assembler& polyfem::problem::KernelProblem::assembler_
private

Definition at line 34 of file KernelProblem.hpp.

Referenced by eval_fun(), and is_scalar().

◆ kernel_distance_

double polyfem::problem::KernelProblem::kernel_distance_ = 0.05
private

Definition at line 36 of file KernelProblem.hpp.

Referenced by eval_fun(), and set_parameters().

◆ kernel_weights_

Eigen::VectorXd polyfem::problem::KernelProblem::kernel_weights_
private

Definition at line 37 of file KernelProblem.hpp.

Referenced by eval_fun(), and set_parameters().

◆ n_kernels_

int polyfem::problem::KernelProblem::n_kernels_ = 5
private

Definition at line 35 of file KernelProblem.hpp.

Referenced by eval_fun(), and set_parameters().


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