How to define the nodes and elements in ABAQUS input file? - abaqus

I have edited an ABAQUS input file generated from the maple code written to create a 3D model for analysis. The input file is missing the nodes and element definitions. Can someone give me some example on how to edit the following code to input the model for analysis.
*HEADING
Woven Unit Cell
***NODE DEFINITION***
*NODE, NSET=NALL
***ELEMENT DEFINITION***
***MATRIX***
*ELEMENT, TYPE=C3D8, ELSET=MATRIX
***FIBERS***
*ELEMENT, TYPE=C3D8, ELSET=FIBER1
*ELEMENT, TYPE=C3D8, ELSET=FIBER2
*ELEMENT, TYPE=C3D8, ELSET=FIBER3
*ELEMENT, TYPE=C3D8, ELSET=FIBER4
*MATERIAL, NAME=MMATRIX
*ELASTIC, TYPE=ISOTROPIC
3.45E+9, 0.35
*MATERIAL, NAME=MFIBER1
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER2
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER3
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*MATERIAL, NAME=MFIBER4
*ELASTIC, TYPE=ENGINEERING CONSTANTS
1.72E+11, 4.72E+09, 4.72E+09, 0.4, 0.4, 0.4, 3.6E+10, 3.6E+10
3.6E+10
*SOLID SECTION, ELSET=MATRIX, MATERIAL=MMATRIX
*SOLID SECTION, ELSET=FIBER1, MATERIAL=MFIBER1, ORIENTATION=FTRANS
*SOLID SECTION, ELSET=FIBER2, MATERIAL=MFIBER2, ORIENTATION=FTRANS
*SOLID SECTION, ELSET=FIBER3, MATERIAL=MFIBER3, ORIENTATION=FLONG
*SOLID SECTION, ELSET=FIBER4, MATERIAL=MFIBER4, ORIENTATION=FLONG
*ORIENTATION, NAME=FLONG, SYSTEM=RECTANGULAR, DEFINITION=COORDINATES
1., 0., 0., 0., 1., 0.
*ORIENTATION, NAME=FTRANS, SYSTEM=RECTANGULAR, DEFINITION=COORDINATES
0., 1., 0., -1., 0., 0.
***NODE SETS***
*NSET, NSET=BASE
*NSET, NSET=TOP
*NSET, NSET=XMIN
*NSET, NSET=XMAX
*NSET, NSET=YMIN
*NSET, NSET=YMAX
*STEP, NLGEOM
*STATIC
*RESTART, WRITE, FREQ=1
***BOUNDARY CONDITIONS***
*BOUNDARY
BASE,3,,0.
TOP,3,,0.
XMIN,1,,0.
XMAX,1,,0.001
YMIN,2,,0.
YMAX,2,,0.
***NODE SET DEFINITION***
*ELSET, ELSET=ALLF
FIBER1,FIBER2,FIBER3,FIBER4
*END STEP

An ID followed by the coordinates identifies each node.
For one C3D8 element you need at least 8 nodes. For instance:
*NODE, NSET=NALL
1, 1., 1., 1.
2, 1., 0., 1.
3, 1., 1., 0.
4, 1., 0., 0.
5, 0., 1., 1.
6, 0., 0., 1.
7, 0., 1., 0.
8, 0., 0., 0.
Similarly, each element has an ID and the nodes in the right order.
Each C3D8 element can be created as, for instance:
*ELEMENT, TYPE=C3D8, ELSET=MATRIX
1, 5, 6, 8, 7, 1, 2, 4, 3
This scheme may help you.
** 8-node 7-----------3
** /| /|
** / | / | y
** 5-----------1 | |
** | | | | |
** | | | | |
** | 8--------|--4 0-----> x
** | / | / /
** |/ |/ /
** 6-----------2 z origin at node 8

Related

How to export global load vector in abaqus

