PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::Density Class Reference

#include <MatParams.hpp>

Inheritance diagram for polyfem::assembler::Density:
[legend]

Public Member Functions

 Density ()
 
virtual ~Density ()=default
 
virtual bool is_constant () const
 Each material entry is independent of coordinates, time and index.
 
virtual bool is_time_dependent () const
 
virtual void add_multimaterial (const int index, const json &params, const std::string &density_unit, const io::ResourceIO &resources)
 
virtual double operator() (double px, double py, double pz, double x, double y, double z, double t, int el_id) const
 
virtual double operator() (const Eigen::MatrixXd &param, const Eigen::MatrixXd &p, double t, int el_id) const
 

Private Member Functions

void set_rho (const json &rho)
 

Private Attributes

std::vector< utils::ExpressionValue > rho_
 
std::size_t nonconstant_count_ = 0
 
std::size_t time_dependent_count_ = 0
 

Detailed Description

Definition at line 116 of file MatParams.hpp.

Constructor & Destructor Documentation

◆ Density()

polyfem::assembler::Density::Density ( )

Definition at line 529 of file MatParams.cpp.

References rho_.

◆ ~Density()

virtual polyfem::assembler::Density::~Density ( )
virtualdefault

Member Function Documentation

◆ add_multimaterial()

void polyfem::assembler::Density::add_multimaterial ( const int  index,
const json &  params,
const std::string &  density_unit,
const io::ResourceIO &  resources 
)
virtual

Reimplemented in polyfem::assembler::NoDensity, and polyfem::assembler::ThermalMassDensity.

Definition at line 556 of file MatParams.cpp.

References polyfem::assembler::MATERIAL_ELEMENT_INDEX, nonconstant_count_, rho_, and time_dependent_count_.

Referenced by polyfem::assembler::NavierStokesFSIVelocity::add_multimaterial(), and polyfem::assembler::NavierStokesFSIInertia::add_multimaterial().

Here is the caller graph for this function:

◆ is_constant()

bool polyfem::assembler::Density::is_constant ( ) const
virtual

Each material entry is independent of coordinates, time and index.

Densities may differ between materials. Custom evaluators must override these queries.

Reimplemented in polyfem::assembler::NoDensity, and polyfem::assembler::ThermalMassDensity.

Definition at line 535 of file MatParams.cpp.

References nonconstant_count_.

Referenced by polyfem::assembler::Mass::assemble().

Here is the caller graph for this function:

◆ is_time_dependent()

bool polyfem::assembler::Density::is_time_dependent ( ) const
virtual

Reimplemented in polyfem::assembler::NoDensity, and polyfem::assembler::ThermalMassDensity.

Definition at line 540 of file MatParams.cpp.

References time_dependent_count_.

Referenced by polyfem::assembler::RhsAssembler::is_rhs_time_dependent().

Here is the caller graph for this function:

◆ operator()() [1/2]

virtual double polyfem::assembler::Density::operator() ( const Eigen::MatrixXd &  param,
const Eigen::MatrixXd &  p,
double  t,
int  el_id 
) const
inlinevirtual

Definition at line 130 of file MatParams.hpp.

◆ operator()() [2/2]

double polyfem::assembler::Density::operator() ( double  px,
double  py,
double  pz,
double  x,
double  y,
double  z,
double  t,
int  el_id 
) const
virtual

Reimplemented in polyfem::assembler::NoDensity, and polyfem::assembler::ThermalMassDensity.

Definition at line 545 of file MatParams.cpp.

References rho_, x, y, and z.

◆ set_rho()

void polyfem::assembler::Density::set_rho ( const json &  rho)
private

Member Data Documentation

◆ nonconstant_count_

std::size_t polyfem::assembler::Density::nonconstant_count_ = 0
private

Definition at line 143 of file MatParams.hpp.

Referenced by add_multimaterial(), and is_constant().

◆ rho_

std::vector<utils::ExpressionValue> polyfem::assembler::Density::rho_
private

Definition at line 142 of file MatParams.hpp.

Referenced by add_multimaterial(), Density(), and operator()().

◆ time_dependent_count_

std::size_t polyfem::assembler::Density::time_dependent_count_ = 0
private

Definition at line 144 of file MatParams.hpp.

Referenced by add_multimaterial(), and is_time_dependent().


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