NetDEM v1.0
Loading...
Searching...
No Matches
netdem::ContactModelFactory Class Reference

A factory class for creating contact models. More...

#include <contact_model_factory.hpp>

Static Public Member Functions

static ContactModelNewContactModel (std::string const &model_name, nlohmann::json const &js)
 Create a new instance of a contact model by name and configuration data.
 

Static Public Attributes

static std::unordered_map< std::string, ContactModel::Typemodel_map
 

Detailed Description

A factory class for creating contact models.

This class provides a set of static methods for creating new instances of contact models, based on a specified name and configuration data in JSON format. The mapping between model names and their corresponding ContactModel::Type enumeration values is stored in a static unordered map.

Member Function Documentation

◆ NewContactModel()

ContactModel * ContactModelFactory::NewContactModel ( std::string const & model_name,
nlohmann::json const & js )
static

Create a new instance of a contact model by name and configuration data.

Given a string specifying the name of a contact model and a JSON object containing configuration data for the model, this function creates a new instance of the appropriate ContactModel subclass and returns a pointer to it.

Parameters
model_nameThe name of the contact model to create.
jsA JSON object containing configuration data for the contact model.
Returns
A pointer to a new instance of the requested contact model.

Member Data Documentation

◆ model_map

unordered_map< string, ContactModel::Type > ContactModelFactory::model_map
static
Initial value:
= {
@ parallel_bond
Definition contact_model.hpp:28
@ linear_spring
Definition contact_model.hpp:28
@ hertz_mindlin
Definition contact_model.hpp:28
@ volume_based
Definition contact_model.hpp:28

A mapping between contact model names and their corresponding ContactModel::Type enumeration values.


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