In FEM, we needs to solve K*u=P, where K is global stiffness matrix, u is displacement, P is global load vector.
I want export global load vector, that is P.
I have a read at the manual, I add follow lines into the inp file.
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
*END STEP
After add the lines, then run the inp file, I can export the global stiffness matrix, I can see a "Job-1_STIF2.mtx" in the work directory, but there is nothing relate to global load vector. I do not know why the load vector can not be export.
Can anyone help me? Could you please modify my inp file? Or give any suggestions? Or give me an example inp that can export global load vector? Thanks for your time.
The full inp file shown as follow
*Heading
** Job name: Job-1 Model name: Job_my
** Generated by: Abaqus/CAE 2016
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1
*Node
1, 0., 0., 0.
2, 0., 10., 0.
3, 10., 0., 0.
4, 10., 10., 0.
5, 0., 0., 5.
6, 0., 10., 5.
7, 10., 0., 5.
8, 10., 10., 5.
9, 0., 0., 10.
10, 0., 10., 10.
11, 10., 0., 10.
12, 10., 10., 10.
*Element, type=C3D4
1, 1, 3, 4, 8
2, 1, 3, 8, 5
3, 3, 8, 5, 7
4, 6, 5, 1, 8
5, 6, 1, 2, 4
6, 6, 1, 4, 8
7, 5, 7, 8, 12
8, 5, 7, 12, 9
9, 7, 12, 9, 11
10, 10, 9, 5, 12
11, 10, 5, 6, 8
12, 10, 5, 8, 12
*Elset, elset=Set-1, generate
1, 12, 1
** Section: Section-1
*Solid Section, elset=Set-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1
*End Instance
**
*Nset, nset=Set-1, instance=PART-1-1, generate
1, 4, 1
*Nset, nset=Set-2, instance=PART-1-1
1, 2, 5, 6, 9, 10
*Nset, nset=Set-3, instance=PART-1-1, generate
1, 11, 2
*Elset, elset=_Surf-1_S2, internal, instance=PART-1-1
10,
*Elset, elset=_Surf-1_S3, internal, instance=PART-1-1
9,
*Surface, type=ELEMENT, name=Surf-1
_Surf-1_S2, S2
_Surf-1_S3, S3
*End Assembly
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
100.,0.3
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Displacement/Rotation
*Boundary
Set-1, 3, 3
** Name: BC-2 Type: Displacement/Rotation
*Boundary
Set-2, 1, 1
** Name: BC-3 Type: Displacement/Rotation
*Boundary
Set-3, 2, 2
** ----------------------------------------------------------------
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
1., 1., 1e-05, 1.
*Element Matrix Output,ELSET=PART-1-1.Set-1,
DLOAD=YES,File Name=element_matrix_vector,Frequency=1,Output File=User Defined,Stiffness=Yes,Mass=Yes
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
*END STEP
The load should also be defined in the step which export the matrix.
That is, the line add to generate global system matrix should be:
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
*END STEP
full inp file shown as follows:
*Heading
** Job name: Job-1 Model name: Job_my
** Generated by: Abaqus/CAE 2016
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1
*Node
1, 0., 0., 0.
2, 0., 10., 0.
3, 10., 0., 0.
4, 10., 10., 0.
5, 0., 0., 5.
6, 0., 10., 5.
7, 10., 0., 5.
8, 10., 10., 5.
9, 0., 0., 10.
10, 0., 10., 10.
11, 10., 0., 10.
12, 10., 10., 10.
*Element, type=C3D4
1, 1, 3, 4, 8
2, 1, 3, 8, 5
3, 3, 8, 5, 7
4, 6, 5, 1, 8
5, 6, 1, 2, 4
6, 6, 1, 4, 8
7, 5, 7, 8, 12
8, 5, 7, 12, 9
9, 7, 12, 9, 11
10, 10, 9, 5, 12
11, 10, 5, 6, 8
12, 10, 5, 8, 12
*Elset, elset=Set-1, generate
1, 12, 1
** Section: Section-1
*Solid Section, elset=Set-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1
*End Instance
**
*Nset, nset=Set-1, instance=PART-1-1, generate
1, 4, 1
*Nset, nset=Set-2, instance=PART-1-1
1, 2, 5, 6, 9, 10
*Nset, nset=Set-3, instance=PART-1-1, generate
1, 11, 2
*Elset, elset=_Surf-1_S2, internal, instance=PART-1-1
10,
*Elset, elset=_Surf-1_S3, internal, instance=PART-1-1
9,
*Surface, type=ELEMENT, name=Surf-1
_Surf-1_S2, S2
_Surf-1_S3, S3
*End Assembly
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
100.,0.3
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Displacement/Rotation
*Boundary
Set-1, 3, 3
** Name: BC-2 Type: Displacement/Rotation
*Boundary
Set-2, 1, 1
** Name: BC-3 Type: Displacement/Rotation
*Boundary
Set-3, 2, 2
** ----------------------------------------------------------------
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
1., 1., 1e-05, 1.
*Element Matrix Output,ELSET=PART-1-1.Set-1,
DLOAD=YES,File Name=element_matrix_vector,Frequency=1,Output File=User Defined,Stiffness=Yes,Mass=Yes
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step
*STEP
*MATRIX GENERATE, STIFFNESS, LOAD
*MATRIX OUTPUT, STIFFNESS, LOAD, FORMAT=MATRIX INPUT
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, 1.
*END STEP

How to choose Strategy in SimpleImputer

