# SinglePointCalculator **Repository Path**: withmc/spc ## Basic Information - **Project Name**: SinglePointCalculator - **Description**: Single Point Calculator - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-09-19 - **Last Updated**: 2022-09-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README SinglePointCalculator is a single material point calculator used to test constitutive models. It calculates the first Piola Kirchhoff stress and/or the deformation gradient. Strain, stress, or mixed control are implemented. # Problem definition To use the solver, it should at first define two problem files. ## charge.txt This file is about the loading of the material point. It contains 2*N lines and 9 colomns. N is the number of period. For each period, the first line is about the control information (0 for strain contrl and 1 for stress control), and the second line is the increment of components of the deformation gradient or the stress. A example is given as: ``` #charge type 0--dF,1--dP 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 #charge 11 12 13 21 22 23 31 32 33 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 # 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 #charge 11 12 13 21 22 23 31 32 33 -2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ``` where "#" notes comments. In this example, two periods of mixed loading are prescribed. F11 goes from 1.0 to 3.0 in the first period and comes back to 1.0 in the second period. P12, P13, P21, P22, P23, P31, P32, P33 are posed to be zero. ## material.txt This file is about the material paremters. It must contains 9 colomns, at least two lines. A example is given as ``` #0--mode(0:solo,1:mix), 1--common lines, 2--lines for each phase, 3--num phases, more--no use 0.0 3.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 # # common parameters for solo mode===================================== 106750.0 60410.0 28340.0 100.0 1000000.0 0.0 63.0 0.1 1.0 1.4 1.0 1.0 0.0 10.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 # # parameters for each phase=========================================== 128.0 40.0 37.0 0.0 0.0 0.0 0.0 0.0 0.0 ``` The comments explain well. Note that the first line is the marker for the program to load the material parameters. In this line the first number is useless. The second, third, and the fourth one correpond to the following lines. The meaning of the material parameters depends on the constitutive models. # Running the calcuation Put material.txt and charge.txt in a folder (here, denotes as the problem path), then write a script to run the calculation. A example is ``` import sys sys.path.append("..") import spc.calculator as spc path = "test02/" aa = spc.SinglePointCalculator(path) aa.calculate(("manik2022",),increment=1000) ``` The problem path is `"test02/"`. A class `SinglePointCalculator` is defined in calculator.py. Run the calcuation by executing the function `calculate()`. Here, the `manik2022` model is used to calculate the loading in 1000 steps. Constitutive model demos are in the folder `spc/constitutive/`. Examples are given in `test/`