Git Product home page Git Product logo

ts-fem's Introduction

fem.ts

Typescript finite element module.

Available analyses

  • Linear elastic with multiple load cases

Supported elements

Boundary conditions

  • Concentrated nodal load
  • Uniform distributed force load
  • Prescribed displacements

Getting started

import {Beam2D, Material, CrossSection, Domain, DofID, Node, Element, Solver, BeamElementUniformEdgeLoad} from '../src/fem';
// Setup model of cantilever beam (in xz plane)
let solver = new Solver();
let domain = solver.domain;
domain.createNode(1, [0,0,0], [DofID.Dx, DofID.Dz,DofID.Ry]); // clamped node
domain.createNode(5, [3,0,0] ); // free node
domain.createBeam2D(10, [1,5], 1, 1); 
domain.createCrossSection(1, { a: 0.06, iy: 0.00045, iz: 0.00025, dyz: 0.0001, h: 0.3, k: 0.8333, j: 0.0007 });
domain.createMaterial(1, { e: 3.e7, g: 1.e7, alpha: 1.2e-5, d: 2.5e3 });
solver.loadCases[0].createBeamElementUniformEdgeLoad(10, [1,1], false);
solver.solve();
// print some results
console.log("Node 1 displacements: ", domain.nodes.get(1).getUnknowns(solver.loadCases[0], [DofID.Dx, DofID.Dz, DofID.Ry]));
console.log("Node 5 displacements: ", domain.nodes.get(5).getUnknowns(solver.loadCases[0], [DofID.Dx, DofID.Dz, DofID.Ry]));
console.log("Element 1 end forces: ", (<Beam2D>domain.elements.get(10)).computeEndForces(solver.loadCases[0]));
console.log("Reactions in node 1:", domain.getNode(1).getReactions(solver.loadCases[0]));

Author

Bořek Patzák ([email protected])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.