21.01.2015 Views

COMSOL Multiphysics™

COMSOL Multiphysics™

COMSOL Multiphysics™

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

eleqw<br />

Purpose<br />

eleqw<br />

Define weak form contributions.<br />

Syntax<br />

Description<br />

el.elem = 'eleqw'<br />

el.g{ig} = geomnum<br />

el.geomdim{ig}{edim}.ind{eldomgrp} = domainlist<br />

el.geomdim{ig}{edim}.coeff{eldomgrp}{iequ} = weak<br />

el.geomdim{ig}{edim}.tcoeff{eldomgrp}{iequ} = dweak<br />

el.geomdim{ig}{edim}.ipoints{eldomgrp}{iequ} = ipind<br />

The eleqw element adds weak form contributions to the FEM problem. For the<br />

syntax of the ind field, see elempty. The weak and dweak coefficients have the same<br />

syntax as the corresponding fields in the standard fem struct syntax. See further the<br />

section “Specifying a Model” in the <strong>COMSOL</strong> Multiphysics Scripting Guide. The<br />

ipoints field differs from the gporder fields in the standard syntax (for example,<br />

fem.equ.gporder) in that it always contains pattern indices instead of orders (see<br />

elgpspec).<br />

The main difference between specifying equations using eleqw and using eleqc is<br />

that the former always gives a correct Jacobian if it is possible to automatically<br />

differentiate all functions called.<br />

Cautionary<br />

Examples<br />

Make sure that the integration point pattern index you use really does exist and<br />

corresponds to a reasonable integration order. When adding an eleqw element to<br />

an existing model, it may be necessary to extract and modify also the default<br />

elgpspec element.<br />

As equation contributions are simply added, it is easy to introduce additional weak<br />

form terms using the fem.elem field.<br />

clear fem;<br />

fem.geom = circ2;<br />

fem.mesh = meshinit(fem);<br />

fem.shape = 2;<br />

fem.equ.c = 1; fem.equ.f = 0;<br />

fem.bnd.h = 1;<br />

fem.elem = {};<br />

clear el;<br />

el.elem = 'eleqw';<br />

el.g = {'1'};<br />

clear equ;<br />

equ.ind = {{'1'}};<br />

equ.coeff = {{'u_test'}};<br />

equ.ipoints = {{'1'}};<br />

el.geomdim{1} = {{},{},equ};<br />

76 | CHAPTER 1: COMMAND REFERENCE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!