How to choose strategy ( mean, median, most_frequent, constant) in a SimpleImputer?
What exactly "constant" strategy does ?
You should refer to this documentation which contains complete description for each strategy.
constant strategy would fill the missing values with a constant which will be defined by the parameter fill_value.
Example:
imp_constant = SimpleImputer(missing_values=np.nan, strategy='constant', fill_value = 1)
imp_constant.fit_transform([[7, 2, 3], [4, np.nan, 6], [10, 5, 9]])
Orignal:
([[ 7., 2., 3.],
[ 4., nan, 6.],
[10., 5., 9.]])
Output:
([[ 7., 2., 3.],
[ 4., 1., 6.],
[10., 5., 9.]])
In the above example since I've chosen strategy='constant', therefore I need to define the constant value which needs to filled that is done using the parameter fill_value = 1. NaN occurrence would then be filled by 1.

Memory error while loading very lard data from h5 file on a cluster

I am running into a MemoryError when I attempt to load a very large dataset from an hdf5 file. I have attached a short example below.
import dask
import dask.array as da
import h5py
from dask.distributed import Client
client = Client('tcp://10.11.69.71:44393')
handle = h5py.File('h5_file.h5', 'r') # matrix size: (4500, 6291456)
a = da.from_array(handle['_data'], chunks='auto') # matrix size: (6291456, 128)
st1 = da.random.random((a.shape[1], 128))
st = client.run(start)
res = da.matmul(a, st1)
res.compute()
this results in the following error:
distributed.worker - WARNING - Compute Failed
Function: execute_task
args: ((subgraph_callable, (<function concatenate_axes at 0x2b85d304a0d0>, [array([[ 42., 50., 5., ..., 168., 203., 214.],
[129., 159., 0., ..., 187., 153., 136.],
[ 0., 0., 0., ..., 228., 209., 204.],
...,
[ 18., 28., 13., ..., 255., 227., 218.],
[ 79., 86., 61., ..., 53., 64., 55.],
[ 42., 76., 106., ..., 101., 35., 20.]], dtype=float32), array([[ 50., 60., 33., ..., 169., 204., 215.],
[ 24., 111., 0., ..., 185., 151., 133.],
[ 0., 0., 0., ..., 226., 207., 202.],
...,
[ 17., 23., 14., ..., 255., 228., 219.],
[111., 120., 101., ..., 53., 64., 55.],
[ 85., 98., 90., ..., 100., 37., 22.]], dtype=float32), array([[ 65., 61., 35., ..., 170., 205., 215.],
[215., 237., 214., ..., 184., 149., 131.],
[ 49., 42., 21., ..., 223., 205., 200.],
...,
[ 16., 20., 11., ..., 255., 229., 220.],
[ 85., 85., 69., ..., 53., 64., 54.],
[ 6
kwargs: {}
Exception: MemoryError()
Am I loading the data incorrectly? I have tried to use result as well to no avail.
PS I am using dask-mpi to create my client
Note that by calling .compute you are asking for the output of your computation to be returned to you as a single, in-memory, numpy array.
If your output is very large then you might instead want to save it to a file, using a function like to_hdf5.

How to repeat unknown dimension in TensorFlow

For example (I can do this with Theano without a problem):
std_var = T.repeat(T.exp(log_var)[None, :], Mean.shape[0], axis=0)
wrt TF Mean has shape (?, num), but log_var has shape (num,)
I don't know how to do the same in TensorFlow...
You can use shape to extract the shape of a placeholder during evaluation. Then simply tile the tensor. For instance, for:
num = 3
p1 = tf.placeholder(tf.float32, (None, num))
p2 = tf.placeholder(tf.float32, (num,))
the operation:
op = tf.tile(tf.reshape(p2, [1, -1]), (tf.shape(p1)[0], 1))
sess.run(op, feed_dict={p1:[[1,2,3],
[4,5,6]],
p2: [1,2,1]})
will give:
array([[ 1., 2., 1.],
[ 1., 2., 1.]], dtype=float32)
However, in most cases you actually do not need to do that since you can rely on the broadcasting behavior of TF operations. For instance:
op = tf.add(p1, p2)
sess.run(op, feed_dict={p1:[[1,2,3],
[4,5,6]],
p2: [1,2,1]})
gives:
array([[ 2., 4., 4.],
[ 5., 7., 7.]], dtype=float32)

Abaqus - How to apply initial conditions as plastic strain?

I m trying to apply to apply plastic strains initial conditions in Abaqus as you can see below : 
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, -0.276, -0.0618, 0.0447
**
** STEP: Step-1
This part of code works in case of Stresses but not for plastic strains... The calculation presents no errors, abaqus runs but when i check the results, it doesnt consider my plastic strain...
----EDIT LATER---
An example of INP file :
*Heading
** Job name: dernier1 Model name: test_plastic
** Generated by: Abaqus/CAE 6.13-1
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=PART-1-1
*Node
1, 0., -13.75, 3.
2, -15., -13.75, 3.
3, -30., -13.75, 3.
4, 0., -13.75, 0.
5, -15., -13.75, 0.
6, -30., -13.75, 0.
7, 0., 2.5, 3.
8, -15.3125, 2.5, 3.
9, -30.625, 2.5, 3.
10, 0., 2.5, 0.
11, -15.3125, 2.5, 0.
12, -30.625, 2.5, 0.
13, 0., 18.75, 3.
14, -15.625, 18.75, 3.
15, -31.25, 18.75, 3.
16, 0., 18.75, 0.
17, -15.625, 18.75, 0.
18, -31.25, 18.75, 0.
*Element, type=C3D8R
1, 7, 8, 11, 10, 1, 2, 5, 4
2, 8, 9, 12, 11, 2, 3, 6, 5
3, 13, 14, 17, 16, 7, 8, 11, 10
4, 14, 15, 18, 17, 8, 9, 12, 11
*Nset, nset=SET-1, generate
1, 18, 1
*Elset, elset=SET-1, generate
1, 4, 1
** Section: Section-1-SET-1
*Solid Section, elset=SET-1, material=MATERIAL-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=PART-1-1, part=PART-1-1
*End Instance
**
*Nset, nset=SET-1, instance=PART-1-1, generate
1, 6, 1
*Elset, elset=SET-1, instance=PART-1-1
1, 2
*Elset, elset="test_elements", instance=PART-1-1
1, 2
*Elset, elset=_SURF-1_S1, internal, instance=PART-1-1
3, 4
*Elset, elset=_SURF-1_S1_1, internal, instance=PART-1-1
3, 4
*Surface, type=ELEMENT, name=SURF-1
_SURF-1_S1_1, S1
*End Assembly
*Amplitude, name=AMP-1, time=TOTAL TIME, definition=PERIODIC
1, 5., 0., 0.
5., 1.
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
140000., 0.28
*Plastic
50., 0.
100., 0.2
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, 0., 0., 0.
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
5., 5., 5e-05, 5.
**
** BOUNDARY CONDITIONS
**
** Name: Disp-BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
SET-1, ENCASTRE
**
** LOADS
**
** Name: SURFFORCE-1 Type: Pressure
*Dsload, amplitude=AMP-1
SURF-1, P, -5
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step
So the only problem to get this to run was the extra set of quotes on test_elements? Not sure what the remaining problem is?
*Heading
** Job name: dernier1 Model name: test_plastic
** Generated by: Abaqus/CAE 6.13-1
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
**
*Node
1, 0., -13.75, 3.
2, -15., -13.75, 3.
3, -30., -13.75, 3.
4, 0., -13.75, 0.
5, -15., -13.75, 0.
6, -30., -13.75, 0.
7, 0., 2.5, 3.
8, -15.3125, 2.5, 3.
9, -30.625, 2.5, 3.
10, 0., 2.5, 0.
11, -15.3125, 2.5, 0.
12, -30.625, 2.5, 0.
13, 0., 18.75, 3.
14, -15.625, 18.75, 3.
15, -31.25, 18.75, 3.
16, 0., 18.75, 0.
17, -15.625, 18.75, 0.
18, -31.25, 18.75, 0.
*Element, type=C3D8R
1, 7, 8, 11, 10, 1, 2, 5, 4
2, 8, 9, 12, 11, 2, 3, 6, 5
3, 13, 14, 17, 16, 7, 8, 11, 10
4, 14, 15, 18, 17, 8, 9, 12, 11
*Nset, nset=SET-1, generate
1, 18, 1
*Elset, elset=SET-1, generate
1, 4, 1
** Section: Section-1-SET-1
*Solid Section, elset=SET-1, material=MATERIAL-1
,
**
*Nset, nset=SET-1, generate
1, 6, 1
*Elset, elset=SET-1
1, 2
*Elset, elset=test_elements
1, 2
*Elset, elset=_SURF-1_S1
3, 4
*Elset, elset=_SURF-1_S1_1
3, 4
*Surface, type=ELEMENT, name=SURF-1
_SURF-1_S1_1, S1
*End Assembly
*Amplitude, name=AMP-1, time=TOTAL TIME, definition=PERIODIC
1, 5., 0., 0.
5., 1.
**
** MATERIALS
**
*Material, name=MATERIAL-1
*Elastic
140000., 0.28
*Plastic
50., 0.
100., 0.2
** ----------------------------------------------------------------
*Initial Conditions, type=PLASTIC STRAIN
test_elements, 0.338, 0., 0., 0.
**
** STEP: Step-1
**
*Step, name=Step-1, nlgeom=NO
*Static
5., 5., 5e-05, 5.
**
** BOUNDARY CONDITIONS
**
** Name: Disp-BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
SET-1, ENCASTRE
**
** LOADS
**
** Name: SURFFORCE-1 Type: Pressure
*Dsload, amplitude=AMP-1
SURF-1, P, -5
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step

Resources