I want to use anisotropic material for each node, and get potential at each node based on laplace equation.
now I'm using StatCurrentSolver for this aim. but got this error:
"Program received signal SIGSEGV: Segmentation fault - invalid memory reference."
The user defined function that I'm using :
Code: Select all
FUNCTION anisotropy(Model, n, f) RESULT(g)
USE DefUtils
TYPE(Nodes_t) :: ElementNodes
TYPE(Model_t) :: Model
integer :: stat, n
LOGICAL, SAVE :: Visited = .FALSE.
REAL(KIND=dp), dimension(:), ALLOCATABLE :: g
REAL(KIND=dp), ALLOCATABLE, SAVE :: gall(:,:)
IF(.NOT. Visited) THEN
! populate some table "gall"
m = Model % Mesh % NumberOfNodes
ALLOCATE(gall(m,9))
OPEN(newunit=io1, file="data.dat", status="old", action="read")
READ(io1, *,iostat=stat) gall(1:m,:)
allocate(g(9))
CLOSE(io1)
Visited = .TRUE.
END IF
g = gall(n,:)
print *, g
END FUNCTION anisotropy
Code: Select all
Electric Conductivity(9) = Variable Potential
Real Procedure "anisotropy" "anisotropy"