Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/lsw9021/DexterousManipulation
13 October 2021, 00:36:27 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 7cca30f
  • /
  • fem
  • /
  • Constraint
  • /
  • LinearMuscleCst.h
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:7f9343121f11653a494e3a54b60135edd565810a
origin badgedirectory badge
swh:1:dir:7adf1921f8bba74d9a0923d92249b1e3d98bdf1e
origin badgerevision badge
swh:1:rev:11269e20e5283c3f31b6ce1ea9a4805c8bdeecac
origin badgesnapshot badge
swh:1:snp:39de196a0865c6816c958d6b123bc74f85735191

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 11269e20e5283c3f31b6ce1ea9a4805c8bdeecac authored by Lee Seung Hwan on 07 October 2021, 05:40:43 UTC
Create LICENSE
Tip revision: 11269e2
LinearMuscleCst.h
#ifndef __LINEAR_MUSCLE_CONSTRAINT_H__
#define __LINEAR_MUSCLE_CONSTRAINT_H__
#include "../Tensor3333.h"
#include "Cst.h"
#include <Eigen/Core>
#include <Eigen/Sparse>
#include <Eigen/Geometry>
namespace Eigen {

typedef Matrix<double, 12, 1> Vector12d;
typedef Matrix<double, 12, 12> Matrix12d;
};
namespace FEM
{


class LinearMuscleCst : public Cst
{
public:
	
	void EvaluatePotentialEnergy(const Eigen::VectorXd& x) override;
	void EvaluateGradient(const Eigen::VectorXd& x) override;
	void EvaluateHessian(const Eigen::VectorXd& x) override;
	void GetPotentialEnergy(double& e) override;
	void GetGradient(Eigen::VectorXd& g) override;
	void GetHessian(std::vector<Eigen::Triplet<double>>& h_triplets) override;
	void Evaluatedgda(const Eigen::VectorXd& x);
	void Getdgda(Eigen::VectorXd& dgda);
	void EvaluateDVector(const Eigen::VectorXd& x) override;
	void GetDVector(int& index,Eigen::VectorXd& d) override;
	void EvaluateJMatrix(int& index, std::vector<Eigen::Triplet<double>>& J_triplets) override;
	void EvaluateLMatrix(std::vector<Eigen::Triplet<double>>& L_triplets) override;
	int GetNumHessianTriplets() override;
	void AddOffset(int offset) override;



	int GetI0() {return mi0;}
	int GetI1() {return mi1;}
	int GetI2() {return mi2;}
	int GetI3() {return mi3;}

	Eigen::Vector3d GetFiberDirection() {return mFiberDirection;}
	double GetActivationLevel() {return mActivationLevel;}
	void SetActivationLevel(double a) { mActivationLevel = a;}

	LinearMuscleCst(const LinearMuscleCst& other) = delete;
	LinearMuscleCst& operator=(const LinearMuscleCst& other) = delete;
	std::shared_ptr<Cst> Clone() override;
	static std::shared_ptr<LinearMuscleCst> Create(const std::string& name,double k,int i0,int i1,int i2,int i3,double volume,const Eigen::Matrix3d& invDm,const Eigen::Vector3d& fiber_direction);
protected:
	LinearMuscleCst(const std::string& name,double k,int i0,int i1,int i2,int i3,double volume,const Eigen::Matrix3d& invDm,const Eigen::Vector3d& fiber_direction);
	int mi0,mi1,mi2,mi3;
	double mVolume;
	Eigen::Matrix3d mInvDm;
	Eigen::Vector3d mFiberDirection;
	double mActivationLevel;
	//For parallization
	double 		mE;
	Eigen::Vector12d mg;
	Eigen::Matrix12d mH;
	Eigen::Matrix3d md;
	Eigen::Vector12d mdgda;

	//For Cache
	Eigen::Vector12d mX;
	Eigen::Matrix3d mF;
	Eigen::Vector3d mp0;
	
	void ComputeF(const Eigen::VectorXd& x);
	void ComputeP(Eigen::Matrix3d& P);
	void ComputedPdF(Tensor3333& dPdF);
	void Computep0();
	void Computedp0(Eigen::Vector3d& dp0);
};
};

#endif

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API